diff options
author | tron <tron@openttd.org> | 2006-04-23 13:48:16 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-04-23 13:48:16 +0000 |
commit | dd180a1e1883336a1edc3b4d6eac440f06e3685b (patch) | |
tree | 3f0769bd955cefba7ab80063e64546c1874e0a62 /dock_gui.c | |
parent | fa213c686ee1d348d1eb167f2423261d8040205e (diff) | |
download | openttd-dd180a1e1883336a1edc3b4d6eac440f06e3685b.tar.xz |
(svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums
Diffstat (limited to 'dock_gui.c')
-rw-r--r-- | dock_gui.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/dock_gui.c b/dock_gui.c index da664345d..123d60923 100644 --- a/dock_gui.c +++ b/dock_gui.c @@ -173,10 +173,11 @@ static void BuildDocksToolbWndProc(Window *w, WindowEvent *e) tile_from = tile_to = e->place.tile; switch (GetTileSlope(tile_from, NULL)) { - case 3: tile_to += TileDiffXY(-1, 0); break; - case 6: tile_to += TileDiffXY( 0, -1); break; - case 9: tile_to += TileDiffXY( 0, 1); break; - case 12: tile_to += TileDiffXY( 1, 0); break; + case SLOPE_SW: tile_to += TileDiffXY(-1, 0); break; + case SLOPE_SE: tile_to += TileDiffXY( 0, -1); break; + case SLOPE_NW: tile_to += TileDiffXY( 0, 1); break; + case SLOPE_NE: tile_to += TileDiffXY( 1, 0); break; + default: break; } VpSetPresizeRange(tile_from, tile_to); } break; |