瀏覽代碼

Added needed @script{ignore} tags to appropriate functions in gameplay.
Added code to gameplay-luagen that cleans the output directory of all .cpp and .h files before generating new ones.

Chris Culy 13 年之前
父節點
當前提交
fd383c8a9d
共有 68 個文件被更改,包括 189 次插入225 次删除
  1. 5 6
      gameplay-luagen/README.md
  2. 24 2
      gameplay-luagen/gameplay-luagen.vcxproj
  3. 2 0
      gameplay-luagen/gameplay-luagen.vcxproj.user
  4. 41 17
      gameplay-luagen/src/Generator.cpp
  5. 1 0
      gameplay-luagen/src/Generator.h
  6. 2 0
      gameplay/src/AudioSource.h
  7. 5 0
      gameplay/src/Bundle.h
  8. 1 0
      gameplay/src/CheckBox.h
  9. 1 0
      gameplay/src/Container.h
  10. 1 0
      gameplay/src/Curve.h
  11. 1 0
      gameplay/src/DepthStencilTarget.h
  12. 2 0
      gameplay/src/Font.h
  13. 2 0
      gameplay/src/Form.h
  14. 1 0
      gameplay/src/FrameBuffer.h
  15. 1 0
      gameplay/src/Image.h
  16. 1 0
      gameplay/src/Joystick.h
  17. 1 0
      gameplay/src/Label.h
  18. 4 0
      gameplay/src/Material.h
  19. 2 0
      gameplay/src/MeshBatch.h
  20. 1 0
      gameplay/src/Model.h
  21. 1 0
      gameplay/src/Node.h
  22. 3 0
      gameplay/src/ParticleEmitter.h
  23. 1 0
      gameplay/src/Properties.h
  24. 1 0
      gameplay/src/RadioButton.h
  25. 1 0
      gameplay/src/RenderState.h
  26. 1 0
      gameplay/src/RenderTarget.h
  27. 1 0
      gameplay/src/SceneLoader.h
  28. 1 0
      gameplay/src/Slider.h
  29. 2 0
      gameplay/src/SpriteBatch.h
  30. 1 0
      gameplay/src/TextBox.h
  31. 5 0
      gameplay/src/Texture.h
  32. 1 0
      gameplay/src/Theme.h
  33. 1 0
      gameplay/src/VertexAttributeBinding.h
  34. 1 0
      gameplay/src/VerticalLayout.h
  35. 2 2
      gameplay/src/lua/lua_AudioSource.cpp
  36. 6 6
      gameplay/src/lua/lua_Bundle.cpp
  37. 1 1
      gameplay/src/lua/lua_CheckBox.cpp
  38. 2 2
      gameplay/src/lua/lua_Container.cpp
  39. 1 1
      gameplay/src/lua/lua_Curve.cpp
  40. 1 1
      gameplay/src/lua/lua_DepthStencilTarget.cpp
  41. 3 3
      gameplay/src/lua/lua_Font.cpp
  42. 3 3
      gameplay/src/lua/lua_Form.cpp
  43. 1 1
      gameplay/src/lua/lua_FrameBuffer.cpp
  44. 5 10
      gameplay/src/lua/lua_Global.cpp
  45. 1 1
      gameplay/src/lua/lua_Image.cpp
  46. 1 1
      gameplay/src/lua/lua_Joystick.cpp
  47. 1 1
      gameplay/src/lua/lua_Label.cpp
  48. 5 5
      gameplay/src/lua/lua_Material.cpp
  49. 6 6
      gameplay/src/lua/lua_MeshBatch.cpp
  50. 1 1
      gameplay/src/lua/lua_Model.cpp
  51. 2 2
      gameplay/src/lua/lua_Node.cpp
  52. 3 3
      gameplay/src/lua/lua_ParticleEmitter.cpp
  53. 1 1
      gameplay/src/lua/lua_Properties.cpp
  54. 1 1
      gameplay/src/lua/lua_RadioButton.cpp
  55. 1 1
      gameplay/src/lua/lua_RenderStateStateBlock.cpp
  56. 1 1
      gameplay/src/lua/lua_RenderTarget.cpp
  57. 0 109
      gameplay/src/lua/lua_SceneLoader.cpp
  58. 0 15
      gameplay/src/lua/lua_SceneLoader.h
  59. 1 1
      gameplay/src/lua/lua_Slider.cpp
  60. 6 6
      gameplay/src/lua/lua_SpriteBatch.cpp
  61. 1 1
      gameplay/src/lua/lua_TextBox.cpp
  62. 6 6
      gameplay/src/lua/lua_Texture.cpp
  63. 3 3
      gameplay/src/lua/lua_TextureSampler.cpp
  64. 1 1
      gameplay/src/lua/lua_Theme.cpp
  65. 1 1
      gameplay/src/lua/lua_VertexAttributeBinding.cpp
  66. 1 1
      gameplay/src/lua/lua_VerticalLayout.cpp
  67. 0 1
      gameplay/src/lua/lua_all_bindings.cpp
  68. 0 1
      gameplay/src/lua/lua_all_bindings.h

+ 5 - 6
gameplay-luagen/README.md

@@ -31,23 +31,22 @@ There are also prebuilt binaries in the gameplay/bin folder.
     end
 - Note: you can't pass an enum to a function that doesn't explicitly take an enum (i.e. Control::setTextColor, which takes an unsigned char). In these cases, you need to go look up the enum values and pass them directly.
 
+
 ## Unsupported Features
 - operators
 - templates
 - variable arguments
 - Lua doesn't support as many types as C++ so if there are functions that overload on parameters with types that overlap in Lua, the overloading won't work properly (i.e. char, short, int, long, float, double and all corresponding unsigned variants overlap in Lua).
 
+
 ### To Do List
 - Get Mac OS X and iOS working.
-- Fix hierarchy inheritance
-- Fix memory leaks in gameplay-luagen and in generated code.
-    * Add "@script{create}" to the appropriate gameplay functions.
+- Fix memory leaks in generated code.
     * Add "@script{own}" to array parameters that are owned by the function or class they are passed to?
