(svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
authorrubidium
Thu, 08 May 2008 13:21:55 +0000
changeset 9147 d9ec5ed630ff
parent 9146 dbe2317185eb
child 9148 ba0f18cfc795
(svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
src/gui.h
src/tilehighlight_func.h
src/tilehighlight_type.h
src/viewport.cpp
src/viewport_func.h
src/viewport_type.h
--- a/src/gui.h	Thu May 08 13:20:54 2008 +0000
+++ b/src/gui.h	Thu May 08 13:21:55 2008 +0000
@@ -48,35 +48,6 @@
 void ShowGenerateLandscape();
 void ShowHeightmapLoad();
 
-/** Drag and drop selection process, or, what to do with an area of land when
- * you've selected it. */
-enum {
-	DDSP_DEMOLISH_AREA,
-	DDSP_RAISE_AND_LEVEL_AREA,
-	DDSP_LOWER_AND_LEVEL_AREA,
-	DDSP_LEVEL_AREA,
-	DDSP_CREATE_DESERT,
-	DDSP_CREATE_ROCKS,
-	DDSP_CREATE_WATER,
-	DDSP_CREATE_RIVER,
-	DDSP_PLANT_TREES,
-	DDSP_BUILD_BRIDGE,
-
-	/* Rail specific actions */
-	DDSP_PLACE_RAIL_NE,
-	DDSP_PLACE_RAIL_NW,
-	DDSP_PLACE_AUTORAIL,
-	DDSP_BUILD_SIGNALS,
-	DDSP_BUILD_STATION,
-	DDSP_REMOVE_STATION,
-	DDSP_CONVERT_RAIL,
-
-	/* Road specific actions */
-	DDSP_PLACE_ROAD_X_DIR,
-	DDSP_PLACE_ROAD_Y_DIR,
-	DDSP_PLACE_AUTOROAD,
-};
-
 /* misc_gui.cpp */
 void PlaceLandBlockInfo();
 void ShowAboutWindow();
--- a/src/tilehighlight_func.h	Thu May 08 13:20:54 2008 +0000
+++ b/src/tilehighlight_func.h	Thu May 08 13:21:55 2008 +0000
@@ -20,6 +20,11 @@
 void SetObjectToPlaceWnd(CursorID icon, SpriteID pal, ViewportHighlightMode mode, Window *w);
 void SetObjectToPlace(CursorID icon, SpriteID pal, ViewportHighlightMode mode, WindowClass window_class, WindowNumber window_num);
 
+void VpSelectTilesWithMethod(int x, int y, ViewportPlaceMethod method);
+void VpStartPlaceSizing(TileIndex tile, ViewportPlaceMethod method, ViewportDragDropSelectionProcess process);
+void VpSetPresizeRange(TileIndex from, TileIndex to);
+void VpSetPlaceSizingLimit(int limit);
+
 extern PlaceProc *_place_proc;
 extern TileHighlightData _thd;
 
--- a/src/tilehighlight_type.h	Thu May 08 13:20:54 2008 +0000
+++ b/src/tilehighlight_type.h	Thu May 08 13:21:55 2008 +0000
@@ -69,7 +69,7 @@
 	WindowNumber window_number;
 
 	ViewportPlaceMethod select_method;
-	byte select_proc;
+	ViewportDragDropSelectionProcess select_proc;
 
 	TileIndex redsq;
 };
--- a/src/viewport.cpp	Thu May 08 13:20:54 2008 +0000
+++ b/src/viewport.cpp	Thu May 08 13:21:55 2008 +0000
@@ -2228,7 +2228,7 @@
 }
 
 /** highlighting tiles while only going over them with the mouse */
-void VpStartPlaceSizing(TileIndex tile, ViewportPlaceMethod method, byte process)
+void VpStartPlaceSizing(TileIndex tile, ViewportPlaceMethod method, ViewportDragDropSelectionProcess process)
 {
 	_thd.select_method = method;
 	_thd.select_proc   = process;
--- a/src/viewport_func.h	Thu May 08 13:20:54 2008 +0000
+++ b/src/viewport_func.h	Thu May 08 13:21:55 2008 +0000
@@ -51,11 +51,6 @@
 
 Vehicle *CheckMouseOverVehicle();
 
-void VpSelectTilesWithMethod(int x, int y, ViewportPlaceMethod method);
-void VpStartPlaceSizing(TileIndex tile, ViewportPlaceMethod method, byte process);
-void VpSetPresizeRange(TileIndex from, TileIndex to);
-void VpSetPlaceSizingLimit(int limit);
-
 void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom);
 
 void ResetObjectToPlace();
--- a/src/viewport_type.h	Thu May 08 13:20:54 2008 +0000
+++ b/src/viewport_type.h	Thu May 08 13:21:55 2008 +0000
@@ -58,4 +58,33 @@
 	VPM_SIGNALDIRS      = 6, ///< similiar to VMP_RAILDIRS, but with different cursor
 };
 
+/** Drag and drop selection process, or, what to do with an area of land when
+ * you've selected it. */
+enum ViewportDragDropSelectionProcess {
+	DDSP_DEMOLISH_AREA,
+	DDSP_RAISE_AND_LEVEL_AREA,
+	DDSP_LOWER_AND_LEVEL_AREA,
+	DDSP_LEVEL_AREA,
+	DDSP_CREATE_DESERT,
+	DDSP_CREATE_ROCKS,
+	DDSP_CREATE_WATER,
+	DDSP_CREATE_RIVER,
+	DDSP_PLANT_TREES,
+	DDSP_BUILD_BRIDGE,
+
+	/* Rail specific actions */
+	DDSP_PLACE_RAIL_NE,
+	DDSP_PLACE_RAIL_NW,
+	DDSP_PLACE_AUTORAIL,
+	DDSP_BUILD_SIGNALS,
+	DDSP_BUILD_STATION,
+	DDSP_REMOVE_STATION,
+	DDSP_CONVERT_RAIL,
+
+	/* Road specific actions */
+	DDSP_PLACE_ROAD_X_DIR,
+	DDSP_PLACE_ROAD_Y_DIR,
+	DDSP_PLACE_AUTOROAD,
+};
+
 #endif /* VIEWPORT_TYPE_H */