Recalculated route step sprite sizes when changing zoom levels

This commit is contained in:
Jonathan G Rennison
2022-08-20 10:02:31 +01:00
parent 84da7ad7b6
commit 8c0eca28a8
4 changed files with 5 additions and 1 deletions

View File

@@ -157,6 +157,7 @@ void SetMouseCursor(CursorID cursor, PaletteID pal);
void SetAnimatedMouseCursor(const AnimCursor *table); void SetAnimatedMouseCursor(const AnimCursor *table);
void CursorTick(); void CursorTick();
void UpdateCursorSize(); void UpdateCursorSize();
void UpdateRouteStepSpriteSize();
bool ChangeResInGame(int w, int h); bool ChangeResInGame(int w, int h);
void SortResolutions(); void SortResolutions();
bool ToggleFullScreen(bool fs); bool ToggleFullScreen(bool fs);

View File

@@ -388,7 +388,7 @@ void CheckBlitter()
ReInitAllWindows(false); ReInitAllWindows(false);
} }
static void UpdateRouteStepSpriteSize() void UpdateRouteStepSpriteSize()
{ {
extern uint _vp_route_step_width; extern uint _vp_route_step_width;
extern uint _vp_route_step_height_top; extern uint _vp_route_step_height_top;

View File

@@ -1252,6 +1252,7 @@ static void ZoomMinMaxChanged(int32 new_value)
/* Restrict GUI zoom if it is no longer available. */ /* Restrict GUI zoom if it is no longer available. */
_gui_zoom = _settings_client.gui.zoom_min; _gui_zoom = _settings_client.gui.zoom_min;
UpdateCursorSize(); UpdateCursorSize();
UpdateRouteStepSpriteSize();
UpdateFontHeightCache(); UpdateFontHeightCache();
LoadStringWidthTable(); LoadStringWidthTable();
} }

View File

@@ -604,6 +604,7 @@ struct GameOptionsWindow : Window {
_gui_zoom_cfg = new_zoom; _gui_zoom_cfg = new_zoom;
UpdateGUIZoom(); UpdateGUIZoom();
UpdateCursorSize(); UpdateCursorSize();
UpdateRouteStepSpriteSize();
UpdateAllVirtCoords(); UpdateAllVirtCoords();
FixTitleGameZoom(); FixTitleGameZoom();
ReInitAllWindows(true); ReInitAllWindows(true);
@@ -618,6 +619,7 @@ struct GameOptionsWindow : Window {
GfxClearSpriteCache(); GfxClearSpriteCache();
_font_zoom_cfg = new_zoom; _font_zoom_cfg = new_zoom;
UpdateGUIZoom(); UpdateGUIZoom();
UpdateRouteStepSpriteSize();
LoadStringWidthTable(); LoadStringWidthTable();
UpdateAllVirtCoords(); UpdateAllVirtCoords();
ReInitAllWindows(true); ReInitAllWindows(true);