From a683a420a9e43705c972b5e74d55e319729e1a81 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 29 Jul 2010 19:53:02 +0000 Subject: SWORD25: Importing original sources svn-id: r53171 --- engines/sword25/fmv/movieplayer_script.cpp | 187 +++++++++++++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100755 engines/sword25/fmv/movieplayer_script.cpp (limited to 'engines/sword25/fmv/movieplayer_script.cpp') diff --git a/engines/sword25/fmv/movieplayer_script.cpp b/engines/sword25/fmv/movieplayer_script.cpp new file mode 100755 index 0000000000..c5160122d0 --- /dev/null +++ b/engines/sword25/fmv/movieplayer_script.cpp @@ -0,0 +1,187 @@ +// ----------------------------------------------------------------------------- +// This file is part of Broken Sword 2.5 +// Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdörfer +// +// Broken Sword 2.5 is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// Broken Sword 2.5 is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Broken Sword 2.5; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +// Includes +// ----------------------------------------------------------------------------- + +#include "kernel/common.h" +#include "kernel/kernel.h" +#include "script/script.h" +#include "script/luabindhelper.h" + +#include "movieplayer.h" + +namespace +{ + // ------------------------------------------------------------------------- + + int LoadMovie(lua_State * L) + { + BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); + + lua_pushbooleancpp(L, FMVPtr->LoadMovie(luaL_checkstring(L, 1), lua_gettop(L) == 2 ? static_cast(luaL_checknumber(L, 2)) : 10)); + + return 1; + } + + // ------------------------------------------------------------------------- + + int UnloadMovie(lua_State * L) + { + BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); + + lua_pushbooleancpp(L, FMVPtr->UnloadMovie()); + + return 1; + } + + // ------------------------------------------------------------------------- + + int Play(lua_State * L) + { + BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); + + lua_pushbooleancpp(L, FMVPtr->Play()); + + return 1; + } + + // ------------------------------------------------------------------------- + + int Pause(lua_State * L) + { + BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); + + lua_pushbooleancpp(L, FMVPtr->Pause()); + + return 1; + } + + // ------------------------------------------------------------------------- + + int Update(lua_State * L) + { + BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); + + FMVPtr->Update(); + + return 0; + } + + // ------------------------------------------------------------------------- + + int IsMovieLoaded(lua_State * L) + { + BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); + + lua_pushbooleancpp(L, FMVPtr->IsMovieLoaded()); + + return 1; + } + + // ------------------------------------------------------------------------- + + int IsPaused(lua_State * L) + { + BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); + + lua_pushbooleancpp(L, FMVPtr->IsPaused()); + + return 1; + } + + // ------------------------------------------------------------------------- + + int GetScaleFactor(lua_State * L) + { + BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); + + lua_pushnumber(L, FMVPtr->GetScaleFactor()); + + return 1; + } + + // ------------------------------------------------------------------------- + + int SetScaleFactor(lua_State * L) + { + BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); + + FMVPtr->SetScaleFactor(static_cast(luaL_checknumber(L, 1))); + + return 0; + } + + // ------------------------------------------------------------------------- + + int GetTime(lua_State * L) + { + BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); + + lua_pushnumber(L, FMVPtr->GetTime()); + + return 1; + } + + // ------------------------------------------------------------------------- + + const char * LIBRARY_NAME = "Movieplayer"; + + const luaL_reg LIBRARY_FUNCTIONS[] = + { + "LoadMovie", LoadMovie, + "UnloadMovie", UnloadMovie, + "Play", Play, + "Pause", Pause, + "Update", Update, + "IsMovieLoaded", IsMovieLoaded, + "IsPaused", IsPaused, + "GetScaleFactor", GetScaleFactor, + "SetScaleFactor", SetScaleFactor, + "GetTime", GetTime, + 0, 0, + }; +} + +// ----------------------------------------------------------------------------- + +bool BS_MoviePlayer::_RegisterScriptBindings() +{ + BS_Kernel * pKernel = BS_Kernel::GetInstance(); + BS_ASSERT(pKernel); + BS_ScriptEngine * pScript = static_cast(pKernel->GetService("script")); + BS_ASSERT(pScript); + lua_State * L = static_cast(pScript->GetScriptObject()); + BS_ASSERT(L); + + if (!BS_LuaBindhelper::AddFunctionsToLib(L, LIBRARY_NAME, LIBRARY_FUNCTIONS)) return false; + + return true; +} -- cgit v1.2.3 From 7b964a2823406721ec1200938948c0cfcdb3f1b1 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 29 Jul 2010 19:55:03 +0000 Subject: SWORD25: Make couple file compilable svn-id: r53179 --- engines/sword25/fmv/movieplayer_script.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/sword25/fmv/movieplayer_script.cpp') diff --git a/engines/sword25/fmv/movieplayer_script.cpp b/engines/sword25/fmv/movieplayer_script.cpp index c5160122d0..43ec6506b4 100755 --- a/engines/sword25/fmv/movieplayer_script.cpp +++ b/engines/sword25/fmv/movieplayer_script.cpp @@ -21,12 +21,12 @@ // Includes // ----------------------------------------------------------------------------- -#include "kernel/common.h" -#include "kernel/kernel.h" -#include "script/script.h" -#include "script/luabindhelper.h" +#include "sword25/kernel/common.h" +#include "sword25/kernel/kernel.h" +#include "sword25/script/script.h" +#include "sword25/script/luabindhelper.h" -#include "movieplayer.h" +#include "sword25/fmv/movieplayer.h" namespace { -- cgit v1.2.3 From 293bf95c01f76c8d812a300eb038854f1246ab3d Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 31 Jul 2010 09:53:02 +0000 Subject: SWORD25: Replacing headers with ScummVM ones plus original (C) svn-id: r53188 --- engines/sword25/fmv/movieplayer_script.cpp | 51 +++++++++++++++++++----------- 1 file changed, 33 insertions(+), 18 deletions(-) mode change 100755 => 100644 engines/sword25/fmv/movieplayer_script.cpp (limited to 'engines/sword25/fmv/movieplayer_script.cpp') diff --git a/engines/sword25/fmv/movieplayer_script.cpp b/engines/sword25/fmv/movieplayer_script.cpp old mode 100755 new mode 100644 index 43ec6506b4..b04cff35f7 --- a/engines/sword25/fmv/movieplayer_script.cpp +++ b/engines/sword25/fmv/movieplayer_script.cpp @@ -1,21 +1,36 @@ -// ----------------------------------------------------------------------------- -// This file is part of Broken Sword 2.5 -// Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdörfer -// -// Broken Sword 2.5 is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// Broken Sword 2.5 is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Broken Sword 2.5; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -// ----------------------------------------------------------------------------- +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +/* + * This code is based on Broken Sword 2.5 engine + * + * Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer + * + * Licensed under GNU GPL v2 + * + */ // ----------------------------------------------------------------------------- // Includes -- cgit v1.2.3 From bed623b11ef007bb46b26f1f995b6073914383c5 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 31 Jul 2010 11:49:39 +0000 Subject: SWORD25: Fix compilation svn-id: r53193 --- engines/sword25/fmv/movieplayer_script.cpp | 31 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'engines/sword25/fmv/movieplayer_script.cpp') diff --git a/engines/sword25/fmv/movieplayer_script.cpp b/engines/sword25/fmv/movieplayer_script.cpp index b04cff35f7..f95dc90b1d 100644 --- a/engines/sword25/fmv/movieplayer_script.cpp +++ b/engines/sword25/fmv/movieplayer_script.cpp @@ -43,9 +43,7 @@ #include "sword25/fmv/movieplayer.h" -namespace -{ - // ------------------------------------------------------------------------- +namespace Sword25 { int LoadMovie(lua_State * L) { @@ -171,21 +169,18 @@ namespace const luaL_reg LIBRARY_FUNCTIONS[] = { - "LoadMovie", LoadMovie, - "UnloadMovie", UnloadMovie, - "Play", Play, - "Pause", Pause, - "Update", Update, - "IsMovieLoaded", IsMovieLoaded, - "IsPaused", IsPaused, - "GetScaleFactor", GetScaleFactor, - "SetScaleFactor", SetScaleFactor, - "GetTime", GetTime, - 0, 0, + { "LoadMovie", LoadMovie }, + { "UnloadMovie", UnloadMovie }, + { "Play", Play }, + { "Pause", Pause }, + { "Update", Update }, + { "IsMovieLoaded", IsMovieLoaded }, + { "IsPaused", IsPaused }, + { "GetScaleFactor", GetScaleFactor }, + { "SetScaleFactor", SetScaleFactor }, + { "GetTime", GetTime }, + { 0, 0 } }; -} - -// ----------------------------------------------------------------------------- bool BS_MoviePlayer::_RegisterScriptBindings() { @@ -200,3 +195,5 @@ bool BS_MoviePlayer::_RegisterScriptBindings() return true; } + +} // End of namespace Sword25 -- cgit v1.2.3 From 9b3e26e7a29756848395d7a12928efdb60b8ff21 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 4 Aug 2010 14:53:07 +0000 Subject: SWORD25: Start for VideoDecoder-compatible Theora player. svn-id: r53206 --- engines/sword25/fmv/movieplayer_script.cpp | 196 ++++++++++++++--------------- 1 file changed, 92 insertions(+), 104 deletions(-) (limited to 'engines/sword25/fmv/movieplayer_script.cpp') diff --git a/engines/sword25/fmv/movieplayer_script.cpp b/engines/sword25/fmv/movieplayer_script.cpp index f95dc90b1d..523cc2d4f3 100644 --- a/engines/sword25/fmv/movieplayer_script.cpp +++ b/engines/sword25/fmv/movieplayer_script.cpp @@ -23,7 +23,7 @@ * */ -/* +/* * This code is based on Broken Sword 2.5 engine * * Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer @@ -45,150 +45,138 @@ namespace Sword25 { - int LoadMovie(lua_State * L) - { - BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); - BS_ASSERT(FMVPtr); +int LoadMovie(lua_State *L) { + BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); - lua_pushbooleancpp(L, FMVPtr->LoadMovie(luaL_checkstring(L, 1), lua_gettop(L) == 2 ? static_cast(luaL_checknumber(L, 2)) : 10)); + lua_pushbooleancpp(L, FMVPtr->LoadMovie(luaL_checkstring(L, 1), lua_gettop(L) == 2 ? static_cast(luaL_checknumber(L, 2)) : 10)); - return 1; - } - - // ------------------------------------------------------------------------- - - int UnloadMovie(lua_State * L) - { - BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); - BS_ASSERT(FMVPtr); - - lua_pushbooleancpp(L, FMVPtr->UnloadMovie()); + return 1; +} - return 1; - } +// ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- +int UnloadMovie(lua_State *L) { + BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); - int Play(lua_State * L) - { - BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); - BS_ASSERT(FMVPtr); + lua_pushbooleancpp(L, FMVPtr->UnloadMovie()); - lua_pushbooleancpp(L, FMVPtr->Play()); + return 1; +} - return 1; - } +// ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- +int Play(lua_State *L) { + BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); - int Pause(lua_State * L) - { - BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); - BS_ASSERT(FMVPtr); + lua_pushbooleancpp(L, FMVPtr->Play()); - lua_pushbooleancpp(L, FMVPtr->Pause()); + return 1; +} - return 1; - } +// ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- +int Pause(lua_State *L) { + BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); - int Update(lua_State * L) - { - BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); - BS_ASSERT(FMVPtr); + lua_pushbooleancpp(L, FMVPtr->Pause()); - FMVPtr->Update(); + return 1; +} - return 0; - } +// ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- +int Update(lua_State *L) { + BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); - int IsMovieLoaded(lua_State * L) - { - BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); - BS_ASSERT(FMVPtr); + FMVPtr->Update(); - lua_pushbooleancpp(L, FMVPtr->IsMovieLoaded()); + return 0; +} - return 1; - } +// ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- +int IsMovieLoaded(lua_State *L) { + BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); - int IsPaused(lua_State * L) - { - BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); - BS_ASSERT(FMVPtr); + lua_pushbooleancpp(L, FMVPtr->IsMovieLoaded()); - lua_pushbooleancpp(L, FMVPtr->IsPaused()); + return 1; +} - return 1; - } +// ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- +int IsPaused(lua_State *L) { + BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); - int GetScaleFactor(lua_State * L) - { - BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); - BS_ASSERT(FMVPtr); + lua_pushbooleancpp(L, FMVPtr->IsPaused()); - lua_pushnumber(L, FMVPtr->GetScaleFactor()); + return 1; +} - return 1; - } +// ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- +int GetScaleFactor(lua_State *L) { + BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); - int SetScaleFactor(lua_State * L) - { - BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); - BS_ASSERT(FMVPtr); + lua_pushnumber(L, FMVPtr->GetScaleFactor()); - FMVPtr->SetScaleFactor(static_cast(luaL_checknumber(L, 1))); + return 1; +} - return 0; - } +// ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- +int SetScaleFactor(lua_State *L) { + BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); - int GetTime(lua_State * L) - { - BS_MoviePlayer * FMVPtr = BS_Kernel::GetInstance()->GetFMV(); - BS_ASSERT(FMVPtr); + FMVPtr->SetScaleFactor(static_cast(luaL_checknumber(L, 1))); - lua_pushnumber(L, FMVPtr->GetTime()); + return 0; +} - return 1; - } +// ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- +int GetTime(lua_State *L) { + BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + BS_ASSERT(FMVPtr); - const char * LIBRARY_NAME = "Movieplayer"; + lua_pushnumber(L, FMVPtr->GetTime()); - const luaL_reg LIBRARY_FUNCTIONS[] = - { - { "LoadMovie", LoadMovie }, - { "UnloadMovie", UnloadMovie }, - { "Play", Play }, - { "Pause", Pause }, - { "Update", Update }, - { "IsMovieLoaded", IsMovieLoaded }, - { "IsPaused", IsPaused }, - { "GetScaleFactor", GetScaleFactor }, - { "SetScaleFactor", SetScaleFactor }, - { "GetTime", GetTime }, - { 0, 0 } - }; + return 1; +} -bool BS_MoviePlayer::_RegisterScriptBindings() -{ - BS_Kernel * pKernel = BS_Kernel::GetInstance(); +// ------------------------------------------------------------------------- + +const char *LIBRARY_NAME = "Movieplayer"; + +const luaL_reg LIBRARY_FUNCTIONS[] = { + { "LoadMovie", LoadMovie }, + { "UnloadMovie", UnloadMovie }, + { "Play", Play }, + { "Pause", Pause }, + { "Update", Update }, + { "IsMovieLoaded", IsMovieLoaded }, + { "IsPaused", IsPaused }, + { "GetScaleFactor", GetScaleFactor }, + { "SetScaleFactor", SetScaleFactor }, + { "GetTime", GetTime }, + { 0, 0 } +}; + +bool BS_MoviePlayer::_RegisterScriptBindings() { + BS_Kernel *pKernel = BS_Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_ScriptEngine * pScript = static_cast(pKernel->GetService("script")); + BS_ScriptEngine *pScript = static_cast(pKernel->GetService("script")); BS_ASSERT(pScript); - lua_State * L = static_cast(pScript->GetScriptObject()); + lua_State *L = static_cast(pScript->GetScriptObject()); BS_ASSERT(L); if (!BS_LuaBindhelper::AddFunctionsToLib(L, LIBRARY_NAME, LIBRARY_FUNCTIONS)) return false; -- cgit v1.2.3 From 485ff15d23b3ae9545f5c9df794f1326185eae7a Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Aug 2010 10:52:24 +0000 Subject: SWORD25: Mass-eliminating of BS_ prefix in fmv/ and gfx/ svn-id: r53258 --- engines/sword25/fmv/movieplayer_script.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'engines/sword25/fmv/movieplayer_script.cpp') diff --git a/engines/sword25/fmv/movieplayer_script.cpp b/engines/sword25/fmv/movieplayer_script.cpp index 523cc2d4f3..dcf5cd334b 100644 --- a/engines/sword25/fmv/movieplayer_script.cpp +++ b/engines/sword25/fmv/movieplayer_script.cpp @@ -46,7 +46,7 @@ namespace Sword25 { int LoadMovie(lua_State *L) { - BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushbooleancpp(L, FMVPtr->LoadMovie(luaL_checkstring(L, 1), lua_gettop(L) == 2 ? static_cast(luaL_checknumber(L, 2)) : 10)); @@ -57,7 +57,7 @@ int LoadMovie(lua_State *L) { // ------------------------------------------------------------------------- int UnloadMovie(lua_State *L) { - BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushbooleancpp(L, FMVPtr->UnloadMovie()); @@ -68,7 +68,7 @@ int UnloadMovie(lua_State *L) { // ------------------------------------------------------------------------- int Play(lua_State *L) { - BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushbooleancpp(L, FMVPtr->Play()); @@ -79,7 +79,7 @@ int Play(lua_State *L) { // ------------------------------------------------------------------------- int Pause(lua_State *L) { - BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushbooleancpp(L, FMVPtr->Pause()); @@ -90,7 +90,7 @@ int Pause(lua_State *L) { // ------------------------------------------------------------------------- int Update(lua_State *L) { - BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); FMVPtr->Update(); @@ -101,7 +101,7 @@ int Update(lua_State *L) { // ------------------------------------------------------------------------- int IsMovieLoaded(lua_State *L) { - BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushbooleancpp(L, FMVPtr->IsMovieLoaded()); @@ -112,7 +112,7 @@ int IsMovieLoaded(lua_State *L) { // ------------------------------------------------------------------------- int IsPaused(lua_State *L) { - BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushbooleancpp(L, FMVPtr->IsPaused()); @@ -123,7 +123,7 @@ int IsPaused(lua_State *L) { // ------------------------------------------------------------------------- int GetScaleFactor(lua_State *L) { - BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushnumber(L, FMVPtr->GetScaleFactor()); @@ -134,7 +134,7 @@ int GetScaleFactor(lua_State *L) { // ------------------------------------------------------------------------- int SetScaleFactor(lua_State *L) { - BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); FMVPtr->SetScaleFactor(static_cast(luaL_checknumber(L, 1))); @@ -145,7 +145,7 @@ int SetScaleFactor(lua_State *L) { // ------------------------------------------------------------------------- int GetTime(lua_State *L) { - BS_MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushnumber(L, FMVPtr->GetTime()); @@ -171,7 +171,7 @@ const luaL_reg LIBRARY_FUNCTIONS[] = { { 0, 0 } }; -bool BS_MoviePlayer::_RegisterScriptBindings() { +bool MoviePlayer::_RegisterScriptBindings() { BS_Kernel *pKernel = BS_Kernel::GetInstance(); BS_ASSERT(pKernel); BS_ScriptEngine *pScript = static_cast(pKernel->GetService("script")); -- cgit v1.2.3 From be44216e5c1d74879d7843215ce1cd3f488b4db8 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Aug 2010 12:57:47 +0000 Subject: SWORD25: eliminated BS_ prefix in all but kernel/ svn-id: r53259 --- engines/sword25/fmv/movieplayer_script.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/sword25/fmv/movieplayer_script.cpp') diff --git a/engines/sword25/fmv/movieplayer_script.cpp b/engines/sword25/fmv/movieplayer_script.cpp index dcf5cd334b..a89338f224 100644 --- a/engines/sword25/fmv/movieplayer_script.cpp +++ b/engines/sword25/fmv/movieplayer_script.cpp @@ -174,12 +174,12 @@ const luaL_reg LIBRARY_FUNCTIONS[] = { bool MoviePlayer::_RegisterScriptBindings() { BS_Kernel *pKernel = BS_Kernel::GetInstance(); BS_ASSERT(pKernel); - BS_ScriptEngine *pScript = static_cast(pKernel->GetService("script")); + ScriptEngine *pScript = static_cast(pKernel->GetService("script")); BS_ASSERT(pScript); lua_State *L = static_cast(pScript->GetScriptObject()); BS_ASSERT(L); - if (!BS_LuaBindhelper::AddFunctionsToLib(L, LIBRARY_NAME, LIBRARY_FUNCTIONS)) return false; + if (!LuaBindhelper::AddFunctionsToLib(L, LIBRARY_NAME, LIBRARY_FUNCTIONS)) return false; return true; } -- cgit v1.2.3 From b01994a53bbc96da907a4c28934e644184291017 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 18 Aug 2010 12:58:22 +0000 Subject: SWORD25: removed BS_ prefix from rest of the classes. The things which are intentionally left with the prefix: BS_LOG, BS_ASSERT, BS_Rect, BS_String. svn-id: r53261 --- engines/sword25/fmv/movieplayer_script.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'engines/sword25/fmv/movieplayer_script.cpp') diff --git a/engines/sword25/fmv/movieplayer_script.cpp b/engines/sword25/fmv/movieplayer_script.cpp index a89338f224..0b96d4dc34 100644 --- a/engines/sword25/fmv/movieplayer_script.cpp +++ b/engines/sword25/fmv/movieplayer_script.cpp @@ -46,7 +46,7 @@ namespace Sword25 { int LoadMovie(lua_State *L) { - MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushbooleancpp(L, FMVPtr->LoadMovie(luaL_checkstring(L, 1), lua_gettop(L) == 2 ? static_cast(luaL_checknumber(L, 2)) : 10)); @@ -57,7 +57,7 @@ int LoadMovie(lua_State *L) { // ------------------------------------------------------------------------- int UnloadMovie(lua_State *L) { - MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushbooleancpp(L, FMVPtr->UnloadMovie()); @@ -68,7 +68,7 @@ int UnloadMovie(lua_State *L) { // ------------------------------------------------------------------------- int Play(lua_State *L) { - MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushbooleancpp(L, FMVPtr->Play()); @@ -79,7 +79,7 @@ int Play(lua_State *L) { // ------------------------------------------------------------------------- int Pause(lua_State *L) { - MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushbooleancpp(L, FMVPtr->Pause()); @@ -90,7 +90,7 @@ int Pause(lua_State *L) { // ------------------------------------------------------------------------- int Update(lua_State *L) { - MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); FMVPtr->Update(); @@ -101,7 +101,7 @@ int Update(lua_State *L) { // ------------------------------------------------------------------------- int IsMovieLoaded(lua_State *L) { - MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushbooleancpp(L, FMVPtr->IsMovieLoaded()); @@ -112,7 +112,7 @@ int IsMovieLoaded(lua_State *L) { // ------------------------------------------------------------------------- int IsPaused(lua_State *L) { - MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushbooleancpp(L, FMVPtr->IsPaused()); @@ -123,7 +123,7 @@ int IsPaused(lua_State *L) { // ------------------------------------------------------------------------- int GetScaleFactor(lua_State *L) { - MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushnumber(L, FMVPtr->GetScaleFactor()); @@ -134,7 +134,7 @@ int GetScaleFactor(lua_State *L) { // ------------------------------------------------------------------------- int SetScaleFactor(lua_State *L) { - MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); FMVPtr->SetScaleFactor(static_cast(luaL_checknumber(L, 1))); @@ -145,7 +145,7 @@ int SetScaleFactor(lua_State *L) { // ------------------------------------------------------------------------- int GetTime(lua_State *L) { - MoviePlayer *FMVPtr = BS_Kernel::GetInstance()->GetFMV(); + MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); lua_pushnumber(L, FMVPtr->GetTime()); @@ -172,7 +172,7 @@ const luaL_reg LIBRARY_FUNCTIONS[] = { }; bool MoviePlayer::_RegisterScriptBindings() { - BS_Kernel *pKernel = BS_Kernel::GetInstance(); + Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); ScriptEngine *pScript = static_cast(pKernel->GetService("script")); BS_ASSERT(pScript); -- cgit v1.2.3 From 086f5961b6575c50bb386750b6e9a3ed1efdd8cd Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 2 Sep 2010 12:14:04 +0000 Subject: SWORD25: unsigned int -> uint svn-id: r53309 --- engines/sword25/fmv/movieplayer_script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/sword25/fmv/movieplayer_script.cpp') diff --git a/engines/sword25/fmv/movieplayer_script.cpp b/engines/sword25/fmv/movieplayer_script.cpp index 0b96d4dc34..60d42ac2b5 100644 --- a/engines/sword25/fmv/movieplayer_script.cpp +++ b/engines/sword25/fmv/movieplayer_script.cpp @@ -49,7 +49,7 @@ int LoadMovie(lua_State *L) { MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); - lua_pushbooleancpp(L, FMVPtr->LoadMovie(luaL_checkstring(L, 1), lua_gettop(L) == 2 ? static_cast(luaL_checknumber(L, 2)) : 10)); + lua_pushbooleancpp(L, FMVPtr->LoadMovie(luaL_checkstring(L, 1), lua_gettop(L) == 2 ? static_cast(luaL_checknumber(L, 2)) : 10)); return 1; } -- cgit v1.2.3 From bf22def884986e4bd5bec2b42dea7f91b5417ccc Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 29 Sep 2010 10:40:06 +0000 Subject: SWORD25: Enforce code naming conventions in fmv/* svn-id: r53388 --- engines/sword25/fmv/movieplayer_script.cpp | 86 +++++++++++------------------- 1 file changed, 31 insertions(+), 55 deletions(-) (limited to 'engines/sword25/fmv/movieplayer_script.cpp') diff --git a/engines/sword25/fmv/movieplayer_script.cpp b/engines/sword25/fmv/movieplayer_script.cpp index 60d42ac2b5..8a47721c95 100644 --- a/engines/sword25/fmv/movieplayer_script.cpp +++ b/engines/sword25/fmv/movieplayer_script.cpp @@ -32,10 +32,6 @@ * */ -// ----------------------------------------------------------------------------- -// Includes -// ----------------------------------------------------------------------------- - #include "sword25/kernel/common.h" #include "sword25/kernel/kernel.h" #include "sword25/script/script.h" @@ -45,133 +41,113 @@ namespace Sword25 { -int LoadMovie(lua_State *L) { +int loadMovie(lua_State *L) { MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); - lua_pushbooleancpp(L, FMVPtr->LoadMovie(luaL_checkstring(L, 1), lua_gettop(L) == 2 ? static_cast(luaL_checknumber(L, 2)) : 10)); + lua_pushbooleancpp(L, FMVPtr->loadMovie(luaL_checkstring(L, 1), lua_gettop(L) == 2 ? static_cast(luaL_checknumber(L, 2)) : 10)); return 1; } -// ------------------------------------------------------------------------- - -int UnloadMovie(lua_State *L) { +int unloadMovie(lua_State *L) { MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); - lua_pushbooleancpp(L, FMVPtr->UnloadMovie()); + lua_pushbooleancpp(L, FMVPtr->unloadMovie()); return 1; } -// ------------------------------------------------------------------------- - -int Play(lua_State *L) { +int play(lua_State *L) { MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); - lua_pushbooleancpp(L, FMVPtr->Play()); + lua_pushbooleancpp(L, FMVPtr->play()); return 1; } -// ------------------------------------------------------------------------- - -int Pause(lua_State *L) { +int pause(lua_State *L) { MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); - lua_pushbooleancpp(L, FMVPtr->Pause()); + lua_pushbooleancpp(L, FMVPtr->pause()); return 1; } -// ------------------------------------------------------------------------- - -int Update(lua_State *L) { +int update(lua_State *L) { MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); - FMVPtr->Update(); + FMVPtr->update(); return 0; } -// ------------------------------------------------------------------------- - -int IsMovieLoaded(lua_State *L) { +int isMovieLoaded(lua_State *L) { MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); - lua_pushbooleancpp(L, FMVPtr->IsMovieLoaded()); + lua_pushbooleancpp(L, FMVPtr->isMovieLoaded()); return 1; } -// ------------------------------------------------------------------------- - -int IsPaused(lua_State *L) { +int isPaused(lua_State *L) { MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); - lua_pushbooleancpp(L, FMVPtr->IsPaused()); + lua_pushbooleancpp(L, FMVPtr->isPaused()); return 1; } -// ------------------------------------------------------------------------- - -int GetScaleFactor(lua_State *L) { +int getScaleFactor(lua_State *L) { MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); - lua_pushnumber(L, FMVPtr->GetScaleFactor()); + lua_pushnumber(L, FMVPtr->getScaleFactor()); return 1; } -// ------------------------------------------------------------------------- - -int SetScaleFactor(lua_State *L) { +int setScaleFactor(lua_State *L) { MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); - FMVPtr->SetScaleFactor(static_cast(luaL_checknumber(L, 1))); + FMVPtr->setScaleFactor(static_cast(luaL_checknumber(L, 1))); return 0; } -// ------------------------------------------------------------------------- - -int GetTime(lua_State *L) { +int getTime(lua_State *L) { MoviePlayer *FMVPtr = Kernel::GetInstance()->GetFMV(); BS_ASSERT(FMVPtr); - lua_pushnumber(L, FMVPtr->GetTime()); + lua_pushnumber(L, FMVPtr->getTime()); return 1; } -// ------------------------------------------------------------------------- - const char *LIBRARY_NAME = "Movieplayer"; const luaL_reg LIBRARY_FUNCTIONS[] = { - { "LoadMovie", LoadMovie }, - { "UnloadMovie", UnloadMovie }, - { "Play", Play }, - { "Pause", Pause }, - { "Update", Update }, - { "IsMovieLoaded", IsMovieLoaded }, - { "IsPaused", IsPaused }, - { "GetScaleFactor", GetScaleFactor }, - { "SetScaleFactor", SetScaleFactor }, - { "GetTime", GetTime }, + { "LoadMovie", loadMovie }, + { "UnloadMovie", unloadMovie }, + { "Play", play }, + { "Pause", pause }, + { "Update", update }, + { "IsMovieLoaded", isMovieLoaded }, + { "IsPaused", isPaused }, + { "GetScaleFactor", getScaleFactor }, + { "SetScaleFactor", setScaleFactor }, + { "GetTime", getTime }, { 0, 0 } }; -bool MoviePlayer::_RegisterScriptBindings() { +bool MoviePlayer::registerScriptBindings() { Kernel *pKernel = Kernel::GetInstance(); BS_ASSERT(pKernel); ScriptEngine *pScript = static_cast(pKernel->GetService("script")); -- cgit v1.2.3 From 54ccc8f4c906cd4f84c955581c0368886a7a9c78 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 3 Oct 2010 13:25:22 +0000 Subject: SWORD25: Enforced code naming conventions in script/* svn-id: r53391 --- engines/sword25/fmv/movieplayer_script.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/sword25/fmv/movieplayer_script.cpp') diff --git a/engines/sword25/fmv/movieplayer_script.cpp b/engines/sword25/fmv/movieplayer_script.cpp index 8a47721c95..13bb149672 100644 --- a/engines/sword25/fmv/movieplayer_script.cpp +++ b/engines/sword25/fmv/movieplayer_script.cpp @@ -152,10 +152,10 @@ bool MoviePlayer::registerScriptBindings() { BS_ASSERT(pKernel); ScriptEngine *pScript = static_cast(pKernel->GetService("script")); BS_ASSERT(pScript); - lua_State *L = static_cast(pScript->GetScriptObject()); + lua_State *L = static_cast(pScript->getScriptObject()); BS_ASSERT(L); - if (!LuaBindhelper::AddFunctionsToLib(L, LIBRARY_NAME, LIBRARY_FUNCTIONS)) return false; + if (!LuaBindhelper::addFunctionsToLib(L, LIBRARY_NAME, LIBRARY_FUNCTIONS)) return false; return true; } -- cgit v1.2.3