diff src/town_cmd.cpp @ 5668:3d6d9bff3dd8 draft

(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.
author peter1138 <peter1138@openttd.org>
date Sun, 14 Jan 2007 19:57:49 +0000
parents c44c070c5032
children 81c312c91b8d
line wrap: on
line diff
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -94,7 +94,7 @@
 
 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 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 @@
 	}
 
 	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,