diff options
author | Paul Gilbert | 2014-02-02 23:59:45 -0500 |
---|---|---|
committer | Paul Gilbert | 2014-02-02 23:59:45 -0500 |
commit | d13b529c4718d01c045c3af7b83c6f6793d92077 (patch) | |
tree | 98f3634837012087890c8e15ff32a80580822e95 /engines/voyeur/debugger.cpp | |
parent | 4ef57db61a7730d0ff1fc19658cb8726ee35b9ca (diff) | |
download | scummvm-rg350-d13b529c4718d01c045c3af7b83c6f6793d92077.tar.gz scummvm-rg350-d13b529c4718d01c045c3af7b83c6f6793d92077.tar.bz2 scummvm-rg350-d13b529c4718d01c045c3af7b83c6f6793d92077.zip |
VOYEUR: Improvements to debugger command for changing time period
Diffstat (limited to 'engines/voyeur/debugger.cpp')
-rw-r--r-- | engines/voyeur/debugger.cpp | 34 |
1 files changed, 16 insertions, 18 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"); } |