summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-12-30 13:16:31 +0000
committeralberth <alberth@openttd.org>2010-12-30 13:16:31 +0000
commit22a13850cb0640d4fdfd8da66bc46ce20e2eb309 (patch)
treeaab09e147008a843c11fcb356d7e9c7993ea680d /src/window.cpp
parent703ff560c19e2b21597e9ed25b3e394a2085702a (diff)
downloadopenttd-22a13850cb0640d4fdfd8da66bc46ce20e2eb309.tar.xz
(svn r21665) -Codechange: Make GetCallbackWnd a method of _thd.
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/window.cpp b/src/window.cpp
index ae9a683ac..3e601d212 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1400,16 +1400,11 @@ static void DecreaseWindowCounters()
}
}
-Window *GetCallbackWnd()
-{
- return FindWindowById(_thd.window_class, _thd.window_number);
-}
-
static void HandlePlacePresize()
{
if (_special_mouse_mode != WSM_PRESIZE) return;
- Window *w = GetCallbackWnd();
+ Window *w = _thd.GetCallbackWnd();
if (w == NULL) return;
Point pt = GetTileBelowCursor();
@@ -1430,7 +1425,7 @@ static EventState HandleDragDrop()
if (_special_mouse_mode != WSM_DRAGDROP) return ES_NOT_HANDLED;
if (_left_button_down) return ES_HANDLED;
- Window *w = GetCallbackWnd();
+ Window *w = _thd.GetCallbackWnd();
if (w != NULL) {
/* send an event in client coordinates. */
@@ -1454,7 +1449,7 @@ static EventState HandleMouseDrag()
if (_special_mouse_mode != WSM_DRAGDROP) return ES_NOT_HANDLED;
if (!_left_button_down || (_cursor.delta.x == 0 && _cursor.delta.y == 0)) return ES_NOT_HANDLED;
- Window *w = GetCallbackWnd();
+ Window *w = _thd.GetCallbackWnd();
if (w != NULL) {
/* Send an event in client coordinates. */