summaryrefslogtreecommitdiffstats
path: root/MatchBloxEngine/MatchBloxEngine/C_MatchBloxEngine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'MatchBloxEngine/MatchBloxEngine/C_MatchBloxEngine.cpp')
-rw-r--r--MatchBloxEngine/MatchBloxEngine/C_MatchBloxEngine.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/MatchBloxEngine/MatchBloxEngine/C_MatchBloxEngine.cpp b/MatchBloxEngine/MatchBloxEngine/C_MatchBloxEngine.cpp
index 80767b8..dafa6a5 100644
--- a/MatchBloxEngine/MatchBloxEngine/C_MatchBloxEngine.cpp
+++ b/MatchBloxEngine/MatchBloxEngine/C_MatchBloxEngine.cpp
@@ -376,7 +376,7 @@ void C_MatchBloxEngine::LoadTexture(const char* f_BmpName, GLuint &f_uiTexHandle
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
}
-void C_MatchBloxEngine::CursorMove(Vect3D_t f_NewCursorPos)
+void C_MatchBloxEngine::CursorMove(Vect3D_t &f_NewCursorPos)
{
//check the state to see what 3d object currently has to be considered to
//be the cursor currently is and which bounding box we need to check for overlap
@@ -436,13 +436,14 @@ void C_MatchBloxEngine::CursorMove(Vect3D_t f_NewCursorPos)
}
-GameResult_t C_MatchBloxEngine::CursorMove_PutBlock(Vect3D_t &f_CursPos, BoundingBox_t &f_CusrBBox)
+bool C_MatchBloxEngine::CursorMove_PutBlock(Vect3D_t &f_CursPos, BoundingBox_t &f_CursBBox)
{
//check if the block is being put in the right hole
//by testing whether the position of the cursor is close
//enough to the center of the correct hole
//note that the hole positions are relative to the position
//of the box
+ bool l_bCollision = false;
Vect3D_t l_AbsHolePos = m_pBox[m_CurrentBox]->GetPos() +
m_pTiles[m_CurrentBlock]->GetPos();
Vect3D_t l_PosDif = l_AbsHolePos - f_CursPos;
@@ -456,27 +457,31 @@ GameResult_t C_MatchBloxEngine::CursorMove_PutBlock(Vect3D_t &f_CursPos, Boundin
//?? would it not be better to check for bounding box intersection with hole?
l_bCollision = !(m_pTiles[m_CurrentBlock]->GetAbsBoundBox() +
- m_pBox[m_CurrentBox]->GetPos())->Overlap(f_CursBBox);
+ m_pBox[m_CurrentBox]->GetPos()).Overlap(f_CursBBox);
//now check if the block is far enough in the hole to count as a point
if (l_PosDif.z > m_GameSettings.m_dHoleDepth)
{
//yipee!! we have got a winner!!
- m_CurrentBlock = m_pGameSession->NewTurn();
+ m_CurrentBlock = m_pCurrentSession->NewTurn();
- m_GameState
+ //m_GameState
}
+
}
+
+ return false;
}
-GameResult_t C_MatchBloxEngine::CursorMove_GrabBlock(Vect3D_t &f_CursPos, BoundingBox_t &f_CusrBBox)
+bool C_MatchBloxEngine::CursorMove_GrabBlock(Vect3D_t &f_CursPos, BoundingBox_t &f_CursBBox)
{
//grabbing a block: just check for bounding box intersection
- if (m_pBlock[(int)m_CurrentBlock)->GetAbsBoundBox().Overlap(f_CursBBox))
+ if (m_pBlock[(int)m_CurrentBlock]->GetAbsBoundBox().Overlap(f_CursBBox))
{
}
+ return true;
}