diff options
author | Eugene Sandulenko | 2010-08-31 21:07:36 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-12 23:22:46 +0000 |
commit | 579d872e96862882d4cf92e82a0e8deb82496020 (patch) | |
tree | 790b3fd7ebbff4e757790a899636f6f47ecc8ce0 /engines/sword25/fmv/movieplayer.cpp | |
parent | f06db87a0ee0323ceb5a1e946fa9ed1f8576abca (diff) | |
download | scummvm-rg350-579d872e96862882d4cf92e82a0e8deb82496020.tar.gz scummvm-rg350-579d872e96862882d4cf92e82a0e8deb82496020.tar.bz2 scummvm-rg350-579d872e96862882d4cf92e82a0e8deb82496020.zip |
SWORD25: Bugfixes for video playback.
svn-id: r53299
Diffstat (limited to 'engines/sword25/fmv/movieplayer.cpp')
-rw-r--r-- | engines/sword25/fmv/movieplayer.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/sword25/fmv/movieplayer.cpp b/engines/sword25/fmv/movieplayer.cpp index e4b417adc5..f3504fcb8f 100644 --- a/engines/sword25/fmv/movieplayer.cpp +++ b/engines/sword25/fmv/movieplayer.cpp @@ -32,9 +32,12 @@ * */ +#include "graphics/surface.h" + #include "sword25/fmv/movieplayer.h" #include "sword25/fmv/theora_decoder.h" #include "sword25/kernel/kernel.h" +#include "sword25/gfx/graphicengine.h" #include "sword25/package/packagemanager.h" namespace Sword25 { @@ -52,6 +55,7 @@ MoviePlayer::MoviePlayer(Kernel *pKernel) : Service(pKernel) { BS_LOGLN("Script bindings registered."); _decoder = new TheoraDecoder(); + _backSurface = (static_cast<GraphicEngine *>(Kernel::GetInstance()->GetService("gfx")))->getSurface(); } bool MoviePlayer::LoadMovie(const Common::String &filename, unsigned int z) { @@ -97,6 +101,11 @@ void MoviePlayer::Update() { return; Graphics::Surface *surface = _decoder->decodeNextFrame(); + + // Probably it's better to copy to _backSurface + if (surface->w > 0 && surface->h > 0) + g_system->copyRectToScreen((byte *)surface->getBasePtr(0, 0), surface->pitch, 0, 0, + MIN(surface->w, _backSurface->w), MIN(surface->h, _backSurface->h)); } bool MoviePlayer::IsMovieLoaded() { |