-- Add a global function that implements casting for use from Lua scripts (i.e. to downcast from a Control to a Button).
-
-### Future Feature List
 - Add support for users to generate bindings for their own classes.
 - Look into updating bindValue() to support binding to any Lua script function.
+- Add a global function that implements casting for use from Lua scripts (i.e. to downcast from a Control to a Button).
+- Currently ignored: there is one memory leak in gameplay-luagen that is very difficult to fix (it appears to be a locale related leak-something leaks the first time an ofstream is created-doesn't matter the ofstream).
 
 
 ## Disclaimer

+ 24 - 2
gameplay-luagen/gameplay-luagen.vcxproj

@@ -55,9 +55,13 @@
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
+    <CustomBuildBeforeTargets>
+    </CustomBuildBeforeTargets>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <LinkIncremental>false</LinkIncremental>
+    <CustomBuildBeforeTargets>
+    </CustomBuildBeforeTargets>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -76,8 +80,17 @@
       <AdditionalDependencies>tinyxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
-      <Command>del /Q "$(ProjectDir)..\gameplay\src\lua\*"</Command>
+      <Command>
+      </Command>
     </PreBuildEvent>
+    <CustomBuildStep>
+      <Command>
+      </Command>
+    </CustomBuildStep>
+    <CustomBuildStep>
+      <Message>
+      </Message>
+    </CustomBuildStep>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
@@ -99,8 +112,17 @@
       <AdditionalDependencies>tinyxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PreBuildEvent>
-      <Command>del /Q "$(ProjectDir)..\gameplay\src\lua\*"</Command>
+      <Command>
+      </Command>
     </PreBuildEvent>
+    <CustomBuildStep>
+      <Command>
+      </Command>
+    </CustomBuildStep>
+    <CustomBuildStep>
+      <Message>
+      </Message>
+    </CustomBuildStep>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">

+ 2 - 0
gameplay-luagen/gameplay-luagen.vcxproj.user

@@ -3,9 +3,11 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LocalDebuggerCommandArguments>"$(ProjectDir)xml/" "$(ProjectDir)../gameplay/src/lua/"</LocalDebuggerCommandArguments>
     <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+    <LocalDebuggerCommand>$(TargetPath)</LocalDebuggerCommand>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <LocalDebuggerCommandArguments>"$(ProjectDir)xml/" "$(ProjectDir)../gameplay/src/lua/"</LocalDebuggerCommandArguments>
     <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+    <LocalDebuggerCommand>$(TargetPath)</LocalDebuggerCommand>
   </PropertyGroup>
 </Project>

+ 41 - 17
gameplay-luagen/src/Generator.cpp

@@ -2,8 +2,6 @@
 
 Generator* Generator::__instance = NULL;
 
-set<string> __warnings;
-
 // Warning flags.
 static bool __printTemplateWarning = false;
 static bool __printVarargWarning = false;
@@ -14,6 +12,7 @@ static string trim(const string& str);
 static string stripTypeQualifiers(const string& typeStr, FunctionBinding::Param::Kind& kind);
 static inline bool isWantedFileNormal(const string& s);
 static inline bool isNamespaceFile(const string& s);
+static inline bool isGeneratedBindingFile(const string& s);
 static bool getFileList(string directory, vector<string>& files, bool (*isWantedFile)(const string& s));
 static bool isReservedKeyword(string name);
 
@@ -103,12 +102,17 @@ bool Generator::isDerived(const ClassBinding& c, string classname)
 {
     for (unsigned int i = 0; i < c.derived.size(); i++)
     {
-        const string& derivedClassName = getIdentifier(c.derived[i]);
-        if (derivedClassName == classname || 
-            (_classes.find(derivedClassName) != _classes.end() &&
-            isDerived(_classes[derivedClassName], classname)))
-        {
-            return true;
+        // If the derived class is not in the ref ID table, then it
+        // is a hidden (protected, private, etc.) class, so don't consider it.
+        if (_refIds.find(c.derived[i]) != _refIds.end())
+        {
+            const string& derivedClassName = getIdentifier(c.derived[i]);
+            if (derivedClassName == classname || 
+                (_classes.find(derivedClassName) != _classes.end() &&
+                isDerived(_classes[derivedClassName], classname)))
+            {
+                return true;
+            }
         }
     }
     return false;
@@ -151,6 +155,18 @@ void Generator::run(string inDir, string outDir)
     // Set the output directory.
     _outDir = outDir;
 
+    // Get a list of all .cpp and .h files in the output directory so
+    // we can delete them before generating new bindings.
+    vector<string> oldBindingsFiles;
+    getFileList(outDir, oldBindingsFiles, isGeneratedBindingFile);
+
+    // Delete the old bindings.
+    for (unsigned int i = 0; i < oldBindingsFiles.size(); i++)
+    {
+        remove(oldBindingsFiles[i].c_str());
+    }
+
+
     // Get a list of the Doxygen XML files that specify a namespace.
     // Note: we must do this before adding the normal files so that
     // when we process the files sequentially, we process the namespaces
@@ -370,10 +386,6 @@ void Generator::getNamespace(XMLElement* nsNode, const string& name)
 
 void Generator::getClass(XMLElement* classNode, const string& name)
 {
-    // Check if we should ignore this class.
-    if (getScriptFlag(classNode) == "ignore")
-        return;
-
     // Get the ref id for the class.
     string refId = classNode->Attribute("id");
 
@@ -383,6 +395,10 @@ void Generator::getClass(XMLElement* classNode, const string& name)
     // Store the mapping between the ref id and the class's fully qualified name.
     Generator::getInstance()->setIdentifier(refId, classBinding.classname);
 
+    // Check if we should ignore this class.
+    if (getScriptFlag(classNode) == "ignore")
+        return;
+
     // Get the include header for the original class declaration.
     XMLElement* includeElement = classNode->FirstChildElement("includes");
     if (includeElement)
@@ -857,7 +873,6 @@ string Generator::getScriptFlag(XMLElement* e)
     return flag;
 }
 
-
 void Generator::getCreateFlag(XMLElement* e, FunctionBinding& b)
 {
     if (getScriptFlag(e) == "create")
@@ -1658,7 +1673,6 @@ void Generator::generateBindings()
         }
     }
 
-end:
     luaAllCpp << "}\n\n";
     if (bindingNS)
         luaAllCpp << "}\n\n";
@@ -1682,9 +1696,14 @@ void Generator::getAllDerived(set<string>& derived, string classname)
 {
     for (unsigned int i = 0, count = _classes[classname].derived.size(); i < count; i++)
     {
-        string derivedClassName = getIdentifier(_classes[classname].derived[i]);
-        derived.insert(derivedClassName);
-        getAllDerived(derived, derivedClassName);
+        // If the derived class is not in the ref ID table, then it
+        // is a hidden (protected, private, etc.) class, so don't include it.
+        if (_refIds.find(_classes[classname].derived[i]) != _refIds.end())
+        {
+            string derivedClassName = getIdentifier(_classes[classname].derived[i]);
+            derived.insert(derivedClassName);
+            getAllDerived(derived, derivedClassName);
+        }
     }
 }
 
@@ -1767,6 +1786,11 @@ static inline bool isNamespaceFile(const string& s)
     return false;
 }
 
+static inline bool isGeneratedBindingFile(const string& s)
+{
+    return ( (s.find(".cpp") == s.size() - 4) || (s.find(".h") == s.size() - 2) );
+}
+
 static bool getFileList(string directory, vector<string>& files, bool (*isWantedFile)(const string& s))
 {
 #ifdef WIN32

+ 1 - 0
gameplay-luagen/src/Generator.h

@@ -199,6 +199,7 @@ private:
     map<string, EnumBinding> _enums;
     map<string, vector<string> > _namespaces;
     map<string, TypedefBinding> _typedefs;
+    set<string> __warnings;
 };
 
 #endif

+ 2 - 0
gameplay/src/AudioSource.h

@@ -40,6 +40,7 @@ public:
      * 
      * @param url The relative location on disk of the sound file or a URL specifying a Properties object defining an audio source.
      * @return The newly created audio source, or NULL if an audio source cannot be created.
+     * @script{create}
      */
     static AudioSource* create(const char* url);
 
@@ -48,6 +49,7 @@ public:
      * 
      * @param properties The properties object defining the audio source (must have namespace equal to 'audio').
      * @return The newly created audio source, or <code>NULL</code> if the audio source failed to load.
+     * @script{create}
      */
     static AudioSource* create(Properties* properties);
 

+ 5 - 0
gameplay/src/Bundle.h

@@ -29,6 +29,7 @@ public:
      * release() method must be called. Note that calling release() does
      * NOT free any actual game objects created/returned from the Bundle
      * instance and those objects must be released separately.
+     * @script{create}
      */
     static Bundle* create(const char* path);
 
@@ -39,6 +40,7 @@ public:
      * @param id The ID of the scene to load (NULL to load the first scene).
      * 
      * @return The loaded scene, or NULL if the scene could not be loaded.
+     * @script{create}
      */
     Scene* loadScene(const char* id = NULL);
 
@@ -48,6 +50,7 @@ public:
      * @param id The ID of the node to load in the bundle.
      * 
      * @return The loaded node, or NULL if the node could not be loaded.
+     * @script{create}
      */
     Node* loadNode(const char* id);
 
@@ -57,6 +60,7 @@ public:
      * @param id The ID of the mesh to load.
      * 
      * @return The loaded mesh, or NULL if the mesh could not be loaded.
+     * @script{create}
      */
     Mesh* loadMesh(const char* id);
 
@@ -66,6 +70,7 @@ public:
      * @param id The ID of the font to load.
      * 
      * @return The loaded font, or NULL if the font could not be loaded.
+     * @script{create}
      */
     Font* loadFont(const char* id);
 

+ 1 - 0
gameplay/src/CheckBox.h

@@ -44,6 +44,7 @@ public:
      * @param style The control's style.
      *
      * @return The new check box.
+     * @script{create}
      */
     static CheckBox* create(const char* id, Theme::Style* style);
 

+ 1 - 0
gameplay/src/Container.h

@@ -72,6 +72,7 @@ public:
      * @param layoutType The container's layout type.
      *
      * @return The new container.
+     * @script{create}
      */
     static Container* create(const char* id, Theme::Style* style, Layout::Type layoutType = Layout::LAYOUT_ABSOLUTE);
 

+ 1 - 0
gameplay/src/Curve.h

@@ -280,6 +280,7 @@ public:
      * 
      * @param pointCount The number of points in the curve.
      * @param componentCount The number of float component values per key value.
+     * @script{create}
      */
     static Curve* create(unsigned int pointCount, unsigned int componentCount);
 

+ 1 - 0
gameplay/src/DepthStencilTarget.h

@@ -45,6 +45,7 @@ public:
      * @param height Height of the new DepthStencilTarget.
      *
      * @return A newly created DepthStencilTarget.
+     * @script{create}
      */
     static DepthStencilTarget* create(const char* id, Format format, unsigned int width, unsigned int height);
 

+ 2 - 0
gameplay/src/Font.h

@@ -129,6 +129,7 @@ public:
      * @param id An optional ID of the font resource within the bundle (NULL for the first/only resource).
      * 
      * @return The specified font.
+     * @script{create}
      */
     static Font* create(const char* path, const char* id = NULL);
 
@@ -146,6 +147,7 @@ public:
      * @param texture A texture map containing rendered glyphs.
      * 
      * @return The new Font.
+     * @script{create}
      */
     static Font* create(const char* family, Style style, unsigned int size, Glyph* glyphs, int glyphCount, Texture* texture);
 

+ 2 - 0
gameplay/src/Form.h

@@ -56,6 +56,7 @@ public:
      * (and "#<namespace-id>/<namespace-id>/.../<namespace-id>" is optional). 
      * 
      * @param url The URL pointing to the Properties object defining the form. 
+     * @script{create}
      */
     static Form* create(const char* url);
 
@@ -67,6 +68,7 @@ public:
      * @param layoutType The form's layout type.
      *
      * @return The new Form.
+     * @script{create}
      */
     static Form* create(const char* id, Theme::Style* style, Layout::Type layoutType = Layout::LAYOUT_ABSOLUTE);
 

+ 1 - 0
gameplay/src/FrameBuffer.h

@@ -33,6 +33,7 @@ public:
      * @param height The height of the RenderTarget to be created and attached.
      *
      * @return A newly created FrameBuffer.
+     * @script{create}
      */
     static FrameBuffer* create(const char* id, unsigned int width, unsigned int height);
 

+ 1 - 0
gameplay/src/Image.h

@@ -27,6 +27,7 @@ public:
      * 
      * @param path The path to the image file.
      * @return The newly created image.
+     * @script{create}
      */
     static Image* create(const char* path);
 

+ 1 - 0
gameplay/src/Joystick.h

@@ -23,6 +23,7 @@ public:
      * @param style The control's style.
      *
      * @return The new joystick.
+     * @script{create}
      */
     static Joystick* create(const char* id, Theme::Style* style);
     

+ 1 - 0
gameplay/src/Label.h

@@ -40,6 +40,7 @@ public:
      * @param style The control's style.
      *
      * @return The new label.
+     * @script{create}
      */
     static Label* create(const char*id, Theme::Style* style);
 

+ 4 - 0
gameplay/src/Material.h

@@ -35,6 +35,7 @@ public:
      * @param url The URL pointing to the Properties object defining the material.
      * 
      * @return A new Material.
+     * @script{create}
      */
     static Material* create(const char* url);
 
@@ -44,6 +45,7 @@ public:
      * @param materialProperties The properties object defining the 
      *      material (must have namespace equal to 'material').
      * @return A new Material.
+     * @script{create}
      */
     static Material* create(Properties* materialProperties);
 
@@ -56,6 +58,7 @@ public:
      * @param effect Effect for the new material.
      * 
      * @return A new Material.
+     * @script{create}
      */
     static Material* create(Effect* effect);
 
@@ -70,6 +73,7 @@ public:
      * @param defines New-line delimitted list of preprocessor defines.
      * 
      * @return A new Material.
+     * @script{create}
      */
     static Material* create(const char* vshPath, const char* fshPath, const char* defines = NULL);
 

+ 2 - 0
gameplay/src/MeshBatch.h

@@ -25,6 +25,7 @@ public:
      * @param growSize Amount to grow the batch by when it overflows (a value of zero prevents batch growing).
      *
      * @return A new mesh batch.
+     * @script{create}
      */
     static MeshBatch* create(const VertexFormat& vertexFormat, Mesh::PrimitiveType primitiveType, const char* materialPath, bool indexed, unsigned int initialCapacity = 1024, unsigned int growSize = 1024);
 
@@ -39,6 +40,7 @@ public:
      * @param growSize Amount to grow the batch by when it overflows (a value of zero prevents batch growing).
      *
      * @return A new mesh batch.
+     * @script{create}
      */
     static MeshBatch* create(const VertexFormat& vertexFormat, Mesh::PrimitiveType primitiveType, Material* material, bool indexed, unsigned int initialCapacity = 1024, unsigned int growSize = 1024);
 

+ 1 - 0
gameplay/src/Model.h

@@ -27,6 +27,7 @@ public:
 
     /**
      * Creates a new Model.
+     * @script{create}
      */
     static Model* create(Mesh* mesh);
 

+ 1 - 0
gameplay/src/Node.h

@@ -45,6 +45,7 @@ public:
      * Creates a new node with the specified ID.
      *
      * @param id The ID for the new node.
+     * @script{create}
      */
     static Node* create(const char* id = NULL);
 

+ 3 - 0
gameplay/src/ParticleEmitter.h

@@ -161,6 +161,7 @@ public:
      * @param url The URL pointing to the Properties object defining the particle emitter.
      * 
      * @return An initialized ParticleEmitter.
+     * @script{create}
      */
     static ParticleEmitter* create(const char* url);
 
@@ -170,6 +171,7 @@ public:
      * @param properties The properties object defining the 
      *      particle emitter (must have namespace equal to 'particle').
      * @return The newly created particle emitter, or <code>NULL</code> if the particle emitter failed to load.
+     * @script{create}
      */
     static ParticleEmitter* create(Properties* properties);
 
@@ -179,6 +181,7 @@ public:
      * @param texturePath A path to the image to use as this ParticleEmitter's texture.
      * @param textureBlending The type of texture blending to be used for the particles emitted.
      * @param particleCountMax The maximum number of particles that can be alive at one time in this ParticleEmitter's system.
+     * @script{create}
      */
     static ParticleEmitter* create(const char* texturePath, TextureBlending textureBlending,  unsigned int particleCountMax);
 

+ 1 - 0
gameplay/src/Properties.h

@@ -150,6 +150,7 @@ public:
      * (and "#<namespace-id>/<namespace-id>/.../<namespace-id>" is optional).
      * 
      * @param url The URL to create the properties from.
+     * @script{create}
      */
     static Properties* create(const char* url);
 

+ 1 - 0
gameplay/src/RadioButton.h

@@ -46,6 +46,7 @@ public:
      * @param style The control's style.
      *
      * @return The new radio button.
+     * @script{create}
      */
     static RadioButton* create(const char* id, Theme::Style* style);
 

+ 1 - 0
gameplay/src/RenderState.h

@@ -120,6 +120,7 @@ public:
 
         /**
          * Creates a new StateBlock with default render state settings.
+         * @script{create}
          */
         static StateBlock* create();
 

+ 1 - 0
gameplay/src/RenderTarget.h

@@ -25,6 +25,7 @@ public:
      * @param height The height of the new RenderTarget.
      *
      * @return A newly created RenderTarget.
+     * @script{create}
      */
     static RenderTarget* create(const char* id, unsigned int width, unsigned int height);
 

+ 1 - 0
gameplay/src/SceneLoader.h

@@ -12,6 +12,7 @@ namespace gameplay
 
 /**
  * Helper class for loading scenes from .scene files.
+ * @script{ignore}
  */
 class SceneLoader
 {

+ 1 - 0
gameplay/src/Slider.h

@@ -42,6 +42,7 @@ public:
      * @param style The control's style.
      *
      * @return The new slider.
+     * @script{create}
      */
     static Slider* create(const char* id, Theme::Style* style);
 

+ 2 - 0
gameplay/src/SpriteBatch.h

@@ -52,6 +52,7 @@ public:
      * @param initialCapacity An optional initial capacity of the batch (number of sprites).
      * 
      * @return A new SpriteBatch for drawing sprites using the given texture.
+     * @script{create}
      */
     static SpriteBatch* create(const char* texturePath, Effect* effect = NULL, unsigned int initialCapacity = 0);
 
@@ -78,6 +79,7 @@ public:
      * @param initialCapacity An optional initial capacity of the batch (number of sprites).
      * 
      * @return A new SpriteBatch for drawing sprites using the given texture.
+     * @script{create}
      */
     static SpriteBatch* create(Texture* texture, Effect* effect = NULL, unsigned int initialCapacity = 0);
 

+ 1 - 0
gameplay/src/TextBox.h

@@ -46,6 +46,7 @@ public:
      * @param style The control's style.
      *
      * @return The new text box.
+     * @script{create}
      */
     static TextBox* create(const char* id, Theme::Style* style);
 

+ 5 - 0
gameplay/src/Texture.h

@@ -69,6 +69,7 @@ public:
          * @param texture The texture.
          *
          * @return The new sampler.
+         * @script{create}
          */
         static Sampler* create(Texture* texture);
 
@@ -79,6 +80,7 @@ public:
          * @param generateMipmaps True to force a full mipmap chain to be generated for the texture, false otherwise.
          *
          * @return The new sampler.
+         * @script{create}
          */
         static Sampler* create(const char* path, bool generateMipmaps = false);
 
@@ -138,16 +140,19 @@ public:
      * @param generateMipmaps true to auto-generate a full mipmap chain, false otherwise.
      * 
      * @return The new texture, or NULL if the texture could not be loaded/created.
+     * @script{create}
      */
     static Texture* create(const char* path, bool generateMipmaps = false);
 
     /**
      * Creates a texture from the given image.
+     * @script{create}
      */
     static Texture* create(Image* image, bool generateMipmaps = false);
 
     /**
      * Creates a texture from the given texture data.
+     * @script{create}
      */
     static Texture* create(Format format, unsigned int width, unsigned int height, unsigned char* data, bool generateMipmaps = false);
 

+ 1 - 0
gameplay/src/Theme.h

@@ -299,6 +299,7 @@ public:
      * (and "#<namespace-id>/<namespace-id>/.../<namespace-id>" is optional). 
      * 
      * @param url The URL pointing to the Properties object defining the theme. 
+     * @script{create}
      */
     static Theme* create(const char* url);
 

+ 1 - 0
gameplay/src/VertexAttributeBinding.h

@@ -46,6 +46,7 @@ public:
      * @param effect The effect.
      * 
      * @return A VertexAttributeBinding for the requested parameters.
+     * @script{create}
      */
     static VertexAttributeBinding* create(Mesh* mesh, Effect* effect);
 

+ 1 - 0
gameplay/src/VerticalLayout.h

@@ -20,6 +20,7 @@ public:
      * Create a VerticalLayout.
      *
      * @return a VerticalLayout object.
+     * @script{create}
      */
     static VerticalLayout* create();
 

+ 2 - 2
gameplay/src/lua/lua_AudioSource.cpp

@@ -752,7 +752,7 @@ int lua_AudioSource_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "AudioSource");
                     lua_setmetatable(state, -2);
                 }
