diff options
author | peter1138 <peter1138@openttd.org> | 2007-01-14 19:57:49 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2007-01-14 19:57:49 +0000 |
commit | 92d418b031d23cf42a4df09e12945cc4b737bce2 (patch) | |
tree | c62990da208a45b3bd1c7379a1835190458d5a49 /src/newgrf_station.cpp | |
parent | 19d31c7417e4c8ad763c6674b7d1c6f9022e3703 (diff) | |
download | openttd-92d418b031d23cf42a4df09e12945cc4b737bce2.tar.xz |
(svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
This lets us increase the sprite width from 14 to up to 29 bits,
effectively nulling the old sprite limit. Table changes in next commit.
Diffstat (limited to 'src/newgrf_station.cpp')
-rw-r--r-- | src/newgrf_station.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index 0b910da58..1e0ed1ef0 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -676,8 +676,8 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID const DrawTileSeqStruct *seq; const RailtypeInfo *rti = GetRailTypeInfo(railtype); SpriteID relocation; - PalSpriteID image; - PalSpriteID colourmod = SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)); + SpriteID image; + SpriteID pal = PLAYER_SPRITE_COLOR(_local_player); uint tile = 2; statspec = GetCustomStationSpec(sclass, station); @@ -697,22 +697,19 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID } image = sprites->ground_sprite; - if (HASBIT(image, 31)) { - CLRBIT(image, 31); + if (HASBIT(image, SPRITE_MODIFIER_USE_OFFSET)) { image += GetCustomStationGroundRelocation(statspec, NULL, INVALID_TILE); image += rti->custom_ground_offset; } else { image += rti->total_offset; } - if (image & PALETTE_MODIFIER_COLOR) image &= SPRITE_MASK; - DrawSprite(image, x, y); + DrawSprite(image, PAL_NONE, x, y); foreach_draw_tile_seq(seq, sprites->seq) { Point pt; image = seq->image; - if (HASBIT(image, 30)) { - CLRBIT(image, 30); + if (HASBIT(image, SPRITE_MODIFIER_USE_OFFSET)) { image += rti->total_offset; } else { image += relocation; @@ -720,7 +717,7 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID if ((byte)seq->delta_z != 0x80) { pt = RemapCoords(seq->delta_x, seq->delta_y, seq->delta_z); - DrawSprite((image & SPRITE_MASK) | colourmod, x + pt.x, y + pt.y); + DrawSprite(image, pal, x + pt.x, y + pt.y); } } |