Browse Source

Added methods to ScriptController to query global variables.
isNil, isNumber, isString...

Darryl Gough 13 years ago
parent
commit
019713776b

+ 1 - 1
gameplay-encoder/src/Scene.h

@@ -59,7 +59,7 @@ private:
 
     /**
      * Recursively calculates the ambient color of the scene starting at the given node.
-     * The ambient light color is added to the givne float array.
+     * The ambient light color is added to the given float array.
      * 
      * @param node The node in this scene to traverse from.
      * @param values Pointer to 3 floats that contains the calculated ambient color.

+ 4 - 0
gameplay/src/FileSystem.h

@@ -15,6 +15,10 @@ class FileSystem
 {
 public:
 
+    /**
+     * Mode flags for opening a stream.
+     * @script{ignore}
+     */
     enum StreamMode
     {
         READ = 1,

+ 93 - 23
gameplay/src/ScriptController.cpp

@@ -372,90 +372,154 @@ std::string ScriptController::loadUrl(const char* url)
     return id;
 }
 
-bool ScriptController::getBool(const char* name)
+bool ScriptController::isNil(const char* name)
 {
     lua_getglobal(_lua, name);
-    bool b = ScriptUtil::luaCheckBool(_lua, -1);
+    bool b = lua_isnil(_lua, -1) != 0;
     lua_pop(_lua, 1);
     return b;
 }
 
-char ScriptController::getChar(const char* name)
+bool ScriptController::isBool(const char* name)
 {
     lua_getglobal(_lua, name);
-    char c = (char)luaL_checkint(_lua, -1);
+    bool b = lua_isboolean(_lua, -1) != 0;
+    lua_pop(_lua, 1);
+    return b;
+}
+
+bool ScriptController::isNumber(const char* name)
+{
+    lua_getglobal(_lua, name);
+    bool b = lua_isnumber(_lua, -1) != 0;
+    lua_pop(_lua, 1);
+    return b;
+}
+
+bool ScriptController::isString(const char* name)
+{
+    lua_getglobal(_lua, name);
+    bool b = lua_isstring(_lua, -1) != 0;
+    lua_pop(_lua, 1);
+    return b;
+}
+
+bool ScriptController::isTable(const char* name)
+{
+    lua_getglobal(_lua, name);
+    bool b = lua_istable(_lua, -1) != 0;
+    lua_pop(_lua, 1);
+    return b;
+}
+
+bool ScriptController::isThread(const char* name)
+{
+    lua_getglobal(_lua, name);
+    bool b = lua_isthread(_lua, -1) != 0;
+    lua_pop(_lua, 1);
+    return b;
+}
+
+bool ScriptController::isUserData(const char* name)
+{
+    lua_getglobal(_lua, name);
+    bool b = lua_isuserdata(_lua, -1) != 0;
+    lua_pop(_lua, 1);
+    return b;
+}
+
+bool ScriptController::isFunction(const char* name)
+{
+    lua_getglobal(_lua, name);
+    bool b = lua_isfunction(_lua, -1) != 0;
+    lua_pop(_lua, 1);
+    return b;
+}
+
+bool ScriptController::getBool(const char* name, bool defaultValue)
+{
+    lua_getglobal(_lua, name);
+    bool b = lua_isboolean(_lua, -1) ? ScriptUtil::luaCheckBool(_lua, -1) : defaultValue;
+    lua_pop(_lua, 1);
+    return b;
+}
+
+char ScriptController::getChar(const char* name, char defaultValue)
+{
+    lua_getglobal(_lua, name);
+    char c = lua_isnumber(_lua, -1) ?  (char)luaL_checkint(_lua, -1) : defaultValue;
     lua_pop(_lua, 1);
     return c;
 }
 
-short ScriptController::getShort(const char* name)
+short ScriptController::getShort(const char* name, short defaultValue)
 {
     lua_getglobal(_lua, name);
-    short n = (short)luaL_checkint(_lua, -1);
+    short n = lua_isnumber(_lua, -1) ? (short)luaL_checkint(_lua, -1) : defaultValue;
     lua_pop(_lua, 1);
     return n;
 }
 
