(svn r19807) -Codechange: instead of having an unnamed enum and passing it as an int, name the enum and pass that
This commit is contained in:
		@@ -128,7 +128,7 @@ void ShowNetworkGiveMoneyWindow(CompanyID company)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* Zooms a viewport in a window in or out
 | 
					/* Zooms a viewport in a window in or out
 | 
				
			||||||
 * No button handling or what so ever */
 | 
					 * No button handling or what so ever */
 | 
				
			||||||
bool DoZoomInOutWindow(int how, Window *w)
 | 
					bool DoZoomInOutWindow(ZoomStateChange how, Window *w)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ViewPort *vp;
 | 
						ViewPort *vp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -136,6 +136,7 @@ bool DoZoomInOutWindow(int how, Window *w)
 | 
				
			|||||||
	vp = w->viewport;
 | 
						vp = w->viewport;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	switch (how) {
 | 
						switch (how) {
 | 
				
			||||||
 | 
							case ZOOM_NONE: NOT_REACHED();
 | 
				
			||||||
		case ZOOM_IN:
 | 
							case ZOOM_IN:
 | 
				
			||||||
			if (vp->zoom == ZOOM_LVL_MIN) return false;
 | 
								if (vp->zoom == ZOOM_LVL_MIN) return false;
 | 
				
			||||||
			vp->zoom = (ZoomLevel)((int)vp->zoom - 1);
 | 
								vp->zoom = (ZoomLevel)((int)vp->zoom - 1);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,12 +35,12 @@ void UpdateViewportPosition(Window *w);
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
void MarkAllViewportsDirty(int left, int top, int right, int bottom);
 | 
					void MarkAllViewportsDirty(int left, int top, int right, int bottom);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool DoZoomInOutWindow(int how, Window *w);
 | 
					bool DoZoomInOutWindow(ZoomStateChange how, Window *w);
 | 
				
			||||||
void ZoomInOrOutToCursorWindow(bool in, Window * w);
 | 
					void ZoomInOrOutToCursorWindow(bool in, Window * w);
 | 
				
			||||||
Point GetTileZoomCenterWindow(bool in, Window * w);
 | 
					Point GetTileZoomCenterWindow(bool in, Window * w);
 | 
				
			||||||
void HandleZoomMessage(Window *w, const ViewPort *vp, byte widget_zoom_in, byte widget_zoom_out);
 | 
					void HandleZoomMessage(Window *w, const ViewPort *vp, byte widget_zoom_in, byte widget_zoom_out);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline void MaxZoomInOut(int how, Window *w)
 | 
					static inline void MaxZoomInOut(ZoomStateChange how, Window *w)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	while (DoZoomInOutWindow(how, w)) {};
 | 
						while (DoZoomInOutWindow(how, w)) {};
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -51,7 +51,7 @@ struct ViewportSign {
 | 
				
			|||||||
	void MarkDirty() const;
 | 
						void MarkDirty() const;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum {
 | 
					enum ZoomStateChange {
 | 
				
			||||||
	ZOOM_IN   = 0,
 | 
						ZOOM_IN   = 0,
 | 
				
			||||||
	ZOOM_OUT  = 1,
 | 
						ZOOM_OUT  = 1,
 | 
				
			||||||
	ZOOM_NONE = 2, // hack, used to update the button status
 | 
						ZOOM_NONE = 2, // hack, used to update the button status
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user