diff options
author | tron <tron@openttd.org> | 2005-07-21 06:31:02 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-07-21 06:31:02 +0000 |
commit | d71788c40206fa35b792d34769fde7768b4456c1 (patch) | |
tree | dc5c9c74cec9bfa29f94932a20193cd902a80f15 /roadveh_cmd.c | |
parent | 5c5840417e2f03514c51098f4786c6c1d6030b59 (diff) | |
download | openttd-d71788c40206fa35b792d34769fde7768b4456c1.tar.xz |
(svn r2660) Get rid of some more shifting/anding/casting
Diffstat (limited to 'roadveh_cmd.c')
-rw-r--r-- | roadveh_cmd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c index 2fad4cdb6..293d2004e 100644 --- a/roadveh_cmd.c +++ b/roadveh_cmd.c @@ -449,10 +449,10 @@ static void UpdateRoadVehDeltaXY(Vehicle *v) }; #undef MKIT uint32 x = _delta_xy_table[v->direction]; - v->x_offs = (byte)x; - v->y_offs = (byte)(x>>=8); - v->sprite_width = (byte)(x>>=8); - v->sprite_height = (byte)(x>>=8); + v->x_offs = GB(x, 0, 8); + v->y_offs = GB(x, 8, 8); + v->sprite_width = GB(x, 16, 8); + v->sprite_height = GB(x, 24, 8); } static void ClearCrashedStation(Vehicle *v) @@ -927,7 +927,7 @@ static void RoadVehCheckOvertake(Vehicle *v, Vehicle *u) if (v->u.road.state >= 32 || (v->u.road.state&7) > 1 ) return; - tt = (byte)(GetTileTrackStatus(v->tile, TRANSPORT_ROAD) & 0x3F); + tt = GetTileTrackStatus(v->tile, TRANSPORT_ROAD) & 0x3F; if ((tt & 3) == 0) return; if ((tt & 0x3C) != 0) |