diff options
author | alberth <alberth@openttd.org> | 2010-12-30 13:16:31 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-12-30 13:16:31 +0000 |
commit | 22a13850cb0640d4fdfd8da66bc46ce20e2eb309 (patch) | |
tree | aab09e147008a843c11fcb356d7e9c7993ea680d /src/viewport.cpp | |
parent | 703ff560c19e2b21597e9ed25b3e394a2085702a (diff) | |
download | openttd-22a13850cb0640d4fdfd8da66bc46ce20e2eb309.tar.xz |
(svn r21665) -Codechange: Make GetCallbackWnd a method of _thd.
Diffstat (limited to 'src/viewport.cpp')
-rw-r--r-- | src/viewport.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp index 2ff4cf635..1b8e5965b 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1871,7 +1871,7 @@ static void PlaceObject() _tile_fract_coords.x = pt.x & TILE_UNIT_MASK; _tile_fract_coords.y = pt.y & TILE_UNIT_MASK; - w = GetCallbackWnd(); + w = _thd.GetCallbackWnd(); if (w != NULL) w->OnPlaceObject(pt, TileVirtXY(pt.x, pt.y)); } @@ -2017,6 +2017,17 @@ bool TileHighlightData::IsDraggingDiagonal() } /** + * Get the window that started the current highlighting. + * @return The window that requested the current tile highlighting, or \c NULL if not available. + */ +Window *TileHighlightData::GetCallbackWnd() +{ + return FindWindowById(this->window_class, this->window_number); +} + + + +/** * Updates tile highlighting for all cases. * Uses _thd.selstart and _thd.selend and _thd.place_mode (set elsewhere) to determine _thd.pos and _thd.size * Also drawstyle is determined. Uses _thd.new.* as a buffer and calls SetSelectionTilesDirty() twice, |