[Scummvm-cvs-logs] SF.net SVN: scummvm:[53299] scummvm/trunk/engines/sword25/fmv
sev at users.sourceforge.net
sev at users.sourceforge.net
Wed Oct 13 01:22:46 CEST 2010
Revision: 53299
http://scummvm.svn.sourceforge.net/scummvm/?rev=53299&view=rev
Author: sev
Date: 2010-10-12 23:22:46 +0000 (Tue, 12 Oct 2010)
Log Message:
-----------
SWORD25: Bugfixes for video playback.
Modified Paths:
--------------
scummvm/trunk/engines/sword25/fmv/movieplayer.cpp
scummvm/trunk/engines/sword25/fmv/movieplayer.h
scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp
Modified: scummvm/trunk/engines/sword25/fmv/movieplayer.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/movieplayer.cpp 2010-10-12 23:22:24 UTC (rev 53298)
+++ scummvm/trunk/engines/sword25/fmv/movieplayer.cpp 2010-10-12 23:22:46 UTC (rev 53299)
@@ -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 @@
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 @@
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() {
Modified: scummvm/trunk/engines/sword25/fmv/movieplayer.h
===================================================================
--- scummvm/trunk/engines/sword25/fmv/movieplayer.h 2010-10-12 23:22:24 UTC (rev 53298)
+++ scummvm/trunk/engines/sword25/fmv/movieplayer.h 2010-10-12 23:22:46 UTC (rev 53299)
@@ -41,6 +41,7 @@
#include "sword25/kernel/common.h"
#include "sword25/kernel/service.h"
+#include "graphics/surface.h"
namespace Sword25 {
@@ -140,6 +141,7 @@
bool _RegisterScriptBindings();
TheoraDecoder *_decoder;
+ Graphics::Surface *_backSurface;
};
} // End of namespace Sword25
Modified: scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp 2010-10-12 23:22:24 UTC (rev 53298)
+++ scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp 2010-10-12 23:22:46 UTC (rev 53299)
@@ -53,10 +53,6 @@
_fileStream = 0;
_surface = 0;
- _theoraPacket = 0;
- _vorbisPacket = 0;
- _stateFlag = false;
-
_soundType = soundType;
_audStream = 0;
_audHandle = new Audio::SoundHandle();
@@ -299,7 +295,6 @@
if (_mixer)
_mixer->stopHandle(*_audHandle);
_audStream = 0;
- _vorbisPacket = 0;
}
if (_theoraPacket) {
ogg_stream_clear(&_theoraOut);
@@ -307,7 +302,6 @@
th_comment_clear(&_theoraComment);
th_info_clear(&_theoraInfo);
_theoraDecode = 0;
- _theoraPacket = 0;
}
if (!_fileStream)
@@ -463,6 +457,10 @@
_audiobufGranulePos = 0;
_curFrame = 0;
+
+ _theoraPacket = 0;
+ _vorbisPacket = 0;
+ _stateFlag = false;
}
bool TheoraDecoder::endOfVideo() const {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list