aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions/duckman
diff options
context:
space:
mode:
authorjohndoe1232015-12-05 00:27:30 +0100
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commit823ba2f462ff75370d1091b5c59dc950b815eed9 (patch)
treec0390e91b5034869de304423b906d8633e5f5945 /engines/illusions/duckman
parent2de38e3469e85e56b6401a9c3cd97ead2249f67e (diff)
downloadscummvm-rg350-823ba2f462ff75370d1091b5c59dc950b815eed9.tar.gz
scummvm-rg350-823ba2f462ff75370d1091b5c59dc950b815eed9.tar.bz2
scummvm-rg350-823ba2f462ff75370d1091b5c59dc950b815eed9.zip
ILLUSIONS: DUCKMAN: Implement load game from the game's menu system
- Fix pause/unpause opcodes - Reduce debug output
Diffstat (limited to 'engines/illusions/duckman')
-rw-r--r--engines/illusions/duckman/illusions_duckman.cpp3
-rw-r--r--engines/illusions/duckman/menusystem_duckman.cpp16
-rw-r--r--engines/illusions/duckman/scriptopcodes_duckman.cpp20
3 files changed, 16 insertions, 23 deletions
diff --git a/engines/illusions/duckman/illusions_duckman.cpp b/engines/illusions/duckman/illusions_duckman.cpp
index 289a3d80b4..8f28a99c56 100644
--- a/engines/illusions/duckman/illusions_duckman.cpp
+++ b/engines/illusions/duckman/illusions_duckman.cpp
@@ -1080,7 +1080,6 @@ bool IllusionsEngine_Duckman::getTriggerCause(uint32 verbId, uint32 objectId2, u
}
uint32 IllusionsEngine_Duckman::runTriggerCause(uint32 verbId, uint32 objectId2, uint32 objectId) {
- // TODO
debug(1, "runTriggerCause(%08X, %08X, %08X)", verbId, objectId2, objectId);
uint32 triggerThreadId;
@@ -1136,7 +1135,7 @@ void IllusionsEngine_Duckman::playTriggerCauseSound(uint32 verbId, uint32 object
}
bool IllusionsEngine_Duckman::loadSavegameFromScript(int16 slotNum, uint32 callingThreadId) {
- const char *fileName = getSavegameFilename(slotNum);
+ const char *fileName = getSavegameFilename(_savegameSlotNum);
bool success = loadgame(fileName);
if (success)
activateSavegame(callingThreadId);
diff --git a/engines/illusions/duckman/menusystem_duckman.cpp b/engines/illusions/duckman/menusystem_duckman.cpp
index 666005d952..7b1191612f 100644
--- a/engines/illusions/duckman/menusystem_duckman.cpp
+++ b/engines/illusions/duckman/menusystem_duckman.cpp
@@ -41,7 +41,7 @@ DuckmanMenuSystem::~DuckmanMenuSystem() {
void DuckmanMenuSystem::runMenu(MenuChoiceOffsets menuChoiceOffsets, int16 *menuChoiceOffset,
uint32 menuId, uint32 duration, uint timeOutMenuChoiceIndex, uint32 menuCallerThreadId) {
- debug("DuckmanMenuSystem::runMenu(%08X)", menuId);
+ debug(0, "DuckmanMenuSystem::runMenu(%08X)", menuId);
setTimeOutDuration(duration, timeOutMenuChoiceIndex);
setMenuCallerThreadId(menuCallerThreadId);
@@ -87,11 +87,7 @@ BaseMenu *DuckmanMenuSystem::createMenuById(int menuId) {
BaseMenu *DuckmanMenuSystem::createMainMenu() {
BaseMenu *menu = new BaseMenu(this, 0x00120003, 12, 17, 11, 27, 0);
menu->addMenuItem(new MenuItem("Start New Game", new MenuActionReturnChoice(this, 11)));
-
- menu->addMenuItem(new MenuItem("Load Saved Game", new MenuActionReturnChoice(this, 0)));
- menu->addMenuItem(new MenuItem("Options", new MenuActionReturnChoice(this, 0)));
-
- // TODO menu->addMenuItem(new MenuItem("Load Saved Game", new MenuActionEnterMenu(this, kDuckmanLoadGameMenu)));
+ menu->addMenuItem(new MenuItem("Load Saved Game", new MenuActionLoadGame(this, 1)));
// TODO menu->addMenuItem(new MenuItem("Options", new MenuActionEnterMenu(this, kDuckmanOptionsMenu)));
menu->addMenuItem(new MenuItem("Quit Game", new MenuActionEnterQueryMenu(this, kDuckmanQueryQuitMenu, 12)));
return menu;
@@ -109,10 +105,12 @@ BaseMenu *DuckmanMenuSystem::createPauseMenu() {
BaseMenu *menu = new BaseMenu(this, 0x00120003, 12, 17, 11, 27, 1);
menu->addText(" Game Paused");
menu->addText("-------------------");
- menu->addMenuItem(new MenuItem("Resume", new MenuActionReturnChoice(this, 1)));
- //menu->addMenuItem(new MenuItem("Restart Game", new MenuActionEnterQueryMenu(this, kDuckmanQueryRestartMenu, 2)));
+ menu->addMenuItem(new MenuItem("Resume", new MenuActionReturnChoice(this, 21)));
+ menu->addMenuItem(new MenuItem("Load Game", new MenuActionLoadGame(this, 1)));
+ // TODO menu->addMenuItem(new MenuItem("Save Game", new MenuActionSaveGame(this, 11)));
+ // TODO menu->addMenuItem(new MenuItem("Restart Game", new MenuActionEnterQueryMenu(this, kDuckmanQueryRestartMenu, 2)));
// TODO menu->addMenuItem(new MenuItem("Options", new MenuActionEnterMenu(this, kDuckmanOptionsMenu)));
- menu->addMenuItem(new MenuItem("Quit Game", new MenuActionEnterQueryMenu(this, kDuckmanQueryQuitMenu, 3)));
+ menu->addMenuItem(new MenuItem("Quit Game", new MenuActionEnterQueryMenu(this, kDuckmanQueryQuitMenu, 23)));
return menu;
}
diff --git a/engines/illusions/duckman/scriptopcodes_duckman.cpp b/engines/illusions/duckman/scriptopcodes_duckman.cpp
index 1456cfc0ee..759b4bc606 100644
--- a/engines/illusions/duckman/scriptopcodes_duckman.cpp
+++ b/engines/illusions/duckman/scriptopcodes_duckman.cpp
@@ -203,14 +203,14 @@ void ScriptOpcodes_Duckman::opStartTimerThread(ScriptThread *scriptThread, OpCal
if (maxDuration)
duration += _vm->getRandom(maxDuration);
-//duration = 1;//DEBUG Speeds up things
-//duration = 5;
-//debug("duration: %d", duration);
+ //duration = 1;//DEBUG Speeds up things
+ //duration = 5;
+ //debug("duration: %d", duration);
if (isAbortable)
- _vm->startAbortableTimerThread(duration, opCall._threadId);
+ _vm->startAbortableTimerThread(duration, opCall._callerThreadId);
else
- _vm->startTimerThread(duration, opCall._threadId);
+ _vm->startTimerThread(duration, opCall._callerThreadId);
}
void ScriptOpcodes_Duckman::opRerunThreads(ScriptThread *scriptThread, OpCall &opCall) {
@@ -592,11 +592,11 @@ void ScriptOpcodes_Duckman::opRunSpecialCode(ScriptThread *scriptThread, OpCall
}
void ScriptOpcodes_Duckman::opPause(ScriptThread *scriptThread, OpCall &opCall) {
- _vm->pause(opCall._threadId);
+ _vm->pause(opCall._callerThreadId);
}
void ScriptOpcodes_Duckman::opUnpause(ScriptThread *scriptThread, OpCall &opCall) {
- _vm->unpause(opCall._threadId);
+ _vm->unpause(opCall._callerThreadId);
}
void ScriptOpcodes_Duckman::opStartSound(ScriptThread *scriptThread, OpCall &opCall) {
@@ -649,21 +649,17 @@ void ScriptOpcodes_Duckman::opDisplayMenu(ScriptThread *scriptThread, OpCall &op
ARG_UINT32(menuId);
ARG_UINT32(timeOutMenuChoiceIndex);
- debug("menuId: %08X", menuId);
- debug("timeOutMenuChoiceIndex: %d", timeOutMenuChoiceIndex);
-
MenuChoiceOffsets menuChoiceOffsets;
// Load menu choices from the stack
do {
int16 choiceOffs = _vm->_stack->pop();
- debug("choiceOffs: %04X", choiceOffs);
menuChoiceOffsets.push_back(choiceOffs);
} while (_vm->_stack->pop() == 0);
_vm->_menuSystem->runMenu(menuChoiceOffsets, &_vm->_menuChoiceOfs,
menuId, timeOutDuration, timeOutMenuChoiceIndex,
- opCall._threadId);
+ opCall._callerThreadId);
//DEBUG Resume calling thread, later done by the video player
//_vm->notifyThreadId(opCall._callerThreadId);