From f6d9b5602b3d313e2011d6c785f1556ffe1c8920 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 5 Feb 2020 19:06:36 +0100 Subject: [PATCH] - fixed hud_scale. --- source/common/gamecvars.cpp | 2 +- source/duke3d/src/game.cpp | 7 ++++--- source/duke3d/src/game.h | 8 -------- source/rr/src/game.cpp | 7 ++++--- source/rr/src/game.h | 8 -------- 5 files changed, 9 insertions(+), 23 deletions(-) diff --git a/source/common/gamecvars.cpp b/source/common/gamecvars.cpp index b3fea40c0..ac9388d2d 100644 --- a/source/common/gamecvars.cpp +++ b/source/common/gamecvars.cpp @@ -181,7 +181,7 @@ CUSTOM_CVARD(Int, hud_scale, 100, CVAR_ARCHIVE | CVAR_NOINITCALL, "changes the h { if (self < 36) self = 36; else if (self > 100) self = 100; - else gi->set_hud_scale(hud_size); + else gi->set_hud_scale(hud_scale); } // This is to allow flattening the overly complicated HUD configuration to one single value and keep the complexity safely inside the HUD code. diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index c31a87189..6378324e9 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -4348,7 +4348,8 @@ void GameInterface::set_hud_layout(int layout) void GameInterface::set_hud_scale(int scale) { - G_SetStatusBarScale(scale); + ud.statusbarscale = clamp(scale, 36, 100); + G_UpdateScreenArea(); } void G_HandleLocalKeys(void) @@ -4388,7 +4389,7 @@ void G_HandleLocalKeys(void) } else { - G_SetStatusBarScale(ud.statusbarscale+5); + hud_scale = hud_scale + 5; } G_UpdateScreenArea(); @@ -4407,7 +4408,7 @@ void G_HandleLocalKeys(void) } else { - G_SetStatusBarScale(ud.statusbarscale-5); + hud_scale = hud_scale - 5; } G_UpdateScreenArea(); diff --git a/source/duke3d/src/game.h b/source/duke3d/src/game.h index cab06df0f..593b55f19 100644 --- a/source/duke3d/src/game.h +++ b/source/duke3d/src/game.h @@ -446,8 +446,6 @@ static inline int G_GetMusicIdx(const char *str) } -EXTERN_INLINE_HEADER void G_SetStatusBarScale(int32_t sc); - EXTERN_INLINE_HEADER void SetIfGreater(int32_t *variable, int32_t potentialValue); #endif @@ -475,12 +473,6 @@ static inline int G_GetViewscreenSizeShift(T const * spr) #if defined game_c_ || !defined DISABLE_INLINING -EXTERN_INLINE void G_SetStatusBarScale(int32_t sc) -{ - ud.statusbarscale = clamp(sc, 36, 100); - G_UpdateScreenArea(); -} - // the point of this is to prevent re-running a function or calculation passed to potentialValue // without making a new variable under each individual circumstance EXTERN_INLINE void SetIfGreater(int32_t *variable, int32_t potentialValue) diff --git a/source/rr/src/game.cpp b/source/rr/src/game.cpp index e291cefaf..ad55e1edc 100644 --- a/source/rr/src/game.cpp +++ b/source/rr/src/game.cpp @@ -5927,7 +5927,8 @@ void GameInterface::set_hud_layout(int layout) void GameInterface::set_hud_scale(int scale) { - G_SetStatusBarScale(scale); + ud.statusbarscale = clamp(scale, 36, 100); + G_UpdateScreenArea(); } void G_HandleLocalKeys(void) @@ -5966,7 +5967,7 @@ void G_HandleLocalKeys(void) } else { - G_SetStatusBarScale(ud.statusbarscale+4); + hud_scale = hud_scale + 4; } G_UpdateScreenArea(); @@ -5985,7 +5986,7 @@ void G_HandleLocalKeys(void) } else { - G_SetStatusBarScale(ud.statusbarscale-4); + hud_scale = hud_scale - 4; } G_UpdateScreenArea(); diff --git a/source/rr/src/game.h b/source/rr/src/game.h index 89c9672ea..193eb30ec 100644 --- a/source/rr/src/game.h +++ b/source/rr/src/game.h @@ -440,8 +440,6 @@ static inline int G_GetMusicIdx(const char *str) extern void G_PrintCurrentMusic(void); -EXTERN_INLINE_HEADER void G_SetStatusBarScale(int32_t sc); - EXTERN_INLINE_HEADER void SetIfGreater(int32_t *variable, int32_t potentialValue); template @@ -464,12 +462,6 @@ static inline int G_GetViewscreenSizeShift(T const *tspr) #if defined game_c_ || !defined DISABLE_INLINING -EXTERN_INLINE void G_SetStatusBarScale(int32_t sc) -{ - ud.statusbarscale = clamp(sc, 36, 100); - G_UpdateScreenArea(); -} - // the point of this is to prevent re-running a function or calculation passed to potentialValue // without making a new variable under each individual circumstance EXTERN_INLINE void SetIfGreater(int32_t *variable, int32_t potentialValue)