[Scummvm-cvs-logs] SF.net SVN: scummvm:[53622] scummvm/trunk/engines/sword25

sev at users.sourceforge.net sev at users.sourceforge.net
Tue Oct 19 22:52:07 CEST 2010


Revision: 53622
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53622&view=rev
Author:   sev
Date:     2010-10-19 20:52:06 +0000 (Tue, 19 Oct 2010)

Log Message:
-----------
SWORD25: Fix engine exit when running without theoradec

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/fmv/movieplayer.cpp
    scummvm/trunk/engines/sword25/fmv/movieplayer.h
    scummvm/trunk/engines/sword25/fmv/movieplayer_script.cpp
    scummvm/trunk/engines/sword25/gfx/graphicengine.cpp
    scummvm/trunk/engines/sword25/kernel/kernel.cpp
    scummvm/trunk/engines/sword25/kernel/kernel.h
    scummvm/trunk/engines/sword25/kernel/service_ids.h
    scummvm/trunk/engines/sword25/module.mk

Modified: scummvm/trunk/engines/sword25/fmv/movieplayer.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/movieplayer.cpp	2010-10-19 20:51:21 UTC (rev 53621)
+++ scummvm/trunk/engines/sword25/fmv/movieplayer.cpp	2010-10-19 20:52:06 UTC (rev 53622)
@@ -39,8 +39,6 @@
 #include "sword25/package/packagemanager.h"
 #include "sword25/sfx/soundengine.h"
 
-#ifdef USE_THEORADEC
-
 #define INDIRECTRENDERING 1
 
 namespace Sword25 {
@@ -53,6 +51,7 @@
 	return new MoviePlayer(pKernel);
 }
 
+#ifdef USE_THEORADEC
 MoviePlayer::MoviePlayer(Kernel *pKernel) : Service(pKernel), _decoder(g_system->getMixer()) {
 	if (!registerScriptBindings())
 		BS_LOG_ERRORLN("Script bindings could not be registered.");
@@ -178,7 +177,56 @@
 	return _decoder.getElapsedTime() / 1000.0;
 }
 
-} // End of namespace Sword25
+#else // USE_THEORADEC
 
-#endif
+MoviePlayer::MoviePlayer(Kernel *pKernel) : Service(pKernel) {
+	if (!registerScriptBindings())
+		BS_LOG_ERRORLN("Script bindings could not be registered.");
+	else
+		BS_LOGLN("Script bindings registered.");
+}
 
+MoviePlayer::~MoviePlayer() {
+}
+
+bool MoviePlayer::loadMovie(const Common::String &Filename, unsigned int Z) {
+	return true;
+}
+
+bool MoviePlayer::unloadMovie() {
+	return true;
+}
+
+bool MoviePlayer::play() {
+	return true;
+}
+
+bool MoviePlayer::pause() {
+	return true;
+}
+
+void MoviePlayer::update() {
+}
+
+bool MoviePlayer::isMovieLoaded() {
+	return true;
+}
+
+bool MoviePlayer::isPaused() {
+	return true;
+}
+
+float MoviePlayer::getScaleFactor() {
+	return 1.0f;
+}
+
+void MoviePlayer::setScaleFactor(float ScaleFactor) {
+}
+
+double MoviePlayer::getTime() {
+	return 1.0;
+}
+
+#endif // USE_THEORADEC
+
+} // End of namespace Sword25

Modified: scummvm/trunk/engines/sword25/fmv/movieplayer.h
===================================================================
--- scummvm/trunk/engines/sword25/fmv/movieplayer.h	2010-10-19 20:51:21 UTC (rev 53621)
+++ scummvm/trunk/engines/sword25/fmv/movieplayer.h	2010-10-19 20:52:06 UTC (rev 53622)
@@ -37,12 +37,14 @@
 
 #include "common/scummsys.h"	// for USE_THEORADEC
 
-#ifdef USE_THEORADEC
 #include "sword25/kernel/common.h"
 #include "sword25/kernel/service.h"
-#include "sword25/fmv/theora_decoder.h"
 #include "sword25/gfx/bitmap.h"
 
