diff options
Diffstat (limited to 'src/renderer/Sprite.cpp')
-rw-r--r-- | src/renderer/Sprite.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/renderer/Sprite.cpp b/src/renderer/Sprite.cpp index ecfd3fdc..bf2c929f 100644 --- a/src/renderer/Sprite.cpp +++ b/src/renderer/Sprite.cpp @@ -14,6 +14,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) { |