make the centering matrix a stack, like the rest

This commit is contained in:
Glenn Maynard
2006-07-25 19:34:11 +00:00
parent 787b5ad09a
commit df153fc924
2 changed files with 9 additions and 3 deletions
+8 -1
View File
@@ -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 )