summaryrefslogtreecommitdiffstats
path: root/src/render/Sprite.cpp
diff options
context:
space:
mode:
authorFire-Head <Fire-Head@users.noreply.github.com>2021-01-12 22:07:24 +0100
committerFire-Head <Fire-Head@users.noreply.github.com>2021-01-12 22:07:24 +0100
commit3648ef4687967c7363c9c61f4610679484dc478e (patch)
tree29e9018c263edde8792a5e4a6917bfc9007f721c /src/render/Sprite.cpp
parentSector sizes (diff)
downloadre3-3648ef4687967c7363c9c61f4610679484dc478e.tar
re3-3648ef4687967c7363c9c61f4610679484dc478e.tar.gz
re3-3648ef4687967c7363c9c61f4610679484dc478e.tar.bz2
re3-3648ef4687967c7363c9c61f4610679484dc478e.tar.lz
re3-3648ef4687967c7363c9c61f4610679484dc478e.tar.xz
re3-3648ef4687967c7363c9c61f4610679484dc478e.tar.zst
re3-3648ef4687967c7363c9c61f4610679484dc478e.zip
Diffstat (limited to '')
-rw-r--r--src/render/Sprite.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/render/Sprite.cpp b/src/render/Sprite.cpp
index 401eebd0..38ddc114 100644
--- a/src/render/Sprite.cpp
+++ b/src/render/Sprite.cpp
@@ -10,6 +10,19 @@ float CSprite::m_f2DFarScreenZ;
float CSprite::m_fRecipNearClipPlane;
int32 CSprite::m_bFlushSpriteBufferSwitchZTest;
+float CalcScreenZ(float z)
+{
+ // LCS TODO: check
+
+ if ( z == 0.0f )
+ return CSprite::GetNearScreenZ();
+
+ return (z - CDraw::GetNearClipZ())
+ * (CSprite::GetFarScreenZ() - CSprite::GetNearScreenZ()) * CDraw::GetFarClipZ()
+ / ( (CDraw::GetFarClipZ() - CDraw::GetNearClipZ()) * z )
+ + CSprite::GetNearScreenZ();
+}
+
float
CSprite::CalcHorizonCoors(void)
{