aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-01-09 23:01:38 +0000
committerMartin Kiewitz2010-01-09 23:01:38 +0000
commit2c1ef90b8766d1abf2e484de989913e29436234c (patch)
treeb74423fc9b847d8a6caedeca57a6abc401659e7a
parenta44c6e43233ffd4b89fb6a6a96e156cd43412c3d (diff)
downloadscummvm-rg350-2c1ef90b8766d1abf2e484de989913e29436234c.tar.gz
scummvm-rg350-2c1ef90b8766d1abf2e484de989913e29436234c.tar.bz2
scummvm-rg350-2c1ef90b8766d1abf2e484de989913e29436234c.zip
SCI: kPortrait - now drawing after wait, also using gui wait so mouse cursor still works during execution, makes lip sync perfect (thx to the other fix by fingolfin)
svn-id: r47214
-rw-r--r--engines/sci/graphics/gui.cpp2
-rw-r--r--engines/sci/graphics/portrait.cpp17
-rw-r--r--engines/sci/graphics/portrait.h3
3 files changed, 12 insertions, 10 deletions
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp
index 7b11684960..3f62c0f5c7 100644
--- a/engines/sci/graphics/gui.cpp
+++ b/engines/sci/graphics/gui.cpp
@@ -851,7 +851,7 @@ reg_t SciGui::portraitLoad(Common::String resourceName) {
}
void SciGui::portraitShow(Common::String resourceName, Common::Point position, uint16 resourceId, uint16 noun, uint16 verb, uint16 cond, uint16 seq) {
- Portrait *myPortrait = new Portrait(_s->resMan, _screen, _palette, _audio, resourceName);
+ Portrait *myPortrait = new Portrait(_s->resMan, this, _screen, _palette, _audio, resourceName);
// TODO: cache portraits
// adjust given coordinates to curPort (but dont adjust coordinates on upscaledHires_Save_Box and give us hires coordinates
// on kDrawCel, yeah this whole stuff makes sense)
diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp
index d80256c3c2..b755604142 100644
--- a/engines/sci/graphics/portrait.cpp
+++ b/engines/sci/graphics/portrait.cpp
@@ -29,6 +29,7 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
+#include "sci/graphics/gui.h"
#include "sci/graphics/screen.h"
#include "sci/graphics/palette.h"
#include "sci/graphics/portrait.h"
@@ -36,8 +37,8 @@
namespace Sci {
-Portrait::Portrait(ResourceManager *resMan, Screen *screen, SciPalette *palette, AudioPlayer *audio, Common::String resourceName)
- : _resMan(resMan), _screen(screen), _palette(palette), _audio(audio), _resourceName(resourceName) {
+Portrait::Portrait(ResourceManager *resMan, SciGui *gui, Screen *screen, SciPalette *palette, AudioPlayer *audio, Common::String resourceName)
+ : _resMan(resMan), _gui(gui), _screen(screen), _palette(palette), _audio(audio), _resourceName(resourceName) {
init();
}
@@ -160,6 +161,12 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
syncCue = 0xFFFF;
}
+ // Wait till syncTime passed, then show specific animation bitmap
+ do {
+ _gui->wait(1);
+ curPosition = _audio->getAudioPosition();
+ } while ((curPosition != -1) && (curPosition < timerPosition));
+
if (syncCue != 0xFFFF) {
// Display animation bitmap
if (syncCue < _bitmapCount) {
@@ -171,12 +178,6 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
warning("kPortrait: sync information tried to draw non-existant %d", syncCue);
}
}
-
- // Wait till syncTime passed, then show specific animation bitmap
- do {
- g_system->delayMillis(10);
- curPosition = _audio->getAudioPosition();
- } while ((curPosition != -1) && (curPosition < timerPosition));
}
_resMan->unlockResource(syncResource);
diff --git a/engines/sci/graphics/portrait.h b/engines/sci/graphics/portrait.h
index 0db90421d7..347f564f33 100644
--- a/engines/sci/graphics/portrait.h
+++ b/engines/sci/graphics/portrait.h
@@ -37,7 +37,7 @@ struct PortraitBitmap {
class Portrait {
public:
- Portrait(ResourceManager *resMan, Screen *screen, SciPalette *palette, AudioPlayer *audio, Common::String resourceName);
+ Portrait(ResourceManager *resMan, SciGui *gui, Screen *screen, SciPalette *palette, AudioPlayer *audio, Common::String resourceName);
~Portrait();
void setupAudio(uint16 resourceId, uint16 noun, uint16 verb, uint16 cond, uint16 seq);
@@ -49,6 +49,7 @@ private:
void bitsShow();
ResourceManager *_resMan;
+ SciGui *_gui;
Screen *_screen;
SciPalette *_palette;
AudioPlayer *_audio;