tile-names: let loadMap() handle dyn-numbered tiles

This commit is contained in:
Jason Long 2014-06-21 19:14:31 -04:00
parent 7ef2158071
commit f136a3f4f4
2 changed files with 6 additions and 1 deletions

View file

@ -2137,7 +2137,7 @@ public class Micropolis
{ {
int z = dis.readShort(); int z = dis.readShort();
z &= ~(1024 | 2048 | 4096 | 8192 | 16384); // clear ZONEBIT,ANIMBIT,BULLBIT,BURNBIT,CONDBIT on import z &= ~(1024 | 2048 | 4096 | 8192 | 16384); // clear ZONEBIT,ANIMBIT,BULLBIT,BURNBIT,CONDBIT on import
map[y][x] = (char) z; map[y][x] = (char) Tiles.loadByOrdinal(z).tileNumber;
} }
} }
} }

View file

@ -86,6 +86,11 @@ public class Tiles
return tilesByName.get(tileName); return tilesByName.get(tileName);
} }
public static TileSpec loadByOrdinal(int tileNumber)
{
return load(Integer.toString(tileNumber));
}
/** /**
* Access a tile specification by index number. * Access a tile specification by index number.
* *