summaryrefslogtreecommitdiffstats
path: root/src/render/Sprite.cpp
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2021-01-08 17:43:31 +0100
committerGitHub <noreply@github.com>2021-01-08 17:43:31 +0100
commit6e42c791cf3bbcb59363ab913a4d909b5345ab1b (patch)
treef39e4ab8a86ccfae72bf59b3ce984a02cc13b50a /src/render/Sprite.cpp
parentMerge pull request #930 from Nick007J/master (diff)
parentbb .ini hello defines (diff)
downloadre3-6e42c791cf3bbcb59363ab913a4d909b5345ab1b.tar
re3-6e42c791cf3bbcb59363ab913a4d909b5345ab1b.tar.gz
re3-6e42c791cf3bbcb59363ab913a4d909b5345ab1b.tar.bz2
re3-6e42c791cf3bbcb59363ab913a4d909b5345ab1b.tar.lz
re3-6e42c791cf3bbcb59363ab913a4d909b5345ab1b.tar.xz
re3-6e42c791cf3bbcb59363ab913a4d909b5345ab1b.tar.zst
re3-6e42c791cf3bbcb59363ab913a4d909b5345ab1b.zip
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;