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; return image;
} }
List<Integer> getBlocks ()
{
List<Integer> blocks = new ArrayList<Integer> ();
for (DataBuffer dataBuffer : dataBuffers)
blocks.add (dataBuffer.block);
return blocks;
}
@Override @Override
public String toString () public String toString ()
{ {

View File

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