Explorar el Código

More LUA scripting rework.

sgrenier hace 11 años
padre
commit
6f7269c232

+ 0 - 2
gameplay/gameplay.vcxproj

@@ -208,7 +208,6 @@
     <ClCompile Include="src\lua\lua_ScreenDisplayer.cpp" />
     <ClCompile Include="src\lua\lua_ScriptController.cpp" />
     <ClCompile Include="src\lua\lua_ScriptTarget.cpp" />
-    <ClCompile Include="src\lua\lua_ScriptTargetEventRegistryEvent.cpp" />
     <ClCompile Include="src\lua\lua_Slider.cpp" />
     <ClCompile Include="src\lua\lua_SpriteBatch.cpp" />
     <ClCompile Include="src\lua\lua_Technique.cpp" />
@@ -497,7 +496,6 @@
     <ClInclude Include="src\lua\lua_ScreenDisplayer.h" />
     <ClInclude Include="src\lua\lua_ScriptController.h" />
     <ClInclude Include="src\lua\lua_ScriptTarget.h" />
-    <ClInclude Include="src\lua\lua_ScriptTargetEventRegistryEvent.h" />
     <ClInclude Include="src\lua\lua_Slider.h" />
     <ClInclude Include="src\lua\lua_SpriteBatch.h" />
     <ClInclude Include="src\lua\lua_Technique.h" />

+ 0 - 6
gameplay/gameplay.vcxproj.filters

@@ -873,9 +873,6 @@
     <ClCompile Include="src\lua\lua_JoystickControl.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
-    <ClCompile Include="src\lua\lua_ScriptTargetEventRegistryEvent.cpp">
-      <Filter>src\lua</Filter>
-    </ClCompile>
     <ClCompile Include="src\lua\lua_ContainerDirection.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
@@ -1739,9 +1736,6 @@
     <ClInclude Include="src\lua\lua_JoystickControl.h">
       <Filter>src\lua</Filter>
     </ClInclude>
-    <ClInclude Include="src\lua\lua_ScriptTargetEventRegistryEvent.h">
-      <Filter>src\lua</Filter>
-    </ClInclude>
     <ClInclude Include="src\lua\lua_ContainerDirection.h">
       <Filter>src\lua</Filter>
     </ClInclude>

+ 6 - 3
gameplay/src/AIAgent.cpp

@@ -2,15 +2,18 @@
 #include "AIAgent.h"
 #include "Node.h"
 
+GP_SCRIPT_EVENTS();
+GP_SCRIPT_EVENT(message, "<AIMessage>");
+
 namespace gameplay
 {
 
 AIAgent::AIAgent()
     : _stateMachine(NULL), _node(NULL), _enabled(true), _listener(NULL), _next(NULL)
 {
-    _stateMachine = new AIStateMachine(this);
+    GP_REGISTER_SCRIPT_EVENTS();
 
-    registerScriptEvent("message", "<AIMessage>");
+    _stateMachine = new AIStateMachine(this);
 }
 
 AIAgent::~AIAgent()
@@ -86,7 +89,7 @@ bool AIAgent::processMessage(AIMessage* message)
     if (_listener && _listener->messageReceived(message))
         return true;
     
-    if (fireScriptEvent<bool>("message", message))
+    if (fireScriptEvent<bool>(SCRIPT_EVENT_message, message))
         return true;
     
     return false;

+ 9 - 6
gameplay/src/AIState.cpp

@@ -2,6 +2,11 @@
 #include "AIState.h"
 #include "AIStateMachine.h"
 
+GP_SCRIPT_EVENTS();
+GP_SCRIPT_EVENT(enter, "<AIAgent><AIState>");
+GP_SCRIPT_EVENT(exit, "<AIAgent><AIState>");
+GP_SCRIPT_EVENT(update, "<AIAgent><AIState>f");
+
 namespace gameplay
 {
 
@@ -10,9 +15,7 @@ AIState* AIState::_empty = NULL;
 AIState::AIState(const char* id)
     : _id(id), _listener(NULL)
 {
-    addScriptEvent("enter", "<AIAgent><AIState>");
-    addScriptEvent("exit", "<AIAgent><AIState>");
-    addScriptEvent("update", "<AIAgent><AIState>f");
+    GP_REGISTER_SCRIPT_EVENTS();
 }
 
 AIState::~AIState()
@@ -39,7 +42,7 @@ void AIState::enter(AIStateMachine* stateMachine)
     if (_listener)
         _listener->stateEnter(stateMachine->getAgent(), this);
 
-    fireScriptEvent<void>("enter", stateMachine->getAgent(), this);
+    fireScriptEvent<void>(SCRIPT_EVENT_enter, stateMachine->getAgent(), this);
 }
 
 void AIState::exit(AIStateMachine* stateMachine)
@@ -47,7 +50,7 @@ void AIState::exit(AIStateMachine* stateMachine)
     if (_listener)
         _listener->stateExit(stateMachine->getAgent(), this);
 
-    fireScriptEvent<void>("exit", stateMachine->getAgent(), this);
+    fireScriptEvent<void>(SCRIPT_EVENT_exit, stateMachine->getAgent(), this);
 }
 
 void AIState::update(AIStateMachine* stateMachine, float elapsedTime)
