This commit is contained in:
Denis Molony 2016-09-19 20:37:50 +10:00
parent 8b6db14ead
commit 0151421d38
2 changed files with 14 additions and 2 deletions

View File

@ -120,6 +120,14 @@ public class Wiz5Monsters extends AbstractFile implements Iterable<Wiz5Monsters.
return image;
}
List<Integer> getBlocks ()
{
List<Integer> blocks = new ArrayList<Integer> ();
for (DataBuffer dataBuffer : dataBuffers)
blocks.add (dataBuffer.block);
return blocks;
}
@Override
public String toString ()
{

View File

@ -136,12 +136,12 @@ public class Wizardry4BootDisk extends PascalDisk
private void linkMonsterImages4 (DefaultMutableTreeNode monstersNode,
FileEntry fileEntry)
{
fileEntry.setFile (null);
List<DiskAddress> pictureBlocks = fileEntry.getSectors ();
Wiz4Monsters w4monsters =
new Wiz4Monsters ("monsters", fileEntry.getDataSource ().buffer);
fileEntry.setFile (w4monsters);
int count = 0;
for (Wiz4Image image : w4monsters.images)
{
@ -154,13 +154,17 @@ public class Wizardry4BootDisk extends PascalDisk
private void linkMonsterImages5 (DefaultMutableTreeNode monstersNode,
FileEntry fileEntry)
{
List<DiskAddress> pictureBlocks = fileEntry.getSectors ();
Wiz5Monsters w5monsters =
new Wiz5Monsters ("monsters", fileEntry.getDataSource ().buffer);
fileEntry.setFile (w5monsters);
for (Wiz5Monsters.Monster monster : w5monsters)
{
List<DiskAddress> monsterBlocks = new ArrayList<DiskAddress> ();
// monsterBlocks.add (pictureBlocks.get (block));
for (Integer blockId : monster.getBlocks ())
monsterBlocks.add (pictureBlocks.get (blockId));
addToNode (monster.getImage (), monstersNode, monsterBlocks);
}
}