diff options
Diffstat (limited to '')
-rw-r--r-- | src/render/Draw.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/render/Draw.h b/src/render/Draw.h index 1fcb5212..ad14e5a9 100644 --- a/src/render/Draw.h +++ b/src/render/Draw.h @@ -1,7 +1,11 @@ #pragma once -#define HUD_SCALE 0.8f -#define DEFAULT_SCALE 1.0f +enum eAspectRatio +{ + AR_AUTO, + AR_4_3, + AR_16_9, +}; class CDraw { @@ -9,8 +13,13 @@ private: static float &ms_fNearClipZ; static float &ms_fFarClipZ; static float &ms_fFOV; + static float ms_fLODDistance; // unused + +#ifdef ASPECT_RATIO_SCALE + // we use this variable to scale a lot of 2D elements + // so better cache it static float ms_fAspectRatio; - static float ms_fScreenMultiplier; +#endif public: static uint8 &FadeValue; @@ -26,8 +35,12 @@ public: static void SetFOV(float fov); static float GetFOV(void) { return ms_fFOV; } - static void CalculateAspectRatio(); + static float FindAspectRatio(void); +#ifdef ASPECT_RATIO_SCALE + static float ConvertFOV(float fov); static float GetAspectRatio(void) { return ms_fAspectRatio; } - static void SetScreenMult(float mult) { ms_fScreenMultiplier = mult; }; - static float GetScreenMult(void) { return ms_fScreenMultiplier; }; + static void SetAspectRatio(float ratio) { ms_fAspectRatio = ratio; } +#else + static float GetAspectRatio(void) { return FindAspectRatio(); } +#endif }; |