diff options
author | Strangerke | 2014-11-05 08:34:59 +0100 |
---|---|---|
committer | Paul Gilbert | 2014-12-12 22:22:54 -0500 |
commit | b8c95e653dab6a82926effe772b03eb6770e6083 (patch) | |
tree | ad6901e79f28936b7dbb97e5fb15255322a4cf74 | |
parent | 2c700cc6cd633b2a07ae5b10c803fb7b7321413c (diff) | |
download | scummvm-rg350-b8c95e653dab6a82926effe772b03eb6770e6083.tar.gz scummvm-rg350-b8c95e653dab6a82926effe772b03eb6770e6083.tar.bz2 scummvm-rg350-b8c95e653dab6a82926effe772b03eb6770e6083.zip |
ACCESS: Implement pan()
-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); |