Skip to content

Commit

Permalink
ACCESS: Move river death flags from engine to River class
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Dec 13, 2014
1 parent 93b1516 commit f2cd2ee
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
3 changes: 0 additions & 3 deletions engines/access/amazon/amazon_game.h
Expand Up @@ -108,9 +108,6 @@ class AmazonEngine : public AccessEngine {
int _oldTitleChapter;
int _maxHits;
int _oldScrollCol;
bool _deathFlag;
int _deathCount;
int _deathType;
int _iqValue;
public:
AmazonEngine(OSystem *syst, const AccessGameDescription *gameDesc);
Expand Down
25 changes: 13 additions & 12 deletions engines/access/amazon/amazon_logic.cpp
Expand Up @@ -1360,6 +1360,8 @@ River::River(AmazonEngine *vm): PannedScene(vm) {
_mapOffset = 0;
_screenVertX = 0;
_saveRiver = false;
_deathFlag = false;
_deathCount = 0;
}

void River::setRiverPan() {
Expand Down Expand Up @@ -1460,8 +1462,8 @@ void River::initRiver() {
updateObstacles();
riverSetPhysX();
_canoeDir = 0;
_vm->_deathFlag = 0;
_vm->_deathCount = 0;
_deathFlag = false;
_deathCount = 0;

_vm->_timers[11]._timer = 1200;
_vm->_timers[11]._initTm = 1200;
Expand Down Expand Up @@ -1518,15 +1520,15 @@ bool River::riverJumpTest() {
_mapPtr += 3;
if (_canoeLane < 3) {
if (val1 != 0) {
_vm->_deathFlag = true;
_vm->_deathCount = 300;
_vm->_deathType = val2;
_deathFlag = true;
_deathCount = 300;
_deathType = val2;
}
} else {
if (val1 != 1) {
_vm->_deathFlag = true;
_vm->_deathCount = 300;
_vm->_deathType = val2;
_deathFlag = true;
_deathCount = 300;
_deathType = val2;
}
_vm->_oldScrollCol = _vm->_screen->_scrollCol;
_vm->_screen->_scrollCol = 44;
Expand Down Expand Up @@ -1866,10 +1868,9 @@ void River::river() {
return;
}

if (_vm->_deathFlag) {
_vm->_deathCount--;
if (_vm->_deathCount == 0) {
_vm->dead(RIVERDEATH[_vm->_deathType]);
if (_deathFlag) {
if (--_deathCount == 0) {
_vm->dead(RIVERDEATH[_deathType]);
return;
}
}
Expand Down
3 changes: 3 additions & 0 deletions engines/access/amazon/amazon_logic.h
Expand Up @@ -167,6 +167,9 @@ class River: public PannedScene {
RiverStruct *_botList;
int _canoeDir;
bool _saveRiver;
bool _deathFlag;
int _deathCount;
int _deathType;

// Saved fields
int _canoeLane;
Expand Down

0 comments on commit f2cd2ee

Please sign in to comment.