summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilrik de Loose <wilrik@wilrik.nl>2008-05-27 20:01:14 (GMT)
committerWilrik de Loose <wilrik@wilrik.nl>2008-05-27 20:01:14 (GMT)
commitd1be71f4ef809d3928ff6c8e3c25bc801cdf6339 (patch)
treeea93c3036e5afb5ac0109b6d832ce2878f84df76
parent4f1e514f389bd1bd0de21bb3daaf477939b0ce33 (diff)
download2iv55-d1be71f4ef809d3928ff6c8e3c25bc801cdf6339.zip
2iv55-d1be71f4ef809d3928ff6c8e3c25bc801cdf6339.tar.gz
2iv55-d1be71f4ef809d3928ff6c8e3c25bc801cdf6339.tar.bz2
small changes in menu button handling
-rw-r--r--headtrack_stereo_demo/headtrack_stereo_demo.vcproj4
-rw-r--r--headtrack_stereo_demo/src/main.cpp6
-rw-r--r--matchblox/engine/C_MatchBloxEngine.cpp10
-rw-r--r--matchblox/menu/menu.c28
-rw-r--r--matchblox/menu/menu.h2
-rw-r--r--matchblox/menu/menu_msg.c2
6 files changed, 30 insertions, 22 deletions
diff --git a/headtrack_stereo_demo/headtrack_stereo_demo.vcproj b/headtrack_stereo_demo/headtrack_stereo_demo.vcproj
index 844c39e..ea27d32 100644
--- a/headtrack_stereo_demo/headtrack_stereo_demo.vcproj
+++ b/headtrack_stereo_demo/headtrack_stereo_demo.vcproj
@@ -20,6 +20,8 @@
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(OutDir)\intermediate"
ConfigurationType="1"
+ UseOfMFC="0"
+ UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
@@ -45,7 +47,7 @@
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
- RuntimeLibrary="3"
+ RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
diff --git a/headtrack_stereo_demo/src/main.cpp b/headtrack_stereo_demo/src/main.cpp
index 9bd8d23..efdb7a0 100644
--- a/headtrack_stereo_demo/src/main.cpp
+++ b/headtrack_stereo_demo/src/main.cpp
@@ -70,10 +70,10 @@ bool InitWiiMotes()
g_GameState.m_pTrackingWiimote->SetLEDs(0x0f);
- g_GameState.m_pTrackingWiimote->SetReportType(wiimote::IN_BUTTONS_ACCEL_IR_EXT); // IR dots
- /*g_GameState.m_pTrackingWiimote->SetRumble(true);
+ g_GameState.m_pTrackingWiimote->SetReportType(wiimote::IN_BUTTONS_ACCEL_IR); // IR dots
+ g_GameState.m_pTrackingWiimote->SetRumble(true);
Sleep(500);
- g_GameState.m_pTrackingWiimote->SetRumble(false); */
+ g_GameState.m_pTrackingWiimote->SetRumble(false);
return true;
}
diff --git a/matchblox/engine/C_MatchBloxEngine.cpp b/matchblox/engine/C_MatchBloxEngine.cpp
index 2a660fd..9d385e2 100644
--- a/matchblox/engine/C_MatchBloxEngine.cpp
+++ b/matchblox/engine/C_MatchBloxEngine.cpp
@@ -102,7 +102,6 @@ GameResult C_MatchBloxEngine::ProcessMsgs(void)
{
case MESSAGE_MENU:
int l_iAction;
- int l_iGameMode;
menu_payload *l_pMsg1;
l_pMsg1 = (menu_payload*)message->payload;
@@ -111,11 +110,14 @@ GameResult C_MatchBloxEngine::ProcessMsgs(void)
switch (l_iAction)
{
case ACTION_PAUSE:
- Pause();
+ if (!Pause())
+ {
+ Resume();
+ }
break;
case ACTION_START:
- l_iGameMode = l_pMsg1->gamemode;
- StartGame();
+ Abort();
+ NewGame(0, l_pMsg1->gamemode, BS_SMALL);
break;
case ACTION_RESUME:
Resume();
diff --git a/matchblox/menu/menu.c b/matchblox/menu/menu.c
index fc3f166..c87d369 100644
--- a/matchblox/menu/menu.c
+++ b/matchblox/menu/menu.c
@@ -120,26 +120,20 @@ void MenuBuild (void)
case MENU_START:
MenuAddLabel(50, 50, "Headtracking");
- MenuAddButton(150, 100, 64, 64, "On", BUTTON_RADIO, BUTTON_GROUP1, NULL);
- MenuAddButton(350, 100, 64, 64, "Off", BUTTON_RADIO, BUTTON_GROUP1, NULL);
+ MenuAddButton(150, 100, 64, 64, "On", BUTTON_RADIO, BUTTON_GROUP1, NULL);
+ MenuAddButton(350, 100, 64, 64, "Off", BUTTON_RADIO, BUTTON_GROUP1, NULL);
MenuEnableGroup(BUTTON_GROUP1);
MenuAddLabel(50, 250, "Stereo vision");
- MenuAddButton(150, 300, 64, 64, "On", BUTTON_RADIO, BUTTON_GROUP2, NULL);
- MenuAddButton(350, 300, 64, 64, "Off", BUTTON_RADIO, BUTTON_GROUP2, NULL);
- MenuAddButton(350, 400, 256, 64, "Next", BUTTON_CLICK, BUTTON_NO_GROUP, MenuPostMessagePause);
+ MenuAddButton(150, 300, 64, 64, "On", BUTTON_RADIO, BUTTON_GROUP2, NULL);
+ MenuAddButton(350, 300, 64, 64, "Off", BUTTON_RADIO, BUTTON_GROUP2, NULL);
+ MenuAddButton(350, 400, 256, 64, "Next", BUTTON_CLICK, BUTTON_NO_GROUP, MenuPostMessageStart);
MenuEnableGroup(BUTTON_GROUP2);
-
- //MenuAddButton(50, 350, 0, 0, "Box size", BUTTON_LABEL, BUTTON_NO_GROUP, NULL);
- //MenuAddButton(50, 400, 64, 64, "Small", BUTTON_RADIO, BUTTON_GROUP3, NULL);
- //MenuAddButton(150, 400, 64, 64, "Medium", BUTTON_RADIO, BUTTON_GROUP3, NULL);
- //MenuAddButton(250, 400, 64, 64, "Large", BUTTON_RADIO, BUTTON_GROUP3, NULL);
- //MenuEnableGroup(BUTTON_GROUP3);
break;
case MENU_OPTIONS:
- MenuAddButton(250, 150, 250, 64, "Abort", BUTTON_CLICK, BUTTON_NO_GROUP, MenuNext);
- MenuAddButton(250, 250, 250, 64, "Recalibrate", BUTTON_CLICK, BUTTON_NO_GROUP, MenuNext);
+ MenuAddButton(200, 150, 250, 64, "Abort", BUTTON_CLICK, BUTTON_NO_GROUP, MenuPostMessageAbort);
+ MenuAddButton(200, 250, 250, 64, "Recalibrate", BUTTON_CLICK, BUTTON_NO_GROUP, MenuPostMessageAbort);
MenuEnableGroup(BUTTON_GROUP1);
break;
}
@@ -433,4 +427,10 @@ void MenuMouseMove(int f_iXPos, int f_iYPos)
}
}
-} // MenuMouseMove \ No newline at end of file
+} // MenuMouseMove
+
+void MenuOff(void)
+{
+ g_pCurMenu = &g_sMenuOff;
+
+} // MenuOff \ No newline at end of file
diff --git a/matchblox/menu/menu.h b/matchblox/menu/menu.h
index 6a54332..b21e50f 100644
--- a/matchblox/menu/menu.h
+++ b/matchblox/menu/menu.h
@@ -13,6 +13,8 @@ void MenuProcessMessage(void);
void MenuMouseClick(int button, int state, int x, int y);
void MenuMouseMove(int x, int y);
+void MenuOff(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/matchblox/menu/menu_msg.c b/matchblox/menu/menu_msg.c
index 3a84543..0fed049 100644
--- a/matchblox/menu/menu_msg.c
+++ b/matchblox/menu/menu_msg.c
@@ -1,6 +1,7 @@
#include "message_queue.h"
#include "message_input.h"
#include "menu_msg.h"
+#include "menu.h"
void MenuPostMessage(struct menu_payload payload)
{
@@ -45,6 +46,7 @@ void MenuPostMessageStart(void)
payload.action = ACTION_START;
payload.gamemode = 0;
+ MenuOff();
MenuPostMessage(payload);