This repository has been archived by the owner. It is now read-only.
Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
14 additions
and
8 deletions.
-
+1
−1
src/core/Camera.cpp
-
+1
−1
src/core/common.h
-
+3
−3
src/render/Draw.cpp
-
+9
−3
src/render/Draw.h
There are no files selected for viewing
|
|
@@ -3561,7 +3561,7 @@ CCamera::CalculateDerivedValues(void) |
|
|
{ |
|
|
m_cameraMatrix = Invert(m_matrix); |
|
|
|
|
|
float hfov = DEGTORAD(CDraw::GetFOV()/2.0f); |
|
|
float hfov = DEGTORAD(CDraw::GetScaledFOV()/2.0f); |
|
|
float c = cos(hfov); |
|
|
float s = sin(hfov); |
|
|
|
|
|
|
|
|
@@ -111,7 +111,7 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w) |
|
|
#define SCREEN_WIDTH ((float)RsGlobal.width) |
|
|
#define SCREEN_HEIGHT ((float)RsGlobal.height) |
|
|
#define SCREEN_ASPECT_RATIO (CDraw::GetAspectRatio()) |
|
|
#define SCREEN_VIEWWINDOW (Tan(DEGTORAD(CDraw::GetFOV() * 0.5f))) |
|
|
#define SCREEN_VIEWWINDOW (Tan(DEGTORAD(CDraw::GetScaledFOV() * 0.5f))) |
|
|
|
|
|
// This scales from PS2 pixel coordinates to the real resolution |
|
|
#define SCREEN_STRETCH_X(a) ((a) * (float) SCREEN_WIDTH / DEFAULT_SCREEN_WIDTH) |
|
|
|
|
|
@@ -6,6 +6,7 @@ |
|
|
|
|
|
#ifdef ASPECT_RATIO_SCALE |
|
|
float CDraw::ms_fAspectRatio = DEFAULT_ASPECT_RATIO; |
|
|
float CDraw::ms_fScaledFOV = 45.0f; |
|
|
#endif |
|
|
|
|
|
float CDraw::ms_fNearClipZ; |
|
|
@@ -61,8 +62,7 @@ void |
|
|
CDraw::SetFOV(float fov) |
|
|
{ |
|
|
#ifdef ASPECT_RATIO_SCALE |
|
|
ms_fFOV = ConvertFOV(fov); |
|
|
#else |
|
|
ms_fFOV = fov; |
|
|
ms_fScaledFOV = ConvertFOV(fov); |
|
|
#endif |
|
|
ms_fFOV = fov; |
|
|
} |
|
|
@@ -16,14 +16,15 @@ class CDraw |
|
|
static float ms_fNearClipZ; |
|
|
static float ms_fFarClipZ; |
|
|
static float ms_fFOV; |
|
|
public: |
|
|
static float ms_fLODDistance; // set but unused? |
|
|
|
|
|
#ifdef ASPECT_RATIO_SCALE |
|
|
// we use this variable to scale a lot of 2D elements |
|
|
// so better cache it |
|
|
static float ms_fAspectRatio; |
|
|
// similar thing for 3D rendering |
|
|
static float ms_fScaledFOV; |
|
|
#endif |
|
|
public: |
|
|
static float ms_fLODDistance; // set but unused? |
|
|
|
|
|
static uint8 FadeValue; |
|
|
static uint8 FadeRed; |
|
|
@@ -37,6 +38,11 @@ class CDraw |
|
|
|
|
|
static void SetFOV(float fov); |
|
|
static float GetFOV(void) { return ms_fFOV; } |
|
|
#ifdef ASPECT_RATIO_SCALE |
|
|
static float GetScaledFOV(void) { return ms_fScaledFOV; } |
|
|
#else |
|
|
static float GetScaledFOV(void) { return ms_fFOV; } |
|
|
#endif |
|
|
|
|
|
static float FindAspectRatio(void); |
|
|
#ifdef ASPECT_RATIO_SCALE |
|
|
|
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.