summaryrefslogtreecommitdiff
path: root/waypoint.c
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2005-07-24 15:56:31 +0000
committercelestar <celestar@openttd.org>2005-07-24 15:56:31 +0000
commit238e47cd42c009f2ab1359428788a65a26fafebb (patch)
treee02fce527cef08bc25354c995fecc8ddb0ab5318 /waypoint.c
parenta227065ab75d6cb9f449f2282315adc933450b49 (diff)
downloadopenttd-238e47cd42c009f2ab1359428788a65a26fafebb.tar.xz
(svn r2702) -Codechange: Cleaned up the sprite code and replaced many magic numbers
by enums. There remains work in gfx.c to move the "transparency" and "recolor" bits around to make space for more sprites. However, 2800 additional sprites can now be loaded. There also remains cleanup and Doxygen work on many of the header files.
Diffstat (limited to 'waypoint.c')
-rw-r--r--waypoint.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/waypoint.c b/waypoint.c
index b96da61d9..1e27cc26e 100644
--- a/waypoint.c
+++ b/waypoint.c
@@ -378,13 +378,13 @@ void DrawWaypointSprite(int x, int y, int stat_id, int railtype)
const DrawTrackSeqStruct *dtss = _track_depot_layout_table[4];
img = dtss++->image;
- if (img & 0x8000) img = (img & 0x7FFF) + railtype*TRACKTYPE_SPRITE_PITCH;
+ if (img & PALETTE_MODIFIER_COLOR) img = (img & SPRITE_MASK) + railtype*TRACKTYPE_SPRITE_PITCH;
DrawSprite(img, x, y);
for (; dtss->image != 0; dtss++) {
Point pt = RemapCoords(dtss->subcoord_x, dtss->subcoord_y, 0);
img = dtss->image;
- if (img & 0x8000) img |= ormod;
+ if (img & PALETTE_MODIFIER_COLOR) img |= ormod;
DrawSprite(img, x + pt.x, y + pt.y);
}
return;
@@ -400,14 +400,14 @@ void DrawWaypointSprite(int x, int y, int stat_id, int railtype)
img = cust->ground_sprite;
img += railtype * ((img < _custom_sprites_base) ? TRACKTYPE_SPRITE_PITCH : 1);
- if (img & 0x8000) img = (img & 0x7FFF);
+ if (img & PALETTE_MODIFIER_COLOR) img = (img & SPRITE_MASK);
DrawSprite(img, x, y);
foreach_draw_tile_seq(seq, cust->seq) {
Point pt = RemapCoords(seq->delta_x, seq->delta_y, seq->delta_z);
uint32 image = seq->image + relocation;
- DrawSprite((image&0x3FFF) | ormod, x + pt.x, y + pt.y);
+ DrawSprite((image & SPRITE_MASK) | ormod, x + pt.x, y + pt.y);
}
}