diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/access/amazon/amazon_scripts.cpp | 30 | ||||
-rw-r--r-- | engines/access/amazon/amazon_scripts.h | 2 |
2 files changed, 28 insertions, 4 deletions
diff --git a/engines/access/amazon/amazon_scripts.cpp b/engines/access/amazon/amazon_scripts.cpp index d2370a2fd1..2b489d678e 100644 --- a/engines/access/amazon/amazon_scripts.cpp +++ b/engines/access/amazon/amazon_scripts.cpp @@ -268,8 +268,32 @@ void AmazonScripts::doFallCell() { _game->_plane._planeCount += 6; } -void AmazonScripts::PAN() { - warning("TODO: PAN"); +void AmazonScripts::pan() { + _zCam += _zTrack; + _xCam += _xTrack; + int tx = (_xCam << 8) / _zCam; + _yCam += _yTrack; + int ty = (_yCam << 8) / _zCam; + + if (_vm->_timers[24]._flag != 1) { + ++_vm->_timers[24]._flag; + for (int i = 0; i < _pNumObj; i++) { + _pObjZ[i] = _zTrack; + _pObjXl[i] += tx * _zTrack; + _pObjX[i] += _pObjXl[i]; + _pObjYl[i] += ty * _zTrack; + _pObjY[i] += _pObjYl[i]; + } + } + + for (int i = 0; i < _pNumObj; i++) { + ImageEntry ie; + ie._flags= 8; + ie._position = Common::Point(_pObjX[i], _pObjY[i]); + ie._offsetY = 0xFF; + ie._spritesPtr = _pObject[i]; + ie._frameNumber = _pImgNum[i]; + } } void AmazonScripts::scrollFly() { @@ -467,7 +491,7 @@ void AmazonScripts::mWhileJWalk() { _vm->_player->checkMove(); _vm->_player->checkScroll(); - PAN(); + pan(); scrollJWalk(); g_system->delayMillis(10); diff --git a/engines/access/amazon/amazon_scripts.h b/engines/access/amazon/amazon_scripts.h index 50fab5caaf..1ee8b98e05 100644 --- a/engines/access/amazon/amazon_scripts.h +++ b/engines/access/amazon/amazon_scripts.h @@ -53,7 +53,7 @@ private: int _pObjXl[16]; int _pObjYl[16]; - void PAN(); + void pan(); protected: virtual void executeSpecial(int commandIndex, int param1, int param2); |