-int ScriptController::getInt(const char* name)
+int ScriptController::getInt(const char* name, int defaultValue)
 {
     lua_getglobal(_lua, name);
-    int n = luaL_checkint(_lua, -1);
+    int n = lua_isnumber(_lua, -1) ? luaL_checkint(_lua, -1) : defaultValue;
     lua_pop(_lua, 1);
     return n;
 }
 
-long ScriptController::getLong(const char* name)
+long ScriptController::getLong(const char* name, long defaultValue)
 {
     lua_getglobal(_lua, name);
-    long n = luaL_checklong(_lua, -1);
+    long n = lua_isnumber(_lua, -1) ? luaL_checklong(_lua, -1) : defaultValue;
     lua_pop(_lua, 1);
     return n;
 }
 
-unsigned char ScriptController::getUnsignedChar(const char* name)
+unsigned char ScriptController::getUnsignedChar(const char* name, unsigned char defaultValue)
 {
     lua_getglobal(_lua, name);
-    unsigned char c = (unsigned char)luaL_checkunsigned(_lua, -1);
+    unsigned char c = lua_isnumber(_lua, -1) ? (unsigned char)luaL_checkunsigned(_lua, -1) : defaultValue;
     lua_pop(_lua, 1);
     return c;
 }
 
-unsigned short ScriptController::getUnsignedShort(const char* name)
+unsigned short ScriptController::getUnsignedShort(const char* name, unsigned short defaultValue)
 {
     lua_getglobal(_lua, name);
-    unsigned short n = (unsigned short)luaL_checkunsigned(_lua, -1);
+    unsigned short n = lua_isnumber(_lua, -1) ? (unsigned short)luaL_checkunsigned(_lua, -1) : defaultValue;
     lua_pop(_lua, 1);
     return n;
 }
 
-unsigned int ScriptController::getUnsignedInt(const char* name)
+unsigned int ScriptController::getUnsignedInt(const char* name, unsigned int defaultValue)
 {
     lua_getglobal(_lua, name);
-    unsigned int n = (unsigned int)luaL_checkunsigned(_lua, -1);
+    unsigned int n = lua_isnumber(_lua, -1) ? (unsigned int)luaL_checkunsigned(_lua, -1) : defaultValue;
     lua_pop(_lua, 1);
     return n;
 }
 
-unsigned long ScriptController::getUnsignedLong(const char* name)
+unsigned long ScriptController::getUnsignedLong(const char* name, unsigned long defaultValue)
 {
     lua_getglobal(_lua, name);
-    unsigned long n = (unsigned long)luaL_checkunsigned(_lua, -1);
+    unsigned long n = lua_isnumber(_lua, -1) ? (unsigned long)luaL_checkunsigned(_lua, -1) : defaultValue;
     lua_pop(_lua, 1);
     return n;
 }
 
-float ScriptController::getFloat(const char* name)
+float ScriptController::getFloat(const char* name, float defaultValue)
 {
     lua_getglobal(_lua, name);
-    float f = (float)luaL_checknumber(_lua, -1);
+    float f = lua_isnumber(_lua, -1) ? (float)luaL_checknumber(_lua, -1) : defaultValue;
     lua_pop(_lua, 1);
     return f;
 }
 
-double ScriptController::getDouble(const char* name)
+double ScriptController::getDouble(const char* name, double defaultValue)
 {
     lua_getglobal(_lua, name);
-    double n = (double)luaL_checknumber(_lua, -1);
+    double n = lua_isnumber(_lua, -1) ? (double)luaL_checknumber(_lua, -1) : defaultValue;
     lua_pop(_lua, 1);
     return n;
 }
@@ -463,11 +527,17 @@ double ScriptController::getDouble(const char* name)
 const char* ScriptController::getString(const char* name)
 {
     lua_getglobal(_lua, name);
-    const char* s = luaL_checkstring(_lua, -1);
+    const char* s = lua_isstring(_lua, -1) ? luaL_checkstring(_lua, -1) : NULL;
     lua_pop(_lua, 1);
     return s;
 }
 
