aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/lure/game.cpp19
-rw-r--r--engines/lure/game.h5
-rw-r--r--engines/lure/lure.cpp2
3 files changed, 22 insertions, 4 deletions
diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp
index 56c2db54e4..2f95bcb01c 100644
--- a/engines/lure/game.cpp
+++ b/engines/lure/game.cpp
@@ -47,7 +47,7 @@ Game &Game::getReference() {
Game::Game() {
int_game = this;
_debugger = new Debugger();
- _slowSpeedFlag = true;
+ _fastTextFlag = false;
_preloadFlag = false;
_soundFlag = true;
}
@@ -867,8 +867,8 @@ void Game::doTextSpeed() {
Menu &menu = Menu::getReference();
StringList &sl = Resources::getReference().stringList();
- _slowSpeedFlag = !_slowSpeedFlag;
- menu.getMenu(2).entries()[1] = sl.getString(_slowSpeedFlag ? S_SLOW_TEXT : S_FAST_TEXT);
+ _fastTextFlag = !_fastTextFlag;
+ menu.getMenu(2).entries()[1] = sl.getString(_fastTextFlag ? S_FAST_TEXT : S_SLOW_TEXT);
}
void Game::doSound() {
@@ -978,4 +978,17 @@ bool Game::getYN() {
return result;
}
+void Game::saveToStream(WriteStream *stream) {
+ stream->writeByte(_fastTextFlag);
+}
+
+void Game::loadFromStream(ReadStream *stream) {
+ Menu &menu = Menu::getReference();
+ StringList &sl = Resources::getReference().stringList();
+
+ _fastTextFlag = stream->readByte() != 0;
+ menu.getMenu(2).entries()[1] = sl.getString(_fastTextFlag ? S_FAST_TEXT : S_SLOW_TEXT);
+}
+
+
} // end of namespace Lure
diff --git a/engines/lure/game.h b/engines/lure/game.h
index 8afbe1691b..bb7c2d6d7e 100644
--- a/engines/lure/game.h
+++ b/engines/lure/game.h
@@ -46,7 +46,7 @@ enum GameState {GS_ERROR = 1, GS_TICK = 2, GS_TOCK = 4, GS_PROT = 8, GS_RESTART
class Game {
private:
Debugger *_debugger;
- bool _slowSpeedFlag, _soundFlag;
+ bool _fastTextFlag, _soundFlag;
uint8 _state;
uint16 _tellCommands[MAX_TELL_COMMANDS * 3 + 1];
int _numTellCommands;
@@ -69,6 +69,8 @@ public:
virtual ~Game();
static Game &getReference();
+ void saveToStream(WriteStream *stream);
+ void loadFromStream(ReadStream *stream);
void tick();
void tickCheck();
@@ -76,6 +78,7 @@ public:
void execute();
void setState(uint8 flags) { _state = flags; }
bool &preloadFlag() { return _preloadFlag; }
+ bool fastTextFlag() { return _fastTextFlag; }
// Menu item support methods
void doDebugMenu();
diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp
index db71989cba..ab9448c7cd 100644
--- a/engines/lure/lure.cpp
+++ b/engines/lure/lure.cpp
@@ -165,6 +165,7 @@ bool LureEngine::saveGame(uint8 slotNumber, Common::String &caption) {
f->writeByte(0); // End of string terminator
Resources::getReference().saveToStream(f);
+ Game::getReference().saveToStream(f);
Room::getReference().saveToStream(f);
Fights.saveToStream(f);
@@ -205,6 +206,7 @@ bool LureEngine::loadGame(uint8 slotNumber) {
// Load in the data
Resources::getReference().loadFromStream(f);
+ Game::getReference().loadFromStream(f);
Room::getReference().loadFromStream(f);
Fights.loadFromStream(f);