tile-animation: let tiles.rc determine coal plant's smoke animation
git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@757 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
1ce5080705
commit
ba7ade2fa4
4 changed files with 18 additions and 14 deletions
|
@ -761,12 +761,12 @@
|
||||||
# BEGIN COAL POWER #
|
# BEGIN COAL POWER #
|
||||||
745 coal@0,0 (conducts)
|
745 coal@0,0 (conducts)
|
||||||
746 coal@16,0 (conducts)
|
746 coal@16,0 (conducts)
|
||||||
747 coal@32,0 (conducts) (becomes=916)
|
747 coal@32,0 (conducts) (onpower=916)
|
||||||
748 coal@48,0 (conducts) (becomes=920)
|
748 coal@48,0 (conducts) (onpower=920)
|
||||||
749 coal@0,16 (conducts)
|
749 coal@0,16 (conducts)
|
||||||
750 coal@16,16 (zone)(conducts)
|
750 coal@16,16 (zone)(conducts)
|
||||||
751 coal@32,16 (conducts) (becomes=924)
|
751 coal@32,16 (conducts) (onpower=924)
|
||||||
752 coal@48,16 (conducts) (becomes=928)
|
752 coal@48,16 (conducts) (onpower=928)
|
||||||
753 coal@0,32 (conducts)
|
753 coal@0,32 (conducts)
|
||||||
754 coal@16,32 (conducts)
|
754 coal@16,32 (conducts)
|
||||||
755 coal@32,32 (conducts)
|
755 coal@32,32 (conducts)
|
||||||
|
|
|
@ -1334,16 +1334,15 @@ class MapScanner
|
||||||
*/
|
*/
|
||||||
void coalSmoke()
|
void coalSmoke()
|
||||||
{
|
{
|
||||||
final int [] SmTb = { COALSMOKE1, COALSMOKE2, COALSMOKE3, COALSMOKE4 };
|
for (int dx = -1; dx <= 2; dx++) {
|
||||||
final int [] dx = { 1, 2, 1, 2 };
|
for (int dy = -1; dy <= 2; dy++) {
|
||||||
final int [] dy = { -1, -1, 0, 0 };
|
int tile = city.getTile(xpos+dx, ypos+dy);
|
||||||
|
TileSpec ts = Tiles.get(tile & LOMASK);
|
||||||
for (int z = 0; z < 4; z++) {
|
if (ts != null && ts.onPower != null) {
|
||||||
int tile = city.getTile(xpos+dx[z], ypos+dy[z]) & LOMASK;
|
city.setTile(xpos + dx, ypos + dy,
|
||||||
if (tile >= COALBASE && tile < COALBASE + 4*4) {
|
(char) (ts.onPower.tileNumber | (tile & ALLBITS))
|
||||||
city.setTile(xpos + dx[z], ypos + dy[z],
|
);
|
||||||
(char) (SmTb[z] | PWRBIT)
|
}
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ public class TileSpec
|
||||||
{
|
{
|
||||||
int tileNumber;
|
int tileNumber;
|
||||||
TileSpec animNext;
|
TileSpec animNext;
|
||||||
|
TileSpec onPower;
|
||||||
boolean canBurn;
|
boolean canBurn;
|
||||||
boolean canConduct;
|
boolean canConduct;
|
||||||
boolean zone;
|
boolean zone;
|
||||||
|
|
|
@ -45,6 +45,10 @@ public class Tiles
|
||||||
if (tmp != null) {
|
if (tmp != null) {
|
||||||
tiles[i].animNext = get(Integer.parseInt(tmp));
|
tiles[i].animNext = get(Integer.parseInt(tmp));
|
||||||
}
|
}
|
||||||
|
tmp = tiles[i].getAttribute("onpower");
|
||||||
|
if (tmp != null) {
|
||||||
|
tiles[i].onPower = get(Integer.parseInt(tmp));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue