diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/callables_ns.cpp | 20 | ||||
-rw-r--r-- | engines/parallaction/graphics.cpp | 30 | ||||
-rw-r--r-- | engines/parallaction/graphics.h | 4 |
3 files changed, 16 insertions, 38 deletions
diff --git a/engines/parallaction/callables_ns.cpp b/engines/parallaction/callables_ns.cpp index 89d59b948b..7d4dda1c2e 100644 --- a/engines/parallaction/callables_ns.cpp +++ b/engines/parallaction/callables_ns.cpp @@ -329,7 +329,8 @@ void Parallaction_ns::_c_onMouse(void *parm) { void Parallaction_ns::_c_setMask(void *parm) { - _gfx->intGrottaHackMask(); + memset(_backgroundInfo->mask.data + 3600, 0, 3600); + _gfx->_bgLayers[1] = 500; return; } @@ -583,7 +584,13 @@ void Parallaction_ns::_c_moveSheet(void *parm) { } void zeroMask(int x, int y, int color, void *data) { - _vm->_gfx->zeroMaskValue(x, y, color); + //_vm->_gfx->zeroMaskValue(x, y, color); + + BackgroundInfo* info = (BackgroundInfo*)data; + + uint16 _ax = x + y * info->width; + info->mask.data[_ax >> 2] &= ~(3 << ((_ax & 3) << 1)); + } void Parallaction_ns::_c_sketch(void *parm) { @@ -596,7 +603,7 @@ void Parallaction_ns::_c_sketch(void *parm) { uint16 oldy = _rightHandPositions[2*(index-1)+1]; uint16 oldx = _rightHandPositions[2*(index-1)]; - Graphics::drawLine(oldx, oldy, newx, newy, 0, zeroMask, NULL); + Graphics::drawLine(oldx, oldy, newx, newy, 0, zeroMask, _backgroundInfo); _rightHandAnim->_left = newx; _rightHandAnim->_top = newy - 20; @@ -618,7 +625,12 @@ void Parallaction_ns::_c_shade(void *parm) { _rightHandAnim->_top ); - _gfx->fillMaskRect(r, 0); + uint16 _di = r.left/4 + r.top * _backgroundInfo->mask.internalWidth; + + for (uint16 _si = r.top; _si < r.bottom; _si++) { + memset(_backgroundInfo->mask.data + _di, 0, r.width()/4+1); + _di += _backgroundInfo->mask.internalWidth; + } return; diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index cad25b578d..72cce40b01 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -730,36 +730,6 @@ void Gfx::grabRect(byte *dst, const Common::Rect& r, Gfx::Buffers srcbuffer, uin return; } -/* - the following 3 routines are hacks for Nippon Safes coming from the original code, - so they shouldn't be modified when adding support for other games -*/ - -void Gfx::zeroMaskValue(uint16 x, uint16 y, byte color) { - - uint16 _ax = x + y * _backgroundWidth; - _depthMask->data[_ax >> 2] &= ~(3 << ((_ax & 3) << 1)); - - return; -} -void Gfx::fillMaskRect(const Common::Rect& r, byte color) { - - uint16 _di = r.left/4 + r.top * _depthMask->internalWidth; - - for (uint16 _si = r.top; _si < r.bottom; _si++) { - memset(_depthMask->data + _di, color, r.width()/4+1); - _di += _depthMask->internalWidth; - } - - return; - -} -void Gfx::intGrottaHackMask() { - memset(_depthMask->data + 3600, 0, 3600); - _bgLayers[1] = 500; - return; -} - int16 Gfx::queryMask(int16 v) { diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index e64ea81403..6082f78343 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -202,10 +202,6 @@ public: void backupGetBackground(GetData *data, int16 x, int16 y); void restoreGetBackground(const Common::Rect& r, byte *data); - // hacks for Nippon Safes - void intGrottaHackMask(); - void fillMaskRect(const Common::Rect& r, byte color); - void zeroMaskValue(uint16 x, uint16 y, byte color); // low level surfaces void clearScreen(Gfx::Buffers buffer); |