aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-11-28 22:12:45 -0500
committerPaul Gilbert2014-12-12 22:51:43 -0500
commitb478b05df2ac62425fc01ea7ad13899c50404166 (patch)
tree159dd733d5d80e761a0da8fb8acf4bbb1fe496e8
parent21519194348425f988f9a78c3748bc596bb1ac61 (diff)
downloadscummvm-rg350-b478b05df2ac62425fc01ea7ad13899c50404166.tar.gz
scummvm-rg350-b478b05df2ac62425fc01ea7ad13899c50404166.tar.bz2
scummvm-rg350-b478b05df2ac62425fc01ea7ad13899c50404166.zip
ACCESS: Move _saveRiver from engine to River class
-rw-r--r--engines/access/amazon/amazon_game.cpp1
-rw-r--r--engines/access/amazon/amazon_game.h1
-rw-r--r--engines/access/amazon/amazon_logic.cpp15
-rw-r--r--engines/access/amazon/amazon_logic.h1
4 files changed, 10 insertions, 8 deletions
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp
index 55876b5692..b6c538542e 100644
--- a/engines/access/amazon/amazon_game.cpp
+++ b/engines/access/amazon/amazon_game.cpp
@@ -43,7 +43,6 @@ AccessEngine(syst, gameDesc),
_skipStart = false;
_charSegSwitch = false;
- _saveRiver = false;
_oldTitleChapter = _chapter = 0;
_updateChapter = -1;
_rawInactiveX = 0;
diff --git a/engines/access/amazon/amazon_game.h b/engines/access/amazon/amazon_game.h
index b09c96d263..d697b16c93 100644
--- a/engines/access/amazon/amazon_game.h
+++ b/engines/access/amazon/amazon_game.h
@@ -86,7 +86,6 @@ public:
InactivePlayer _inactive;
bool _charSegSwitch;
bool _skipStart;
- bool _saveRiver;
// Fields that are mapped to flags
int &_guardLocation;
diff --git a/engines/access/amazon/amazon_logic.cpp b/engines/access/amazon/amazon_logic.cpp
index 8df28ae85e..3ecb20d974 100644
--- a/engines/access/amazon/amazon_logic.cpp
+++ b/engines/access/amazon/amazon_logic.cpp
@@ -1013,6 +1013,7 @@ River::River(AmazonEngine *vm): PannedScene(vm) {
_rKeyFlag = 0;
_mapOffset = 0;
_screenVirtX = 0;
+ _saveRiver = false;
}
void River::setRiverPan() {
@@ -1058,7 +1059,7 @@ void River::initRiver() {
_vm->_destIn = &_vm->_buffer2;
_vm->_room->roomMenu();
- if (_vm->_saveRiver) {
+ if (_saveRiver) {
// Restoring a savegame, so set properties from saved fields
_vm->_screen->_scrollRow = _rScrollRow;
_vm->_screen->_scrollCol = _rScrollCol;
@@ -1076,7 +1077,7 @@ void River::initRiver() {
_vm->copyBF2Vid();
_vm->_screen->forceFadeIn();
- if (_vm->_saveRiver) {
+ if (_saveRiver) {
// Restore draw rects from savegame
_vm->_oldRects.resize(_rOldRectCount);
_vm->_newRects.resize(_rNewRectCount);
@@ -1096,7 +1097,7 @@ void River::initRiver() {
_canoeFrame = 0;
_mapPtr = (const byte *)MAPTBL[_vm->_riverFlag] + 1;
- if (_vm->_saveRiver) {
+ if (_saveRiver) {
_mapPtr--;
_mapPtr += _mapOffset;
} else {
@@ -1123,7 +1124,7 @@ void River::initRiver() {
++_vm->_timers[12]._flag;
_vm->_maxHits = 2 - _vm->_riverFlag;
- _vm->_saveRiver = false;
+ _saveRiver = false;
}
void River::resetPositions() {
@@ -1234,7 +1235,7 @@ void River::moveCanoe() {
_vm->_scripts->printString(BAR_MESSAGE);
} else {
// Clicked on the Disc icon
- _vm->_saveRiver = true;
+ _saveRiver = true;
_rScrollRow = screen._scrollRow;
_rScrollCol = screen._scrollCol;
_rScrollX = screen._scrollX;
@@ -1245,7 +1246,7 @@ void River::moveCanoe() {
_vm->_room->handleCommand(9);
if (_vm->_room->_function != FN_CLEAR1) {
- _vm->_saveRiver = false;
+ _saveRiver = false;
_vm->_room->buildScreen();
_vm->copyBF2Vid();
}
@@ -1561,6 +1562,8 @@ void River::synchronize(Common::Serializer &s) {
s.syncAsUint16LE(_screenVirtX);
warning("TODO: s.syncAsSint16LE(_topList);");
warning("TODO: s.syncAsSint16LE(_botList);");
+
+ _saveRiver = s.isLoading();
}
}
diff --git a/engines/access/amazon/amazon_logic.h b/engines/access/amazon/amazon_logic.h
index 4d5e274388..46b3c7047c 100644
--- a/engines/access/amazon/amazon_logic.h
+++ b/engines/access/amazon/amazon_logic.h
@@ -151,6 +151,7 @@ private:
RiverStruct *_topList;
RiverStruct *_botList;
int _canoeDir;
+ bool _saveRiver;
// Saved fields
int _canoeLane;