@@ -773,7 +773,7 @@ int lua_AudioSource_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "AudioSource");
                     lua_setmetatable(state, -2);
                 }

+ 6 - 6
gameplay/src/lua/lua_Bundle.cpp

@@ -298,7 +298,7 @@ int lua_Bundle_loadFont(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Font");
                     lua_setmetatable(state, -2);
                 }
@@ -348,7 +348,7 @@ int lua_Bundle_loadMesh(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Mesh");
                     lua_setmetatable(state, -2);
                 }
@@ -398,7 +398,7 @@ int lua_Bundle_loadNode(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Node");
                     lua_setmetatable(state, -2);
                 }
@@ -444,7 +444,7 @@ int lua_Bundle_loadScene(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Scene");
                     lua_setmetatable(state, -2);
                 }
@@ -476,7 +476,7 @@ int lua_Bundle_loadScene(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Scene");
                     lua_setmetatable(state, -2);
                 }
@@ -558,7 +558,7 @@ int lua_Bundle_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Bundle");
                     lua_setmetatable(state, -2);
                 }

+ 1 - 1
gameplay/src/lua/lua_CheckBox.cpp

@@ -4507,7 +4507,7 @@ int lua_CheckBox_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "CheckBox");
                     lua_setmetatable(state, -2);
                 }

