diff options
author | Nicola Mettifogo | 2008-01-12 10:46:51 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2008-01-12 10:46:51 +0000 |
commit | 7d635a4b9c0d7bd250779ae2295ae4758106a7e8 (patch) | |
tree | 9bc2e45361af9347f77c942784fe6369d3f14bc5 | |
parent | 48bd0ca6b6e62105e7536fe00d4c9a87174859e7 (diff) | |
download | scummvm-rg350-7d635a4b9c0d7bd250779ae2295ae4758106a7e8.tar.gz scummvm-rg350-7d635a4b9c0d7bd250779ae2295ae4758106a7e8.tar.bz2 scummvm-rg350-7d635a4b9c0d7bd250779ae2295ae4758106a7e8.zip |
Added function to encapsulate/protect manipulation of background.
svn-id: r30441
-rw-r--r-- | engines/parallaction/exec_ns.cpp | 10 | ||||
-rw-r--r-- | engines/parallaction/graphics.cpp | 13 | ||||
-rw-r--r-- | engines/parallaction/graphics.h | 2 |
3 files changed, 17 insertions, 8 deletions
diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp index f2ee015498..91a8809070 100644 --- a/engines/parallaction/exec_ns.cpp +++ b/engines/parallaction/exec_ns.cpp @@ -133,15 +133,9 @@ DECLARE_INSTRUCTION_OPCODE(put) { int16 x = inst->_opA.getRValue(); int16 y = inst->_opB.getRValue(); + bool mask = (inst->_flags & kInstMaskedPut) == kInstMaskedPut; - if (inst->_flags & kInstMaskedPut) { - uint16 z = _gfx->queryMask(y); - _gfx->blitCnv(&v18, x, y, z, Gfx::kBitBack); - _gfx->blitCnv(&v18, x, y, z, Gfx::kBit2); - } else { - _gfx->flatBlitCnv(&v18, x, y, Gfx::kBitBack); - _gfx->flatBlitCnv(&v18, x, y, Gfx::kBit2); - } + _gfx->patchBackground(v18, x, y, mask); } DECLARE_INSTRUCTION_OPCODE(null) { diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 595c264c59..65938fc176 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -394,6 +394,19 @@ void Gfx::copyScreen(Gfx::Buffers srcbuffer, Gfx::Buffers dstbuffer) { return; } +void Gfx::patchBackground(Graphics::Surface &surf, int16 x, int16 y, bool mask) { + + if (mask) { + uint16 z = queryMask(y); + blitCnv(&surf, x, y, z, kBitBack); + blitCnv(&surf, x, y, z, kBit2); + } else { + flatBlitCnv(&surf, x, y, kBitBack); + flatBlitCnv(&surf, x, y, kBit2); + } + +} + void Gfx::floodFill(Gfx::Buffers buffer, const Common::Rect& r, byte color) { byte *d = (byte*)_buffers[buffer]->getBasePtr(r.left, r.top); diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index a9af5e85ab..7bfaef624d 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -274,6 +274,8 @@ public: void freeLabels(); // cut/paste + void patchBackground(Graphics::Surface &surf, int16 x, int16 y, bool mask = false); + void flatBlitCnv(Graphics::Surface *cnv, int16 x, int16 y, Gfx::Buffers buffer); void flatBlitCnv(Frames *cnv, uint16 frame, int16 x, int16 y, Gfx::Buffers buffer); void blitCnv(Graphics::Surface *cnv, int16 x, int16 y, uint16 z, Gfx::Buffers buffer); |