+void ScriptController::setNil(const char* name)
+{
+    lua_pushnil(_lua);
+    lua_setglobal(_lua, name);
+}
+
 void ScriptController::setBool(const char* name, bool v)
 {
     lua_pushboolean(_lua, v);

+ 201 - 14
gameplay/src/ScriptController.h

@@ -19,6 +19,7 @@ namespace ScriptUtil
 
 /**
  * Represents a C++ object from within Lua.
+ * 
  * @script{ignore}
  */
 struct LuaObject
@@ -32,6 +33,7 @@ struct LuaObject
 /**
  * Stores a Lua parameter of an array/pointer type that is passed from Lua to C.
  * Handles automatic cleanup of any temporary memory associated with the array.
+ * 
  * @script{ignore}
  */
 template <typename T>
@@ -102,6 +104,7 @@ private:
  * 
  * @param name The name of the library from within Lua.
  * @param functions The library function mapping (Lua function names to C++ functions).
+ * 
  * @script{ignore}
  */
 void registerLibrary(const char* name, const luaL_Reg* functions);
@@ -112,6 +115,7 @@ void registerLibrary(const char* name, const luaL_Reg* functions);
  * @param name The name of the constant (what the user would use from Lua).
  * @param value The constant's value.
  * @param scopePath The list of containing classes, going inward from the most outer class.
+ * 
  * @script{ignore}
  */
 void registerConstantBool(const std::string& name, bool value, const std::vector<std::string>& scopePath);
@@ -122,6 +126,7 @@ void registerConstantBool(const std::string& name, bool value, const std::vector
  * @param name The name of the constant (what the user would use from Lua).
  * @param value The constant's value.
  * @param scopePath The list of containing classes, going inward from the most outer class.
+ * 
  * @script{ignore}
  */
 void registerConstantNumber(const std::string& name, double value, const std::vector<std::string>& scopePath);
@@ -132,6 +137,7 @@ void registerConstantNumber(const std::string& name, double value, const std::ve
  * @param name The name of the constant (what the user would use from Lua).
  * @param value The constant's value.
  * @param scopePath The list of containing classes, going inward from the most outer class.
+ * 
  * @script{ignore}
  */
 void registerConstantString(const std::string& name, const std::string& value, const std::vector<std::string>& scopePath);
@@ -145,6 +151,7 @@ void registerConstantString(const std::string& name, const std::string& value, c
  * @param deleteFunction The function to call that destroys an instance of the class.
  * @param statics The library function mapping for all the static functions (Lua function names to C++ functions).
  * @param scopePath For an inner class, this is a list of its containing classes, going inward from the most outer class.
+ * 
  * @script{ignore}
  */
 void registerClass(const char* name, const luaL_Reg* members, lua_CFunction newFunction, lua_CFunction deleteFunction, const luaL_Reg* statics,
@@ -155,6 +162,7 @@ void registerClass(const char* name, const luaL_Reg* members, lua_CFunction newF
  * 
  * @param luaFunction The name of the function from within Lua.
  * @param cppFunction The C++ function pointer.
+ * 
  * @script{ignore}
  */
 void registerFunction(const char* luaFunction, lua_CFunction cppFunction);
@@ -164,6 +172,7 @@ void registerFunction(const char* luaFunction, lua_CFunction cppFunction);
  * 
  * @param base The base class of the inheritance pair.
  * @param derived The derived class of the inheritance pair.
+ * 
  * @script{ignore}
  */
 void setGlobalHierarchyPair(const std::string& base, const std::string& derived);
@@ -172,6 +181,7 @@ void setGlobalHierarchyPair(const std::string& base, const std::string& derived)
  * Adds the given function as a string-from-enumerated value conversion function.
  * 
  * @param stringFromEnum The pointer to the string-from-enum conversion function.
+ * 
  * @script{ignore}
  */
 void addStringFromEnumConversionFunction(luaStringEnumConversionFunction stringFromEnum);
@@ -180,7 +190,9 @@ void addStringFromEnumConversionFunction(luaStringEnumConversionFunction stringF
  * Gets a pointer to a bool (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index.
  * 
  * @param index The stack index.
+ * 
  * @return The pointer.
+ * 
  * @script{ignore}
  */
 LuaArray<bool> getBoolPointer(int index);
@@ -189,7 +201,9 @@ LuaArray<bool> getBoolPointer(int index);
  * Gets a pointer to a short (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index.
  * 
  * @param index The stack index.
+ * 
  * @return The pointer.
+ * 
  * @script{ignore}
  */
 LuaArray<short> getShortPointer(int index);
@@ -198,7 +212,9 @@ LuaArray<short> getShortPointer(int index);
  * Gets a pointer to an int (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index.
  * 
  * @param index The stack index.
+ * 
  * @return The pointer.
+ * 
  * @script{ignore}
  */
 LuaArray<int> getIntPointer(int index);
@@ -207,7 +223,9 @@ LuaArray<int> getIntPointer(int index);
  * Gets a pointer to a long (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index.
  * 
  * @param index The stack index.
+ * 
  * @return The pointer.
+ * 
  * @script{ignore}
  */
 LuaArray<long> getLongPointer(int index);
@@ -216,7 +234,9 @@ LuaArray<long> getLongPointer(int index);
  * Gets a pointer to an unsigned char (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index.
  * 
  * @param index The stack index.
+ * 
  * @return The pointer.
+ * 
  * @script{ignore}
  */
 LuaArray<unsigned char> getUnsignedCharPointer(int index);
@@ -225,7 +245,9 @@ LuaArray<unsigned char> getUnsignedCharPointer(int index);
  * Gets a pointer to an unsigned short (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index.
  * 
  * @param index The stack index.
+ * 
  * @return The pointer.
+ * 
  * @script{ignore}
  */
 LuaArray<unsigned short> getUnsignedShortPointer(int index);
@@ -234,7 +256,9 @@ LuaArray<unsigned short> getUnsignedShortPointer(int index);
  * Gets a pointer to an unsigned int (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index.
  * 
  * @param index The stack index.
+ * 
  * @return The pointer.
+ * 
  * @script{ignore}
  */
 LuaArray<unsigned int> getUnsignedIntPointer(int index);
@@ -243,7 +267,9 @@ LuaArray<unsigned int> getUnsignedIntPointer(int index);
  * Gets a pointer to an unsigned long (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index.
  * 
  * @param index The stack index.
+ * 
  * @return The pointer.
+ * 
  * @script{ignore}
  */
 LuaArray<unsigned long> getUnsignedLongPointer(int index);
@@ -252,7 +278,9 @@ LuaArray<unsigned long> getUnsignedLongPointer(int index);
  * Gets a pointer to a float (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index.
  * 
  * @param index The stack index.
+ * 
  * @return The pointer.
+ * 
  * @script{ignore}
  */
 LuaArray<float> getFloatPointer(int index);
@@ -261,7 +289,9 @@ LuaArray<float> getFloatPointer(int index);
  * Gets a pointer to a double (as an array-use SAFE_DELETE_ARRAY to clean up) for the given stack index.
  * 
  * @param index The stack index.
+ * 
  * @return The pointer.
+ * 
  * @script{ignore}
  */
 LuaArray<double> getDoublePointer(int index);
@@ -275,8 +305,10 @@ LuaArray<double> getDoublePointer(int index);
  *      are retrieving is actually a reference or by-value parameter).
  * @param success An out parameter that is set to true if the Lua parameter was successfully
  *      converted to a valid object, or false if it was unable to perform a valid conversion.
+ * 
  * @return The object pointer or <code>NULL</code> if the data at the stack index
  *      is not an object or if the object is not derived from the given type.
+ * 
  * @script{ignore}
  */
 template <typename T>
@@ -287,7 +319,9 @@ LuaArray<T> getObjectPointer(int index, const char* type, bool nonNull, bool* su
  * 
  * @param index The stack index.
  * @param isStdString Whether the string being retrieved is a std::string object or not.
+ * 
  * @return The string or <code>NULL</code>.
+ * 
  * @script{ignore}
  */
 const char* getString(int index, bool isStdString);
@@ -297,14 +331,15 @@ const char* getString(int index, bool isStdString);
  * 
  * @param state The Lua state.
  * @param n The stack index.
+ * 
  * @return The boolean (if successful; otherwise it logs an error).
+ * 
  * @script{ignore}
  */
 bool luaCheckBool(lua_State* state, int n);
 
 }
 
-
 /**
  * Controls and manages all scripts.
  */
@@ -326,6 +361,7 @@ public:
      * Given a URL, loads the referenced file and returns the referenced function name.
      * 
      * @param url The url to load.
+     * 
      * @return The function that the URL references.
      */
     std::string loadUrl(const char* url);
@@ -334,6 +370,7 @@ public:
      * Calls the specified no-parameter Lua function.
      * 
      * @param func The name of the function to call.
+     * 
      * @return The return value of the executed Lua function.
      */
     template<typename T> T executeFunction(const char* func);
@@ -358,6 +395,7 @@ public:
      *      - 'p' - pointer
      *      - '<object-type>' - a <b>pointer</b> to an object of the given type (where the qualified type name is enclosed by angle brackets).
      *      - '[enum-type]' - an enumerated value of the given type (where the qualified type name is enclosed by square brackets).
+     * 
      * @return The return value of the executed Lua function.
      */
     template<typename T> T executeFunction(const char* func, const char* args, ...);
@@ -383,114 +421,238 @@ public:
      *      - '<object-type>' - a <b>pointer</b> to an object of the given type (where the qualified type name is enclosed by angle brackets).
      *      - '[enum-type]' - an enumerated value of the given type (where the qualified type name is enclosed by square brackets).
      * @param list The variable argument list containing the function's parameters.
+     * 
      * @return The return value of the executed Lua function.
      */
     template<typename T> T executeFunction(const char* func, const char* args, va_list* list);
 
+    /**
+     * Returns true if the global variable is nil.
+     * 
+     * @param name The name of the global variable.
+     * 
+     * @return True if the global variable is nil, false otherwise.
+     * 
+     * @script{ignore}
+     */
+    bool isNil(const char* name);
+
+    /**
+     * Returns true if the global variable is a boolean.
+     * 
+     * @param name The name of the global variable.
+     * 
+     * @return True if the global variable is a boolean, false otherwise.
+     * 
+     * @script{ignore}
+     */
+    bool isBool(const char* name);
+
+    /**
+     * Returns true if the global variable is a number.
+     * 
+     * @param name The name of the global variable.
+     * 
+     * @return Returns true if the global variable is a number, false otherwise.
+     * 
+     * @script{ignore}
+     */
+    bool isNumber(const char* name);
+
+    /**
+     * Returns true if the global variable is a string.
+     * 
+     * @param name The name of the global variable.
+     * 
+     * @return Returns true if the global variable is a string, false otherwise.
+     * 
+     * @script{ignore}
+     */
+    bool isString(const char* name);
+
+    /**
+     * Returns true if the global variable is a table.
+     * 
+     * @param name The name of the global variable.
+     * 
+     * @return Returns true if the global variable is a table, false otherwise.
+     * 
+     * @script{ignore}
+     */
+    bool isTable(const char* name);
+
+    /**
+     * Returns true if the global variable is a thread.
+     * 
+     * @param name The name of the global variable.
+     * 
+     * @return Returns true if the global variable is a thread, false otherwise.
+     * 
+     * @script{ignore}
+     */
+    bool isThread(const char* name);
+
+    /**
+     * Returns true if the global variable is a userdata.
+     * 
+     * @param name The name of the global variable.
+     * 
+     * @return Returns true if the global variable is a userdata, false otherwise.
+     * 
+     * @script{ignore}
+     */
+    bool isUserData(const char* name);
+
+    /**
+     * Returns true if the global variable is a function.
+     * 
+     * @param name The name of the global variable.
+     * 
+     * @return Returns true if the global variable is a function, false otherwise.
+     * 
+     * @script{ignore}
+     */
+    bool isFunction(const char* name);
+
     /**
      * Gets the global boolean script variable with the given name.
      * 
      * @param name The name of the variable.
+     * @param defaultValue The default value to return if the variable is not a bool.
+     * 
      * @return The global boolean script variable.
+     * 
      * @script{ignore}
      */
-    bool getBool(const char* name);
+    bool getBool(const char* name, bool defaultValue = false);
 
     /**
      * Gets the global char script variable with the given name.
      * 
      * @param name The name of the variable.
+     * @param defaultValue The default value to return if the variable is not a number.
+     * 
      * @return The global char script variable.
+     * 
      * @script{ignore}
      */
-    char getChar(const char* name);
+    char getChar(const char* name, char defaultValue = 0);
 
     /**
      * Gets the global short script variable with the given name.
      * 
      * @param name The name of the variable.
+     * @param defaultValue The default value to return if the variable is not a number.
+     * 
      * @return The global short script variable.
+     * 
      * @script{ignore}
      */
-    short getShort(const char* name);
+    short getShort(const char* name, short defaultValue = 0);
 
     /**
      * Gets the global int script variable with the given name.
      * 
      * @param name The name of the variable.
+     * @param defaultValue The default value to return if the variable is not a number.
+     * 
      * @return The global int script variable.
+     * 
      * @script{ignore}
      */
-    int getInt(const char* name);
+    int getInt(const char* name, int defaultValue = 0);
 
     /**
      * Gets the global long script variable with the given name.
      * 
      * @param name The name of the variable.
+     * @param defaultValue The default value to return if the variable is not a number.
+     * 
      * @return The global long script variable.
+     * 
      * @script{ignore}
      */
-    long getLong(const char* name);
+    long getLong(const char* name, long defaultValue = 0);
 
     /**
      * Gets the global unsigned char script variable with the given name.
      * 
      * @param name The name of the variable.
+     * @param defaultValue The default value to return if the variable is not a number.
+     * 
      * @return The global unsigned char script variable.
+     * 
      * @script{ignore}
      */
-    unsigned char getUnsignedChar(const char* name);
+    unsigned char getUnsignedChar(const char* name, unsigned char defaultValue = 0);
 
     /**
      * Gets the global unsigned short script variable with the given name.
      * 
      * @param name The name of the variable.
+     * @param defaultValue The default value to return if the variable is not a number.
+     * 
      * @return The global unsigned short script variable.
+     * 
      * @script{ignore}
      */
-    unsigned short getUnsignedShort(const char* name);
+    unsigned short getUnsignedShort(const char* name, unsigned short defaultValue = 0);
 
     /**
      * Gets the global unsigned int script variable with the given name.
      * 
      * @param name The name of the variable.
+     * @param defaultValue The default value to return if the variable is not a number.
+     * 
      * @return The global unsigned int script variable.
+     * 
      * @script{ignore}
      */
-    unsigned int getUnsignedInt(const char* name);
+    unsigned int getUnsignedInt(const char* name, unsigned int defaultValue = 0);
 
     /**
      * Gets the global unsigned long script variable with the given name.
      * 
      * @param name The name of the variable.
+     * @param defaultValue The default value to return if the variable is not a number.
+     * 
      * @return The global unsigned long script variable.
+     * 
      * @script{ignore}
      */
-    unsigned long getUnsignedLong(const char* name);
+    unsigned long getUnsignedLong(const char* name, unsigned long defaultValue = 0);
 
     /**
      * Gets the global float script variable with the given name.
      * 
      * @param name The name of the variable.
+     * @param defaultValue The default value to return if the variable is not a number.
+     * 
      * @return The global float script variable.
+     * 
      * @script{ignore}
      */
-    float getFloat(const char* name);
+    float getFloat(const char* name, float defaultValue = 0);
 
     /**
      * Gets the global double script variable with the given name.
      * 
      * @param name The name of the variable.
+     * @param defaultValue The default value to return if the variable is not a number.
+     * 
      * @return The global double script variable.
+     * 
      * @script{ignore}
      */
-    double getDouble(const char* name);
+    double getDouble(const char* name, double defaultValue = 0);
 
     /**
-     * Gets the global string script variable with the given name.
+     * Gets the global string variable with the given name.
      * 
      * @param name The name of the variable.
-     * @return The global string script variable.
+     * 
+     * @return The string variable or NULL if the variable is not a string.
+     * 
      * @script{ignore}
      */
     const char* getString(const char* name);
@@ -500,16 +662,28 @@ public:
      * 
      * @param type The type of the variable in Lua.
      * @param name The name of the variable.
+     * 
      * @return The global pointer script variable.
+     * 
      * @script{ignore}
      */
     template<typename T>T* getObjectPointer(const char* type, const char* name);
 
+    /**
+     * Sets the global variable to nil.
+     * 
+     * @param name The name of the global variable.
+     * 
+     * @script{ignore}
+     */
+    void setNil(const char* name);
+
     /**
      * Sets the global boolean script variable with the given name to the given value.
      * 
      * @param name The name of the script variable.
      * @param v The boolean value.
+     * 
      * @script{ignore}
      */
     void setBool(const char* name, bool v);
@@ -519,6 +693,7 @@ public:
      * 
      * @param name The name of the script variable.
      * @param v The char value.
+     * 
      * @script{ignore}
      */
     void setChar(const char* name, char v);
@@ -528,6 +703,7 @@ public:
      * 
      * @param name The name of the script variable.
      * @param v The short value.
+     * 
      * @script{ignore}
      */
     void setShort(const char* name, short v);
@@ -537,6 +713,7 @@ public:
      * 
      * @param name The name of the script variable.
      * @param v The int value.
+     * 
      * @script{ignore}
      */
     void setInt(const char* name, int v);
@@ -546,6 +723,7 @@ public:
      * 
      * @param name The name of the script variable.
      * @param v The long value.
+     * 
      * @script{ignore}
      */
     void setLong(const char* name, long v);
@@ -555,6 +733,7 @@ public:
      * 
      * @param name The name of the script variable.
      * @param v The unsigned char value.
+     * 
      * @script{ignore}
      */
     void setUnsignedChar(const char* name, unsigned char v);
@@ -564,6 +743,7 @@ public:
      * 
      * @param name The name of the script variable.
      * @param v The unsigned short value.
+     * 
      * @script{ignore}
      */
     void setUnsignedShort(const char* name, unsigned short v);
@@ -573,6 +753,7 @@ public:
      * 
      * @param name The name of the script variable.
      * @param v The unsigned int value.
+     * 
      * @script{ignore}
      */
     void setUnsignedInt(const char* name, unsigned int v);
@@ -582,6 +763,7 @@ public:
      * 
      * @param name The name of the script variable.
      * @param v The unsigned long value.
+     * 
      * @script{ignore}
      */
     void setUnsignedLong(const char* name, unsigned long v);
@@ -591,6 +773,7 @@ public:
      * 
      * @param name The name of the script variable.
      * @param v The float value.
+     * 
      * @script{ignore}
      */
     void setFloat(const char* name, float v);
@@ -600,6 +783,7 @@ public:
      * 
      * @param name The name of the script variable.
      * @param v The double value.
+     * 
      * @script{ignore}
      */
     void setDouble(const char* name, double v);
@@ -609,6 +793,7 @@ public:
      * 
      * @param name The name of the script variable.
      * @param v The string value.
+     * 
      * @script{ignore}
      */
     void setString(const char* name, const char* v);
@@ -619,6 +804,7 @@ public:
      * @param type The type of the script variable.
      * @param name The name of the variable.
      * @param v The pointer value.
+     * 
      * @script{ignore}
      */
     template<typename T>void setObjectPointer(const char* type, const char* name, T* v);
@@ -790,6 +976,7 @@ private:
      * or to ScriptController::INVALID_CALLBACK if there is no valid conversion.
      * 
      * @param name The name of the callback.
+     * 
      * @return The corresponding callback enumeration value.
      */
     static ScriptController::ScriptCallback toCallback(const char* name);

+ 1 - 0
gameplay/src/lua/lua_FileSystem.cpp

@@ -4,6 +4,7 @@
 #include "Base.h"
 #include "FileSystem.h"
 #include "Properties.h"
+#include "Stream.h"
 
 namespace gameplay
 {