src/viewport.h
branchnoai
changeset 9722 ebf0ece7d8f6
parent 9704 197cb8c6ae17
--- a/src/viewport.h	Thu Nov 22 23:01:41 2007 +0000
+++ b/src/viewport.h	Fri Nov 23 16:59:30 2007 +0000
@@ -73,24 +73,21 @@
 void SetTileSelectSize(int w, int h);
 void SetTileSelectBigSize(int ox, int oy, int sx, int sy);
 
-void VpStartPlaceSizing(TileIndex tile, byte method, byte process);
-void VpSetPresizeRange(uint from, uint to);
-void VpSetPlaceSizingLimit(int limit);
-
 Vehicle *CheckMouseOverVehicle();
 
-enum {
-	VPM_X_OR_Y          = 0,
-	VPM_FIX_X           = 1,
-	VPM_FIX_Y           = 2,
-	VPM_RAILDIRS        = 3,
-	VPM_X_AND_Y         = 4,
-	VPM_X_AND_Y_LIMITED = 5,
-	VPM_SIGNALDIRS      = 6
+/** Viewport place method (type of highlighted area and placed objects) */
+enum ViewportPlaceMethod {
+	VPM_X_OR_Y          = 0, ///< drag in X or Y direction
+	VPM_FIX_X           = 1, ///< drag only in X axis
+	VPM_FIX_Y           = 2, ///< drag only in Y axis
+	VPM_RAILDIRS        = 3, ///< all rail directions
+	VPM_X_AND_Y         = 4, ///< area of land in X and Y directions
+	VPM_X_AND_Y_LIMITED = 5, ///< area of land of limited size
+	VPM_SIGNALDIRS      = 6, ///< similiar to VMP_RAILDIRS, but with different cursor
 };
 
-/* viewport highlight mode (for highlighting tiles below cursor) */
-enum {
+/** Viewport highlight mode (for highlighting tiles below cursor) */
+enum ViewportHighlightMode {
 	VHM_NONE    = 0, ///< default
 	VHM_RECT    = 1, ///< rectangle (stations, depots, ...)
 	VHM_POINT   = 2, ///< point (lower land, raise land, level land, ...)
@@ -99,7 +96,10 @@
 	VHM_RAIL    = 5, ///< rail pieces
 };
 
-void VpSelectTilesWithMethod(int x, int y, int method);
+void VpSelectTilesWithMethod(int x, int y, ViewportPlaceMethod method);
+void VpStartPlaceSizing(TileIndex tile, ViewportPlaceMethod method, byte process);
+void VpSetPresizeRange(uint from, uint to);
+void VpSetPlaceSizingLimit(int limit);
 
 /* highlighting draw styles */
 typedef byte HighLightStyle;
@@ -143,12 +143,12 @@
 	byte new_drawstyle;  // only used in UpdateTileSelection() to as a buffer to compare if there was a change between old and new
 	byte next_drawstyle; // queued, but not yet drawn style
 
-	byte place_mode;
+	ViewportHighlightMode place_mode;
 	bool make_square_red;
 	WindowClass window_class;
 	WindowNumber window_number;
 
-	byte select_method;
+	ViewportPlaceMethod select_method;
 	byte select_proc;
 
 	TileIndex redsq;
@@ -156,7 +156,7 @@
 
 
 /* common button handler */
-bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, int mode, PlaceProc *placeproc);
+bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, ViewportHighlightMode mode, PlaceProc *placeproc);
 
 VARDEF Point _tile_fract_coords;