summaryrefslogtreecommitdiff
path: root/unmovable_cmd.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-11-14 01:25:05 +0000
committerdarkvater <darkvater@openttd.org>2004-11-14 01:25:05 +0000
commit7930faace98fea1ce02032c9cebc06e9b5266a16 (patch)
tree11dd7877ad10a2ccc94b14f4aa90d5c235fc4dbc /unmovable_cmd.c
parente9ef930155c51d4412410c304cf08eba7c1e658f (diff)
downloadopenttd-7930faace98fea1ce02032c9cebc06e9b5266a16.tar.xz
(svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
Diffstat (limited to 'unmovable_cmd.c')
-rw-r--r--unmovable_cmd.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/unmovable_cmd.c b/unmovable_cmd.c
index ebcecdacf..ec40f2663 100644
--- a/unmovable_cmd.c
+++ b/unmovable_cmd.c
@@ -4,6 +4,7 @@
#include "viewport.h"
#include "player.h"
#include "gui.h"
+#include "station.h"
#include "economy.h"
#include "town.h"
@@ -17,15 +18,6 @@ typedef struct DrawTileUnmovableStruct {
byte unused;
} DrawTileUnmovableStruct;
-typedef struct DrawTileSeqStruct {
- int8 delta_x;
- int8 delta_y;
- int8 delta_z;
- byte width,height;
- byte unk;
- SpriteID image;
-} DrawTileSeqStruct;
-
#include "table/unmovable_land.h"
static void DrawTile_Unmovable(TileInfo *ti)
@@ -77,18 +69,16 @@ static void DrawTile_Unmovable(TileInfo *ti)
}
} else {
const DrawTileSeqStruct *dtss;
- const byte *t;
+ const DrawTileSprites *t;
if (ti->tileh) DrawFoundation(ti, ti->tileh);
ormod = PLAYER_SPRITE_COLOR(_map_owner[ti->tile]);
- t = _unmovable_display_datas[ti->map5 & 0x7F];
- DrawGroundSprite(*(const uint16*)t | ormod);
-
- t += sizeof(uint16);
+ t = &_unmovable_display_datas[ti->map5 & 0x7F];
+ DrawGroundSprite(t->ground_sprite | ormod);
- for(dtss = (const DrawTileSeqStruct *)t; (byte)dtss->delta_x != 0x80; dtss++) {
+ foreach_draw_tile_seq(dtss, t->seq) {
image = dtss->image;
if (_display_opt & DO_TRANS_BUILDINGS) {
image |= ormod;