@@ -55,7 +58,7 @@ void AIState::update(AIStateMachine* stateMachine, float elapsedTime)
     if (_listener)
         _listener->stateUpdate(stateMachine->getAgent(), this, elapsedTime);
 
-    fireScriptEvent<void>("update", stateMachine->getAgent(), this, elapsedTime);
+    fireScriptEvent<void>(SCRIPT_EVENT_update, stateMachine->getAgent(), this, elapsedTime);
 }
 
 AIState::Listener::~Listener()

+ 7 - 2
gameplay/src/Control.cpp

@@ -9,6 +9,11 @@
 #define BOUNDS_WIDTH_PERCENTAGE_BIT 4
 #define BOUNDS_HEIGHT_PERCENTAGE_BIT 8
 
+/** @script{ignore} */
+GP_SCRIPT_EVENTS();
+/** @script{ignore} */
+GP_SCRIPT_EVENT(controlEvent, "<Control>[Control::Listener::EventType]");
+
 namespace gameplay
 {
 
@@ -43,7 +48,7 @@ Control::Control()
     _autoSize(AUTO_SIZE_BOTH), _listeners(NULL), _style(NULL), _visible(true), _opacity(0.0f), _zIndex(-1),
     _contactIndex(INVALID_CONTACT_INDEX), _focusIndex(-1), _canFocus(false), _state(NORMAL), _parent(NULL), _styleOverridden(false), _skin(NULL)
 {
-    addScriptEvent("controlEvent", "<Control>[Control::Listener::EventType]");
+    GP_REGISTER_SCRIPT_EVENTS();
 }
 
 Control::~Control()
@@ -1098,7 +1103,7 @@ void Control::notifyListeners(Control::Listener::EventType eventType)
         }
     }
 
-    fireScriptEvent<void>("controlEvent", this, eventType);
+    fireScriptEvent<void>(SCRIPT_EVENT_controlEvent, this, eventType);
 
     release();
 }

+ 5 - 3
gameplay/src/Node.cpp

@@ -16,12 +16,14 @@
 #define NODE_DIRTY_BOUNDS 2
 #define NODE_DIRTY_ALL (NODE_DIRTY_WORLD | NODE_DIRTY_BOUNDS)
 
