mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-18 01:42:38 +01:00
Codechange: Pass Viewport by reference.
This means we do not have to care what type of pointer is used.
This commit is contained in:
committed by
Peter Nelson
parent
70b4beb8e7
commit
8275bbfb87
@@ -333,9 +333,9 @@ DEF_CONSOLE_CMD(ConZoomToLevel)
|
||||
IConsolePrint(CC_ERROR, "Current client settings do not allow zooming out beyond level {}.", _settings_client.gui.zoom_max);
|
||||
} else {
|
||||
Window *w = GetMainWindow();
|
||||
Viewport *vp = w->viewport;
|
||||
while (vp->zoom > level) DoZoomInOutWindow(ZOOM_IN, w);
|
||||
while (vp->zoom < level) DoZoomInOutWindow(ZOOM_OUT, w);
|
||||
Viewport &vp = *w->viewport;
|
||||
while (vp.zoom > level) DoZoomInOutWindow(ZOOM_IN, w);
|
||||
while (vp.zoom < level) DoZoomInOutWindow(ZOOM_OUT, w);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user