Mercurial > hg > openttd
diff src/viewport.cpp @ 16068:75bd5a94eab3 draft
(svn r20761) -Codechange: make PlaceObject() static
author | smatz <smatz@openttd.org> |
---|---|
date | Tue, 07 Sep 2010 11:05:22 +0000 (2010-09-07) |
parents | e8e9ee785788 |
children | 7065c54bda2c |
line wrap: on
line diff
--- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1802,6 +1802,26 @@ return true; } +static void PlaceObject() +{ + Point pt; + Window *w; + + pt = GetTileBelowCursor(); + if (pt.x == -1) return; + + if (_thd.place_mode == HT_POINT) { + pt.x += 8; + pt.y += 8; + } + + _tile_fract_coords.x = pt.x & TILE_UNIT_MASK; + _tile_fract_coords.y = pt.y & TILE_UNIT_MASK; + + w = GetCallbackWnd(); + if (w != NULL) w->OnPlaceObject(pt, TileVirtXY(pt.x, pt.y)); +} + bool HandleViewportClicked(const ViewPort *vp, int x, int y) { @@ -1836,26 +1856,6 @@ return CheckClickOnLandscape(vp, x, y); } -void PlaceObject() -{ - Point pt; - Window *w; - - pt = GetTileBelowCursor(); - if (pt.x == -1) return; - - if (_thd.place_mode == HT_POINT) { - pt.x += 8; - pt.y += 8; - } - - _tile_fract_coords.x = pt.x & TILE_UNIT_MASK; - _tile_fract_coords.y = pt.y & TILE_UNIT_MASK; - - w = GetCallbackWnd(); - if (w != NULL) w->OnPlaceObject(pt, TileVirtXY(pt.x, pt.y)); -} - /** * Scrolls the viewport in a window to a given location.