aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-01-09 21:20:39 +0000
committerMartin Kiewitz2010-01-09 21:20:39 +0000
commit8fdf6a8095286751c8e267b747c2168aa4213b6d (patch)
treeed4cbf20d74f045475111a576bb7f92928c5e307
parent6619d95f48e2b3f5a67c58c4e951d2f371f21a62 (diff)
downloadscummvm-rg350-8fdf6a8095286751c8e267b747c2168aa4213b6d.tar.gz
scummvm-rg350-8fdf6a8095286751c8e267b747c2168aa4213b6d.tar.bz2
scummvm-rg350-8fdf6a8095286751c8e267b747c2168aa4213b6d.zip
SCI: kPortrait - drawing base bitmap before drawing animation bitmap
svn-id: r47211
-rw-r--r--engines/sci/graphics/portrait.cpp12
-rw-r--r--engines/sci/graphics/portrait.h1
2 files changed, 9 insertions, 4 deletions
diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp
index d2fbe60b1d..d80256c3c2 100644
--- a/engines/sci/graphics/portrait.cpp
+++ b/engines/sci/graphics/portrait.cpp
@@ -140,6 +140,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
// Draw base bitmap
_palette->set(&_portraitPalette, 1);
drawBitmap(0);
+ bitsShow();
// Start playing audio...
_audio->stopAudio();
@@ -161,9 +162,11 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
if (syncCue != 0xFFFF) {
// Display animation bitmap
- syncCue++; // TODO: Not sure if 0 means main bitmap or animation-frame 0
if (syncCue < _bitmapCount) {
+ if (syncCue)
+ drawBitmap(0); // Draw base bitmap first to get valid animation frame
drawBitmap(syncCue);
+ bitsShow();
} else {
warning("kPortrait: sync information tried to draw non-existant %d", syncCue);
}
@@ -179,7 +182,6 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
_resMan->unlockResource(syncResource);
}
-// TODO: coordinate offset is missing...can't find it in the bitmap header nor in the main header
void Portrait::drawBitmap(uint16 bitmapNr) {
byte *data = _bitmaps[bitmapNr].rawBitmap;
uint16 bitmapHeight = _bitmaps[bitmapNr].height;
@@ -195,9 +197,11 @@ void Portrait::drawBitmap(uint16 bitmapNr) {
}
data += _bitmaps[bitmapNr].extraBytesPerLine;
}
+}
- Common::Rect bitmapRect = Common::Rect(bitmapWidth, bitmapHeight);
- bitmapRect.moveTo(bitmapPosition.x, bitmapPosition.y);
+void Portrait::bitsShow() {
+ Common::Rect bitmapRect = Common::Rect(_width, _height);
+ bitmapRect.moveTo(_position.x, _position.y);
_screen->copyDisplayRectToScreen(bitmapRect);
g_system->updateScreen();
}
diff --git a/engines/sci/graphics/portrait.h b/engines/sci/graphics/portrait.h
index 15540627e9..0db90421d7 100644
--- a/engines/sci/graphics/portrait.h
+++ b/engines/sci/graphics/portrait.h
@@ -46,6 +46,7 @@ public:
private:
void init();
void drawBitmap(uint16 bitmapNr);
+ void bitsShow();
ResourceManager *_resMan;
Screen *_screen;