diff options
author | maedhros <maedhros@openttd.org> | 2007-05-23 12:45:56 +0000 |
---|---|---|
committer | maedhros <maedhros@openttd.org> | 2007-05-23 12:45:56 +0000 |
commit | 1a9d43ff40f859c705ab987ef66b1576b6090425 (patch) | |
tree | 6595e32b2d16537c3647b01f1ff39b07b4d0f57a /src/viewport.cpp | |
parent | c35b459d021068333c08be402e2bfbcb8842c659 (diff) | |
download | openttd-1a9d43ff40f859c705ab987ef66b1576b6090425.tar.xz |
(svn r9900) -Codechange: Separate the variables for how to highlight a land area and what to do with it afterwards.
Diffstat (limited to 'src/viewport.cpp')
-rw-r--r-- | src/viewport.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp index 68b9a947f..a40dd2777 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1985,9 +1985,10 @@ void UpdateTileSelection() } /** highlighting tiles while only going over them with the mouse */ -void VpStartPlaceSizing(TileIndex tile, int user) +void VpStartPlaceSizing(TileIndex tile, byte method, byte process) { - _thd.userdata = user; + _thd.select_method = method; + _thd.select_proc = process; _thd.selend.x = TileX(tile) * TILE_SIZE; _thd.selstart.x = TileX(tile) * TILE_SIZE; _thd.selend.y = TileY(tile) * TILE_SIZE; @@ -2445,7 +2446,8 @@ bool VpHandlePlaceSizingDrag() if (_special_mouse_mode != WSM_SIZING) return true; - e.we.place.userdata = _thd.userdata; + e.we.place.select_method = _thd.select_method; + e.we.place.select_proc = _thd.select_proc; /* stop drag mode if the window has been closed */ w = FindWindowById(_thd.window_class, _thd.window_number); @@ -2467,7 +2469,7 @@ bool VpHandlePlaceSizingDrag() _special_mouse_mode = WSM_NONE; if (_thd.next_drawstyle == HT_RECT) { _thd.place_mode = VHM_RECT; - } else if ((e.we.place.userdata & 0xF) == VPM_SIGNALDIRS) { // some might call this a hack... -- Dominik + } else if (e.we.place.select_method == VPM_SIGNALDIRS) { // some might call this a hack... -- Dominik _thd.place_mode = VHM_RECT; } else if (_thd.next_drawstyle & HT_LINE) { _thd.place_mode = VHM_RAIL; |