diff options
Diffstat (limited to 'engines/gob/draw_v1.cpp')
-rw-r--r-- | engines/gob/draw_v1.cpp | 87 |
1 files changed, 25 insertions, 62 deletions
diff --git a/engines/gob/draw_v1.cpp b/engines/gob/draw_v1.cpp index b5bc56b6f5..8a5ac021eb 100644 --- a/engines/gob/draw_v1.cpp +++ b/engines/gob/draw_v1.cpp @@ -362,20 +362,15 @@ void Draw_v1::spriteOperation(int16 operation) { _spriteTop + _spriteBottom - 1, _destSpriteX, _destSpriteY, _transparency); - if (_destSurface == 21) { - invalidateRect(_destSpriteX, _destSpriteY, - _destSpriteX + _spriteRight - 1, - _destSpriteY + _spriteBottom - 1); - } + dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, + _destSpriteX + _spriteRight - 1, _destSpriteY + _spriteBottom - 1); break; case DRAW_PUTPIXEL: _vm->_video->putPixel(_destSpriteX, _destSpriteY, _frontColor, _spritesArray[_destSurface]); - if (_destSurface == 21) { - invalidateRect(_destSpriteX, _destSpriteY, - _destSpriteX, _destSpriteY); - } + + dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, _destSpriteX, _destSpriteY); break; case DRAW_FILLRECT: @@ -384,11 +379,8 @@ void Draw_v1::spriteOperation(int16 operation) { _destSpriteX + _spriteRight - 1, _destSpriteY + _spriteBottom - 1, _backColor); - if (_destSurface == 21) { - invalidateRect(_destSpriteX, _destSpriteY, - _destSpriteX + _spriteRight - 1, - _destSpriteY + _spriteBottom - 1); - } + dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, + _destSpriteX + _spriteRight - 1, _destSpriteY + _spriteBottom - 1); break; case DRAW_DRAWLINE: @@ -396,19 +388,12 @@ void Draw_v1::spriteOperation(int16 operation) { _destSpriteX, _destSpriteY, _spriteRight, _spriteBottom, _frontColor); - if (_destSurface == 21) { - invalidateRect(_destSpriteX, _destSpriteY, - _spriteRight, _spriteBottom); - } + dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, _spriteRight, _spriteBottom); break; case DRAW_INVALIDATE: - if (_destSurface == 21) { - invalidateRect(_destSpriteX - _spriteRight, - _destSpriteY - _spriteBottom, - _destSpriteX + _spriteRight, - _destSpriteY + _spriteBottom); - } + dirtiedRect(_destSurface, _destSpriteX - _spriteRight, _destSpriteY - _spriteBottom, + _destSpriteX + _spriteRight, _destSpriteY + _spriteBottom); break; case DRAW_LOADSPRITE: @@ -420,11 +405,8 @@ void Draw_v1::spriteOperation(int16 operation) { _spriteRight, _spriteBottom, _destSpriteX, _destSpriteY, _transparency, _spritesArray[_destSurface]); - if (_destSurface == 21) { - invalidateRect(_destSpriteX, _destSpriteY, - _destSpriteX + _spriteRight - 1, - _destSpriteY + _spriteBottom - 1); - } + dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, + _destSpriteX + _spriteRight - 1, _destSpriteY + _spriteBottom - 1); delete[] dataBuf; break; } else if (id >= _vm->_game->_totResourceTable->itemsCount) { @@ -451,20 +433,15 @@ void Draw_v1::spriteOperation(int16 operation) { _destSpriteX, _destSpriteY, _transparency, _spritesArray[_destSurface]); - if (_destSurface == 21) { - invalidateRect(_destSpriteX, _destSpriteY, - _destSpriteX + _spriteRight - 1, - _destSpriteY + _spriteBottom - 1); - } + dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, + _destSpriteX + _spriteRight - 1, _destSpriteY + _spriteBottom - 1); break; case DRAW_PRINTTEXT: len = strlen(_textToPrint); - if (_destSurface == 21) { - invalidateRect(_destSpriteX, _destSpriteY, - _destSpriteX + len * _fonts[_fontIndex]->itemWidth - 1, - _destSpriteY + _fonts[_fontIndex]->itemHeight - 1); - } + dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, + _destSpriteX + len * _fonts[_fontIndex]->itemWidth - 1, + _destSpriteY + _fonts[_fontIndex]->itemHeight - 1); for (int i = 0; i < len; i++) { _vm->_video->drawLetter(_textToPrint[i], @@ -495,10 +472,7 @@ void Draw_v1::spriteOperation(int16 operation) { _destSpriteX, _destSpriteY, _spriteRight, _destSpriteY, _frontColor); - if (_destSurface == 21) { - invalidateRect(_destSpriteX, _destSpriteY, - _spriteRight, _spriteBottom); - } + dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, _spriteRight, _spriteBottom); break; case DRAW_CLEARRECT: @@ -508,10 +482,7 @@ void Draw_v1::spriteOperation(int16 operation) { _spriteRight, _spriteBottom, _backColor); } - if (_destSurface == 21) { - invalidateRect(_destSpriteX, _destSpriteY, - _spriteRight, _spriteBottom); - } + dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, _spriteRight, _spriteBottom); break; case DRAW_FILLRECTABS: @@ -519,20 +490,14 @@ void Draw_v1::spriteOperation(int16 operation) { _destSpriteX, _destSpriteY, _spriteRight, _spriteBottom, _backColor); - if (_destSurface == 21) { - invalidateRect(_destSpriteX, _destSpriteY, - _spriteRight, _spriteBottom); - } + dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, _spriteRight, _spriteBottom); break; case DRAW_DRAWLETTER: if (_fontToSprite[_fontIndex].sprite == -1) { - if (_destSurface == 21) { - invalidateRect(_destSpriteX, - _destSpriteY, - _destSpriteX + _fonts[_fontIndex]->itemWidth - 1, - _destSpriteY + _fonts[_fontIndex]->itemHeight - 1); - } + dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, + _destSpriteX + _fonts[_fontIndex]->itemWidth - 1, + _destSpriteY + _fonts[_fontIndex]->itemHeight - 1); _vm->_video->drawLetter(_letterToPrint, _destSpriteX, _destSpriteY, _fonts[_fontIndex], @@ -552,11 +517,9 @@ void Draw_v1::spriteOperation(int16 operation) { x = (_letterToPrint - _fontToSprite[_fontIndex].base) % perLine * _fontToSprite[_fontIndex].width; - if (_destSurface == 21) { - invalidateRect(_destSpriteX, _destSpriteY, - _destSpriteX + _fontToSprite[_fontIndex].width, - _destSpriteY + _fontToSprite[_fontIndex].height); - } + dirtiedRect(_destSurface, _destSpriteX, _destSpriteY, + _destSpriteX + _fontToSprite[_fontIndex].width, + _destSpriteY + _fontToSprite[_fontIndex].height); _vm->_video->drawSprite(_spritesArray[(int16)_fontToSprite[_fontIndex].sprite], _spritesArray[_destSurface], x, y, |