+ 2 - 2
gameplay/src/lua/lua_Container.cpp

@@ -4713,7 +4713,7 @@ int lua_Container_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Container");
                     lua_setmetatable(state, -2);
                 }
@@ -4751,7 +4751,7 @@ int lua_Container_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Container");
                     lua_setmetatable(state, -2);
                 }

+ 1 - 1
gameplay/src/lua/lua_Curve.cpp

@@ -544,7 +544,7 @@ int lua_Curve_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Curve");
                     lua_setmetatable(state, -2);
                 }

+ 1 - 1
gameplay/src/lua/lua_DepthStencilTarget.cpp

@@ -290,7 +290,7 @@ int lua_DepthStencilTarget_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "DepthStencilTarget");
                     lua_setmetatable(state, -2);
                 }

+ 3 - 3
gameplay/src/lua/lua_Font.cpp

@@ -1607,7 +1607,7 @@ int lua_Font_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Font");
                     lua_setmetatable(state, -2);
                 }
@@ -1641,7 +1641,7 @@ int lua_Font_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Font");
                     lua_setmetatable(state, -2);
                 }
@@ -1691,7 +1691,7 @@ int lua_Font_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Font");
                     lua_setmetatable(state, -2);
                 }

+ 3 - 3
gameplay/src/lua/lua_Form.cpp

