summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-01-14 19:57:49 +0000
committerpeter1138 <peter1138@openttd.org>2007-01-14 19:57:49 +0000
commitca9843424be6008d9b8019423f2ead65fdb75fe2 (patch)
treec62990da208a45b3bd1c7379a1835190458d5a49 /src/town_cmd.cpp
parentc04c2b28245770aa7729b818fb876cd23c880620 (diff)
downloadopenttd-ca9843424be6008d9b8019423f2ead65fdb75fe2.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.cpp21
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,