Skip to content

Commit

Permalink
ACCESS: Implement plotRiver
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke authored and dreammaster committed Dec 13, 2014
1 parent 51ccd0c commit f1b99b0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 9 deletions.
45 changes: 37 additions & 8 deletions engines/access/amazon/amazon_scripts.cpp
Expand Up @@ -1903,26 +1903,55 @@ void AmazonScripts::UPDATEOBSTACLES() {

void AmazonScripts::riverSetPhysX() {
int val = (_vm->_screen->_scrollCol * 16) + _vm->_screen->_scrollX;
RiverStruct *si = _game->_topList;
RiverStruct *di = _game->_botList;
while (si <= di) {
si[0]._field5 = val - (_screenVertX - si[0]._field3);
si = &si[1];
RiverStruct *cur = _game->_topList;
while (cur <= _game->_botList) {
cur[0]._field5 = val - (_screenVertX - cur[0]._field3);
++cur;
}
}

void AmazonScripts::RIVERCOLLIDE() {
warning("TODO: RIVERCOLLIDE()");
}

void AmazonScripts::PLOTRIVER() {
warning("TODO: PLOTRIVER");
void AmazonScripts::plotRiver() {
if (_vm->_timers[3]._flag == 0) {
++_vm->_timers[3]._flag;
if (_game->_canoeFrame == 12)
_game->_canoeFrame = 0;
else
++_game->_canoeFrame;
}

ImageEntry ie;
ie._flags = 8;
ie._spritesPtr = _vm->_objectsTable[45];
ie._frameNumber = _game->_canoeFrame;
ie._position.x = (_vm->_screen->_scrollCol * 16) + _vm->_screen->_scrollX + 160;
ie._position.y = _game->_canoeYPos - 41;
ie._offsetY = 41;
_vm->_images.addToList(ie);

RiverStruct *cur = _game->_topList;
while (cur <= _game->_botList) {
if (cur[0]._id != -1) {
ie._flags = 8;
ie._spritesPtr = _vm->_objectsTable[45];
ie._frameNumber = 0;
ie._position.x = cur[0]._field5;
int val = (cur[0]._lane * 5) + 56;
ie._position.y = val - cur[0]._field8;
ie._offsetY = cur[0]._field8;
_vm->_images.addToList(ie);
}
++cur;
}
}

void AmazonScripts::scrollRiver1() {
_vm->copyBF1BF2();
_vm->_newRects.clear();
PLOTRIVER();
plotRiver();
_vm->plotList();
_vm->copyRects();
_vm->copyBF2Vid();
Expand Down
2 changes: 1 addition & 1 deletion engines/access/amazon/amazon_scripts.h
Expand Up @@ -104,7 +104,7 @@ class AmazonScripts: public Scripts {
void UPDATEOBSTACLES();
void riverSetPhysX();
void RIVERCOLLIDE();
void PLOTRIVER();
void plotRiver();
void scrollRiver1();
void setRiverPan();
void RIVER();
Expand Down

0 comments on commit f1b99b0

Please sign in to comment.