AGI: Fix Hold-Key-Mode implementation

Hold-Key-Mode got introduced v2.425, it was simply not possible
to disable it until 3.098.
Now creating a AGI_KEY_STATIONARY event, so that it works properly

Fixes Mixed Up Mother Goose
This commit is contained in:
Martin Kiewitz 2016-02-04 22:53:15 +01:00
parent 9f7ff8351b
commit 4b7d49dcff
5 changed files with 36 additions and 14 deletions

View file

@ -45,7 +45,7 @@
#include "agi/systemui.h"
#include "agi/words.h"
#define SAVEGAME_CURRENT_VERSION 7
#define SAVEGAME_CURRENT_VERSION 8
//
// Version 0 (Sarien): view table has 64 entries
@ -59,7 +59,9 @@
// required for some games for quick-loading from ScummVM main menu
// for games, that do not set all key mappings right at the start
// Added automatic save data (for command SetSimple)
//
// Version 8 (ScummVM): Added Hold-Key-Mode boolean
// required for at least Mixed Up Mother Goose
// gets set at the start of the game only
namespace Agi {
@ -195,6 +197,10 @@ int AgiEngine::saveGame(const Common::String &fileName, const Common::String &de
out->writeByte(_game.controllerKeyMapping[i].controllerSlot);
}
// Version 8+: hold-key-mode
// required for at least Mixed Up Mother Goose
out->writeByte(_keyHoldMode);
// game.ev_keyp
for (i = 0; i < MAX_STRINGS; i++)
out->write(_game.strings[i], MAX_STRINGLEN);
@ -521,6 +527,15 @@ int AgiEngine::loadGame(const Common::String &fileName, bool checkId) {
}
}
if (saveVersion >= 8) {
// Version 8+: hold-key-mode
if (in->readByte()) {
_keyHoldMode = true;
} else {
_keyHoldMode = false;
}
}
for (i = 0; i < MAX_STRINGS; i++)
in->read(_game.strings[i], MAX_STRINGLEN);