@@ -4835,7 +4835,7 @@ int lua_Form_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Form");
                     lua_setmetatable(state, -2);
                 }
@@ -4869,7 +4869,7 @@ int lua_Form_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Form");
                     lua_setmetatable(state, -2);
                 }
@@ -4907,7 +4907,7 @@ int lua_Form_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Form");
                     lua_setmetatable(state, -2);
                 }

+ 1 - 1
gameplay/src/lua/lua_FrameBuffer.cpp

@@ -613,7 +613,7 @@ int lua_FrameBuffer_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "FrameBuffer");
                     lua_setmetatable(state, -2);
                 }

+ 5 - 10
gameplay/src/lua/lua_Global.cpp

@@ -12,7 +12,7 @@ void luaRegister_lua_Global()
     ScriptUtil::registerFunction("printError", lua__printError);
 
     std::map<std::string, std::vector<std::string> > hierarchy;
-    hierarchy["AnimationClip::Listener"].push_back("classgameplay_1_1_script_listener");
+    hierarchy["AnimationClip::Listener"].push_back("ScriptListener");
     hierarchy["AnimationTarget"].push_back("Button");
     hierarchy["AnimationTarget"].push_back("CheckBox");
     hierarchy["AnimationTarget"].push_back("Container");
@@ -27,7 +27,6 @@ void luaRegister_lua_Global()
     hierarchy["AnimationTarget"].push_back("Slider");
     hierarchy["AnimationTarget"].push_back("TextBox");
     hierarchy["AnimationTarget"].push_back("Transform");
