summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-12 17:42:04 +0000
committertron <tron@openttd.org>2006-03-12 17:42:04 +0000
commit00cf5c9acf8f4a1a029d2d28c15b7be7c33200cf (patch)
tree92107719a9ce6eb371c4b48b27ef13761bc42120 /train_cmd.c
parenteeb5bf41a152087031b0764d5d3b2783922b70ae (diff)
downloadopenttd-00cf5c9acf8f4a1a029d2d28c15b7be7c33200cf.tar.xz
(svn r3832) Replace some magic numbers by (Diag)Direction enums
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/train_cmd.c b/train_cmd.c
index c174937d8..b14a9e0ff 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -400,7 +400,7 @@ void DrawTrainEngine(int x, int y, EngineID engine, uint32 image_ormod)
uint32 image = 0;
if (is_custom_sprite(img)) {
- image = GetCustomVehicleIcon(engine, 6);
+ image = GetCustomVehicleIcon(engine, DIR_W);
if (image == 0) {
img = orig_rail_vehicle_info[engine].image_index;
} else {
@@ -3153,13 +3153,13 @@ static bool TrainCheckIfLineEnds(Vehicle *v)
y = v->y_pos & 0xF;
switch (v->direction) {
- case 0: x = ~x + ~y + 24; break;
- case 7: x = y; /* FALLTHROUGH */
- case 1: x = ~x + 16; break;
- case 2: x = ~x + y + 8; break;
- case 3: x = y; break;
- case 4: x = x + y - 8; break;
- case 6: x = ~y + x + 8; break;
+ case DIR_N : x = ~x + ~y + 24; break;
+ case DIR_NW: x = y; /* FALLTHROUGH */
+ case DIR_NE: x = ~x + 16; break;
+ case DIR_E : x = ~x + y + 8; break;
+ case DIR_SE: x = y; break;
+ case DIR_S : x = x + y - 8; break;
+ case DIR_W : x = ~y + x + 8; break;
}
if (GB(ts, 0, 16) != 0) {