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/town_cmd.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/town_cmd.cpp')
-rw-r--r-- | src/town_cmd.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index b54c544d5..b79b5e211 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -94,7 +94,7 @@ static void DoBuildTownHouse(Town *t, TileIndex tile); static void TownDrawHouseLift(const TileInfo *ti) { - AddChildSpriteScreen(SPR_LIFT, 14, 60 - GetLiftPosition(ti->tile)); + AddChildSpriteScreen(SPR_LIFT, PAL_NONE, 14, 60 - GetLiftPosition(ti->tile)); } typedef void TownDrawTileProc(const TileInfo *ti); @@ -106,7 +106,8 @@ static TownDrawTileProc * const _town_draw_tile_procs[1] = { static void DrawTile_Town(TileInfo *ti) { const DrawBuildingsTileStruct *dcts; - uint32 image; + SpriteID image; + SpriteID pal; /* Retrieve pointer to the draw town tile struct */ { @@ -121,14 +122,22 @@ static void DrawTile_Town(TileInfo *ti) } if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, ti->tileh); - DrawGroundSprite(dcts->ground); + + image = dcts->ground.sprite; + pal = dcts->ground.pal; + DrawGroundSprite(image, pal); /* Add a house on top of the ground? */ - image = dcts->building; + image = dcts->building.sprite; if (image != 0) { - if (_display_opt & DO_TRANS_BUILDINGS) MAKE_TRANSPARENT(image); + if (_display_opt & DO_TRANS_BUILDINGS) { + SETBIT(image, PALETTE_MODIFIER_TRANSPARENT); + pal = PALETTE_TO_TRANSPARENT; + } else { + pal = dcts->building.pal; + } - AddSortableSpriteToDraw(image, + AddSortableSpriteToDraw(image, pal, ti->x + dcts->subtile_x, ti->y + dcts->subtile_y, dcts->width + 1, |