aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/script
diff options
context:
space:
mode:
authorEugene Sandulenko2010-08-18 12:57:47 +0000
committerEugene Sandulenko2010-10-12 22:55:59 +0000
commitbe44216e5c1d74879d7843215ce1cd3f488b4db8 (patch)
treecd49961f2fe9b1ea641e2e57d90b3d8a315123ea /engines/sword25/script
parent485ff15d23b3ae9545f5c9df794f1326185eae7a (diff)
downloadscummvm-rg350-be44216e5c1d74879d7843215ce1cd3f488b4db8.tar.gz
scummvm-rg350-be44216e5c1d74879d7843215ce1cd3f488b4db8.tar.bz2
scummvm-rg350-be44216e5c1d74879d7843215ce1cd3f488b4db8.zip
SWORD25: eliminated BS_ prefix in all but kernel/
svn-id: r53259
Diffstat (limited to 'engines/sword25/script')
-rw-r--r--engines/sword25/script/lua_extensions.cpp4
-rw-r--r--engines/sword25/script/luabindhelper.cpp16
-rw-r--r--engines/sword25/script/luabindhelper.h2
-rw-r--r--engines/sword25/script/luacallback.cpp18
-rw-r--r--engines/sword25/script/luacallback.h6
-rw-r--r--engines/sword25/script/luascript.cpp28
-rw-r--r--engines/sword25/script/luascript.h6
-rw-r--r--engines/sword25/script/script.h6
8 files changed, 43 insertions, 43 deletions
diff --git a/engines/sword25/script/lua_extensions.cpp b/engines/sword25/script/lua_extensions.cpp
index 91303ac8e0..6a2110428f 100644
--- a/engines/sword25/script/lua_extensions.cpp
+++ b/engines/sword25/script/lua_extensions.cpp
@@ -72,11 +72,11 @@ static const luaL_reg GLOBAL_FUNCTIONS[] = {
// -----------------------------------------------------------------------------
-bool BS_LuaScriptEngine::RegisterStandardLibExtensions() {
+bool LuaScriptEngine::RegisterStandardLibExtensions() {
lua_State *L = m_State;
BS_ASSERT(m_State);
- if (!BS_LuaBindhelper::AddFunctionsToLib(L, "", GLOBAL_FUNCTIONS)) return false;
+ if (!LuaBindhelper::AddFunctionsToLib(L, "", GLOBAL_FUNCTIONS)) return false;
return true;
}
diff --git a/engines/sword25/script/luabindhelper.cpp b/engines/sword25/script/luabindhelper.cpp
index f45a6c24f4..843e8dd4de 100644
--- a/engines/sword25/script/luabindhelper.cpp
+++ b/engines/sword25/script/luabindhelper.cpp
@@ -93,7 +93,7 @@ namespace Sword25 {
* The array must be terminated with the enry (0, 0)
* @return Returns true if successful, otherwise false.
*/
-bool BS_LuaBindhelper::AddFunctionsToLib(lua_State *L, const Common::String &LibName, const luaL_reg *Functions) {
+bool LuaBindhelper::AddFunctionsToLib(lua_State *L, const Common::String &LibName, const luaL_reg *Functions) {
#ifdef DEBUG
int __startStackDepth = lua_gettop(L);
#endif
@@ -149,7 +149,7 @@ bool BS_LuaBindhelper::AddFunctionsToLib(lua_State *L, const Common::String &Lib
* The array must be terminated with the enry (0, 0)
* @return Returns true if successful, otherwise false.
*/
-bool BS_LuaBindhelper::AddConstantsToLib(lua_State *L, const Common::String &LibName, const lua_constant_reg *Constants) {
+bool LuaBindhelper::AddConstantsToLib(lua_State *L, const Common::String &LibName, const lua_constant_reg *Constants) {
#ifdef DEBUG
int __startStackDepth = lua_gettop(L);
#endif
@@ -196,7 +196,7 @@ bool BS_LuaBindhelper::AddConstantsToLib(lua_State *L, const Common::String &Lib
* The array must be terminated with the enry (0, 0)
* @return Returns true if successful, otherwise false.
*/
-bool BS_LuaBindhelper::AddMethodsToClass(lua_State *L, const Common::String &ClassName, const luaL_reg *Methods) {
+bool LuaBindhelper::AddMethodsToClass(lua_State *L, const Common::String &ClassName, const luaL_reg *Methods) {
#ifdef DEBUG
int __startStackDepth = lua_gettop(L);
#endif
@@ -236,7 +236,7 @@ bool BS_LuaBindhelper::AddMethodsToClass(lua_State *L, const Common::String &Cla
* @param GCHandler A function pointer
* @return Returns true if successful, otherwise false.
*/
-bool BS_LuaBindhelper::SetClassGCHandler(lua_State *L, const Common::String &ClassName, lua_CFunction GCHandler) {
+bool LuaBindhelper::SetClassGCHandler(lua_State *L, const Common::String &ClassName, lua_CFunction GCHandler) {
#ifdef DEBUG
int __startStackDepth = lua_gettop(L);
#endif
@@ -288,7 +288,7 @@ void PushMetatableTable(lua_State *L) {
namespace Sword25 {
-bool BS_LuaBindhelper::GetMetatable(lua_State *L, const Common::String &TableName) {
+bool LuaBindhelper::GetMetatable(lua_State *L, const Common::String &TableName) {
// Push the Metatable table onto the stack
PushMetatableTable(L);
@@ -322,7 +322,7 @@ bool BS_LuaBindhelper::GetMetatable(lua_State *L, const Common::String &TableNam
// -----------------------------------------------------------------------------
-bool BS_LuaBindhelper::_CreateTable(lua_State *L, const Common::String &TableName) {
+bool LuaBindhelper::_CreateTable(lua_State *L, const Common::String &TableName) {
const char *PartBegin = TableName.c_str();
while (PartBegin - TableName.c_str() < (int)TableName.size()) {
@@ -406,7 +406,7 @@ Common::String GetLuaValueInfo(lua_State *L, int StackIndex) {
namespace Sword25 {
-Common::String BS_LuaBindhelper::StackDump(lua_State *L) {
+Common::String LuaBindhelper::StackDump(lua_State *L) {
Common::String oss;
int i = lua_gettop(L);
@@ -422,7 +422,7 @@ Common::String BS_LuaBindhelper::StackDump(lua_State *L) {
return oss;
}
-Common::String BS_LuaBindhelper::TableDump(lua_State *L) {
+Common::String LuaBindhelper::TableDump(lua_State *L) {
Common::String oss;
oss += "------------------- Table Dump -------------------\n";
diff --git a/engines/sword25/script/luabindhelper.h b/engines/sword25/script/luabindhelper.h
index 9c864c6085..85ff089ee4 100644
--- a/engines/sword25/script/luabindhelper.h
+++ b/engines/sword25/script/luabindhelper.h
@@ -59,7 +59,7 @@ struct lua_constant_reg {
lua_Number Value;
};
-class BS_LuaBindhelper {
+class LuaBindhelper {
public:
/**
* Registers a set of functions into a Lua library.
diff --git a/engines/sword25/script/luacallback.cpp b/engines/sword25/script/luacallback.cpp
index dfabc81807..4e9d4dd06c 100644
--- a/engines/sword25/script/luacallback.cpp
+++ b/engines/sword25/script/luacallback.cpp
@@ -59,7 +59,7 @@ namespace Sword25 {
// -----------------------------------------------------------------------------
-BS_LuaCallback::BS_LuaCallback(lua_State *L) {
+LuaCallback::LuaCallback(lua_State *L) {
// Create callback table
lua_newtable(L);
lua_setglobal(L, CALLBACKTABLE_NAME);
@@ -67,12 +67,12 @@ BS_LuaCallback::BS_LuaCallback(lua_State *L) {
// -----------------------------------------------------------------------------
-BS_LuaCallback::~BS_LuaCallback() {
+LuaCallback::~LuaCallback() {
}
// -----------------------------------------------------------------------------
-void BS_LuaCallback::RegisterCallbackFunction(lua_State *L, unsigned int ObjectHandle) {
+void LuaCallback::RegisterCallbackFunction(lua_State *L, unsigned int ObjectHandle) {
BS_ASSERT(lua_isfunction(L, -1));
EnsureObjectCallbackTableExists(L, ObjectHandle);
@@ -86,7 +86,7 @@ void BS_LuaCallback::RegisterCallbackFunction(lua_State *L, unsigned int ObjectH
// -----------------------------------------------------------------------------
-void BS_LuaCallback::UnregisterCallbackFunction(lua_State *L, unsigned int ObjectHandle) {
+void LuaCallback::UnregisterCallbackFunction(lua_State *L, unsigned int ObjectHandle) {
BS_ASSERT(lua_isfunction(L, -1));
EnsureObjectCallbackTableExists(L, ObjectHandle);
@@ -116,7 +116,7 @@ void BS_LuaCallback::UnregisterCallbackFunction(lua_State *L, unsigned int Objec
// -----------------------------------------------------------------------------
-void BS_LuaCallback::RemoveAllObjectCallbacks(lua_State *L, unsigned int ObjectHandle) {
+void LuaCallback::RemoveAllObjectCallbacks(lua_State *L, unsigned int ObjectHandle) {
PushCallbackTable(L);
// Remove the object callback from the callback table
@@ -129,7 +129,7 @@ void BS_LuaCallback::RemoveAllObjectCallbacks(lua_State *L, unsigned int ObjectH
// -----------------------------------------------------------------------------
-void BS_LuaCallback::InvokeCallbackFunctions(lua_State *L, unsigned int ObjectHandle) {
+void LuaCallback::InvokeCallbackFunctions(lua_State *L, unsigned int ObjectHandle) {
EnsureObjectCallbackTableExists(L, ObjectHandle);
// Iterate through the table and perform all the callbacks
@@ -161,7 +161,7 @@ void BS_LuaCallback::InvokeCallbackFunctions(lua_State *L, unsigned int ObjectHa
// -----------------------------------------------------------------------------
-void BS_LuaCallback::EnsureObjectCallbackTableExists(lua_State *L, unsigned int ObjectHandle) {
+void LuaCallback::EnsureObjectCallbackTableExists(lua_State *L, unsigned int ObjectHandle) {
PushObjectCallbackTable(L, ObjectHandle);
// If the table is nil, it must first be created
@@ -184,13 +184,13 @@ void BS_LuaCallback::EnsureObjectCallbackTableExists(lua_State *L, unsigned int
// -----------------------------------------------------------------------------
-void BS_LuaCallback::PushCallbackTable(lua_State *L) {
+void LuaCallback::PushCallbackTable(lua_State *L) {
lua_getglobal(L, CALLBACKTABLE_NAME);
}
// -----------------------------------------------------------------------------
-void BS_LuaCallback::PushObjectCallbackTable(lua_State *L, unsigned int ObjectHandle) {
+void LuaCallback::PushObjectCallbackTable(lua_State *L, unsigned int ObjectHandle) {
PushCallbackTable(L);
// Push Object Callback table onto the stack
diff --git a/engines/sword25/script/luacallback.h b/engines/sword25/script/luacallback.h
index b8ac97fd95..89ab67a52e 100644
--- a/engines/sword25/script/luacallback.h
+++ b/engines/sword25/script/luacallback.h
@@ -59,10 +59,10 @@ namespace Sword25 {
// Class definitions
// -----------------------------------------------------------------------------
-class BS_LuaCallback {
+class LuaCallback {
public:
- BS_LuaCallback(lua_State *L);
- virtual ~BS_LuaCallback();
+ LuaCallback(lua_State *L);
+ virtual ~LuaCallback();
// Funktion muss auf dem Lua-Stack liegen.
void RegisterCallbackFunction(lua_State *L, unsigned int ObjectHandle);
diff --git a/engines/sword25/script/luascript.cpp b/engines/sword25/script/luascript.cpp
index 6d2816ae13..2ba528ed18 100644
--- a/engines/sword25/script/luascript.cpp
+++ b/engines/sword25/script/luascript.cpp
@@ -65,15 +65,15 @@ using namespace Lua;
// Constructor / Destructor
// -----------------------------------------------------------------------------
-BS_LuaScriptEngine::BS_LuaScriptEngine(BS_Kernel *KernelPtr) :
- BS_ScriptEngine(KernelPtr),
+LuaScriptEngine::LuaScriptEngine(BS_Kernel *KernelPtr) :
+ ScriptEngine(KernelPtr),
m_State(0),
m_PcallErrorhandlerRegistryIndex(0) {
}
// -----------------------------------------------------------------------------
-BS_LuaScriptEngine::~BS_LuaScriptEngine() {
+LuaScriptEngine::~LuaScriptEngine() {
// Lua de-initialisation
if (m_State)
lua_close(m_State);
@@ -81,8 +81,8 @@ BS_LuaScriptEngine::~BS_LuaScriptEngine() {
// -----------------------------------------------------------------------------
-BS_Service *BS_LuaScriptEngine_CreateObject(BS_Kernel *KernelPtr) {
- return new BS_LuaScriptEngine(KernelPtr);
+BS_Service *LuaScriptEngine_CreateObject(BS_Kernel *KernelPtr) {
+ return new LuaScriptEngine(KernelPtr);
}
// -----------------------------------------------------------------------------
@@ -96,7 +96,7 @@ int PanicCB(lua_State *L) {
// -----------------------------------------------------------------------------
-bool BS_LuaScriptEngine::Init() {
+bool LuaScriptEngine::Init() {
// Lua-State initialisation, as well as standard libaries initialisation
m_State = luaL_newstate();
if (!m_State || ! RegisterStandardLibs() || !RegisterStandardLibExtensions()) {
@@ -146,14 +146,14 @@ bool BS_LuaScriptEngine::Init() {
// -----------------------------------------------------------------------------
-bool BS_LuaScriptEngine::ExecuteFile(const Common::String &FileName) {
+bool LuaScriptEngine::ExecuteFile(const Common::String &FileName) {
#ifdef DEBUG
int __startStackDepth = lua_gettop(m_State);
#endif
debug(2, "ExecuteFile(%s)", FileName.c_str());
// Get a pointer to the package manager
- BS_PackageManager *pPackage = static_cast<BS_PackageManager *>(BS_Kernel::GetInstance()->GetService("package"));
+ PackageManager *pPackage = static_cast<PackageManager *>(BS_Kernel::GetInstance()->GetService("package"));
BS_ASSERT(pPackage);
// File read
@@ -189,7 +189,7 @@ bool BS_LuaScriptEngine::ExecuteFile(const Common::String &FileName) {
// -----------------------------------------------------------------------------
-bool BS_LuaScriptEngine::ExecuteString(const Common::String &Code) {
+bool LuaScriptEngine::ExecuteString(const Common::String &Code) {
return ExecuteBuffer((byte *)Code.c_str(), Code.size(), "???");
}
@@ -212,7 +212,7 @@ void RemoveForbiddenFunctions(lua_State *L) {
}
}
-bool BS_LuaScriptEngine::RegisterStandardLibs() {
+bool LuaScriptEngine::RegisterStandardLibs() {
luaL_openlibs(m_State);
RemoveForbiddenFunctions(m_State);
return true;
@@ -220,7 +220,7 @@ bool BS_LuaScriptEngine::RegisterStandardLibs() {
// -----------------------------------------------------------------------------
-bool BS_LuaScriptEngine::ExecuteBuffer(const byte *Data, unsigned int Size, const Common::String &Name) const {
+bool LuaScriptEngine::ExecuteBuffer(const byte *Data, unsigned int Size, const Common::String &Name) const {
// Compile buffer
if (luaL_loadbuffer(m_State, (const char *)Data, Size, Name.c_str()) != 0) {
BS_LOG_ERRORLN("Couldn't compile \"%s\":\n%s", Name.c_str(), lua_tostring(m_State, -1));
@@ -251,7 +251,7 @@ bool BS_LuaScriptEngine::ExecuteBuffer(const byte *Data, unsigned int Size, cons
// -----------------------------------------------------------------------------
-void BS_LuaScriptEngine::SetCommandLine(const Common::StringArray &CommandLineParameters) {
+void LuaScriptEngine::SetCommandLine(const Common::StringArray &CommandLineParameters) {
debug(0, "SetCommandLine()");
lua_newtable(m_State);
@@ -424,7 +424,7 @@ int Chunkwriter(lua_State *L, const void *p, size_t sz, void *ud) {
}
}
-bool BS_LuaScriptEngine::Persist(BS_OutputPersistenceBlock &Writer) {
+bool LuaScriptEngine::Persist(BS_OutputPersistenceBlock &Writer) {
// Empty the Lua stack. pluto_persist() xepects that the stack is empty except for its parameters
lua_settop(m_State, 0);
@@ -516,7 +516,7 @@ void ClearGlobalTable(lua_State *L, const char **Exceptions) {
// -----------------------------------------------------------------------------
-bool BS_LuaScriptEngine::Unpersist(BS_InputPersistenceBlock &Reader) {
+bool LuaScriptEngine::Unpersist(BS_InputPersistenceBlock &Reader) {
// Empty the Lua stack. pluto_persist() xepects that the stack is empty except for its parameters
lua_settop(m_State, 0);
diff --git a/engines/sword25/script/luascript.h b/engines/sword25/script/luascript.h
index 39fa9ebec4..f7cc152f3f 100644
--- a/engines/sword25/script/luascript.h
+++ b/engines/sword25/script/luascript.h
@@ -64,14 +64,14 @@ class BS_Kernel;
// Class declaration
// -----------------------------------------------------------------------------
-class BS_LuaScriptEngine : public BS_ScriptEngine {
+class LuaScriptEngine : public ScriptEngine {
public:
// -----------------------------------------------------------------------------
// Constructor / Destructor
// -----------------------------------------------------------------------------
- BS_LuaScriptEngine(BS_Kernel *KernelPtr);
- virtual ~BS_LuaScriptEngine();
+ LuaScriptEngine(BS_Kernel *KernelPtr);
+ virtual ~LuaScriptEngine();
/**
* Initialises the scripting engine
diff --git a/engines/sword25/script/script.h b/engines/sword25/script/script.h
index 4804324226..b7d550a163 100644
--- a/engines/sword25/script/script.h
+++ b/engines/sword25/script/script.h
@@ -59,14 +59,14 @@ class BS_InputPersistenceBlock;
// Class declaration
// -----------------------------------------------------------------------------
-class BS_ScriptEngine : public BS_Service, public BS_Persistable {
+class ScriptEngine : public BS_Service, public BS_Persistable {
public:
// -----------------------------------------------------------------------------
// Constructor / destructor
// -----------------------------------------------------------------------------
- BS_ScriptEngine(BS_Kernel *KernelPtr) : BS_Service(KernelPtr) {};
- virtual ~BS_ScriptEngine() {};
+ ScriptEngine(BS_Kernel *KernelPtr) : BS_Service(KernelPtr) {};
+ virtual ~ScriptEngine() {};
// -----------------------------------------------------------------------------
// This method must be implemented by the script engine