-    hierarchy["AnimationTarget"].push_back("classgameplay_1_1_theme_1_1_style_1_1_overlay");
     hierarchy["Button"].push_back("CheckBox");
     hierarchy["Button"].push_back("RadioButton");
     hierarchy["Container"].push_back("Form");
@@ -40,7 +39,7 @@ void luaRegister_lua_Global()
     hierarchy["Control"].push_back("RadioButton");
     hierarchy["Control"].push_back("Slider");
     hierarchy["Control"].push_back("TextBox");
-    hierarchy["Control::Listener"].push_back("classgameplay_1_1_script_listener");
+    hierarchy["Control::Listener"].push_back("ScriptListener");
     hierarchy["Label"].push_back("Button");
     hierarchy["Label"].push_back("CheckBox");
     hierarchy["Label"].push_back("RadioButton");
@@ -53,13 +52,13 @@ void luaRegister_lua_Global()
     hierarchy["PhysicsCollisionObject"].push_back("PhysicsCharacter");
     hierarchy["PhysicsCollisionObject"].push_back("PhysicsGhostObject");
     hierarchy["PhysicsCollisionObject"].push_back("PhysicsRigidBody");
-    hierarchy["PhysicsCollisionObject::CollisionListener"].push_back("classgameplay_1_1_script_listener");
+    hierarchy["PhysicsCollisionObject::CollisionListener"].push_back("ScriptListener");
     hierarchy["PhysicsConstraint"].push_back("PhysicsFixedConstraint");
     hierarchy["PhysicsConstraint"].push_back("PhysicsGenericConstraint");
     hierarchy["PhysicsConstraint"].push_back("PhysicsHingeConstraint");
     hierarchy["PhysicsConstraint"].push_back("PhysicsSocketConstraint");
     hierarchy["PhysicsConstraint"].push_back("PhysicsSpringConstraint");
-    hierarchy["PhysicsController::Listener"].push_back("classgameplay_1_1_script_listener");
+    hierarchy["PhysicsController::Listener"].push_back("ScriptListener");
     hierarchy["PhysicsGenericConstraint"].push_back("PhysicsFixedConstraint");
     hierarchy["PhysicsGenericConstraint"].push_back("PhysicsSpringConstraint");
     hierarchy["PhysicsGhostObject"].push_back("PhysicsCharacter");
@@ -111,10 +110,6 @@ void luaRegister_lua_Global()
     hierarchy["Ref"].push_back("Theme::ThemeImage");
     hierarchy["Ref"].push_back("VertexAttributeBinding");
     hierarchy["Ref"].push_back("VerticalLayout");
-    hierarchy["Ref"].push_back("classgameplay_1_1_material_parameter_1_1_method_binding");
-    hierarchy["Ref"].push_back("classgameplay_1_1_theme_1_1_image_list");
-    hierarchy["Ref"].push_back("classgameplay_1_1_theme_1_1_skin");
-    hierarchy["Ref"].push_back("classgameplay_1_1_theme_1_1_style_1_1_overlay");
     hierarchy["RenderState"].push_back("Material");
     hierarchy["RenderState"].push_back("Pass");
     hierarchy["RenderState"].push_back("Technique");
@@ -127,7 +122,7 @@ void luaRegister_lua_Global()
     hierarchy["Transform::Listener"].push_back("PhysicsCharacter");
     hierarchy["Transform::Listener"].push_back("PhysicsGhostObject");
     hierarchy["Transform::Listener"].push_back("PhysicsRigidBody");
