aboutsummaryrefslogtreecommitdiff
path: root/src/render/Sprite.cpp
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2021-01-08 19:43:31 +0300
committerGitHub <noreply@github.com>2021-01-08 19:43:31 +0300
commit6e42c791cf3bbcb59363ab913a4d909b5345ab1b (patch)
treef39e4ab8a86ccfae72bf59b3ce984a02cc13b50a /src/render/Sprite.cpp
parentc594d89dc5be27126d63fddec4c93a15b7f702df (diff)
parent368d2f3279b474056e888dcccea234f32614b506 (diff)
Merge pull request #909 from Fire-Head/master
Sprite Scaling Option
Diffstat (limited to 'src/render/Sprite.cpp')
-rw-r--r--src/render/Sprite.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/render/Sprite.cpp b/src/render/Sprite.cpp
index 9ec7b002..c31c75d2 100644
--- a/src/render/Sprite.cpp
+++ b/src/render/Sprite.cpp
@@ -5,6 +5,10 @@
#include "Camera.h"
#include "Sprite.h"
+#ifdef ASPECT_RATIO_SCALE
+#include "Frontend.h"
+#endif
+
float CSprite::m_f2DNearScreenZ;
float CSprite::m_f2DFarScreenZ;
float CSprite::m_fRecipNearClipPlane;
@@ -33,7 +37,11 @@ CSprite::CalcScreenCoors(const RwV3d &in, RwV3d *out, float *outw, float *outh,
// this is used to scale correctly if you zoom in with sniper rifle
float fovScale = fov / CDraw::GetFOV();
+#ifdef FIX_SPRITES
+ *outw = fovScale * recip * SCREEN_HEIGHT;
+#else
*outw = fovScale * SCREEN_SCALE_AR(recip) * SCREEN_WIDTH;
+#endif
*outh = fovScale * recip * SCREEN_HEIGHT;
return true;