summaryrefslogtreecommitdiffstats
path: root/MatchBloxEngine/MatchBloxEngine/C_Block.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'MatchBloxEngine/MatchBloxEngine/C_Block.cpp')
-rw-r--r--MatchBloxEngine/MatchBloxEngine/C_Block.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/MatchBloxEngine/MatchBloxEngine/C_Block.cpp b/MatchBloxEngine/MatchBloxEngine/C_Block.cpp
index 4b2a9f7..4c092a2 100644
--- a/MatchBloxEngine/MatchBloxEngine/C_Block.cpp
+++ b/MatchBloxEngine/MatchBloxEngine/C_Block.cpp
@@ -28,6 +28,7 @@ void C_Block::Render(unsigned int f_iElapsedTime)
unsigned int l_uiDeltaTime = f_iElapsedTime - m_uiAnimStart;
double l_Scale = 0.0;
+
//check if the previous animation has ended in between
//calls to this Render function.
if (l_uiDeltaTime > g_BlockAnimDurations[(int)m_CurrState])
@@ -35,12 +36,15 @@ void C_Block::Render(unsigned int f_iElapsedTime)
m_CurrState = BS_IDLE;
}
+ glPushMatrix();
+
switch (m_CurrState)
{
case BS_FADE_IN:
l_Scale = (double)l_uiDeltaTime / (double)g_BlockAnimDurations[BS_FADE_IN];
//glScaled(l_Scale, l_Scale, l_Scale);
SetScale(l_Scale, l_Scale, l_Scale);
+ TransRotateScale();
C_3DObject::Render();
break;
@@ -48,6 +52,7 @@ void C_Block::Render(unsigned int f_iElapsedTime)
l_Scale = 1.0 - ((double)l_uiDeltaTime / (double)g_BlockAnimDurations[BS_FADE_OUT]);
// glScaled(l_Scale, l_Scale, l_Scale);
SetScale(l_Scale, l_Scale, l_Scale);
+ TransRotateScale();
C_3DObject::Render();
break;
@@ -56,8 +61,11 @@ void C_Block::Render(unsigned int f_iElapsedTime)
case BS_IDLE:
default:
+ TransRotateScale();
C_3DObject::Render();
break;
}
+ glPopMatrix();
+
}