-namespace gameplay
-{
-
+/** @script{ignore} */
 GP_SCRIPT_EVENTS();
+/** @script{ignore} */
 GP_SCRIPT_EVENT(update, "f");
 
+namespace gameplay
+{
+
 Node::Node(const char* id)
     : _scene(NULL), _firstChild(NULL), _nextSibling(NULL), _prevSibling(NULL), _parent(NULL), _childCount(0), _active(true),
     _tags(NULL), _camera(NULL), _light(NULL), _model(NULL), _terrain(NULL), _form(NULL), _audioSource(NULL), _particleEmitter(NULL),

+ 9 - 4
gameplay/src/PhysicsController.cpp

@@ -19,6 +19,11 @@
 // The initial capacity of the Bullet debug drawer's vertex batch.
 #define INITIAL_CAPACITY 280
 
+/** @script{ignore} */
+GP_SCRIPT_EVENTS();
+/** @script{ignore} */
+GP_SCRIPT_EVENT(statusEvent, "[PhysicsController::Listener::EventType]");
+
 namespace gameplay
 {
 
@@ -33,10 +38,10 @@ PhysicsController::PhysicsController()
     _debugDrawer(NULL), _status(PhysicsController::Listener::DEACTIVATED), _listeners(NULL),
     _gravity(btScalar(0.0), btScalar(-9.8), btScalar(0.0)), _collisionCallback(NULL)
 {
+    GP_REGISTER_SCRIPT_EVENTS();
+
     // Default gravity is 9.8 along the negative Y axis.
     _collisionCallback = new CollisionCallback(this);
-
-    addScriptEvent("statusEvent", "[PhysicsController::Listener::EventType]");
 }
 
 PhysicsController::~PhysicsController()
@@ -484,7 +489,7 @@ void PhysicsController::update(float elapsedTime)
     _world->stepSimulation(elapsedTime * 0.001f, 10);
 
     // If we have status listeners, then check if our status has changed.
-    if (_listeners || _callbacks["statusEvent"])
+    if (_listeners || hasScriptListener(SCRIPT_EVENT_statusEvent))
     {
         Listener::EventType oldStatus = _status;
 
@@ -529,7 +534,7 @@ void PhysicsController::update(float elapsedTime)
                 }
             }
 
-            fireScriptEvent<void>("statusEvent", _status);
+            fireScriptEvent<void>(SCRIPT_EVENT_statusEvent, _status);
         }
     }
 

+ 12 - 9
gameplay/src/ScriptController.cpp

@@ -505,7 +505,7 @@ int ScriptController::loadScriptIsolated(const char* path)
     }
     fullPath.append(path);
 
-    // Load the script chunk, but don't execute it yet: S: 1
+    // Load the script chunk, but don't execute it yet [chunk]
     if (luaL_loadfile(_lua, fullPath.c_str()))
     {
         GP_WARN("Failed to load script with error: '%s'.", lua_tostring(_lua, -1));
@@ -513,23 +513,26 @@ int ScriptController::loadScriptIsolated(const char* path)
     }
 
     // Create a new table as an environment for the new script
-    lua_newtable(_lua); // new ENV for script: S: 21
+    lua_newtable(_lua); // new ENV for script [chunk, env]
 
-    // Store a ref to the table in the registry (this pops the table)
+    // Store a ref to the table in the registry (this pops the table) [chunk]
     int id = luaL_ref(_lua, LUA_REGISTRYINDEX);
 
+    // Put the env table back on top of the stack
+    lua_rawgeti(_lua, LUA_REGISTRYINDEX, id); // [chunk, env]
+
     // Create a metatable that forwards missed lookups to global table _G
-    lua_newtable(_lua); // metatable: S: 321
-    lua_getglobal(_lua, "_G"); // pushes _G, which will be the __index metatable entry: S: 4321
+    lua_newtable(_lua); // metatable [chunk, env, meta]
+    lua_getglobal(_lua, "_G"); // pushes _G, which will be the __index metatable entry [chunk, env, meta, _G]
 
-    // Set the __index property of the metatable to _G (pops _G)
-    lua_setfield(_lua, -2, "__index"); // metatable on top: S: 321
+    // Set the __index property of the metatable to _G
+    lua_setfield(_lua, -2, "__index"); // metatable on top [chunk, env, meta]
 
     // Set the metatable for our new environment table
-    lua_setmetatable(_lua, -2); // S: 21
+    lua_setmetatable(_lua, -2); // [chunk, env]
 
     // Set the first upvalue (_ENV) for our chunk to the new environment table
-    lua_setupvalue(_lua, 1, 1); // S: 1
+    lua_setupvalue(_lua, 1, 1); // [chunk]
 
     // Finally, execute the code for our chunk that is now in its own environment
     if (lua_pcall(_lua, 0, LUA_MULTRET, 0))

