From 25865e68c4c87cfe3cf63c8721f3d0ec8dfca35c Mon Sep 17 00:00:00 2001 From: aap Date: Wed, 3 Jul 2019 13:13:55 +0200 Subject: cleaned up to be closer to original game --- src/render/Draw.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/render/Draw.h') diff --git a/src/render/Draw.h b/src/render/Draw.h index 1fcb5212..3349c6c9 100644 --- a/src/render/Draw.h +++ b/src/render/Draw.h @@ -1,16 +1,18 @@ #pragma once -#define HUD_SCALE 0.8f -#define DEFAULT_SCALE 1.0f - class CDraw { 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 +28,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 }; -- cgit v1.2.3