diff options
-rw-r--r-- | engines/access/access.cpp | 51 | ||||
-rw-r--r-- | engines/access/access.h | 6 | ||||
-rw-r--r-- | engines/access/animation.cpp | 2 | ||||
-rw-r--r-- | engines/access/asurface.cpp | 11 | ||||
-rw-r--r-- | engines/access/asurface.h | 8 | ||||
-rw-r--r-- | engines/access/player.cpp | 8 | ||||
-rw-r--r-- | engines/access/player.h | 2 | ||||
-rw-r--r-- | engines/access/room.cpp | 4 | ||||
-rw-r--r-- | engines/access/screen.cpp | 4 | ||||
-rw-r--r-- | engines/access/screen.h | 2 |
10 files changed, 87 insertions, 11 deletions
diff --git a/engines/access/access.cpp b/engines/access/access.cpp index a21a97c0b0..9fb0287883 100644 --- a/engines/access/access.cpp +++ b/engines/access/access.cpp @@ -73,6 +73,7 @@ AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc) _scaleT1 = 0; _scaleMaxY = 0; _scaleI = 0; + _scaleFlag = false; _conversation = 0; _currentMan = 0; @@ -247,4 +248,54 @@ void AccessEngine::doEstablish(int v) { warning("TODO: doEstablish"); } +void AccessEngine::plotList() { + _player->calcPlayer(); + plotList1(); +} + +void AccessEngine::plotList1() { + for (uint idx = 0; idx < _images.size(); ++idx) { + ImageEntry &ie = _images[idx]; + + _scaleFlag = (ie._flags & 8) != 0; + Common::Point pt = ie._position - _screen->_bufferStart; + SpriteResource *sprites = ie._spritesPtr; + SpriteFrame *frame = sprites->getFrame(ie._frameNumber); + + Common::Rect bounds(pt.x, pt.y, pt.x + frame->w, pt.y + frame->h); + if (!_scaleFlag) { + bounds.setWidth(_screen->_scaleTable1[frame->w]); + bounds.setHeight(_screen->_scaleTable1[frame->h]); + } + + if (_buffer2.clip(bounds)) { + ie._flags |= 1; + } else { + ie._flags &= ~1; + if (_buffer2._leftSkip != 0 || _buffer2._rightSkip != 0 + || _buffer2._topSkip != 0 || _buffer2._bottomSkip != 0) + ie._flags |= 1; + + _newRect.push_back(bounds); + + if (!_scaleFlag) { + _buffer2._rightSkip /= _scale; + bounds.setWidth(bounds.width() / _scale); + + if (ie._flags & 2) { + _buffer2.sPlotB(frame, Common::Point(bounds.left, bounds.top)); + } else { + _buffer2.sPlotF(frame, Common::Point(bounds.left, bounds.top)); + } + } else { + if (ie._flags & 2) { + _buffer2.plotB(frame, Common::Point(bounds.left, bounds.top)); + } else { + _buffer2.plotFrame(frame, Common::Point(bounds.left, bounds.top)); + } + } + } + } +} + } // End of namespace Access diff --git a/engines/access/access.h b/engines/access/access.h index f84a7bd1ca..819f7faaa7 100644 --- a/engines/access/access.h +++ b/engines/access/access.h @@ -72,7 +72,7 @@ struct AccessGameDescription; class ImageEntry { public: - int _field0; + int _frameNumber; SpriteResource *_spritesPtr; int _priority; Common::Point _position; @@ -166,6 +166,7 @@ public: int _scaleT1; int _scaleMaxY; int _scaleI; + bool _scaleFlag; int _playFieldHeight; // Fields that are included in savegames @@ -236,6 +237,9 @@ public: void establish(int v); void establishCenter(int v); + + void plotList(); + void plotList1(); }; } // End of namespace Access diff --git a/engines/access/animation.cpp b/engines/access/animation.cpp index a17c30f495..20772af8f0 100644 --- a/engines/access/animation.cpp +++ b/engines/access/animation.cpp @@ -230,7 +230,7 @@ void Animation::setFrame1(AnimationFrame *frame) { // Set the other fields ie._spritesPtr = _vm->_objectsTable[part->_spritesIndex]; - ie._field0 = part->_frameIndex; + ie._frameNumber = part->_frameIndex; ie._position = part->_position + _vm->_animation->_base; ie._priority = part->_priority - ie._position.y; diff --git a/engines/access/asurface.cpp b/engines/access/asurface.cpp index 3a381a10e5..fe11612075 100644 --- a/engines/access/asurface.cpp +++ b/engines/access/asurface.cpp @@ -219,5 +219,16 @@ void ASurface::copyTo(ASurface *dest, const Common::Point &destPos) { } } +void ASurface::sPlotB(SpriteFrame *frame, const Common::Point &pt) { + error("TODO"); +} + +void ASurface::sPlotF(SpriteFrame *frame, const Common::Point &pt) { + error("TODO"); +} + +void ASurface::plotB(SpriteFrame *frame, const Common::Point &pt) { + error("TODO"); +} } // End of namespace Access diff --git a/engines/access/asurface.h b/engines/access/asurface.h index c4dfc5442d..99f99ae696 100644 --- a/engines/access/asurface.h +++ b/engines/access/asurface.h @@ -45,7 +45,7 @@ public: static int _scrollX, _scrollY; static void init(); -protected: +public: virtual void ASurface::plotFrame(SpriteFrame *frame, const Common::Point &pt); public: void clearBuffer(); @@ -56,6 +56,12 @@ public: void plotImage(SpriteResource *sprite, int frameNum, const Common::Point &pt); + void sPlotB(SpriteFrame *frame, const Common::Point &pt); + + void sPlotF(SpriteFrame *frame, const Common::Point &pt); + + void plotB(SpriteFrame *frame, const Common::Point &pt); + void copyTo(ASurface *dest, const Common::Point &destPos); }; diff --git a/engines/access/player.cpp b/engines/access/player.cpp index b28e6c92bc..794fc08fa4 100644 --- a/engines/access/player.cpp +++ b/engines/access/player.cpp @@ -151,4 +151,12 @@ void Player::walk() { warning("TODO: Player::walk"); } +void Player::calcPlayer() { + Screen &scr = *_vm->_screen; + scr._bufferStart.x = (scr._scrollCol << 4) + scr._scrollX; + scr._bufferStart.y = (scr._scrollRow << 4) + scr._scrollY; + _playerX = _rawPlayer.x - scr._bufferStart.x; + _playerY = _rawPlayer.y - scr._bufferStart.y; +} + } // End of namespace Access diff --git a/engines/access/player.h b/engines/access/player.h index 7625fa2cc7..b491ed7e85 100644 --- a/engines/access/player.h +++ b/engines/access/player.h @@ -82,6 +82,8 @@ public: void calcManScale(); void walk(); + + void calcPlayer(); }; } // End of namespace Access diff --git a/engines/access/room.cpp b/engines/access/room.cpp index 98e9d5ed6f..b39e99815b 100644 --- a/engines/access/room.cpp +++ b/engines/access/room.cpp @@ -117,7 +117,7 @@ void Room::doRoom() { clearRoom(); break; } else { - _vm->_screen->plotList(); + _vm->plotList(); _vm->_screen->copyRects(); _vm->_screen->copyBF2Vid(); @@ -132,7 +132,7 @@ void Room::doRoom() { clearRoom(); break; } else { - _vm->_screen->plotList(); + _vm->plotList(); _vm->_screen->copyBlocks(); } } diff --git a/engines/access/screen.cpp b/engines/access/screen.cpp index bc913c5e78..2dc86982b7 100644 --- a/engines/access/screen.cpp +++ b/engines/access/screen.cpp @@ -162,10 +162,6 @@ void Screen::copyBF2Vid() { warning("TODO"); } -void Screen::plotList() { - warning("TODO: plotList"); -} - void Screen::copyBlocks() { warning("TODO: copyBlocks"); } diff --git a/engines/access/screen.h b/engines/access/screen.h index 45db7d0fb1..6c1d96e360 100644 --- a/engines/access/screen.h +++ b/engines/access/screen.h @@ -123,8 +123,6 @@ public: void copyBF2Vid(); - void plotList(); - void copyBlocks(); void copyRects(); |