diff options
author | Nicola Mettifogo | 2007-08-04 18:58:50 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-08-04 18:58:50 +0000 |
commit | 663e78b911a7447c25d24e5b7de820a1c790a759 (patch) | |
tree | b4b1ca91417bd3390f80216d6b9d3e9065404fb2 | |
parent | 44279df48e3951fe58b325c36fae276eddcb1f94 (diff) | |
download | scummvm-rg350-663e78b911a7447c25d24e5b7de820a1c790a759.tar.gz scummvm-rg350-663e78b911a7447c25d24e5b7de820a1c790a759.tar.bz2 scummvm-rg350-663e78b911a7447c25d24e5b7de820a1c790a759.zip |
Added routine to restore door backgrounds: this means that backgrounds for door and get zones are now handled by two different sets of routines. This fixes bugs #1765191 and #1762643 (it was actually the same bug).
svn-id: r28449
-rw-r--r-- | engines/parallaction/graphics.cpp | 34 | ||||
-rw-r--r-- | engines/parallaction/graphics.h | 3 | ||||
-rw-r--r-- | engines/parallaction/zone.cpp | 13 |
3 files changed, 43 insertions, 7 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 16b1059c28..8d45c4aaa9 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -548,9 +548,41 @@ void Gfx::backupGetBackground(GetData *data, int16 x, int16 y) { } // +// restores background according to specified frame +// +void Gfx::restoreDoorBackground(StaticCnv *cnv, const Common::Rect& r, byte* background) { + + byte *t = cnv->_data0; + byte *s = background; + byte *d0 = _buffers[kBitBack] + r.left + r.top * _vm->_screenWidth; + byte *d1 = _buffers[kBit2] + r.left + r.top * _vm->_screenWidth; + + for (uint16 i = 0; i < r.height() ; i++) { + for (uint16 j = 0; j < r.width() ; j++) { + if (*t) { + *d0 = *s; + *d1 = *s; + } + + d0++; + d1++; + t++; + s++; + } + + d0 += (_vm->_screenWidth - r.width()); + d1 += (_vm->_screenWidth - r.width()); + } + + + return; +} + + +// // copies a rectangular bitmap on the background // -void Gfx::restoreZoneBackground(const Common::Rect& r, byte *data) { +void Gfx::restoreGetBackground(const Common::Rect& r, byte *data) { StaticCnv cnv; diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index cb92c90547..f518bd6625 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -175,7 +175,8 @@ public: void freeStaticCnv(StaticCnv *cnv); void backupDoorBackground(DoorData *data, int16 x, int16 y); void backupGetBackground(GetData *data, int16 x, int16 y); - void restoreZoneBackground(const Common::Rect& r, byte *data); + void restoreGetBackground(const Common::Rect& r, byte *data); + void restoreDoorBackground(StaticCnv *cnv, const Common::Rect& r, byte* background); // location void setBackground(byte *background); diff --git a/engines/parallaction/zone.cpp b/engines/parallaction/zone.cpp index 73095e6f65..50f63b3b75 100644 --- a/engines/parallaction/zone.cpp +++ b/engines/parallaction/zone.cpp @@ -424,14 +424,17 @@ void jobToggleDoor(void *parm, Job *j) { StaticCnv v14; if (z->u.door->_cnv) { + Common::Rect r(z->_left, z->_top, z->_left+z->u.door->_cnv->_width, z->_top+z->u.door->_cnv->_height); + + uint16 _ax = (z->_flags & kFlagsClosed ? 1 : 0); + v14._width = z->u.door->_cnv->_width; v14._height = z->u.door->_cnv->_height; + v14._data0 = z->u.door->_cnv->getFramePtr(_ax); - Common::Rect r(z->_left, z->_top, z->_left+z->u.door->_cnv->_width, z->_top+z->u.door->_cnv->_height); - - _vm->_gfx->restoreZoneBackground(r, z->u.door->_background); + _vm->_gfx->restoreDoorBackground(&v14, r, z->u.door->_background); - uint16 _ax = (z->_flags & kFlagsClosed ? 0 : 1); + _ax = (z->_flags & kFlagsClosed ? 0 : 1); _vm->_gfx->flatBlitCnv(z->u.door->_cnv, _ax, z->_left, z->_top, Gfx::kBitBack); _vm->_gfx->flatBlitCnv(z->u.door->_cnv, _ax, z->_left, z->_top, Gfx::kBit2); @@ -469,7 +472,7 @@ void jobRemovePickedItem(void *parm, Job *j) { if (z->u.get->_cnv) { Common::Rect r(z->_left, z->_top, z->_left + z->u.get->_cnv->_width, z->_top + z->u.get->_cnv->_height); - _vm->_gfx->restoreZoneBackground(r, z->u.get->_backup); + _vm->_gfx->restoreGetBackground(r, z->u.get->_backup); } count++; |