+#ifdef USE_THEORADEC
+#include "sword25/fmv/theora_decoder.h"
+#endif
+
 namespace Sword25 {
 
 class MoviePlayer : public Service {
@@ -138,16 +140,17 @@
 private:
 	bool registerScriptBindings();
 
+
+#ifdef USE_THEORADEC
 	TheoraDecoder _decoder;
 
 	Graphics::Surface *_backSurface;
 	int _outX, _outY;
 
 	RenderObjectPtr<Bitmap>	_outputBitmap;
+#endif
 };
 
 } // End of namespace Sword25
 
 #endif
-
-#endif

Modified: scummvm/trunk/engines/sword25/fmv/movieplayer_script.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/movieplayer_script.cpp	2010-10-19 20:51:21 UTC (rev 53621)
+++ scummvm/trunk/engines/sword25/fmv/movieplayer_script.cpp	2010-10-19 20:52:06 UTC (rev 53622)
@@ -44,127 +44,91 @@
 namespace Sword25 {
 
 int loadMovie(lua_State *L) {
-#ifdef USE_THEORADEC
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
 	lua_pushbooleancpp(L, FMVPtr->loadMovie(luaL_checkstring(L, 1), lua_gettop(L) == 2 ? static_cast<uint>(luaL_checknumber(L, 2)) : 10));
-#else
-	lua_pushbooleancpp(L, true);
-#endif
 
 	return 1;
 }
 
 int unloadMovie(lua_State *L) {
-#ifdef USE_THEORADEC
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
 	lua_pushbooleancpp(L, FMVPtr->unloadMovie());
-#else
-	lua_pushbooleancpp(L, true);
-#endif
 
 	return 1;
 }
 
 int play(lua_State *L) {
-#ifdef USE_THEORADEC
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
 	lua_pushbooleancpp(L, FMVPtr->play());
-#else
-	lua_pushbooleancpp(L, true);
-#endif
 
 	return 1;
 }
 
 int pause(lua_State *L) {
-#ifdef USE_THEORADEC
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
 	lua_pushbooleancpp(L, FMVPtr->pause());
-#else
-	lua_pushbooleancpp(L, true);
-#endif
 
 	return 1;
 }
 
 int update(lua_State *L) {
-#ifdef USE_THEORADEC
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
 	FMVPtr->update();
-#endif
 
 	return 0;
 }
 
 int isMovieLoaded(lua_State *L) {
-#ifdef USE_THEORADEC
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
 	lua_pushbooleancpp(L, FMVPtr->isMovieLoaded());
-#else
-	lua_pushbooleancpp(L, true);
-#endif
 
 	return 1;
 }
 
 int isPaused(lua_State *L) {
-#ifdef USE_THEORADEC
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
 	lua_pushbooleancpp(L, FMVPtr->isPaused());
-#else
-	lua_pushbooleancpp(L, false);
-#endif
 
 	return 1;
 }
 
 int getScaleFactor(lua_State *L) {
-#ifdef USE_THEORADEC
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
 	lua_pushnumber(L, FMVPtr->getScaleFactor());
-#else
-	lua_pushnumber(L, 1);
-#endif
 
 	return 1;
 }
 
 int setScaleFactor(lua_State *L) {
-#ifdef USE_THEORADEC
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
 	FMVPtr->setScaleFactor(static_cast<float>(luaL_checknumber(L, 1)));
-#endif
 
 	return 0;
 }
 
 int getTime(lua_State *L) {
-#ifdef USE_THEORADEC
 	MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV();
 	BS_ASSERT(FMVPtr);
 
 	lua_pushnumber(L, FMVPtr->getTime());
-#else
-	lua_pushnumber(L, 0);
-#endif
 
 	return 1;
 }
@@ -185,7 +149,6 @@
 	{ 0, 0 }
 };
 
-#ifdef USE_THEORADEC
 bool MoviePlayer::registerScriptBindings() {
 	ScriptEngine *pScript = Kernel::GetInstance()->GetScript();
 	BS_ASSERT(pScript);
@@ -196,6 +159,5 @@
 
 	return true;
 }
-#endif
 
 } // End of namespace Sword25

