diff options
Diffstat (limited to '')
-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) { |