summaryrefslogtreecommitdiffstats
path: root/matchblox/engine/C_MatchBloxEngine.h
diff options
context:
space:
mode:
Diffstat (limited to 'matchblox/engine/C_MatchBloxEngine.h')
-rw-r--r--matchblox/engine/C_MatchBloxEngine.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/matchblox/engine/C_MatchBloxEngine.h b/matchblox/engine/C_MatchBloxEngine.h
new file mode 100644
index 0000000..97aa892
--- /dev/null
+++ b/matchblox/engine/C_MatchBloxEngine.h
@@ -0,0 +1,87 @@
+#ifndef C_MATCHBLOXENGINE_HEADER_FILE
+
+#define C_MATCHBLOXENGINE_HEADER_FILE
+
+#include "MessageQueue.h"
+
+class C_3DObject;
+class C_Block;
+class C_Hand;
+class C_Log;
+class C_Environment;
+class C_Box;
+
+typedef enum GameResult
+{
+ GR_FINISHED,
+ GR_BUSY,
+ GR_ERROR
+} GameResult;
+
+enum EngineState
+{
+ ES_INITIALISED,
+ ES_ERROR,
+ ES_GET_READY, //game initialised, waiting for start signal from player
+ ES_PLAYING_GRAB_BLOCK, //no block in hand -> grab floating block
+ ES_PLAYING_PUT_BLOCK, //block in hand -> put block in box
+ ES_PAUSED, //pause...
+ ES_FINISHED //finished -> show score and goto init
+};
+
+enum BlockType
+{
+ BT_SQUARE = 0,
+ BT_CIRCLE = 1,
+ BT_TRIANGLE = 2,
+ BT_CROSS = 3
+};
+
+enum BoxSize
+{
+ BS_SMALL = 0,
+ BS_MED = 1,
+ BS_LARGE = 2
+};
+
+
+class C_MatchBloxEngine
+{
+public:
+ C_MatchBloxEngine(const char *f_strModelPath,
+ const char *f_strLogFile);
+ ~C_MatchBloxEngine();
+
+ GameResult GameStep(msgQueue &f_Queue);
+ void Render(unsigned int f_uiElapsedTime);
+
+ bool NewGame(int f_iUserID, int f_iGameId, BoxSize f_BS);
+ bool StartGame();
+ bool Pause();
+ bool Resume();
+ bool Abort();
+
+private:
+ C_Environment *m_pEnvMap;
+ C_Block *m_pBlock[4];
+ C_Hand *m_pHand;
+ C_3DObject *m_pTiles[5];
+ C_Box *m_pBox[3];
+ C_Log *m_pLog;
+
+ GLuint m_uiWood1Tex,
+ m_uiWood2Tex,
+ m_uiWood3Tex;
+
+ EngineState m_State, m_SavedState;
+ BoxSize m_CurrentBox;
+
+ void Render_Basics(unsigned int f_uiElapsedTime);
+
+ bool LoadModels(const char* f_strModelDir);
+ void DeleteModels();
+ void LoadTexture(const char* f_BmpName, GLuint &f_uiTexHandle);
+};
+
+#endif //C_MATCHBLOXENGINE_HEADER_FILE
+