diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index 0fa56db39b..d232e42060 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -356,14 +356,21 @@ public: // Obtain the current matrix at the top of the stack const RageMatrix* GetTop() { return &stack.back(); } + void SetTop( const RageMatrix &m ) { stack.back() = m; } }; +static MatrixStack g_CenteringStack; static MatrixStack g_ProjectionStack; static MatrixStack g_ViewStack; static MatrixStack g_WorldStack; static MatrixStack g_TextureStack; +const RageMatrix* RageDisplay::GetCentering() +{ + return g_CenteringStack.GetTop(); +} + const RageMatrix* RageDisplay::GetProjectionTop() { return g_ProjectionStack.GetTop(); @@ -644,7 +651,7 @@ RageMatrix RageDisplay::GetCenteringMatrix( float fTranslateX, float fTranslateY void RageDisplay::UpdateCentering() { - m_Centering = GetCenteringMatrix( (float) g_iTranslateX, (float) g_iTranslateY, (float) g_iAddWidth, (float) g_iAddHeight ); + g_CenteringStack.SetTop( GetCenteringMatrix( (float) g_iTranslateX, (float) g_iTranslateY, (float) g_iAddWidth, (float) g_iAddHeight ) ); } bool RageDisplay::SaveScreenshot( RString sPath, GraphicsFileFormat format ) diff --git a/stepmania/src/RageDisplay.h b/stepmania/src/RageDisplay.h index ea7af8ed9e..669e77e9a2 100644 --- a/stepmania/src/RageDisplay.h +++ b/stepmania/src/RageDisplay.h @@ -325,12 +325,11 @@ protected: // // Matrix that adjusts position and scale of image on the screen // - RageMatrix m_Centering; RageMatrix GetCenteringMatrix( float fTranslateX, float fTranslateY, float fAddWidth, float fAddHeight ) const; void UpdateCentering(); // Called by the RageDisplay derivitives - const RageMatrix* GetCentering() { return &m_Centering; } + const RageMatrix* GetCentering(); const RageMatrix* GetProjectionTop(); const RageMatrix* GetViewTop(); const RageMatrix* GetWorldTop();