Screen mask is now only used for V2 games

svn-id: r32147
This commit is contained in:
Filippos Karapetis 2008-05-17 09:06:54 +00:00
parent 5127f1a8f1
commit 66ecacc7c3

View File

@ -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;
}
}