diff options
-rw-r--r-- | engines/access/asurface.cpp | 18 | ||||
-rw-r--r-- | engines/access/asurface.h | 42 | ||||
-rw-r--r-- | engines/access/room.cpp | 2 |
3 files changed, 42 insertions, 20 deletions
diff --git a/engines/access/asurface.cpp b/engines/access/asurface.cpp index a9d97aa48c..3a381a10e5 100644 --- a/engines/access/asurface.cpp +++ b/engines/access/asurface.cpp @@ -168,7 +168,10 @@ void ASurface::plotImage(SpriteResource *sprite, int frameNum, const Common::Poi } void ASurface::plotFrame(SpriteFrame *frame, const Common::Point &pt) { - return; + frame->copyTo(this, pt); +// g_system->copyRectToScreen((byte *)getPixels(), 320, 0, 0, 320, 200); +// g_system->updateScreen(); + /* byte *destP = (byte *)getBasePtr(pt.x, _scrollY + pt.y); @@ -204,4 +207,17 @@ void ASurface::plotFrame(SpriteFrame *frame, const Common::Point &pt) { */ } +void ASurface::copyTo(ASurface *dest, const Common::Point &destPos) { + for (int yp = 0; yp < h; ++yp) { + byte *srcP = (byte *)getBasePtr(0, yp); + byte *destP = (byte *)dest->getBasePtr(destPos.x, destPos.y + yp); + + for (int xp = 0; xp < this->w; ++xp, ++srcP, ++destP) { + if (*srcP != 0) + *destP = *srcP; + } + } +} + + } // End of namespace Access diff --git a/engines/access/asurface.h b/engines/access/asurface.h index d726e6aeae..c4dfc5442d 100644 --- a/engines/access/asurface.h +++ b/engines/access/asurface.h @@ -32,24 +32,8 @@ namespace Access { -class SpriteFrame : public Graphics::Surface { -public: - SpriteFrame(AccessEngine *vm, Common::MemoryReadStream &stream, int frameSize); - ~SpriteFrame(); -}; - -class SpriteResource { -public: - Common::Array<SpriteFrame *> _frames; -public: - SpriteResource(AccessEngine *vm, const byte *data, uint32 size, - DisposeAfterUse::Flag disposeMemory = DisposeAfterUse::NO); - ~SpriteResource(); - - int getCount() { return _frames.size(); } - - SpriteFrame *getFrame(int idx) { return _frames[idx]; } -}; +class SpriteResource; +class SpriteFrame; class ASurface : public Graphics::Surface { public: @@ -71,8 +55,30 @@ public: bool clip(Common::Rect &r); void plotImage(SpriteResource *sprite, int frameNum, const Common::Point &pt); + + void copyTo(ASurface *dest, const Common::Point &destPos); }; +class SpriteFrame : public ASurface { +public: + SpriteFrame(AccessEngine *vm, Common::MemoryReadStream &stream, int frameSize); + ~SpriteFrame(); +}; + +class SpriteResource { +public: + Common::Array<SpriteFrame *> _frames; +public: + SpriteResource(AccessEngine *vm, const byte *data, uint32 size, + DisposeAfterUse::Flag disposeMemory = DisposeAfterUse::NO); + ~SpriteResource(); + + int getCount() { return _frames.size(); } + + SpriteFrame *getFrame(int idx) { return _frames[idx]; } +}; + + } // End of namespace Access #endif /* ACCESS_ASURFACE_H */ diff --git a/engines/access/room.cpp b/engines/access/room.cpp index 6f449268c6..371b714467 100644 --- a/engines/access/room.cpp +++ b/engines/access/room.cpp @@ -296,7 +296,7 @@ void Room::buildScreen() { int cnt = _vWindowWidth + 1; int offset = 0; - for (int idx = 0; idx < cnt, offset += TILE_WIDTH; ++idx) { + for (int idx = 0; idx < cnt; offset += TILE_WIDTH, ++idx) { buildColumn(_vm->_screen->_scrollCol, offset); ++_vm->_screen->_scrollCol; } |