aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-02-02 23:59:45 -0500
committerPaul Gilbert2014-02-02 23:59:45 -0500
commitd13b529c4718d01c045c3af7b83c6f6793d92077 (patch)
tree98f3634837012087890c8e15ff32a80580822e95
parent4ef57db61a7730d0ff1fc19658cb8726ee35b9ca (diff)
downloadscummvm-rg350-d13b529c4718d01c045c3af7b83c6f6793d92077.tar.gz
scummvm-rg350-d13b529c4718d01c045c3af7b83c6f6793d92077.tar.bz2
scummvm-rg350-d13b529c4718d01c045c3af7b83c6f6793d92077.zip
VOYEUR: Improvements to debugger command for changing time period
-rw-r--r--engines/voyeur/debugger.cpp34
-rw-r--r--engines/voyeur/files.h6
2 files changed, 21 insertions, 19 deletions
diff --git a/engines/voyeur/debugger.cpp b/engines/voyeur/debugger.cpp
index 8fdcf20823..b1bc2633ee 100644
--- a/engines/voyeur/debugger.cpp
+++ b/engines/voyeur/debugger.cpp
@@ -40,6 +40,10 @@ Debugger::Debugger() : GUI::Debugger() {
_showMousePosition = false;
}
+static const int TIME_STATES[] = {
+ 0, 31, 0, 43, 59, 0, 67, 75, 85, 93, 0, 0, 111, 121, 0, 0
+};
+
bool Debugger::Cmd_Time(int argc, const char **argv) {
if (argc < 2) {
// Get the current day and time of day
@@ -48,8 +52,8 @@ bool Debugger::Cmd_Time(int argc, const char **argv) {
if (!timeString.empty())
dtString += " " + timeString;
- DebugPrintf("Current date/time is: %s, time is %s\n",
- dtString.c_str(), _isTimeActive ? "on" : "off");
+ DebugPrintf("Time period = %d, date/time is: %s, time is %s\n",
+ _vm->_voy._transitionId, dtString.c_str(), _isTimeActive ? "on" : "off");
DebugPrintf("Format: %s [on | off | 1..17 | val <amount>]\n\n", argv[0]);
} else {
if (!strcmp(argv[1], "on")) {
@@ -68,22 +72,16 @@ bool Debugger::Cmd_Time(int argc, const char **argv) {
} else {
int timeId = atoi(argv[1]);
if (timeId >= 1 && timeId <= 17) {
- _vm->_voy._transitionId = timeId;
- _vm->_gameHour = LEVEL_H[timeId - 1];
- _vm->_gameMinute = LEVEL_M[timeId - 1];
- _vm->_voy._isAM = (timeId == 6);
-
- // Camera back to full charge
- _vm->_voy._RTVNum = 0;
- _vm->_voy._RTANum = 255;
-
- // Get the new current day and time of day
- Common::String dtString = _vm->getDayName();
- Common::String timeString = _vm->getTimeOfDay();
- if (!timeString.empty())
- dtString += " " + timeString;
-
- DebugPrintf("Current date/time is now: %s\n\n", dtString.c_str());
+ int stateId = TIME_STATES[timeId - 1];
+ if (!stateId) {
+ DebugPrintf("Given time period is not used in-game\n");
+ } else {
+ DebugPrintf("Changing to time period: %d\n", timeId);
+ if (_vm->_mainThread->goToState(-1, stateId))
+ _vm->_mainThread->parsePlayCommands();
+
+ return false;
+ }
} else {
DebugPrintf("Unknown parameter\n\n");
}
diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h
index 358d1626c3..d05cba45c1 100644
--- a/engines/voyeur/files.h
+++ b/engines/voyeur/files.h
@@ -515,7 +515,6 @@ private:
void cardAction(const byte *p);
void doSTAMPCardAction();
bool goToStateID(int stackId, int id);
- bool goToState(int stackId, int stateId);
const byte *cardPerform(const byte *card);
bool cardPerform2(const byte *p, int cardCmdId);
void savePrevious();
@@ -578,6 +577,11 @@ public:
void unloadAStack(int stackId);
/**
+ * Go to a new state and/or stack
+ */
+ bool goToState(int stackId, int stateId);
+
+ /**
* Initialises data for the thread based on the current state
*/
bool doState();