aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/hugo/file.cpp4
-rw-r--r--engines/hugo/hugo.cpp3
-rw-r--r--engines/hugo/hugo.h1
3 files changed, 5 insertions, 3 deletions
diff --git a/engines/hugo/file.cpp b/engines/hugo/file.cpp
index a0e3ff05ce..dcbc1569eb 100644
--- a/engines/hugo/file.cpp
+++ b/engines/hugo/file.cpp
@@ -400,7 +400,7 @@ bool FileManager::saveGame(const int16 slot, const Common::String &descrip) {
out->writeByte((gameStatus.gameOverFl) ? 1 : 0);
// Save screen states
- for (int i = 0; i < _vm->_numScreens; i++)
+ for (int i = 0; i < _vm->_numStates; i++)
out->writeByte(_vm->_screenStates[i]);
_vm->_scheduler->saveSchedulerData(out);
@@ -497,7 +497,7 @@ bool FileManager::restoreGame(const int16 slot) {
gameStatus.storyModeFl = (in->readByte() == 1);
_vm->_mouse->setJumpExitFl(in->readByte() == 1);
gameStatus.gameOverFl = (in->readByte() == 1);
- for (int i = 0; i < _vm->_numScreens; i++)
+ for (int i = 0; i < _vm->_numStates; i++)
_vm->_screenStates[i] = in->readByte();
_vm->_scheduler->restoreSchedulerData(in);
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index ba87f58150..32247be2da 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -53,7 +53,7 @@ HugoEngine *HugoEngine::s_Engine = 0;
HugoEngine::HugoEngine(OSystem *syst, const HugoGameDescription *gd) : Engine(syst), _gameDescription(gd),
_hero(0), _heroImage(0), _defltTunes(0), _numScreens(0), _tunesNbr(0), _soundSilence(0), _soundTest(0),
- _screenStates(0), _score(0), _maxscore(0), _lastTime(0), _curTime(0), _episode(0)
+ _screenStates(0), _numStates(0), _score(0), _maxscore(0), _lastTime(0), _curTime(0), _episode(0)
{
_system = syst;
DebugMan.addDebugChannel(kDebugSchedule, "Schedule", "Script Schedule debug level");
@@ -463,6 +463,7 @@ bool HugoEngine::loadHugoDat() {
for (int varnt = 0; varnt < _numVariant; varnt++) {
numElem = in.readUint16BE();
if (varnt == _gameVariant) {
+ _numStates = numElem;
_screenStates = (byte *)malloc(sizeof(byte) * numElem);
memset(_screenStates, 0, sizeof(_screenStates));
}
diff --git a/engines/hugo/hugo.h b/engines/hugo/hugo.h
index ed021f5cd6..0a8325f439 100644
--- a/engines/hugo/hugo.h
+++ b/engines/hugo/hugo.h
@@ -238,6 +238,7 @@ public:
int8 _soundTest;
int8 _tunesNbr;
uint16 _numScreens;
+ uint16 _numStates;
int8 _normalTPS; // Number of ticks (frames) per second.
// 8 for Win versions, 9 for DOS versions
object_t *_hero;