From dda0e12deb635ff058273c4f9c06a5aa8fbbb225 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 10 Sep 2006 08:34:50 +0000 Subject: [PATCH] init centering matrix with identity by default; reinit other stacks, too, so we're consistent if DISPLAY is recreated --- stepmania/src/RageDisplay.cpp | 10 ++++++++++ stepmania/src/RageDisplay.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index 08f15239e1..cfe9eab87e 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -407,6 +407,16 @@ static MatrixStack g_ViewStack; static MatrixStack g_WorldStack; static MatrixStack g_TextureStack; + +RageDisplay::RageDisplay() +{ + RageMatrixIdentity( &g_CenteringMatrix ); + g_ProjectionStack = MatrixStack(); + g_ViewStack = MatrixStack(); + g_WorldStack = MatrixStack(); + g_TextureStack = MatrixStack(); +} + const RageMatrix* RageDisplay::GetCentering() const { return &g_CenteringMatrix; diff --git a/stepmania/src/RageDisplay.h b/stepmania/src/RageDisplay.h index 9284a2d74a..870d5751a4 100644 --- a/stepmania/src/RageDisplay.h +++ b/stepmania/src/RageDisplay.h @@ -152,7 +152,7 @@ public: virtual const PixelFormatDesc *GetPixelFormatDesc( PixelFormat pf ) const = 0; - /* This is needed or the overridden classes' dtors will not be called. */ + RageDisplay(); virtual ~RageDisplay() { } virtual RString Init( const VideoModeParams &p, bool bAllowUnacceleratedRenderer ) = 0;