(svn r5350) -Backport: r5327 0.4
authortron
Sat, 24 Jun 2006 09:48:51 +0000
branch0.4
changeset 10045 ed89f9eb128d
parent 10044 ec5486f6f9ef
child 10046 6301f3512550
(svn r5350) -Backport: r5327
Use DrawFoundation() for houses
-Fix: Some graphical glitches on house tiles with foundations
-Fix: The selection cursor is now aligned with the top of the foundation for house tiles
town_cmd.c
--- a/town_cmd.c	Sat Jun 24 09:12:15 2006 +0000
+++ b/town_cmd.c	Sat Jun 24 09:48:51 2006 +0000
@@ -3,6 +3,7 @@
 #include "stdafx.h"
 #include "openttd.h"
 #include "functions.h"
+#include "slope.h"
 #include "strings.h"
 #include "table/strings.h"
 #include "table/sprites.h"
@@ -89,7 +90,6 @@
 static void DrawTile_Town(TileInfo *ti)
 {
 	const DrawTownTileStruct *dcts;
-	byte z;
 	uint32 image;
 
 	/* Retrieve pointer to the draw town tile struct */
@@ -106,17 +106,8 @@
 		dcts = &_town_draw_tile_data[gfx << 4 | variant << 2 | stage];
 	}
 
-	z = ti->z;
-
-	/* Add bricks below the house? */
-	if (ti->tileh) {
-		AddSortableSpriteToDraw(SPR_FOUNDATION_BASE + ti->tileh, ti->x, ti->y, 16, 16, 7, z);
-		AddChildSpriteScreen(dcts->sprite_1, 0x1F, 1);
-		z += 8;
-	} else {
-		/* Else draw regular ground */
-		DrawGroundSprite(dcts->sprite_1);
-	}
+	if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, ti->tileh);
+	DrawGroundSprite(dcts->sprite_1);
 
 	/* Add a house on top of the ground? */
 	image = dcts->sprite_2;
@@ -129,7 +120,8 @@
 			dcts->width + 1,
 			dcts->height + 1,
 			dcts->dz,
-			z);
+			ti->z
+		);
 
 		if (_display_opt & DO_TRANS_BUILDINGS) return;
 	}