-    hierarchy["Transform::Listener"].push_back("classgameplay_1_1_script_listener");
+    hierarchy["Transform::Listener"].push_back("ScriptListener");
     ScriptUtil::setGlobalHierarchy(hierarchy);
 
     // Register enumeration AIMessage::ParameterType.

+ 1 - 1
gameplay/src/lua/lua_Image.cpp

@@ -316,7 +316,7 @@ int lua_Image_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Image");
                     lua_setmetatable(state, -2);
                 }

+ 1 - 1
gameplay/src/lua/lua_Joystick.cpp

@@ -4471,7 +4471,7 @@ int lua_Joystick_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Joystick");
                     lua_setmetatable(state, -2);
                 }

+ 1 - 1
gameplay/src/lua/lua_Label.cpp

@@ -4338,7 +4338,7 @@ int lua_Label_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Label");
                     lua_setmetatable(state, -2);
                 }

+ 5 - 5
gameplay/src/lua/lua_Material.cpp

@@ -645,7 +645,7 @@ int lua_Material_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Material");
                     lua_setmetatable(state, -2);
                 }
@@ -666,7 +666,7 @@ int lua_Material_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Material");
                     lua_setmetatable(state, -2);
                 }
@@ -687,7 +687,7 @@ int lua_Material_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Material");
                     lua_setmetatable(state, -2);
                 }
@@ -721,7 +721,7 @@ int lua_Material_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Material");
                     lua_setmetatable(state, -2);
                 }
@@ -759,7 +759,7 @@ int lua_Material_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Material");
                     lua_setmetatable(state, -2);
                 }

+ 6 - 6
gameplay/src/lua/lua_MeshBatch.cpp

@@ -332,7 +332,7 @@ int lua_MeshBatch_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "MeshBatch");
                     lua_setmetatable(state, -2);
                 }
@@ -365,7 +365,7 @@ int lua_MeshBatch_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "MeshBatch");
                     lua_setmetatable(state, -2);
                 }
@@ -411,7 +411,7 @@ int lua_MeshBatch_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "MeshBatch");
                     lua_setmetatable(state, -2);
                 }
@@ -448,7 +448,7 @@ int lua_MeshBatch_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "MeshBatch");
                     lua_setmetatable(state, -2);
                 }
@@ -498,7 +498,7 @@ int lua_MeshBatch_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "MeshBatch");
                     lua_setmetatable(state, -2);
                 }
@@ -539,7 +539,7 @@ int lua_MeshBatch_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "MeshBatch");
                     lua_setmetatable(state, -2);
                 }

+ 1 - 1
gameplay/src/lua/lua_Model.cpp

@@ -784,7 +784,7 @@ int lua_Model_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Model");
                     lua_setmetatable(state, -2);
                 }

+ 2 - 2
gameplay/src/lua/lua_Node.cpp

@@ -5828,7 +5828,7 @@ int lua_Node_static_create(lua_State* state)
             {
                 ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                 object->instance = returnPtr;
-                object->owns = false;
+                object->owns = true;
                 luaL_getmetatable(state, "Node");
                 lua_setmetatable(state, -2);
             }
@@ -5852,7 +5852,7 @@ int lua_Node_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Node");
                     lua_setmetatable(state, -2);
                 }

+ 3 - 3
gameplay/src/lua/lua_ParticleEmitter.cpp

@@ -2452,7 +2452,7 @@ int lua_ParticleEmitter_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "ParticleEmitter");
                     lua_setmetatable(state, -2);
                 }
@@ -2473,7 +2473,7 @@ int lua_ParticleEmitter_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "ParticleEmitter");
                     lua_setmetatable(state, -2);
                 }
@@ -2511,7 +2511,7 @@ int lua_ParticleEmitter_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "ParticleEmitter");
                     lua_setmetatable(state, -2);
                 }

+ 1 - 1
gameplay/src/lua/lua_Properties.cpp

@@ -1021,7 +1021,7 @@ int lua_Properties_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Properties");
                     lua_setmetatable(state, -2);
                 }

+ 1 - 1
gameplay/src/lua/lua_RadioButton.cpp

@@ -4468,7 +4468,7 @@ int lua_RadioButton_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "RadioButton");
                     lua_setmetatable(state, -2);
                 }

+ 1 - 1
gameplay/src/lua/lua_RenderStateStateBlock.cpp

@@ -513,7 +513,7 @@ int lua_RenderStateStateBlock_static_create(lua_State* state)
             {
                 ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                 object->instance = returnPtr;
-                object->owns = false;
+                object->owns = true;
                 luaL_getmetatable(state, "RenderStateStateBlock");
                 lua_setmetatable(state, -2);
             }

+ 1 - 1
gameplay/src/lua/lua_RenderTarget.cpp

@@ -294,7 +294,7 @@ int lua_RenderTarget_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "RenderTarget");
                     lua_setmetatable(state, -2);
                 }

+ 0 - 109
gameplay/src/lua/lua_SceneLoader.cpp

