aboutsummaryrefslogtreecommitdiff
path: root/engines/startrek/graphics.cpp
diff options
context:
space:
mode:
authorMatthew Stewart2018-07-26 02:25:18 -0400
committerEugene Sandulenko2018-08-09 08:37:30 +0200
commit5660ce81340a013c0c653a55b7430737213783a4 (patch)
treee2a7ee405321733b69e8f5fab000473ac9419cc5 /engines/startrek/graphics.cpp
parent20904176129e7ad6f9435e9563e1fa0bca5cb0f6 (diff)
downloadscummvm-rg350-5660ce81340a013c0c653a55b7430737213783a4.tar.gz
scummvm-rg350-5660ce81340a013c0c653a55b7430737213783a4.tar.bz2
scummvm-rg350-5660ce81340a013c0c653a55b7430737213783a4.zip
STARTREK: Fix .BAN file rendering behind textboxes
Diffstat (limited to 'engines/startrek/graphics.cpp')
-rw-r--r--engines/startrek/graphics.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp
index 43358f8c1c..cce9861934 100644
--- a/engines/startrek/graphics.cpp
+++ b/engines/startrek/graphics.cpp
@@ -304,14 +304,14 @@ void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface) {
// rect is the portion of the sprite to update. It must be entirely contained within the
// sprite's actual, full rectangle.
-void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, const Common::Rect &rect) {
+void Graphics::drawSprite(const Sprite &sprite, ::Graphics::Surface *surface, const Common::Rect &rect, int rectLeft, int rectTop) {
Common::Rect spriteRect = Common::Rect(sprite.drawX, sprite.drawY,
sprite.drawX + sprite.bitmap->width, sprite.drawY + sprite.bitmap->height);
assert(_screenRect.contains(rect));
assert(spriteRect.contains(rect));
- byte *dest = (byte *)surface->getPixels() + rect.top * SCREEN_WIDTH + rect.left;
+ byte *dest = (byte *)surface->getPixels() + (rect.top - rectTop) * SCREEN_WIDTH + (rect.left - rectLeft);
switch (sprite.drawMode) {
case 0: { // Normal sprite
@@ -583,8 +583,9 @@ void Graphics::drawAllSprites(bool updateScreen) {
this->updateScreen();
}
-void Graphics::drawAllSpritesInRect(const Common::Rect &rect) {
- ::Graphics::Surface *surface = _vm->_system->lockScreen();
+void Graphics::drawAllSpritesInRectToSurface(const Common::Rect &rect, ::Graphics::Surface *surface) {
+ surface->copyFrom(*_vm->_system->lockScreen());
+ _vm->_system->unlockScreen();
for (int i = 0; i < _numSprites; i++) {
Sprite *sprite = _sprites[i];
@@ -595,8 +596,6 @@ void Graphics::drawAllSpritesInRect(const Common::Rect &rect) {
if (!intersect.isEmpty())
drawSprite(*sprite, surface, intersect);
}
-
- _vm->_system->unlockScreen();
}
void Graphics::forceDrawAllSprites(bool updateScreen) {