diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-01-18 14:01:17 +0100 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-01-18 14:01:17 +0100 |
commit | 8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b (patch) | |
tree | 7b351a0f43b5f1b3135feadfcdeb52d0b64648bc /src/render/Sprite.cpp | |
parent | Use of sized bool types for CFont (diff) | |
parent | sync milessdk with re3mss (diff) | |
download | re3-8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b.tar re3-8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b.tar.gz re3-8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b.tar.bz2 re3-8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b.tar.lz re3-8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b.tar.xz re3-8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b.tar.zst re3-8d2aa61f9b93a83c7a89a1ed180f3953f4638a8b.zip |
Diffstat (limited to 'src/render/Sprite.cpp')
-rw-r--r-- | src/render/Sprite.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/render/Sprite.cpp b/src/render/Sprite.cpp index ba6ab291..0e4d4fcd 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) { |