summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Peeten <dpeeten@onsneteindhoven.nl>2008-05-20 13:45:34 (GMT)
committerDennis Peeten <dpeeten@onsneteindhoven.nl>2008-05-20 13:45:34 (GMT)
commitc7c995631d14d5c65d538422159b782752e9357c (patch)
treebf38babf27ac39a8727b2af34c95b9abc4eb386a
parent97de050f8924000194f7ba7224cfeb0b22cf8fec (diff)
download2iv55-c7c995631d14d5c65d538422159b782752e9357c.zip
2iv55-c7c995631d14d5c65d538422159b782752e9357c.tar.gz
2iv55-c7c995631d14d5c65d538422159b782752e9357c.tar.bz2
-rw-r--r--matchblox/engine/C_MatchBloxEngine.cpp41
-rw-r--r--matchblox/menu/menu.c2
2 files changed, 32 insertions, 11 deletions
diff --git a/matchblox/engine/C_MatchBloxEngine.cpp b/matchblox/engine/C_MatchBloxEngine.cpp
index 29b787e..e9c9473 100644
--- a/matchblox/engine/C_MatchBloxEngine.cpp
+++ b/matchblox/engine/C_MatchBloxEngine.cpp
@@ -79,16 +79,35 @@ GameResult C_MatchBloxEngine::ProcessMsgs(void)
void C_MatchBloxEngine::Render_Basics(unsigned int f_uiElapsedTime)
{
- //render the environment
+ glPushMatrix();
+
+ //set camera pitch
+ glRotated(20.0, 1.0, 0.0, 0.0);
+ //rotate the environment map about the y axis
+ glRotated((GLdouble)f_uiElapsedTime/1000.0, 0.0, 1.0, 0.0);
m_pEnvMap->Render();
- if (m_pCurrentSession)
- {
- m_pBox[(int)m_pCurrentSession->m_BoxSize]->Render();
- for (int i=0; i<4; i++)
- m_pBlock[i]->Render(f_uiElapsedTime);
+ glPopMatrix();
+
+ glPushMatrix();
+
+
+ //move the camera backwards
+ glTranslated(0.0, 0.0, -16.0);
+ glRotated(20.0, 1.0, 0.0, 0.0);
+
+
+
+
+ //if (m_pCurrentSession)
+ //{
+ m_pBox[(int)m_CurrentBox]->Render();
+ //for (int i=0; i<4; i++)
+ //m_pBlock[i]->Render(f_uiElapsedTime);
// m_pHand->Render(f_uiElapsedTime);
- }
+ //}
+
+ glPopMatrix();
}
void C_MatchBloxEngine::Render(unsigned int f_uiElapsedTime)
@@ -167,8 +186,8 @@ bool C_MatchBloxEngine::NewGame(int f_iUserID, int f_iGameId, BoxSize f_BS)
//randomize the box tiles
m_pBox[(int)m_pCurrentSession->m_BoxSize]->RandomizeTiles();
- //init box's position
- m_pBox[(int)m_pCurrentSession->m_BoxSize]->SetPos(0.0, -6.0, -15.0);
+
+ m_CurrentBox = f_BS;
//set state to GET READY
m_State = ES_GET_READY;
@@ -254,7 +273,7 @@ bool C_MatchBloxEngine::LoadModels(const char* f_strModelDir)
std::string l_BaseName = f_strModelDir;
//create the environment mapped cube
- m_pEnvMap = new C_Environment("envmaps/terrain_", 50.0);
+ m_pEnvMap = new C_Environment("envmaps/brightday2_", 50.0);
//load the bitmaps for the textures
LoadTexture((l_BaseName + "/wood1.bmp").c_str(), m_uiWood1Tex);
@@ -323,7 +342,7 @@ bool C_MatchBloxEngine::LoadModels(const char* f_strModelDir)
m_pBox[0] = new C_Box((l_BaseName + "/box_small.obj").c_str(),
m_uiWood2Tex, l_Mat, 2, 2, m_pTiles);
if (!m_pBox[0]->Initialized()) return false;
-
+
m_pBox[1] = new C_Box((l_BaseName + "/box_med.obj").c_str(),
m_uiWood2Tex, l_Mat, 4, 2, m_pTiles);
if (!m_pBox[1]->Initialized()) return false;
diff --git a/matchblox/menu/menu.c b/matchblox/menu/menu.c
index 8766ef8..02376d1 100644
--- a/matchblox/menu/menu.c
+++ b/matchblox/menu/menu.c
@@ -201,6 +201,7 @@ void MenuRender(void)
glClearColor(0.9, 0.9, 0.9, 1);
+ glPushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT | GL_CURRENT_BIT | GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
glDisable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
@@ -250,6 +251,7 @@ void MenuRender(void)
glPopMatrix();
+ glPopAttrib();
} // MenuRender