summaryrefslogtreecommitdiffstats
path: root/MatchBloxEngine/MatchBloxEngine/C_Hand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'MatchBloxEngine/MatchBloxEngine/C_Hand.cpp')
-rw-r--r--MatchBloxEngine/MatchBloxEngine/C_Hand.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/MatchBloxEngine/MatchBloxEngine/C_Hand.cpp b/MatchBloxEngine/MatchBloxEngine/C_Hand.cpp
index 54c1837..8c4d977 100644
--- a/MatchBloxEngine/MatchBloxEngine/C_Hand.cpp
+++ b/MatchBloxEngine/MatchBloxEngine/C_Hand.cpp
@@ -1,41 +1,43 @@
-#include <GL\glut.h>
+#include <GL/glut.h>
#include "C_Hand.h"
#define FADE_DURATION 500
-C_Hand::C_Hand(char* f_strFileName)
-: C_3DObject(f_strFileName), m_CurrState(IDLE), m_uiAnimStart(0)
+//duration of animations in ms
+unsigned int g_HandAnimDurations[3] = {0, 100, 100};
+
+
+C_Hand::C_Hand(const char* f_strFileName, GLuint f_uiTex,
+ MatProps_t f_Mat)
+: C_3DObject(f_strFileName, f_uiTex, f_Mat),
+ m_CurrState(HS_IDLE), m_uiAnimStart(0)
{
}
-void C_Hand::Draw(unsigned int f_iElapsedTime)
+void C_Hand::Render(unsigned int f_iElapsedTime)
{
unsigned int l_uiDeltaTime = f_iElapsedTime - m_uiAnimStart;
if (l_uiDeltaTime > g_HandAnimDurations[(int)m_CurrState])
{
- m_CurrState = IDLE;
+ m_CurrState = HS_IDLE;
}
- glPushMatrix();
- TransRotateScale();
-
switch (m_CurrState)
{
- case GRAB:
- C_3DObject::Draw();
+ case HS_GRAB:
+ C_3DObject::Render();
break;
- case RELEASE:
- C_3DObject::Draw();
+ case HS_RELEASE:
+ C_3DObject::Render();
break;
- case IDLE:
+ case HS_IDLE:
default:
- C_3DObject::Draw();
+ C_3DObject::Render();
break;
}
- glPopMatrix();
-} \ No newline at end of file
+}