ACCESS: Start implementing mWhileJWalk()

This commit is contained in:
Strangerke 2014-11-04 23:57:51 +01:00 committed by Paul Gilbert
parent fb686191a8
commit 2c700cc6cd
3 changed files with 137 additions and 4 deletions

View file

@ -32,6 +32,27 @@ namespace Amazon {
AmazonScripts::AmazonScripts(AccessEngine *vm) : Scripts(vm) { AmazonScripts::AmazonScripts(AccessEngine *vm) : Scripts(vm) {
_game = (AmazonEngine *)_vm; _game = (AmazonEngine *)_vm;
_xTrack = 0;
_yTrack = 0;
_zTrack = 0;
_xCam = 0;
_yCam = 0;
_zCam = 0;
_pNumObj = 0;
for (int i = 0; i < 32; i++) {
_pImgNum[i] = 0;
_pObject[i] = nullptr;
_pObjX[i] = 0;
_pObjY[i] = 0;
_pObjZ[i] = 0;
}
for (int i = 0; i < 16; i++) {
_pObjXl[i] = 0;
_pObjYl[i] = 0;
}
} }
void AmazonScripts::cLoop() { void AmazonScripts::cLoop() {
@ -247,6 +268,10 @@ void AmazonScripts::doFallCell() {
_game->_plane._planeCount += 6; _game->_plane._planeCount += 6;
} }
void AmazonScripts::PAN() {
warning("TODO: PAN");
}
void AmazonScripts::scrollFly() { void AmazonScripts::scrollFly() {
_vm->copyBF1BF2(); _vm->copyBF1BF2();
_vm->_newRects.clear(); _vm->_newRects.clear();
@ -263,6 +288,14 @@ void AmazonScripts::scrollFall() {
_vm->copyBF2Vid(); _vm->copyBF2Vid();
} }
void AmazonScripts::scrollJWalk() {
_vm->copyBF1BF2();
_vm->_newRects.clear();
_game->plotList();
_vm->copyRects();
_vm->copyBF2Vid();
}
void AmazonScripts::mWhileFly() { void AmazonScripts::mWhileFly() {
_vm->_events->hideCursor(); _vm->_events->hideCursor();
_vm->_screen->clearScreen(); _vm->_screen->clearScreen();
@ -369,6 +402,83 @@ void AmazonScripts::mWhileFall() {
} }
} }
void AmazonScripts::mWhileJWalk() {
const int jungleObj[7][4] = {
{2, 77, 0, 40},
{0, 290, 0, 50},
{1, 210, 0, 70},
{0, 50, 0, 30},
{1, 70, 0, 20},
{0, -280, 0, 60},
{1, -150, 0, 30},
};
_vm->_screen->fadeOut();
_vm->_events->hideCursor();
_vm->_screen->clearScreen();
_vm->_buffer2.clearBuffer();
_vm->_screen->setBufferScan();
_vm->_screen->_scrollX = 0;
_vm->_room->buildScreen();
_vm->copyBF2Vid();
_vm->_screen->fadeIn();
// KEYFLG = 0;
_vm->_player->_xFlag = 1;
_vm->_player->_yFlag = 0;
_vm->_player->_moveTo.x = 160;
_vm->_player->_move = UP;
_game->_plane._xCount = 2;
_xTrack = 10;
_yTrack = _zTrack = 0;
_xCam = 480;
_yCam = 0;
_zCam = 80;
TimerEntry *te = &_vm->_timers[24];
te->_initTm = te->_timer = 1;
te->_flag++;
_pNumObj = 7;
for (int i = 0; i < _pNumObj; i++) {
_pObject[i] = _vm->_objectsTable[24];
_pImgNum[i] = jungleObj[i][0];
_pObjX[i] = jungleObj[i][1];
_pObjY[i] = jungleObj[i][2];
_pObjZ[i] = jungleObj[i][3];
_pObjXl[i] = _pObjYl[i] = 0;
}
while (true) {
_vm->_images.clear();
int _vbCount = 6;
if (_vm->_player->_xFlag == 2) {
_vm->_events->showCursor();
return;
}
_pImgNum[0] = _game->_plane._xCount;
if (_game->_plane._xCount == 2)
++_game->_plane._xCount;
else
--_game->_plane._xCount;
_vm->_player->checkMove();
_vm->_player->checkScroll();
PAN();
scrollJWalk();
g_system->delayMillis(10);
while(_vbCount > 0) {
// To be rewritten when NEWTIMER is done
_vm->_events->checkForNextFrameCounter();
_vbCount--;
}
}
}
void AmazonScripts::mWhile(int param1) { void AmazonScripts::mWhile(int param1) {
switch(param1) { switch(param1) {
case 1: case 1:
@ -381,7 +491,7 @@ void AmazonScripts::mWhile(int param1) {
mWhileFall(); mWhileFall();
break; break;
case 4: case 4:
warning("TODO JWALK"); mWhileJWalk();
break; break;
case 5: case 5:
warning("TODO DOOPEN"); warning("TODO DOOPEN");

View file

@ -35,6 +35,26 @@ class AmazonEngine;
class AmazonScripts: public Scripts { class AmazonScripts: public Scripts {
private: private:
AmazonEngine *_game; AmazonEngine *_game;
int _xTrack;
int _yTrack;
int _zTrack;
int _xCam;
int _yCam;
int _zCam;
int _pNumObj;
int _pImgNum[32];
SpriteResource *_pObject[32];
int _pObjX[32];
int _pObjY[32];
int _pObjZ[32];
int _pObjXl[16];
int _pObjYl[16];
void PAN();
protected: protected:
virtual void executeSpecial(int commandIndex, int param1, int param2); virtual void executeSpecial(int commandIndex, int param1, int param2);
virtual void executeCommand(int commandIndex); virtual void executeCommand(int commandIndex);
@ -43,11 +63,13 @@ protected:
void doFallCell(); void doFallCell();
void scrollFly(); void scrollFly();
void scrollFall(); void scrollFall();
void scrollJWalk();
void cLoop(); void cLoop();
void mWhile1(); void mWhile1();
void mWhile2(); void mWhile2();
void mWhileFly(); void mWhileFly();
void mWhileFall(); void mWhileFall();
void mWhileJWalk();
void mWhile(int param1); void mWhile(int param1);
void guardSee(); void guardSee();
void setGuardFrame(); void setGuardFrame();

View file

@ -49,14 +49,11 @@ private:
int _diagUpWalkMin, _diagUpWalkMax; int _diagUpWalkMin, _diagUpWalkMax;
int _diagDownWalkMin, _diagDownWalkMax; int _diagDownWalkMin, _diagDownWalkMax;
Common::Point _guard; Common::Point _guard;
Direction _move;
int _xFlag, _yFlag;
SpriteResource *_playerSprites1; SpriteResource *_playerSprites1;
byte *_manPal1; byte *_manPal1;
int _scrollEnd; int _scrollEnd;
int _inactiveYOff; int _inactiveYOff;
void checkMove();
void plotCom(int v1); void plotCom(int v1);
void plotCom1(); void plotCom1();
void plotCom2(); void plotCom2();
@ -97,6 +94,8 @@ public:
int _playerYLow; int _playerYLow;
int _playerY; int _playerY;
int _frame; int _frame;
int _xFlag, _yFlag;
Direction _move;
// Additional public globals we've added to new Player class // Additional public globals we've added to new Player class
bool _playerOff; bool _playerOff;
@ -129,6 +128,8 @@ public:
void checkScroll(); void checkScroll();
void checkMove();
/** /**
* Synchronize savegame data * Synchronize savegame data
*/ */