diff options
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/Draw.cpp | 16 | ||||
-rw-r--r-- | src/render/Draw.h | 7 | ||||
-rw-r--r-- | src/render/Hud.cpp | 1 | ||||
-rw-r--r-- | src/render/Hud.h | 1 |
4 files changed, 23 insertions, 2 deletions
diff --git a/src/render/Draw.cpp b/src/render/Draw.cpp index fd9a2d7e..e1f79697 100644 --- a/src/render/Draw.cpp +++ b/src/render/Draw.cpp @@ -1,6 +1,10 @@ #include "common.h" #include "patcher.h" #include "Draw.h" +#include "Frontend.h" +#include "Camera.h" + +float CDraw::ms_fAspectRatio; float &CDraw::ms_fNearClipZ = *(float*)0x8E2DC4; float &CDraw::ms_fFarClipZ = *(float*)0x9434F0; @@ -11,6 +15,18 @@ uint8 &CDraw::FadeRed = *(uint8*)0x95CD90; uint8 &CDraw::FadeGreen = *(uint8*)0x95CD71; uint8 &CDraw::FadeBlue = *(uint8*)0x95CD53; +void CDraw::CalculateAspectRatio() { + if (FrontEndMenuManager.m_PrefsUseWideScreen) { + ms_fAspectRatio = 1.7777778f; + } + else if (TheCamera.m_WideScreenOn) { + ms_fAspectRatio = 1.25f; + } + else { + ms_fAspectRatio = 1.3333334f; + } +} + static float hFov2vFov(float hfov) { float w = SCREENW; diff --git a/src/render/Draw.h b/src/render/Draw.h index 408c41b0..6dd42121 100644 --- a/src/render/Draw.h +++ b/src/render/Draw.h @@ -6,6 +6,8 @@ private: static float &ms_fNearClipZ; static float &ms_fFarClipZ; static float &ms_fFOV; + static float ms_fAspectRatio; + public: static uint8 &FadeValue; static uint8 &FadeRed; @@ -16,6 +18,11 @@ public: static float GetNearClipZ(void) { return ms_fNearClipZ; } static void SetFarClipZ(float farclip) { ms_fFarClipZ = farclip; } static float GetFarClipZ(void) { return ms_fFarClipZ; } + static void SetFOV(float fov); static float GetFOV(void) { return ms_fFOV; } + + static void CalculateAspectRatio(); + static float GetAspectRatio(void) { return ms_fAspectRatio; } + }; diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp index 8ff20e5a..1d454d2a 100644 --- a/src/render/Hud.cpp +++ b/src/render/Hud.cpp @@ -53,7 +53,6 @@ wchar* CHud::m_pLastVehicleName = *(wchar **)0x8E2DD8; wchar* CHud::m_pVehicleNameToPrint; wchar* CHud::m_Message = (wchar*)0x72E318; wchar* CHud::m_PagerMessage = (wchar*)0x878840; -Bool &CHud::m_bRetuneInProgress = *(Bool*)0x650B80; Bool &CHud::m_Wants_To_Draw_Hud = *(Bool*)0x95CD89; Bool &CHud::m_Wants_To_Draw_3dMarkers = *(Bool*)0x95CD62; wchar(*CHud::m_BigMessage)[128] = (wchar(*)[128])0x664CE0; diff --git a/src/render/Hud.h b/src/render/Hud.h index 65f75241..04795981 100644 --- a/src/render/Hud.h +++ b/src/render/Hud.h @@ -49,7 +49,6 @@ public: static int32 m_VehicleNameTimer; static wchar* m_Message; static wchar* m_PagerMessage; - static Bool &m_bRetuneInProgress; static Bool &m_Wants_To_Draw_Hud; static Bool &m_Wants_To_Draw_3dMarkers; static wchar(*m_BigMessage)[128]; |