mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 10:30:28 +00:00
(svn r7095) -Codechange: Move MaxZoomIn function to viewport.h and change it to MaxZoomInOut
with a zoom parameter and a pointer to the window which's viewport we want to zoom.
This commit is contained in:
parent
65e051fe93
commit
293a89dd71
@ -888,11 +888,6 @@ bool DoZoomInOutWindow(int how, Window *w)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MaxZoomIn(void)
|
|
||||||
{
|
|
||||||
while (DoZoomInOutWindow(ZOOM_IN, FindWindowById(WC_MAIN_WINDOW, 0) ) ) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ToolbarZoomInClick(Window *w)
|
static void ToolbarZoomInClick(Window *w)
|
||||||
{
|
{
|
||||||
if (DoZoomInOutWindow(ZOOM_IN, FindWindowById(WC_MAIN_WINDOW, 0))) {
|
if (DoZoomInOutWindow(ZOOM_IN, FindWindowById(WC_MAIN_WINDOW, 0))) {
|
||||||
@ -2272,7 +2267,7 @@ static void MainWindowWndProc(Window *w, WindowEvent *e)
|
|||||||
Point pt = GetTileBelowCursor();
|
Point pt = GetTileBelowCursor();
|
||||||
if (pt.x != -1) {
|
if (pt.x != -1) {
|
||||||
ScrollMainWindowTo(pt.x, pt.y);
|
ScrollMainWindowTo(pt.x, pt.y);
|
||||||
if (e->we.keypress.keycode == 'Z') MaxZoomIn();
|
if (e->we.keypress.keycode == 'Z') MaxZoomInOut(ZOOM_IN, w);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,11 @@ 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)
|
||||||
|
{
|
||||||
|
while (DoZoomInOutWindow(how, w) ) {};
|
||||||
|
}
|
||||||
|
|
||||||
void OffsetGroundSprite(int x, int y);
|
void OffsetGroundSprite(int x, int y);
|
||||||
|
|
||||||
void DrawGroundSprite(uint32 image);
|
void DrawGroundSprite(uint32 image);
|
||||||
|
Loading…
Reference in New Issue
Block a user