summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2010-09-07 11:05:22 +0000
committersmatz <smatz@openttd.org>2010-09-07 11:05:22 +0000
commitbb4538665af0a07b3fa32610639c2cb96be7848b (patch)
tree83a97b0f0dd0d89989d52ea8a0034a00618d10d9
parent15c2a2d5553bb13768d7da341c3c140c8317a0fe (diff)
downloadopenttd-bb4538665af0a07b3fa32610639c2cb96be7848b.tar.xz
(svn r20761) -Codechange: make PlaceObject() static
-rw-r--r--src/viewport.cpp40
-rw-r--r--src/viewport_func.h1
2 files changed, 20 insertions, 21 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp
index a883ceb8e..abef0e9f9 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -1802,6 +1802,26 @@ static bool CheckClickOnLandscape(const ViewPort *vp, int x, int y)
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 @@ bool HandleViewportClicked(const ViewPort *vp, int x, int y)
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.
diff --git a/src/viewport_func.h b/src/viewport_func.h
index 2b4f964ec..1e3c77107 100644
--- a/src/viewport_func.h
+++ b/src/viewport_func.h
@@ -58,7 +58,6 @@ void StartSpriteCombine();
void EndSpriteCombine();
bool HandleViewportClicked(const ViewPort *vp, int x, int y);
-void PlaceObject();
void SetRedErrorSquare(TileIndex tile);
void SetTileSelectSize(int w, int h);
void SetTileSelectBigSize(int ox, int oy, int sx, int sy);