[Scummvm-cvs-logs] SF.net SVN: scummvm:[55663] scummvm/trunk/engines/sword25
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sun Jan 30 21:34:47 CET 2011
Revision: 55663
http://scummvm.svn.sourceforge.net/scummvm/?rev=55663&view=rev
Author: thebluegr
Date: 2011-01-30 20:34:47 +0000 (Sun, 30 Jan 2011)
Log Message:
-----------
SWORD25: Some translations, and a bugfix. Disabled a hack.
Translated some comments, and pushed the indirect rendering define to the header
file, so that the engine won't try and update the screen with direct movie rendering.
Also, the thumbnail hack has been disabled, as it doesn't really work (at least not for
me: all the thumbnails are gray)
Modified Paths:
--------------
scummvm/trunk/engines/sword25/fmv/movieplayer.cpp
scummvm/trunk/engines/sword25/fmv/movieplayer.h
scummvm/trunk/engines/sword25/gfx/graphicengine.cpp
Modified: scummvm/trunk/engines/sword25/fmv/movieplayer.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/movieplayer.cpp 2011-01-30 20:21:45 UTC (rev 55662)
+++ scummvm/trunk/engines/sword25/fmv/movieplayer.cpp 2011-01-30 20:34:47 UTC (rev 55663)
@@ -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 @@
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\xF6glichst viel Bildschirmfl\xE4che 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 @@
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 @@
// 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 @@
}
bool MoviePlayer::isMovieLoaded() {
- return true;
+ return false;
}
bool MoviePlayer::isPaused() {
Modified: scummvm/trunk/engines/sword25/fmv/movieplayer.h
===================================================================
--- scummvm/trunk/engines/sword25/fmv/movieplayer.h 2011-01-30 20:21:45 UTC (rev 55662)
+++ scummvm/trunk/engines/sword25/fmv/movieplayer.h 2011-01-30 20:34:47 UTC (rev 55663)
@@ -45,6 +45,8 @@
#include "sword25/fmv/theora_decoder.h"
#endif
+#define THEORA_INDIRECT_RENDERING
+
namespace Sword25 {
class MoviePlayer : public Service {
Modified: scummvm/trunk/engines/sword25/gfx/graphicengine.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/graphicengine.cpp 2011-01-30 20:21:45 UTC (rev 55662)
+++ scummvm/trunk/engines/sword25/gfx/graphicengine.cpp 2011-01-30 20:34:47 UTC (rev 55663)
@@ -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::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 @@
Common::copy((byte *)_backSurface.pixels, (byte *)_backSurface.pixels +
(_backSurface.pitch * _backSurface.h), (byte *)_frameBuffer.pixels);
}
+#endif
g_system->updateScreen();
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