diff options
author | Filippos Karapetis | 2010-10-13 13:07:16 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-10-13 13:07:16 +0000 |
commit | 681ec592927b8d9a81eed7b1038743bf8e378de2 (patch) | |
tree | e78b164f2539b46927207757fae6148f776a25bd /engines/sword25/fmv/movieplayer_script.cpp | |
parent | 30ed39e381648154ab18bd5d80f196a77a50eb7c (diff) | |
download | scummvm-rg350-681ec592927b8d9a81eed7b1038743bf8e378de2.tar.gz scummvm-rg350-681ec592927b8d9a81eed7b1038743bf8e378de2.tar.bz2 scummvm-rg350-681ec592927b8d9a81eed7b1038743bf8e378de2.zip |
SWORD25: Added a ENABLE_THEORA define inside fmv/theora_decoder.h
This define can be used to disable building of the Theora decoder, and thus makes
libtheora optional (therefore resolving an item in the Sword25 TODO). Disabling the
Theora decoder will effectively disable the game's videos
Note that running the game with the Theora decoder disabled is still untested
svn-id: r53416
Diffstat (limited to 'engines/sword25/fmv/movieplayer_script.cpp')
-rw-r--r-- | engines/sword25/fmv/movieplayer_script.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/engines/sword25/fmv/movieplayer_script.cpp b/engines/sword25/fmv/movieplayer_script.cpp index 13bb149672..7825911525 100644 --- a/engines/sword25/fmv/movieplayer_script.cpp +++ b/engines/sword25/fmv/movieplayer_script.cpp @@ -42,91 +42,127 @@ namespace Sword25 { int loadMovie(lua_State *L) { +#ifdef ENABLE_THEORA 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 ENABLE_THEORA 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 ENABLE_THEORA 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 ENABLE_THEORA 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 ENABLE_THEORA MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); FMVPtr->update(); +#endif return 0; } int isMovieLoaded(lua_State *L) { +#ifdef ENABLE_THEORA 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 ENABLE_THEORA 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 ENABLE_THEORA 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 ENABLE_THEORA 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 ENABLE_THEORA MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushnumber(L, FMVPtr->getTime()); +#else + lua_pushnumber(L, 0); +#endif return 1; } @@ -147,6 +183,7 @@ const luaL_reg LIBRARY_FUNCTIONS[] = { { 0, 0 } }; +#ifdef ENABLE_THEORA bool MoviePlayer::registerScriptBindings() { Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); @@ -159,5 +196,6 @@ bool MoviePlayer::registerScriptBindings() { return true; } +#endif } // End of namespace Sword25 |