mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 06:39:17 +00:00
SWORD2: Reduce overhead
This commit is contained in:
parent
1c95d47cfa
commit
aa2a2e046b
@ -182,17 +182,18 @@ void MoviePlayer::closeTextObject(uint32 index, byte *screen, uint16 pitch) {
|
||||
int frameHeight = _decoder->getHeight();
|
||||
int frameX = (_system->getWidth() - frameWidth) / 2;
|
||||
int frameY = (_system->getHeight() - frameHeight) / 2;
|
||||
byte black = findBlackPalIndex();
|
||||
|
||||
byte *dst = screen + _textY * pitch;
|
||||
|
||||
for (int y = 0; y < text->_textSprite.h; y++) {
|
||||
if (_textY + y < frameY || _textY + y >= frameY + frameHeight) {
|
||||
memset(dst + _textX, findBlackPalIndex(), text->_textSprite.w);
|
||||
memset(dst + _textX, black, text->_textSprite.w);
|
||||
} else {
|
||||
if (frameX > _textX)
|
||||
memset(dst + _textX, findBlackPalIndex(), frameX - _textX);
|
||||
memset(dst + _textX, black, frameX - _textX);
|
||||
if (frameX + frameWidth < _textX + text->_textSprite.w)
|
||||
memset(dst + frameX + frameWidth, findBlackPalIndex(), _textX + text->_textSprite.w - (frameX + frameWidth));
|
||||
memset(dst + frameX + frameWidth, black, _textX + text->_textSprite.w - (frameX + frameWidth));
|
||||
}
|
||||
|
||||
dst += pitch;
|
||||
|
Loading…
Reference in New Issue
Block a user