@@ -1,109 +0,0 @@
-#include "Base.h"
-#include "ScriptController.h"
-#include "lua_SceneLoader.h"
-#include "AudioSource.h"
-#include "Base.h"
-#include "Bundle.h"
-#include "Game.h"
-#include "SceneLoader.h"
-
-namespace gameplay
-{
-
-void luaRegister_SceneLoader()
-{
-    const luaL_Reg lua_members[] = 
-    {
-        {NULL, NULL}
-    };
-    const luaL_Reg* lua_statics = NULL;
-    std::vector<std::string> scopePath;
-
-    ScriptUtil::registerClass("SceneLoader", lua_members, lua_SceneLoader__init, lua_SceneLoader__gc, lua_statics, scopePath);
-}
-
-static SceneLoader* getInstance(lua_State* state)
-{
-    void* userdata = luaL_checkudata(state, 1, "SceneLoader");
-    luaL_argcheck(state, userdata != NULL, 1, "'SceneLoader' expected.");
-    return (SceneLoader*)((ScriptUtil::LuaObject*)userdata)->instance;
-}
-
-int lua_SceneLoader__gc(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 1:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
-            {
-                void* userdata = luaL_checkudata(state, 1, "SceneLoader");
-                luaL_argcheck(state, userdata != NULL, 1, "'SceneLoader' expected.");
-                ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)userdata;
-                if (object->owns)
-                {
-                    SceneLoader* instance = (SceneLoader*)object->instance;
-                    SAFE_DELETE(instance);
-                }
-                
-                return 0;
-            }
-            else
-            {
-                lua_pushstring(state, "lua_SceneLoader__gc - Failed to match the given parameters to a valid function signature.");
-                lua_error(state);
-            }
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_SceneLoader__init(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 0:
-        {
-            void* returnPtr = (void*)new SceneLoader();
-            if (returnPtr)
-            {
-                ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
-                object->instance = returnPtr;
-                object->owns = true;
-                luaL_getmetatable(state, "SceneLoader");
-                lua_setmetatable(state, -2);
-            }
-            else
-            {
-                lua_pushnil(state);
-            }
-
-            return 1;
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 0).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-}

+ 0 - 15
gameplay/src/lua/lua_SceneLoader.h

@@ -1,15 +0,0 @@
-#ifndef LUA_SCENELOADER_H_
-#define LUA_SCENELOADER_H_
-
-namespace gameplay
-{
-
-// Lua bindings for SceneLoader.
-int lua_SceneLoader__gc(lua_State* state);
-int lua_SceneLoader__init(lua_State* state);
-
-void luaRegister_SceneLoader();
-
-}
-
-#endif

+ 1 - 1
gameplay/src/lua/lua_Slider.cpp

@@ -4647,7 +4647,7 @@ int lua_Slider_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Slider");
                     lua_setmetatable(state, -2);
                 }

+ 6 - 6
gameplay/src/lua/lua_SpriteBatch.cpp

@@ -1003,7 +1003,7 @@ int lua_SpriteBatch_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "SpriteBatch");
                     lua_setmetatable(state, -2);
                 }
@@ -1024,7 +1024,7 @@ int lua_SpriteBatch_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "SpriteBatch");
                     lua_setmetatable(state, -2);
                 }
@@ -1058,7 +1058,7 @@ int lua_SpriteBatch_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "SpriteBatch");
                     lua_setmetatable(state, -2);
                 }
@@ -1083,7 +1083,7 @@ int lua_SpriteBatch_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "SpriteBatch");
                     lua_setmetatable(state, -2);
                 }
@@ -1121,7 +1121,7 @@ int lua_SpriteBatch_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "SpriteBatch");
                     lua_setmetatable(state, -2);
                 }
@@ -1150,7 +1150,7 @@ int lua_SpriteBatch_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "SpriteBatch");
                     lua_setmetatable(state, -2);
                 }

+ 1 - 1
gameplay/src/lua/lua_TextBox.cpp

@@ -4377,7 +4377,7 @@ int lua_TextBox_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "TextBox");
                     lua_setmetatable(state, -2);
                 }

+ 6 - 6
gameplay/src/lua/lua_Texture.cpp

@@ -563,7 +563,7 @@ int lua_Texture_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Texture");
                     lua_setmetatable(state, -2);
                 }
@@ -584,7 +584,7 @@ int lua_Texture_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Texture");
                     lua_setmetatable(state, -2);
                 }
@@ -618,7 +618,7 @@ int lua_Texture_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Texture");
                     lua_setmetatable(state, -2);
                 }
@@ -643,7 +643,7 @@ int lua_Texture_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Texture");
                     lua_setmetatable(state, -2);
                 }
@@ -685,7 +685,7 @@ int lua_Texture_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Texture");
                     lua_setmetatable(state, -2);
                 }
@@ -731,7 +731,7 @@ int lua_Texture_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Texture");
                     lua_setmetatable(state, -2);
                 }

+ 3 - 3
gameplay/src/lua/lua_TextureSampler.cpp

@@ -374,7 +374,7 @@ int lua_TextureSampler_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "TextureSampler");
                     lua_setmetatable(state, -2);
                 }
@@ -395,7 +395,7 @@ int lua_TextureSampler_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "TextureSampler");
                     lua_setmetatable(state, -2);
                 }
@@ -429,7 +429,7 @@ int lua_TextureSampler_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "TextureSampler");
                     lua_setmetatable(state, -2);
                 }

+ 1 - 1
gameplay/src/lua/lua_Theme.cpp

@@ -299,7 +299,7 @@ int lua_Theme_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Theme");
                     lua_setmetatable(state, -2);
                 }

+ 1 - 1
gameplay/src/lua/lua_VertexAttributeBinding.cpp

@@ -242,7 +242,7 @@ int lua_VertexAttributeBinding_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "VertexAttributeBinding");
                     lua_setmetatable(state, -2);
                 }

+ 1 - 1
gameplay/src/lua/lua_VerticalLayout.cpp

@@ -314,7 +314,7 @@ int lua_VerticalLayout_static_create(lua_State* state)
             {
                 ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                 object->instance = returnPtr;
-                object->owns = false;
+                object->owns = true;
                 luaL_getmetatable(state, "VerticalLayout");
                 lua_setmetatable(state, -2);
             }

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

@@ -98,7 +98,6 @@ void lua_RegisterAllBindings()
     luaRegister_RenderStateStateBlock();
     luaRegister_RenderTarget();
     luaRegister_Scene();
-    luaRegister_SceneLoader();
     luaRegister_ScreenDisplayer();
     luaRegister_ScriptController();
     luaRegister_Slider();

+ 0 - 1
gameplay/src/lua/lua_all_bindings.h

@@ -93,7 +93,6 @@
 #include "lua_RenderStateStateBlock.h"
 #include "lua_RenderTarget.h"
 #include "lua_Scene.h"
-#include "lua_SceneLoader.h"
 #include "lua_ScreenDisplayer.h"
 #include "lua_ScriptController.h"
 #include "lua_Slider.h"