TileConstants: replace BLBN, BLBNCN, BNCN constants with definitions

This will make it easier to find and replace uses of BULLBIT, BURNBIT, and
CONDBIT.

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@741 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-07-20 21:10:34 +00:00
parent 91b3736886
commit 0a65ac514c
4 changed files with 9 additions and 13 deletions

View file

@ -479,7 +479,7 @@ public class MapGenerator
if ((map[mapY][mapX] & LOMASK) == DIRT) if ((map[mapY][mapX] & LOMASK) == DIRT)
{ {
map[mapY][mapX] = WOODS + BLBNBIT; map[mapY][mapX] = WOODS | BULLBIT | BURNBIT;
} }
} }
} }
@ -532,7 +532,7 @@ public class MapGenerator
temp -= 8; temp -= 8;
} }
} }
map[mapY][mapX] = (char)(temp + BLBNBIT); map[mapY][mapX] = (char)(temp | BULLBIT | BURNBIT);
} }
else else
{ {

View file

@ -509,7 +509,7 @@ class MapScanner
{ {
for (int x = xpos-1; x <= xpos+1; x++) for (int x = xpos-1; x <= xpos+1; x++)
{ {
city.setTile(x, y, (char)(base | BNCNBIT | (x == xpos && y == ypos ? BULLBIT : 0))); city.setTile(x, y, (char)(base | BURNBIT | CONDBIT | (x == xpos && y == ypos ? BULLBIT : 0)));
base++; base++;
} }
} }
@ -1080,7 +1080,7 @@ class MapScanner
assert houseNumber >= 0 && houseNumber < 12; assert houseNumber >= 0 && houseNumber < 12;
assert city.testBounds(xx, yy); assert city.testBounds(xx, yy);
city.setTile(xx, yy, (char)(HOUSE + houseNumber + BLBNCNBIT)); city.setTile(xx, yy, (char)((HOUSE + houseNumber) | BULLBIT | BURNBIT | CONDBIT));
} }
} }
@ -1207,7 +1207,7 @@ class MapScanner
{ {
// downgrade from full-size zone to 8 little houses // downgrade from full-size zone to 8 little houses
city.setTile(xpos, ypos, (char)(FREEZ | BLBNCNBIT)); city.setTile(xpos, ypos, (char)(FREEZ | BULLBIT | BURNBIT | CONDBIT));
for (int x = xpos-1; x <= xpos+1; x++) for (int x = xpos-1; x <= xpos+1; x++)
{ {
for (int y = ypos-1; y <= ypos+1; y++) for (int y = ypos-1; y <= ypos+1; y++)
@ -1218,7 +1218,7 @@ class MapScanner
{ {
// pick a random small house // pick a random small house
int houseNumber = value * 3 + PRNG.nextInt(3); int houseNumber = value * 3 + PRNG.nextInt(3);
city.setTile(x, y, (char) (HOUSE + houseNumber + BLBNCNBIT)); city.setTile(x, y, (char) ((HOUSE + houseNumber) | BULLBIT | BURNBIT | CONDBIT));
} }
} }
} }
@ -1243,7 +1243,7 @@ class MapScanner
int loc = city.map[y][x] & LOMASK; int loc = city.map[y][x] & LOMASK;
if (loc >= LHTHR && loc <= HHTHR) if (loc >= LHTHR && loc <= HHTHR)
{ //little house { //little house
city.setTile(x, y, (char)(Brdr[z] + BLBNCNBIT + FREEZ - 4)); city.setTile(x, y, (char)((Brdr[z] + FREEZ - 4) | BULLBIT | BURNBIT | CONDBIT));
return; return;
} }
} }
@ -1374,7 +1374,7 @@ class MapScanner
for (int x = 0; x < 4; x++, zoneBase++) for (int x = 0; x < 4; x++, zoneBase++)
{ {
city.setTile(xpos - 1 + x, ypos - 1 + y, city.setTile(xpos - 1 + x, ypos - 1 + y,
(char) (zoneBase | BNCNBIT | (x == 1 && y == 1 ? (PWRBIT) : 0))); (char) (zoneBase | BURNBIT | CONDBIT | (x == 1 && y == 1 ? (PWRBIT) : 0)));
} }
} }
} }

View file

@ -218,10 +218,6 @@ public class TileConstants
public static final char ALLBITS = 64512; // mask for upper 6 bits public static final char ALLBITS = 64512; // mask for upper 6 bits
public static final char LOMASK = 1023; //mask for low 10 bits public static final char LOMASK = 1023; //mask for low 10 bits
public static final char BLBNBIT = (BULLBIT | BURNBIT);
public static final char BLBNCNBIT = (BULLBIT | BURNBIT | CONDBIT);
public static final char BNCNBIT = (BURNBIT | CONDBIT);
private TileConstants() {} private TileConstants() {}
private static int [] buildingBases = { private static int [] buildingBases = {

View file

@ -182,7 +182,7 @@ public class ToolStroke
for (int columnNum = 0; columnNum < width; columnNum++) for (int columnNum = 0; columnNum < width; columnNum++)
{ {
eff.setTile(columnNum, rowNum, (char) ( eff.setTile(columnNum, rowNum, (char) (
tileBase + BNCNBIT tileBase | BURNBIT | CONDBIT
)); ));
tileBase++; tileBase++;
} }