summaryrefslogtreecommitdiffstats
path: root/src/render/Draw.h
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2019-07-04 04:00:33 +0200
committereray orçunus <erayorcunus@gmail.com>2019-07-04 04:00:33 +0200
commitcc56292bc503d5aaa96c5146480ab8bd1b6b0488 (patch)
tree77949cc32155e844b34c75f856f79ff3f3ad9cec /src/render/Draw.h
parentEven more CPed (diff)
parentMerge pull request #107 from Nick007J/master (diff)
downloadre3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar.gz
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar.bz2
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar.lz
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar.xz
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar.zst
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.zip
Diffstat (limited to '')
-rw-r--r--src/render/Draw.h25
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
};