92 static void ClearTownHouse(Town *t, TileIndex tile); |
92 static void ClearTownHouse(Town *t, TileIndex tile); |
93 static void DoBuildTownHouse(Town *t, TileIndex tile); |
93 static void DoBuildTownHouse(Town *t, TileIndex tile); |
94 |
94 |
95 static void TownDrawHouseLift(const TileInfo *ti) |
95 static void TownDrawHouseLift(const TileInfo *ti) |
96 { |
96 { |
97 AddChildSpriteScreen(SPR_LIFT, 14, 60 - GetLiftPosition(ti->tile)); |
97 AddChildSpriteScreen(SPR_LIFT, PAL_NONE, 14, 60 - GetLiftPosition(ti->tile)); |
98 } |
98 } |
99 |
99 |
100 typedef void TownDrawTileProc(const TileInfo *ti); |
100 typedef void TownDrawTileProc(const TileInfo *ti); |
101 static TownDrawTileProc * const _town_draw_tile_procs[1] = { |
101 static TownDrawTileProc * const _town_draw_tile_procs[1] = { |
102 TownDrawHouseLift |
102 TownDrawHouseLift |
119 variant &= 3; |
120 variant &= 3; |
120 dcts = &_town_draw_tile_data[GetHouseType(ti->tile) << 4 | variant << 2 | GetHouseBuildingStage(ti->tile)]; |
121 dcts = &_town_draw_tile_data[GetHouseType(ti->tile) << 4 | variant << 2 | GetHouseBuildingStage(ti->tile)]; |
121 } |
122 } |
122 |
123 |
123 if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, ti->tileh); |
124 if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, ti->tileh); |
124 DrawGroundSprite(dcts->ground); |
125 |
|
126 image = dcts->ground.sprite; |
|
127 pal = dcts->ground.pal; |
|
128 DrawGroundSprite(image, pal); |
125 |
129 |
126 /* Add a house on top of the ground? */ |
130 /* Add a house on top of the ground? */ |
127 image = dcts->building; |
131 image = dcts->building.sprite; |
128 if (image != 0) { |
132 if (image != 0) { |
129 if (_display_opt & DO_TRANS_BUILDINGS) MAKE_TRANSPARENT(image); |
133 if (_display_opt & DO_TRANS_BUILDINGS) { |
130 |
134 SETBIT(image, PALETTE_MODIFIER_TRANSPARENT); |
131 AddSortableSpriteToDraw(image, |
135 pal = PALETTE_TO_TRANSPARENT; |
|
136 } else { |
|
137 pal = dcts->building.pal; |
|
138 } |
|
139 |
|
140 AddSortableSpriteToDraw(image, pal, |
132 ti->x + dcts->subtile_x, |
141 ti->x + dcts->subtile_x, |
133 ti->y + dcts->subtile_y, |
142 ti->y + dcts->subtile_y, |
134 dcts->width + 1, |
143 dcts->width + 1, |
135 dcts->height + 1, |
144 dcts->height + 1, |
136 dcts->dz, |
145 dcts->dz, |