aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sword25/fmv/movieplayer.cpp15
-rw-r--r--engines/sword25/fmv/movieplayer.h2
-rw-r--r--engines/sword25/gfx/graphicengine.cpp13
3 files changed, 18 insertions, 12 deletions
diff --git a/engines/sword25/fmv/movieplayer.cpp b/engines/sword25/fmv/movieplayer.cpp
index 06e697b991..3b4d3a74b9 100644
--- a/engines/sword25/fmv/movieplayer.cpp
+++ b/engines/sword25/fmv/movieplayer.cpp
@@ -40,8 +40,6 @@
#include "sword25/package/packagemanager.h"
#include "sword25/sfx/soundengine.h"
-#define INDIRECTRENDERING 1
-
namespace Sword25 {
#define FLT_EPSILON 1.192092896e-07F /* smallest such that 1.0+FLT_EPSILON != 1.0 */
@@ -63,17 +61,16 @@ bool MoviePlayer::loadMovie(const Common::String &filename, uint z) {
Common::SeekableReadStream *in = Kernel::getInstance()->getPackage()->getStream(filename);
_decoder.load(in);
- // Ausgabebitmap erstellen
GraphicEngine *pGfx = Kernel::getInstance()->getGfx();
-#if INDIRECTRENDERING
+#ifdef THEORA_INDIRECT_RENDERING
_outputBitmap = pGfx->getMainPanel()->addDynamicBitmap(_decoder.getWidth(), _decoder.getHeight());
if (!_outputBitmap.isValid()) {
error("Output bitmap for movie playback could not be created.");
return false;
}
- // Skalierung des Ausgabebitmaps berechnen, so dass es möglichst viel Bildschirmfläche einnimmt.
+ // Compute the scaling of the output bitmap, so that it takes up the most space
float screenToVideoWidth = (float)pGfx->getDisplayWidth() / (float)_outputBitmap->getWidth();
float screenToVideoHeight = (float)pGfx->getDisplayHeight() / (float)_outputBitmap->getHeight();
float scaleFactor = MIN(screenToVideoWidth, screenToVideoHeight);
@@ -82,11 +79,9 @@ bool MoviePlayer::loadMovie(const Common::String &filename, uint z) {
scaleFactor = 1.0f;
_outputBitmap->setScaleFactor(scaleFactor);
-
- // Z-Wert setzen
_outputBitmap->setZ(z);
- // Ausgabebitmap auf dem Bildschirm zentrieren
+ // Center bitmap on screen
_outputBitmap->setX((pGfx->getDisplayWidth() - _outputBitmap->getWidth()) / 2);
_outputBitmap->setY((pGfx->getDisplayHeight() - _outputBitmap->getHeight()) / 2);
#else
@@ -128,7 +123,7 @@ void MoviePlayer::update() {
// Transfer the next frame
assert(s->bytesPerPixel == 4);
-#if INDIRECTRENDERING
+#ifdef THEORA_INDIRECT_RENDERING
byte *frameData = (byte *)s->getBasePtr(0, 0);
_outputBitmap->setContent(frameData, s->pitch * s->h, 0, s->pitch);
#else
@@ -204,7 +199,7 @@ void MoviePlayer::update() {
}
bool MoviePlayer::isMovieLoaded() {
- return true;
+ return false;
}
bool MoviePlayer::isPaused() {
diff --git a/engines/sword25/fmv/movieplayer.h b/engines/sword25/fmv/movieplayer.h
index 350407cea5..df0792c8a8 100644
--- a/engines/sword25/fmv/movieplayer.h
+++ b/engines/sword25/fmv/movieplayer.h
@@ -45,6 +45,8 @@
#include "sword25/fmv/theora_decoder.h"
#endif
+#define THEORA_INDIRECT_RENDERING
+
namespace Sword25 {
class MoviePlayer : public Service {
diff --git a/engines/sword25/gfx/graphicengine.cpp b/engines/sword25/gfx/graphicengine.cpp
index cf97534d6c..5fefcec420 100644
--- a/engines/sword25/gfx/graphicengine.cpp
+++ b/engines/sword25/gfx/graphicengine.cpp
@@ -51,6 +51,8 @@
#include "sword25/gfx/graphicengine.h"
+#include "sword25/fmv/movieplayer.h"
+
#include "sword25/util/lua/lua.h"
#include "sword25/util/lua/lauxlib.h"
enum {
@@ -140,10 +142,16 @@ bool GraphicEngine::startFrame(bool updateAll) {
}
bool GraphicEngine::endFrame() {
- // Scene zeichnen
+#ifndef THEORA_INDIRECT_RENDERING
+ if (Kernel::getInstance()->getFMV()->isMovieLoaded())
+ return true;
+#endif
+
_renderObjectManagerPtr->render();
- // FIXME: The frame buffer surface is only used as the base for creating thumbnails when saving the
+ // FIXME: The following hack doesn't really work (all the thumbnails are empty)
+#if 0
+ // HACK: The frame buffer surface is only used as the base for creating thumbnails when saving the
// game, since the _backSurface is blanked. Currently I'm doing a slightly hacky check and only
// copying the back surface if line 50 (the first line after the interface area) is non-blank
if (READ_LE_UINT32((byte *)_backSurface.pixels + (_backSurface.pitch * 50)) & 0xffffff) {
@@ -151,6 +159,7 @@ bool GraphicEngine::endFrame() {
Common::copy((byte *)_backSurface.pixels, (byte *)_backSurface.pixels +
(_backSurface.pitch * _backSurface.h), (byte *)_frameBuffer.pixels);
}
+#endif
g_system->updateScreen();