+ 16 - 0
gameplay/src/ScriptTarget.cpp

@@ -124,6 +124,22 @@ bool ScriptTarget::removeScript(const char* path)
     return false;
 }
 
+bool ScriptTarget::hasScriptListener(const EventRegistry::Event* evt) const
+{
+    Script* script = _scripts;
+    while (script)
+    {
+        // Does this script have a callback implemented for the given event?
+        std::vector<std::string>& callbacks = script->eventCallbacks;
+        std::vector<std::string>::iterator itr = std::find(callbacks.begin(), callbacks.end(), evt->name);
+        if (itr != callbacks.end())
+            return true;
+        script = script->next;
+    }
+
+    return false;
+}
+
 template<> void ScriptTarget::fireScriptEvent<void>(const EventRegistry::Event* evt, ...)
 {
     GP_ASSERT(evt);

+ 18 - 0
gameplay/src/ScriptTarget.h

@@ -13,6 +13,8 @@ namespace gameplay
  *
  * It is recommended that these macros be used at the top of the source file that
  * contains the implemtation of a ScriptTarget child class.
+ *
+ * @script{ignore}
  */
 #define GP_SCRIPT_EVENTS() \
     static gameplay::ScriptTarget::EventRegistry __eventRegistry
@@ -32,6 +34,8 @@ namespace gameplay
  * @param eventArgs Parmeters for this script event.
  *
  * @see ScriptController::executeFunction
+ *
+ * @script{ignore}
  */
 #define GP_SCRIPT_EVENT(eventName, eventArgs) \
     static const gameplay::ScriptTarget::EventRegistry::Event* SCRIPT_EVENT_ ## eventName = __eventRegistry.addEvent(#eventName, eventArgs)
@@ -42,6 +46,8 @@ namespace gameplay
  * This macro should be called in the constructor of a ScriptTarget
  * child class implementation. It requires that GP_SCRIPT_EVENT
  * macros be defined (normally at the top of the compilation unit).
+ *
+ * @script{ignore}
  */
 #define GP_REGISTER_SCRIPT_EVENTS() \
     ScriptTarget::registerEvents(&__eventRegistry)
@@ -67,6 +73,8 @@ public:
 
         /**
          * Defines a single script event.
+         *
+         * @script{ignore}
          */
         struct Event
         {
@@ -142,6 +150,16 @@ public:
      */
     bool removeScript(const char* path);
 
+    /**
+     * Determines if there is a script installed that is listening for the given script
+     * event (i.e. has a function callback defined for the given event).
+     *
+     * @param evt The script event to check.
+     *
+     * @return True if there is a listener for the specified event, false otherwise.
+     */
+    bool hasScriptListener(const EventRegistry::Event* evt) const;
+
 protected:
 
     /**

+ 5 - 4
gameplay/src/Transform.cpp

@@ -3,13 +3,14 @@
 #include "Game.h"
 #include "Node.h"
 
-namespace gameplay
-{
-
-// Setup scripting
+/** @script{ignore} */
 GP_SCRIPT_EVENTS();
+/** @script{ignore} */
 GP_SCRIPT_EVENT(transformChanged, "<Transform>");
 
+namespace gameplay
+{
+
 int Transform::_suspendTransformChanged(0);
 std::vector<Transform*> Transform::_transformsChanged;
 

+ 72 - 1
gameplay/src/lua/lua_AudioSource.cpp

@@ -31,6 +31,7 @@ void luaRegister_AudioSource()
         {"getState", lua_AudioSource_getState},
         {"getVelocity", lua_AudioSource_getVelocity},
         {"isLooped", lua_AudioSource_isLooped},
+        {"isStreamed", lua_AudioSource_isStreamed},
         {"pause", lua_AudioSource_pause},
         {"play", lua_AudioSource_play},
         {"release", lua_AudioSource_release},
@@ -393,6 +394,41 @@ int lua_AudioSource_isLooped(lua_State* state)
     return 0;
 }
 
+int lua_AudioSource_isStreamed(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))
+            {
+                AudioSource* instance = getInstance(state);
+                bool result = instance->isStreamed();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_AudioSource_isStreamed - 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_AudioSource_pause(lua_State* state)
 {
     // Get the number of parameters.
@@ -799,9 +835,44 @@ int lua_AudioSource_static_create(lua_State* state)
             lua_error(state);
             break;
         }
+        case 2:
+        {
+            do
+            {
+                if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
+                    lua_type(state, 2) == LUA_TBOOLEAN)
+                {
+                    // Get parameter 1 off the stack.
+                    const char* param1 = gameplay::ScriptUtil::getString(1, false);
+
+                    // Get parameter 2 off the stack.
+                    bool param2 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+
+                    void* returnPtr = (void*)AudioSource::create(param1, param2);
+                    if (returnPtr)
+                    {
+                        gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                        object->instance = returnPtr;
+                        object->owns = true;
+                        luaL_getmetatable(state, "AudioSource");
+                        lua_setmetatable(state, -2);
+                    }
+                    else
+                    {
+                        lua_pushnil(state);
+                    }
+
+                    return 1;
+                }
+            } while (0);
+
+            lua_pushstring(state, "lua_AudioSource_static_create - 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_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
             lua_error(state);
             break;
         }

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

@@ -14,6 +14,7 @@ int lua_AudioSource_getRefCount(lua_State* state);
 int lua_AudioSource_getState(lua_State* state);
 int lua_AudioSource_getVelocity(lua_State* state);
 int lua_AudioSource_isLooped(lua_State* state);
+int lua_AudioSource_isStreamed(lua_State* state);
 int lua_AudioSource_pause(lua_State* state);
 int lua_AudioSource_play(lua_State* state);
 int lua_AudioSource_release(lua_State* state);

+ 0 - 106
gameplay/src/lua/lua_Global.cpp

@@ -6,7 +6,6 @@ namespace gameplay
 
 void luaRegister_lua_Global()
 {
-    gameplay::ScriptUtil::registerFunction("GP_SCRIPT_EVENTS", lua___init);
     gameplay::ScriptUtil::registerFunction("strcmpnocase", lua__strcmpnocase);
     gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "Button");
     gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "CheckBox");
@@ -923,111 +922,6 @@ void luaRegister_lua_Global()
     }
 }
 
