From 66ecacc7c388d268d2ecf04c3b6cbf4face5a164 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 17 May 2008 09:06:54 +0000 Subject: Screen mask is now only used for V2 games svn-id: r32147 --- engines/made/screen.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'engines/made/screen.cpp') diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp index 563e059309..20327c3acf 100644 --- a/engines/made/screen.cpp +++ b/engines/made/screen.cpp @@ -45,11 +45,13 @@ Screen::Screen(MadeEngine *vm) : _vm(vm) { _workScreenDrawCtx.destSurface = _workScreen; _clipArea.destSurface = _workScreen; - // FIXME: Screen mask is only needed in v2 games - _screenMask = new Graphics::Surface(); - _screenMask->create(320, 200, 1); - _maskDrawCtx.clipRect = Common::Rect(320, 200); - _maskDrawCtx.destSurface = _screenMask; + // Screen mask is only needed in v2 games + if (_vm->getGameID() != GID_RTZ) { + _screenMask = new Graphics::Surface(); + _screenMask->create(320, 200, 1); + _maskDrawCtx.clipRect = Common::Rect(320, 200); + _maskDrawCtx.destSurface = _screenMask; + } for (int i = 0; i <= 3; i++) _excludeClipAreaEnabled[i] = false; @@ -90,14 +92,16 @@ Screen::Screen(MadeEngine *vm) : _vm(vm) { Screen::~Screen() { delete _backgroundScreen; delete _workScreen; - delete _screenMask; + if (_vm->getGameID() != GID_RTZ) + delete _screenMask; delete _fx; } void Screen::clearScreen() { _backgroundScreen->fillRect(Common::Rect(0, 0, 320, 200), 0); _workScreen->fillRect(Common::Rect(0, 0, 320, 200), 0); - _screenMask->fillRect(Common::Rect(0, 0, 320, 200), 0); + if (_vm->getGameID() != GID_RTZ) + _screenMask->fillRect(Common::Rect(0, 0, 320, 200), 0); _mask = 0; _needPalette = true; } @@ -167,7 +171,8 @@ void Screen::drawSurface(Graphics::Surface *sourceSurface, int x, int y, int16 f source = (byte*)sourceSurface->getBasePtr(startX, startY); dest = (byte*)clipInfo.destSurface->getBasePtr(x, y); - maskp = (byte*)_maskDrawCtx.destSurface->getBasePtr(x, y); + if (_vm->getGameID() != GID_RTZ) + maskp = (byte*)_maskDrawCtx.destSurface->getBasePtr(x, y); int32 sourcePitch, linePtrAdd; byte *linePtr; @@ -192,7 +197,7 @@ void Screen::drawSurface(Graphics::Surface *sourceSurface, int x, int y, int16 f linePtr = source; } for (int16 xc = 0; xc < clipWidth; xc++) { - if (*linePtr && (mask == 0 || maskp[xc] == 0)) { + if (*linePtr && (_vm->getGameID() == GID_RTZ || (mask == 0 || maskp[xc] == 0))) { if (*linePtr) dest[xc] = *linePtr; } @@ -200,7 +205,8 @@ void Screen::drawSurface(Graphics::Surface *sourceSurface, int x, int y, int16 f } source += sourcePitch; dest += clipInfo.destSurface->pitch; - maskp += _maskDrawCtx.destSurface->pitch; + if (_vm->getGameID() != GID_RTZ) + maskp += _maskDrawCtx.destSurface->pitch; } } -- cgit v1.2.3