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/script/luascript.h | 102 +++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100755 engines/sword25/script/luascript.h (limited to 'engines/sword25/script/luascript.h') diff --git a/engines/sword25/script/luascript.h b/engines/sword25/script/luascript.h new file mode 100755 index 0000000000..dd0500a710 --- /dev/null +++ b/engines/sword25/script/luascript.h @@ -0,0 +1,102 @@ +// ----------------------------------------------------------------------------- +// 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 +// ----------------------------------------------------------------------------- + +#ifndef LUASCRIPT_H +#define LUASCRIPT_H + +// ----------------------------------------------------------------------------- +// Includes +// ----------------------------------------------------------------------------- + +#include "kernel/common.h" +#include "script.h" + +// ----------------------------------------------------------------------------- +// Forward declarations +// ----------------------------------------------------------------------------- + +class BS_Kernel; +struct lua_State; + +// ----------------------------------------------------------------------------- +// Class declaration +// ----------------------------------------------------------------------------- + +class BS_LuaScriptEngine : public BS_ScriptEngine +{ +public: + // ----------------------------------------------------------------------------- + // Konstruktion / Destruktion + // ----------------------------------------------------------------------------- + + BS_LuaScriptEngine(BS_Kernel * KernelPtr); + virtual ~BS_LuaScriptEngine(); + + /** + @brief Initialisiert die Scriptengine. + @return Gibt true bei Erfolg zurück, ansonsten false. + */ + virtual bool Init(); + + /** + @brief Lädt eine Skriptdatei und führt diese aus. + @param FileName der Dateiname der Skriptdatei + @return Gibt true bei Erfolg zurück, ansonsten false. + */ + virtual bool ExecuteFile(const std::string & FileName); + + /** + @brief Führt einen String mit Skriptcode aus. + @param Code ein String der Skriptcode enthält. + @return Gibt true bei Erfolg zurück, ansonsten false. + */ + virtual bool ExecuteString(const std::string & Code); + + /** + @brief Gibt einen Pointer auf das Hauptobjekt der Skriptsprache zurück. + @remark Durch die Benutzung dieser Methode wird die Kapselung der Sprache aufgehoben. + */ + virtual void * GetScriptObject() { return m_State; } + + /** + @brief Macht die Kommandozeilen-Parameter für die Skriptumgebung zugänglich. + @param CommandLineParameters ein string vector der alle Kommandozeilenparameter enthält. + @remark Auf welche Weise die Kommandozeilen-Parameter durch Skripte zugegriffen werden können hängt von der jeweiligen Implementierung ab. + */ + virtual void SetCommandLine(const std::vector & CommandLineParameters); + + /** + @remark Der Lua-Stack wird durch diese Methode geleert. + */ + virtual bool Persist(BS_OutputPersistenceBlock & Writer); + /** + @remark Der Lua-Stack wird durch diese Methode geleert. + */ + virtual bool Unpersist(BS_InputPersistenceBlock & Reader); + +private: + lua_State * m_State; + int m_PcallErrorhandlerRegistryIndex; + + bool RegisterStandardLibs(); + bool RegisterStandardLibExtensions(); + bool ExecuteBuffer(const char * Data, unsigned int Size, const std::string & Name) const; +}; + +#endif -- cgit v1.2.3 From 65da804f583460739aec3bfe35b70310af1ee5a9 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 29 Jul 2010 19:55:28 +0000 Subject: SWORD25: Path fixes for includes svn-id: r53180 --- engines/sword25/script/luascript.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/sword25/script/luascript.h') diff --git a/engines/sword25/script/luascript.h b/engines/sword25/script/luascript.h index dd0500a710..83c2a22f8e 100755 --- a/engines/sword25/script/luascript.h +++ b/engines/sword25/script/luascript.h @@ -17,15 +17,15 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // ----------------------------------------------------------------------------- -#ifndef LUASCRIPT_H -#define LUASCRIPT_H +#ifndef SWORD25_LUASCRIPT_H +#define SWORD25_LUASCRIPT_H // ----------------------------------------------------------------------------- // Includes // ----------------------------------------------------------------------------- -#include "kernel/common.h" -#include "script.h" +#include "sword25/kernel/common.h" +#include "sword25/script/script.h" // ----------------------------------------------------------------------------- // Forward declarations -- 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/script/luascript.h | 51 ++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 18 deletions(-) mode change 100755 => 100644 engines/sword25/script/luascript.h (limited to 'engines/sword25/script/luascript.h') diff --git a/engines/sword25/script/luascript.h b/engines/sword25/script/luascript.h old mode 100755 new mode 100644 index 83c2a22f8e..214d728d07 --- a/engines/sword25/script/luascript.h +++ b/engines/sword25/script/luascript.h @@ -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 + * + */ #ifndef SWORD25_LUASCRIPT_H #define SWORD25_LUASCRIPT_H -- cgit v1.2.3 From 2d8e94e4ff71cefb9822732741bc7eb1a9116e07 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 1 Aug 2010 01:49:06 +0000 Subject: SWORD25: Converted Lua interface classes svn-id: r53195 --- engines/sword25/script/luascript.h | 79 ++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 34 deletions(-) (limited to 'engines/sword25/script/luascript.h') diff --git a/engines/sword25/script/luascript.h b/engines/sword25/script/luascript.h index 214d728d07..4d216be413 100644 --- a/engines/sword25/script/luascript.h +++ b/engines/sword25/script/luascript.h @@ -39,6 +39,8 @@ // Includes // ----------------------------------------------------------------------------- +#include "common/str.h" +#include "common/str-array.h" #include "sword25/kernel/common.h" #include "sword25/script/script.h" @@ -46,72 +48,81 @@ // Forward declarations // ----------------------------------------------------------------------------- -class BS_Kernel; +namespace { + struct lua_State; +} + +namespace Sword25 { + +class BS_Kernel; + // ----------------------------------------------------------------------------- // Class declaration // ----------------------------------------------------------------------------- -class BS_LuaScriptEngine : public BS_ScriptEngine -{ +class BS_LuaScriptEngine : public BS_ScriptEngine { public: // ----------------------------------------------------------------------------- - // Konstruktion / Destruktion + // Constructor / Destructor // ----------------------------------------------------------------------------- - BS_LuaScriptEngine(BS_Kernel * KernelPtr); + BS_LuaScriptEngine(BS_Kernel *KernelPtr); virtual ~BS_LuaScriptEngine(); /** - @brief Initialisiert die Scriptengine. - @return Gibt true bei Erfolg zurück, ansonsten false. + * Initialises the scripting engine + * @return Returns true if successful, otherwise false. */ virtual bool Init(); /** - @brief Lädt eine Skriptdatei und führt diese aus. - @param FileName der Dateiname der Skriptdatei - @return Gibt true bei Erfolg zurück, ansonsten false. - */ - virtual bool ExecuteFile(const std::string & FileName); + * Loads a script file and executes it + * @param FileName The filename of the script + * @return Returns true if successful, otherwise false. + */ + virtual bool ExecuteFile(const Common::String &FileName); /** - @brief Führt einen String mit Skriptcode aus. - @param Code ein String der Skriptcode enthält. - @return Gibt true bei Erfolg zurück, ansonsten false. - */ - virtual bool ExecuteString(const std::string & Code); + * Execute a string of script code + * @param Code A string of script code + * @return Returns true if successful, otherwise false. + */ + virtual bool ExecuteString(const Common::String &Code); /** - @brief Gibt einen Pointer auf das Hauptobjekt der Skriptsprache zurück. - @remark Durch die Benutzung dieser Methode wird die Kapselung der Sprache aufgehoben. - */ - virtual void * GetScriptObject() { return m_State; } + * Returns a pointer to the main object of the scripting language + * @remark Using this method breaks the encapsulation of the language + */ + virtual void *GetScriptObject() { return m_State; } /** - @brief Macht die Kommandozeilen-Parameter für die Skriptumgebung zugänglich. - @param CommandLineParameters ein string vector der alle Kommandozeilenparameter enthält. - @remark Auf welche Weise die Kommandozeilen-Parameter durch Skripte zugegriffen werden können hängt von der jeweiligen Implementierung ab. - */ - virtual void SetCommandLine(const std::vector & CommandLineParameters); + * Makes the command line parameters for the scripting environment available + * @param CommandLineParameters An array containing all the command line parameters + * @remark How the command line parameters will be used by scripts is + * dependant on the particular implementation. + */ + virtual void SetCommandLine(const Common::StringArray &CommandLineParameters); /** - @remark Der Lua-Stack wird durch diese Methode geleert. - */ - virtual bool Persist(BS_OutputPersistenceBlock & Writer); + * @remark The Lua stack is cleared by this method + */ + virtual bool Persist(BS_OutputPersistenceBlock &Writer); /** - @remark Der Lua-Stack wird durch diese Methode geleert. - */ - virtual bool Unpersist(BS_InputPersistenceBlock & Reader); + * @remark The Lua stack is cleared by this method + */ + virtual bool Unpersist(BS_InputPersistenceBlock &Reader); private: - lua_State * m_State; + ::lua_State *m_State; int m_PcallErrorhandlerRegistryIndex; bool RegisterStandardLibs(); bool RegisterStandardLibExtensions(); - bool ExecuteBuffer(const char * Data, unsigned int Size, const std::string & Name) const; + bool ExecuteBuffer(const char *Data, unsigned int Size, const Common::String &Name) const; }; +} // End of namespace Sword25 + #endif -- cgit v1.2.3 From 2006e564a1287ff31c2c6acedecf90034e784fd2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 1 Aug 2010 09:31:36 +0000 Subject: SWORD25: Moved the Lua library into it's own namespace Previously with some of the files I was leaving the #include references to the library inside the global namespace. However, since the engine itself is now inside a namespace, I had to do a lot of changes, such as lua_State to ::lua_State. This way is cleaner, and I just need to add a 'using namespace Lua' where needed. svn-id: r53198 --- engines/sword25/script/luascript.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/sword25/script/luascript.h') diff --git a/engines/sword25/script/luascript.h b/engines/sword25/script/luascript.h index 4d216be413..f0a8a9bbdc 100644 --- a/engines/sword25/script/luascript.h +++ b/engines/sword25/script/luascript.h @@ -48,12 +48,14 @@ // Forward declarations // ----------------------------------------------------------------------------- -namespace { +namespace Lua { struct lua_State; } +using namespace Lua; + namespace Sword25 { class BS_Kernel; @@ -115,7 +117,7 @@ public: virtual bool Unpersist(BS_InputPersistenceBlock &Reader); private: - ::lua_State *m_State; + lua_State *m_State; int m_PcallErrorhandlerRegistryIndex; bool RegisterStandardLibs(); -- cgit v1.2.3 From 47904bc7b2992189bb554833f00a79ff0fea9fb8 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 6 Aug 2010 13:13:25 +0000 Subject: SWORD25: Mass-astyle. svn-id: r53222 --- engines/sword25/script/luascript.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'engines/sword25/script/luascript.h') diff --git a/engines/sword25/script/luascript.h b/engines/sword25/script/luascript.h index f0a8a9bbdc..228625a67b 100644 --- a/engines/sword25/script/luascript.h +++ b/engines/sword25/script/luascript.h @@ -23,7 +23,7 @@ * */ -/* +/* * This code is based on Broken Sword 2.5 engine * * Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer @@ -75,44 +75,46 @@ public: /** * Initialises the scripting engine - * @return Returns true if successful, otherwise false. + * @return Returns true if successful, otherwise false. */ virtual bool Init(); /** * Loads a script file and executes it - * @param FileName The filename of the script - * @return Returns true if successful, otherwise false. + * @param FileName The filename of the script + * @return Returns true if successful, otherwise false. */ virtual bool ExecuteFile(const Common::String &FileName); /** * Execute a string of script code - * @param Code A string of script code - * @return Returns true if successful, otherwise false. + * @param Code A string of script code + * @return Returns true if successful, otherwise false. */ virtual bool ExecuteString(const Common::String &Code); /** * Returns a pointer to the main object of the scripting language - * @remark Using this method breaks the encapsulation of the language + * @remark Using this method breaks the encapsulation of the language */ - virtual void *GetScriptObject() { return m_State; } + virtual void *GetScriptObject() { + return m_State; + } /** * Makes the command line parameters for the scripting environment available - * @param CommandLineParameters An array containing all the command line parameters - * @remark How the command line parameters will be used by scripts is + * @param CommandLineParameters An array containing all the command line parameters + * @remark How the command line parameters will be used by scripts is * dependant on the particular implementation. */ virtual void SetCommandLine(const Common::StringArray &CommandLineParameters); /** - * @remark The Lua stack is cleared by this method + * @remark The Lua stack is cleared by this method */ virtual bool Persist(BS_OutputPersistenceBlock &Writer); /** - * @remark The Lua stack is cleared by this method + * @remark The Lua stack is cleared by this method */ virtual bool Unpersist(BS_InputPersistenceBlock &Reader); -- cgit v1.2.3 From a1d22a063b2a9de47cf3f23cac1cd73777eea321 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 16 Aug 2010 20:23:53 +0000 Subject: SWORD25: Fix warnings svn-id: r53254 --- engines/sword25/script/luascript.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/sword25/script/luascript.h') diff --git a/engines/sword25/script/luascript.h b/engines/sword25/script/luascript.h index 228625a67b..39fa9ebec4 100644 --- a/engines/sword25/script/luascript.h +++ b/engines/sword25/script/luascript.h @@ -124,7 +124,7 @@ private: bool RegisterStandardLibs(); bool RegisterStandardLibExtensions(); - bool ExecuteBuffer(const char *Data, unsigned int Size, const Common::String &Name) const; + bool ExecuteBuffer(const byte *Data, unsigned int Size, const Common::String &Name) const; }; } // End of namespace Sword25 -- 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/script/luascript.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/sword25/script/luascript.h') 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 -- 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/script/luascript.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/sword25/script/luascript.h') diff --git a/engines/sword25/script/luascript.h b/engines/sword25/script/luascript.h index f7cc152f3f..31038b97e9 100644 --- a/engines/sword25/script/luascript.h +++ b/engines/sword25/script/luascript.h @@ -58,7 +58,7 @@ using namespace Lua; namespace Sword25 { -class BS_Kernel; +class Kernel; // ----------------------------------------------------------------------------- // Class declaration @@ -70,7 +70,7 @@ public: // Constructor / Destructor // ----------------------------------------------------------------------------- - LuaScriptEngine(BS_Kernel *KernelPtr); + LuaScriptEngine(Kernel *KernelPtr); virtual ~LuaScriptEngine(); /** @@ -112,11 +112,11 @@ public: /** * @remark The Lua stack is cleared by this method */ - virtual bool Persist(BS_OutputPersistenceBlock &Writer); + virtual bool Persist(OutputPersistenceBlock &Writer); /** * @remark The Lua stack is cleared by this method */ - virtual bool Unpersist(BS_InputPersistenceBlock &Reader); + virtual bool Unpersist(InputPersistenceBlock &Reader); private: lua_State *m_State; -- 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/script/luascript.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/sword25/script/luascript.h') diff --git a/engines/sword25/script/luascript.h b/engines/sword25/script/luascript.h index 31038b97e9..f2773eef06 100644 --- a/engines/sword25/script/luascript.h +++ b/engines/sword25/script/luascript.h @@ -124,7 +124,7 @@ private: bool RegisterStandardLibs(); bool RegisterStandardLibExtensions(); - bool ExecuteBuffer(const byte *Data, unsigned int Size, const Common::String &Name) const; + bool ExecuteBuffer(const byte *Data, uint Size, const Common::String &Name) const; }; } // End of namespace Sword25 -- cgit v1.2.3 From 06bce68860696f67f0a0ac1e9682635081918801 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 2 Sep 2010 17:11:45 +0000 Subject: SWORD25: Comply to the code conventions for several classes svn-id: r53310 --- engines/sword25/script/luascript.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/sword25/script/luascript.h') diff --git a/engines/sword25/script/luascript.h b/engines/sword25/script/luascript.h index f2773eef06..831a994ea2 100644 --- a/engines/sword25/script/luascript.h +++ b/engines/sword25/script/luascript.h @@ -112,11 +112,11 @@ public: /** * @remark The Lua stack is cleared by this method */ - virtual bool Persist(OutputPersistenceBlock &Writer); + virtual bool persist(OutputPersistenceBlock &writer); /** * @remark The Lua stack is cleared by this method */ - virtual bool Unpersist(InputPersistenceBlock &Reader); + virtual bool unpersist(InputPersistenceBlock &reader); private: lua_State *m_State; -- 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/script/luascript.h | 38 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) (limited to 'engines/sword25/script/luascript.h') diff --git a/engines/sword25/script/luascript.h b/engines/sword25/script/luascript.h index 831a994ea2..f557ae45f1 100644 --- a/engines/sword25/script/luascript.h +++ b/engines/sword25/script/luascript.h @@ -35,19 +35,11 @@ #ifndef SWORD25_LUASCRIPT_H #define SWORD25_LUASCRIPT_H -// ----------------------------------------------------------------------------- -// Includes -// ----------------------------------------------------------------------------- - #include "common/str.h" #include "common/str-array.h" #include "sword25/kernel/common.h" #include "sword25/script/script.h" -// ----------------------------------------------------------------------------- -// Forward declarations -// ----------------------------------------------------------------------------- - namespace Lua { struct lua_State; @@ -60,16 +52,8 @@ namespace Sword25 { class Kernel; -// ----------------------------------------------------------------------------- -// Class declaration -// ----------------------------------------------------------------------------- - class LuaScriptEngine : public ScriptEngine { public: - // ----------------------------------------------------------------------------- - // Constructor / Destructor - // ----------------------------------------------------------------------------- - LuaScriptEngine(Kernel *KernelPtr); virtual ~LuaScriptEngine(); @@ -77,28 +61,28 @@ public: * Initialises the scripting engine * @return Returns true if successful, otherwise false. */ - virtual bool Init(); + virtual bool init(); /** * Loads a script file and executes it * @param FileName The filename of the script * @return Returns true if successful, otherwise false. */ - virtual bool ExecuteFile(const Common::String &FileName); + virtual bool executeFile(const Common::String &fileName); /** * Execute a string of script code * @param Code A string of script code * @return Returns true if successful, otherwise false. */ - virtual bool ExecuteString(const Common::String &Code); + virtual bool executeString(const Common::String &code); /** * Returns a pointer to the main object of the scripting language * @remark Using this method breaks the encapsulation of the language */ - virtual void *GetScriptObject() { - return m_State; + virtual void *getScriptObject() { + return _state; } /** @@ -107,7 +91,7 @@ public: * @remark How the command line parameters will be used by scripts is * dependant on the particular implementation. */ - virtual void SetCommandLine(const Common::StringArray &CommandLineParameters); + virtual void setCommandLine(const Common::StringArray &commandLineParameters); /** * @remark The Lua stack is cleared by this method @@ -119,12 +103,12 @@ public: virtual bool unpersist(InputPersistenceBlock &reader); private: - lua_State *m_State; - int m_PcallErrorhandlerRegistryIndex; + lua_State *_state; + int _pcallErrorhandlerRegistryIndex; - bool RegisterStandardLibs(); - bool RegisterStandardLibExtensions(); - bool ExecuteBuffer(const byte *Data, uint Size, const Common::String &Name) const; + bool registerStandardLibs(); + bool registerStandardLibExtensions(); + bool executeBuffer(const byte *data, uint size, const Common::String &name) const; }; } // End of namespace Sword25 -- cgit v1.2.3