-int lua___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*)GP_SCRIPT_EVENTS();
-            if (returnPtr)
-            {
-                gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
-                object->instance = returnPtr;
-                object->owns = false;
-                luaL_getmetatable(state, "GP_SCRIPT_EVENTS");
-                lua_setmetatable(state, -2);
-            }
-            else
-            {
-                lua_pushnil(state);
-            }
-
-            return 1;
-            break;
-        }
-        case 2:
-        {
-            do
-            {
-                if (lua_type(state, 1) == LUA_TNONE &&
-                    lua_type(state, 2) == LUA_TNONE)
-                {
-                    // Get parameter 1 off the stack.
-                    GP_WARN("Attempting to get parameter 1 with unrecognized type update as an unsigned integer.");
-                    update param1 = (update)luaL_checkunsigned(state, 1);
-
-                    // Get parameter 2 off the stack.
-                    GP_WARN("Attempting to get parameter 2 with unrecognized type "f" as an unsigned integer.");
-                    "f" param2 = ("f")luaL_checkunsigned(state, 2);
-
-                    void* returnPtr = (void*)GP_SCRIPT_EVENT(param1, param2);
-                    if (returnPtr)
-                    {
-                        gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
-                        object->instance = returnPtr;
-                        object->owns = false;
-                        luaL_getmetatable(state, "GP_SCRIPT_EVENT");
-                        lua_setmetatable(state, -2);
-                    }
-                    else
-                    {
-                        lua_pushnil(state);
-                    }
-
-                    return 1;
-                }
-            } while (0);
-
-            do
-            {
-                if (lua_type(state, 1) == LUA_TNONE &&
-                    lua_type(state, 2) == LUA_TNONE)
-                {
-                    // Get parameter 1 off the stack.
-                    GP_WARN("Attempting to get parameter 1 with unrecognized type transformChanged as an unsigned integer.");
-                    transformChanged param1 = (transformChanged)luaL_checkunsigned(state, 1);
-
-                    // Get parameter 2 off the stack.
-                    GP_WARN("Attempting to get parameter 2 with unrecognized type "<Transform>" as an unsigned integer.");
-                    "<Transform>" param2 = ("<Transform>")luaL_checkunsigned(state, 2);
-
-                    void* returnPtr = (void*)GP_SCRIPT_EVENT(param1, param2);
-                    if (returnPtr)
-                    {
-                        gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
-                        object->instance = returnPtr;
-                        object->owns = false;
-                        luaL_getmetatable(state, "GP_SCRIPT_EVENT");
-                        lua_setmetatable(state, -2);
-                    }
-                    else
-                    {
-                        lua_pushnil(state);
-                    }
-
-                    return 1;
-                }
-            } while (0);
-
-            lua_pushstring(state, "lua___init - Failed to match the given parameters to a valid function signature.");
-            lua_error(state);
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 0 or 2).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua__strcmpnocase(lua_State* state)
 {
     // Get the number of parameters.

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

@@ -56,7 +56,6 @@ namespace gameplay
 {
 
 // Lua bindings for global functions.
-int lua___init(lua_State* state);
 int lua__strcmpnocase(lua_State* state);
 
 // Global enum to string conversion function (used to pass enums to Lua from C++).

+ 0 - 197
gameplay/src/lua/lua_ScriptTargetEventRegistryEvent.cpp

@@ -1,197 +0,0 @@
-#include "Base.h"
-#include "ScriptController.h"
-#include "lua_ScriptTargetEventRegistryEvent.h"
-#include "Base.h"
-#include "ScriptController.h"
-#include "ScriptTarget.h"
-
-namespace gameplay
-{
-
-void luaRegister_ScriptTargetEventRegistryEvent()
-{
-    const luaL_Reg lua_members[] = 
-    {
-        {"args", lua_ScriptTargetEventRegistryEvent_args},
-        {"name", lua_ScriptTargetEventRegistryEvent_name},
-        {"registry", lua_ScriptTargetEventRegistryEvent_registry},
-        {NULL, NULL}
-    };
-    const luaL_Reg* lua_statics = NULL;
-    std::vector<std::string> scopePath;
-    scopePath.push_back("ScriptTarget");
-    scopePath.push_back("EventRegistry");
-
-    gameplay::ScriptUtil::registerClass("ScriptTargetEventRegistryEvent", lua_members, lua_ScriptTargetEventRegistryEvent__init, lua_ScriptTargetEventRegistryEvent__gc, lua_statics, scopePath);
-}
-
-static ScriptTarget::EventRegistry::Event* getInstance(lua_State* state)
-{
-    void* userdata = luaL_checkudata(state, 1, "ScriptTargetEventRegistryEvent");
-    luaL_argcheck(state, userdata != NULL, 1, "'ScriptTargetEventRegistryEvent' expected.");
-    return (ScriptTarget::EventRegistry::Event*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
-}
-
-int lua_ScriptTargetEventRegistryEvent__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, "ScriptTargetEventRegistryEvent");
-                luaL_argcheck(state, userdata != NULL, 1, "'ScriptTargetEventRegistryEvent' expected.");
-                gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)userdata;
-                if (object->owns)
-                {
-                    ScriptTarget::EventRegistry::Event* instance = (ScriptTarget::EventRegistry::Event*)object->instance;
-                    SAFE_DELETE(instance);
-                }
-                
-                return 0;
-            }
-
-            lua_pushstring(state, "lua_ScriptTargetEventRegistryEvent__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_ScriptTargetEventRegistryEvent__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 ScriptTarget::EventRegistry::Event();
-            if (returnPtr)
-            {
-                gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
-                object->instance = returnPtr;
-                object->owns = true;
-                luaL_getmetatable(state, "ScriptTargetEventRegistryEvent");
-                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;
-}
-
-int lua_ScriptTargetEventRegistryEvent_args(lua_State* state)
-{
-    // Validate the number of parameters.
-    if (lua_gettop(state) > 2)
-    {
-        lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
-        lua_error(state);
-    }
-
-    ScriptTarget::EventRegistry::Event* instance = getInstance(state);
-    if (lua_gettop(state) == 2)
-    {
-        // Get parameter 2 off the stack.
-        std::string param2 = gameplay::ScriptUtil::getString(2, true);
-
-        instance->args = param2;
-        return 0;
-    }
-    else
-    {
-        std::string result = instance->args;
-
-        // Push the return value onto the stack.
-        lua_pushstring(state, result.c_str());
-
-        return 1;
-    }
-}
-
-int lua_ScriptTargetEventRegistryEvent_name(lua_State* state)
-{
-    // Validate the number of parameters.
-    if (lua_gettop(state) > 2)
-    {
-        lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
-        lua_error(state);
-    }
-
-    ScriptTarget::EventRegistry::Event* instance = getInstance(state);
-    if (lua_gettop(state) == 2)
-    {
-        // Get parameter 2 off the stack.
-        std::string param2 = gameplay::ScriptUtil::getString(2, true);
-
-        instance->name = param2;
-        return 0;
-    }
-    else
-    {
-        std::string result = instance->name;
-
-        // Push the return value onto the stack.
-        lua_pushstring(state, result.c_str());
-
-        return 1;
-    }
-}
-
-int lua_ScriptTargetEventRegistryEvent_registry(lua_State* state)
-{
-    // Validate the number of parameters.
-    if (lua_gettop(state) > 2)
-    {
-        lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
-        lua_error(state);
-    }
-
-    ScriptTarget::EventRegistry::Event* instance = getInstance(state);
-    if (lua_gettop(state) == 2)
-    {
-        // Get parameter 2 off the stack.
-        GP_WARN("Attempting to get parameter 2 with unrecognized type classgameplay_1_1_script_target_1_1_event_registry as an unsigned integer.");
-        classgameplay_1_1_script_target_1_1_event_registry* param2 = (classgameplay_1_1_script_target_1_1_event_registry)luaL_checkunsigned(state, 2);
-
-        memcpy(instance->registry, param2, sizeof() * classgameplay_1_1_script_target_1_1_event_registry);
-        return 0;
-    }
-    else
-    {
-        classgameplay_1_1_script_target_1_1_event_registry* result = instance->registry;
-
-        // Push the return value onto the stack.
-        lua_pushlightuserdata(state, result);
-        return 1;
-    }
-}
-
-}

+ 0 - 18
gameplay/src/lua/lua_ScriptTargetEventRegistryEvent.h

@@ -1,18 +0,0 @@
-#ifndef LUA_SCRIPTTARGETEVENTREGISTRYEVENT_H_
-#define LUA_SCRIPTTARGETEVENTREGISTRYEVENT_H_
-
-namespace gameplay
-{
-
-// Lua bindings for ScriptTarget::EventRegistry::Event.
-int lua_ScriptTargetEventRegistryEvent__gc(lua_State* state);
-int lua_ScriptTargetEventRegistryEvent__init(lua_State* state);
-int lua_ScriptTargetEventRegistryEvent_args(lua_State* state);
-int lua_ScriptTargetEventRegistryEvent_name(lua_State* state);
-int lua_ScriptTargetEventRegistryEvent_registry(lua_State* state);
-
-void luaRegister_ScriptTargetEventRegistryEvent();
-
-}
-
-#endif

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

@@ -107,7 +107,6 @@ void lua_RegisterAllBindings()
     luaRegister_ScreenDisplayer();
     luaRegister_ScriptController();
     luaRegister_ScriptTarget();
-    luaRegister_ScriptTargetEventRegistryEvent();
     luaRegister_Slider();
     luaRegister_SpriteBatch();
     luaRegister_Technique();

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

@@ -102,7 +102,6 @@
 #include "lua_ScreenDisplayer.h"
 #include "lua_ScriptController.h"
 #include "lua_ScriptTarget.h"
-#include "lua_ScriptTargetEventRegistryEvent.h"
 #include "lua_Slider.h"
 #include "lua_SpriteBatch.h"
 #include "lua_Technique.h"