Modified: scummvm/trunk/engines/sword25/gfx/graphicengine.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/graphicengine.cpp	2010-10-19 20:51:21 UTC (rev 53621)
+++ scummvm/trunk/engines/sword25/gfx/graphicengine.cpp	2010-10-19 20:52:06 UTC (rev 53622)
@@ -223,9 +223,6 @@
 		rect = *fillRectPtr;
 	}
 
-	if (rect.width() == 800 && rect.height() == 600)
-		debug(0, "[%d, %d, %d, %d], 0x%08x", rect.left, rect.top, rect.right, rect.bottom, color);
-
 	if (rect.width() > 0 && rect.height() > 0) {
 		if (ca == 0xff) {
 			_backSurface.fillRect(rect, color);

Modified: scummvm/trunk/engines/sword25/kernel/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sword25/kernel/kernel.cpp	2010-10-19 20:51:21 UTC (rev 53621)
+++ scummvm/trunk/engines/sword25/kernel/kernel.cpp	2010-10-19 20:52:06 UTC (rev 53622)
@@ -34,9 +34,7 @@
 
 #include "common/system.h"
 #include "sword25/gfx/graphicengine.h"
-#ifdef USE_THEORADEC
 #include "sword25/fmv/movieplayer.h"
-#endif
 #include "sword25/input/inputengine.h"
 #include "sword25/kernel/kernel.h"
 #include "sword25/kernel/persistenceservice.h"
@@ -439,14 +437,12 @@
 
 // -----------------------------------------------------------------------------
 
-#ifdef USE_THEORADEC
 /**
  * Returns a pointer to the movie player, or NULL if it is not active.
  */
 MoviePlayer *Kernel::GetFMV() {
 	return static_cast<MoviePlayer *>(GetService("fmv"));
 }
-#endif
 
 // -----------------------------------------------------------------------------
 

Modified: scummvm/trunk/engines/sword25/kernel/kernel.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/kernel.h	2010-10-19 20:51:21 UTC (rev 53621)
+++ scummvm/trunk/engines/sword25/kernel/kernel.h	2010-10-19 20:52:06 UTC (rev 53622)
@@ -201,12 +201,10 @@
 	 */
 	ScriptEngine *GetScript();
 
-#ifdef USE_THEORADEC
 	/**
 	 * Returns a pointer to the movie player, or NULL if it is not active
 	 */
 	MoviePlayer *GetFMV();
-#endif
 
 	/**
 	 * Pauses for the specified amount of time

Modified: scummvm/trunk/engines/sword25/kernel/service_ids.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/service_ids.h	2010-10-19 20:51:21 UTC (rev 53621)
+++ scummvm/trunk/engines/sword25/kernel/service_ids.h	2010-10-19 20:52:06 UTC (rev 53622)
@@ -55,11 +55,7 @@
 Service *SoundEngine_CreateObject(Kernel *pKernel);
 Service *LuaScriptEngine_CreateObject(Kernel *pKernel);
 Service *Geometry_CreateObject(Kernel *pKernel);
-#ifdef USE_THEORADEC
 Service *OggTheora_CreateObject(Kernel *pKernel);
-#else
-Service *OggTheora_CreateObject(Kernel *pKernel) { return NULL; }
-#endif
 
 
 /**

Modified: scummvm/trunk/engines/sword25/module.mk
===================================================================
--- scummvm/trunk/engines/sword25/module.mk	2010-10-19 20:51:21 UTC (rev 53621)
+++ scummvm/trunk/engines/sword25/module.mk	2010-10-19 20:52:06 UTC (rev 53622)
@@ -3,6 +3,8 @@
 MODULE_OBJS := \
 	detection.o \
 	sword25.o \
+	fmv/movieplayer.o \
+	fmv/movieplayer_script.o \
 	gfx/animation.o \
 	gfx/animationdescription.o \
 	gfx/animationresource.o \
@@ -96,8 +98,6 @@
 
 ifdef USE_THEORADEC
 MODULE_OBJS += \
-	fmv/movieplayer.o \
-	fmv/movieplayer_script.o \
 	fmv/theora_decoder.o \
 	fmv/yuvtorgba.o
 endif


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