aboutsummaryrefslogtreecommitdiff
path: root/engines/access/amazon
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-29 21:03:11 -0400
committerPaul Gilbert2014-08-29 21:03:11 -0400
commit8b9faf7de563b5c3a00cc9935eccb5e60b816632 (patch)
tree2a8863b2da17c335e6438766b889f91b52a228e2 /engines/access/amazon
parent0ef365ab025cb77ab40e95e5e9139a5f86168fa6 (diff)
downloadscummvm-rg350-8b9faf7de563b5c3a00cc9935eccb5e60b816632.tar.gz
scummvm-rg350-8b9faf7de563b5c3a00cc9935eccb5e60b816632.tar.bz2
scummvm-rg350-8b9faf7de563b5c3a00cc9935eccb5e60b816632.zip
ACCESS: Add synchronize method for savegames
Diffstat (limited to 'engines/access/amazon')
-rw-r--r--engines/access/amazon/amazon_game.cpp40
-rw-r--r--engines/access/amazon/amazon_game.h48
2 files changed, 82 insertions, 6 deletions
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp
index cf383ce45a..0ccaae85dc 100644
--- a/engines/access/amazon/amazon_game.cpp
+++ b/engines/access/amazon/amazon_game.cpp
@@ -44,7 +44,7 @@ AmazonEngine::AmazonEngine(OSystem *syst, const AccessGameDescription *gameDesc)
_hitCount = 0;
_saveRiver = 0;
_hitSafe = 0;
- _oldTitleChap = _chapter = 0;
+ _oldTitleChapter = _chapter = 0;
_updateChapter = -1;
_topList = 0;
_botList = 0;
@@ -291,10 +291,10 @@ void AmazonEngine::tileScreen() {
if (!_screen->_vesaMode)
return;
- if (!_clearSummaryFlag && (_oldTitleChap == _chapter))
+ if (!_clearSummaryFlag && (_oldTitleChapter == _chapter))
return;
- _oldTitleChap = _chapter;
+ _oldTitleChapter = _chapter;
int idx = _chapter - 1;
if (!_files->existFile(_tileFiles[idx]))
@@ -361,6 +361,40 @@ void AmazonEngine::drawHelp() {
error("TODO: drawHelp");
}
+void AmazonEngine::synchronize(Common::Serializer &s) {
+ AccessEngine::synchronize(s);
+
+ s.syncAsSint16LE(_canoeLane);
+ s.syncAsSint16LE(_canoeYPos);
+ s.syncAsSint16LE(_hitCount);
+ s.syncAsSint16LE(_saveRiver);
+ s.syncAsSint16LE(_hitSafe);
+ s.syncAsSint16LE(_chapter);
+ s.syncAsSint16LE(_topList);
+ s.syncAsSint16LE(_botList);
+ s.syncAsSint16LE(_riverIndex);
+ s.syncAsSint16LE(_rawInactiveX);
+ s.syncAsSint16LE(_rawInactiveY);
+ s.syncAsSint16LE(_inactiveYOff);
+ for (int i = 0; i < 100; ++i)
+ s.syncAsSint16LE(_esTabTable[i]);
+}
+
+/*------------------------------------------------------------------------*/
+
+Guard::Guard() {
+ _guardCel = 0;
+ _gCode1 = _gCode2 = 0;
+ _xMid = _yMid = 0;
+}
+
+Plane::Plane() {
+ _pCount = 0;
+ _planeCount = 0;
+ _propCount = 0;
+ _xCount = 0;
+}
+
} // End of namespace Amazon
} // End of namespace Access
diff --git a/engines/access/amazon/amazon_game.h b/engines/access/amazon/amazon_game.h
index 59511c4546..6511b377ae 100644
--- a/engines/access/amazon/amazon_game.h
+++ b/engines/access/amazon/amazon_game.h
@@ -29,6 +29,29 @@ namespace Access {
namespace Amazon {
+class Plane {
+public:
+ int _pCount;
+ Common::Point _position;
+ int _planeCount;
+ int _propCount;
+ int _xCount;
+public:
+ Plane();
+};
+
+class Guard {
+public:
+ int _guardCel;
+ Common::Point _position;
+ int _gCode1;
+ int _gCode2;
+ Common::Rect _bounds;
+ int _xMid, _yMid;
+public:
+ Guard();
+};
+
class AmazonEngine : public AccessEngine {
private:
bool _skipStart;
@@ -39,7 +62,6 @@ private:
int _hitCount;
int _saveRiver;
int _hitSafe;
- int _oldTitleChap;
int _topList;
int _botList;
int _riverIndex;
@@ -47,6 +69,8 @@ private:
int _rawInactiveY;
int _inactiveYOff;
int _esTabTable[100];
+
+ // Other fields
Common::Point _tilePos;
byte _tileData[1455];
@@ -84,6 +108,11 @@ protected:
* Play the game
*/
virtual void playGame();
+
+ /**
+ * Synchronize savegame data
+ */
+ virtual void synchronize(Common::Serializer &s);
public:
// Fields that are mapped to flags
int &_guardLocation;
@@ -100,11 +129,24 @@ public:
int &_allenFlag;
int &_noSound;
+ // Saved fields
+ int _chapter;
+
// Other game specific fields
+ Guard _guard;
+ Plane _plane;
int _hintLevel;
-
- int _chapter;
int _updateChapter;
+ int _oldTitleChapter;
+ int _maxHits;
+ int _oldScrollCol;
+ bool _deathFlag;
+ int _deathCount;
+ int _deathType;
+ int _mapPtr;
+ int _canoeVXPos;
+ int _canoeMoveCount;
+ int _canoeFrame;
public:
AmazonEngine(OSystem *syst, const AccessGameDescription *gameDesc);