summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2008-02-16 02:37:31 +0000
committerbelugas <belugas@openttd.org>2008-02-16 02:37:31 +0000
commitb8f8d0ca5153cffcbced76e1759dc264ed2c72ff (patch)
tree60eeea05f68ba48799ca4e98963d07b99db5f227 /src
parentb4f58ebae4db322a61d57788af654a7fe60e4672 (diff)
downloadopenttd-b8f8d0ca5153cffcbced76e1759dc264ed2c72ff.tar.xz
(svn r12157) -Codechange: Remove a structure definition and replace it with another one closely matching
-Codechange: Replace two magic numbers with according sprite names
Diffstat (limited to 'src')
-rw-r--r--src/table/unmovable_land.h15
-rw-r--r--src/unmovable_cmd.cpp8
2 files changed, 6 insertions, 17 deletions
diff --git a/src/table/unmovable_land.h b/src/table/unmovable_land.h
index 887e432bf..e7a97cb89 100644
--- a/src/table/unmovable_land.h
+++ b/src/table/unmovable_land.h
@@ -1,18 +1,9 @@
/* $Id$ */
-struct DrawTileUnmovableStruct {
- uint16 image;
- byte subcoord_x;
- byte subcoord_y;
- byte width;
- byte height;
- byte z_size;
- byte unused;
-};
-static const DrawTileUnmovableStruct _draw_tile_unmovable_data[] = {
- {0xA29, 7, 7, 2, 2, 70, 0},
- {0xA2A, 4, 4, 7, 7, 61, 0},
+static const DrawTileSeqStruct _draw_tile_transmitterlighthouse_data[] = {
+ { 7, 7, 0, 2, 2, 70, {SPR_UNMOVABLE_TRANSMITTER, PAL_NONE}},
+ { 4, 4, 0, 7, 7, 61, {SPR_UNMOVABLE_LIGHTHOUSE, PAL_NONE}},
};
#define TILE_SEQ_LINE(sz, img) { 0, 0, 0, 16, 16, sz, {img, PAL_NONE} },
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp
index f02eac7da..345e9f0c3 100644
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -167,16 +167,14 @@ static void DrawTile_Unmovable(TileInfo *ti)
switch (GetUnmovableType(ti->tile)) {
case UNMOVABLE_TRANSMITTER:
case UNMOVABLE_LIGHTHOUSE: {
- const DrawTileUnmovableStruct* dtus;
+ const DrawTileSeqStruct* dtu = &_draw_tile_transmitterlighthouse_data[GetUnmovableType(ti->tile)];
if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
DrawClearLandTile(ti, 2);
- dtus = &_draw_tile_unmovable_data[GetUnmovableType(ti->tile)];
-
AddSortableSpriteToDraw(
- dtus->image, PAL_NONE, ti->x | dtus->subcoord_x, ti->y | dtus->subcoord_y,
- dtus->width, dtus->height, dtus->z_size, ti->z,
+ dtu->image.sprite, PAL_NONE, ti->x | dtu->delta_x, ti->y | dtu->delta_y,
+ dtu->size_x, dtu->size_y, dtu->size_z, ti->z,
IsTransparencySet(TO_STRUCTURES)
);
break;