Skip to content

Commit

Permalink
ACCESS: Start the implementation of RIVER (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke authored and dreammaster committed Dec 13, 2014
1 parent 5de214d commit e1e97ec
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 3 deletions.
2 changes: 1 addition & 1 deletion engines/access/amazon/amazon_game.h
Expand Up @@ -59,7 +59,6 @@ class AmazonEngine : public AccessEngine {
int _canoeYPos;
int _hitCount;
int _saveRiver;
int _hitSafe;
int _topList;
int _botList;
int _riverIndex;
Expand Down Expand Up @@ -109,6 +108,7 @@ class AmazonEngine : public AccessEngine {
bool _charSegSwitch;
bool _skipStart;

int _hitSafe;
int _rawInactiveX;
int _rawInactiveY;
int _inactiveYOff;
Expand Down
103 changes: 102 additions & 1 deletion engines/access/amazon/amazon_scripts.cpp
Expand Up @@ -1585,6 +1585,107 @@ void AmazonScripts::plotInactive() {

}

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

bool AmazonScripts::JUMPTEST() {
warning("TODO: JUMPTEST();");
return true;
}

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

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

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

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

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

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

void AmazonScripts::RIVER() {
static const int RIVERDEATH[5] = {22, 23, 24, 25, 26};

initRiver();
while (true) {
_vm->_events->_vbCount = 4;

int bx = _vm->_player->_scrollAmount - _screenVertX;
if (_vm->_screen->_scrollX == 0) {
_vm->_sound->midiRepeat();
if (JUMPTEST()) {
CHICKENOUTFLG = false;
return;
}
} else {
_vm->_screen->_scrollX -= _vm->_player->_scrollAmount;
}

if (CHICKENOUTFLG) {
CHICKENOUTFLG = false;
return;
}

_vm->_images.clear();
_vm->_animation->animate(0);

RIVERSOUND();
pan();
MOVECANOE();

if (_vm->_room->_function == 1) {
CHICKENOUTFLG = false;
return;
}

UPDATEOBSTACLES();
SETPHYSX();
RIVERCOLLIDE();
if (_game->_hitSafe != 0)
_game->_hitSafe -= 2;

if (_game->_hitSafe < 0) {
warning("TODO: cmdDead(RIVERDEATH[0]);");
return;
}

if (_game->_deathFlag) {
_game->_deathCount--;
if (_game->_deathCount == 0) {
warning("TODO: cmdDead(RIVERDEATH[_game->_deathType]);");
return;
}
}

if (_vm->_events->_mousePos.y >= 24 && _vm->_events->_mousePos.y <= 136) {
_vm->_events->hideCursor();
SCROLLRIVER1();
_vm->_events->pollEvents();
} else
SCROLLRIVER1();

while (!_vm->shouldQuit() && _vm->_events->_vbCount > 0) {
_vm->_events->pollEvents();
g_system->delayMillis(10);
}
}
}

void AmazonScripts::executeSpecial(int commandIndex, int param1, int param2) {
switch (commandIndex) {
case 1:
Expand Down Expand Up @@ -1612,7 +1713,7 @@ void AmazonScripts::executeSpecial(int commandIndex, int param1, int param2) {
plotInactive();
break;
case 13:
warning("TODO RIVER");
RIVER();
break;
case 14:
ANT();
Expand Down
12 changes: 11 additions & 1 deletion engines/access/amazon/amazon_scripts.h
Expand Up @@ -42,7 +42,8 @@ class AmazonScripts: public Scripts {
int _yCam;
int _zCam;
int _pNumObj;

int _screenVertX;
bool CHICKENOUTFLG;
int _pImgNum[32];

SpriteResource *_pObject[32];
Expand Down Expand Up @@ -94,6 +95,15 @@ class AmazonScripts: public Scripts {
void ANT();
void doCast(int param1);
void loadBackground(int param1, int param2);
void initRiver();
bool JUMPTEST();
void RIVERSOUND();
void MOVECANOE();
void UPDATEOBSTACLES();
void SETPHYSX();
void RIVERCOLLIDE();
void SCROLLRIVER1();
void RIVER();
void plotInactive();
void setInactive();
void boatWalls(int param1, int param2);
Expand Down

0 comments on commit e1e97ec

Please sign in to comment.