|
|
@@ -10,7 +10,8 @@
|
|
|
#include <anki/scene/SceneGraph.h>
|
|
|
#include <anki/Event.h>
|
|
|
|
|
|
-namespace anki {
|
|
|
+namespace anki
|
|
|
+{
|
|
|
|
|
|
//==============================================================================
|
|
|
static EventManager* getEventManager(lua_State* l)
|
|
|
@@ -53,29 +54,30 @@ static inline int pwrapLightEventsetIntensityMultiplier(lua_State* l)
|
|
|
(void)voidp;
|
|
|
PtrSize size;
|
|
|
(void)size;
|
|
|
-
|
|
|
+
|
|
|
LuaBinder::checkArgsCount(l, 2);
|
|
|
-
|
|
|
+
|
|
|
// Get "this" as "self"
|
|
|
- if(LuaBinder::checkUserData(l, 1, classnameLightEvent, 840634010629725278, ud))
|
|
|
+ if(LuaBinder::checkUserData(
|
|
|
+ l, 1, classnameLightEvent, 840634010629725278, ud))
|
|
|
{
|
|
|
return -1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
LightEvent* self = ud->getData<LightEvent>();
|
|
|
-
|
|
|
+
|
|
|
// Pop arguments
|
|
|
if(LuaBinder::checkUserData(l, 2, "Vec4", 6804478823655046386, ud))
|
|
|
{
|
|
|
return -1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Vec4* iarg0 = ud->getData<Vec4>();
|
|
|
const Vec4& arg0(*iarg0);
|
|
|
-
|
|
|
+
|
|
|
// Call the method
|
|
|
self->setIntensityMultiplier(arg0);
|
|
|
-
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
@@ -88,7 +90,7 @@ static int wrapLightEventsetIntensityMultiplier(lua_State* l)
|
|
|
{
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
lua_error(l);
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -103,33 +105,34 @@ static inline int pwrapLightEventsetFrequency(lua_State* l)
|
|
|
(void)voidp;
|
|
|
PtrSize size;
|
|
|
(void)size;
|
|
|
-
|
|
|
+
|
|
|
LuaBinder::checkArgsCount(l, 3);
|
|
|
-
|
|
|
+
|
|
|
// Get "this" as "self"
|
|
|
- if(LuaBinder::checkUserData(l, 1, classnameLightEvent, 840634010629725278, ud))
|
|
|
+ if(LuaBinder::checkUserData(
|
|
|
+ l, 1, classnameLightEvent, 840634010629725278, ud))
|
|
|
{
|
|
|
return -1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
LightEvent* self = ud->getData<LightEvent>();
|
|
|
-
|
|
|
+
|
|
|
// Pop arguments
|
|
|
F32 arg0;
|
|
|
if(LuaBinder::checkNumber(l, 2, arg0))
|
|
|
{
|
|
|
return -1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
F32 arg1;
|
|
|
if(LuaBinder::checkNumber(l, 3, arg1))
|
|
|
{
|
|
|
return -1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// Call the method
|
|
|
self->setFrequency(arg0, arg1);
|
|
|
-
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
@@ -142,7 +145,7 @@ static int wrapLightEventsetFrequency(lua_State* l)
|
|
|
{
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
lua_error(l);
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -152,8 +155,10 @@ static int wrapLightEventsetFrequency(lua_State* l)
|
|
|
static inline void wrapLightEvent(lua_State* l)
|
|
|
{
|
|
|
LuaBinder::createClass(l, classnameLightEvent);
|
|
|
- LuaBinder::pushLuaCFuncMethod(l, "setIntensityMultiplier", wrapLightEventsetIntensityMultiplier);
|
|
|
- LuaBinder::pushLuaCFuncMethod(l, "setFrequency", wrapLightEventsetFrequency);
|
|
|
+ LuaBinder::pushLuaCFuncMethod(
|
|
|
+ l, "setIntensityMultiplier", wrapLightEventsetIntensityMultiplier);
|
|
|
+ LuaBinder::pushLuaCFuncMethod(
|
|
|
+ l, "setFrequency", wrapLightEventsetFrequency);
|
|
|
lua_settop(l, 0);
|
|
|
}
|
|
|
|
|
|
@@ -186,53 +191,54 @@ static inline int pwrapEventManagernewLightEvent(lua_State* l)
|
|
|
(void)voidp;
|
|
|
PtrSize size;
|
|
|
(void)size;
|
|
|
-
|
|
|
+
|
|
|
LuaBinder::checkArgsCount(l, 4);
|
|
|
-
|
|
|
+
|
|
|
// Get "this" as "self"
|
|
|
- if(LuaBinder::checkUserData(l, 1, classnameEventManager, -6959305329499243407, ud))
|
|
|
+ if(LuaBinder::checkUserData(
|
|
|
+ l, 1, classnameEventManager, -6959305329499243407, ud))
|
|
|
{
|
|
|
return -1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
EventManager* self = ud->getData<EventManager>();
|
|
|
-
|
|
|
+
|
|
|
// Pop arguments
|
|
|
F32 arg0;
|
|
|
if(LuaBinder::checkNumber(l, 2, arg0))
|
|
|
{
|
|
|
return -1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
F32 arg1;
|
|
|
if(LuaBinder::checkNumber(l, 3, arg1))
|
|
|
{
|
|
|
return -1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(LuaBinder::checkUserData(l, 4, "SceneNode", -2220074417980276571, ud))
|
|
|
{
|
|
|
return -1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
SceneNode* iarg2 = ud->getData<SceneNode>();
|
|
|
SceneNode* arg2(iarg2);
|
|
|
-
|
|
|
+
|
|
|
// Call the method
|
|
|
LightEvent* ret = self->newEvent<LightEvent>(arg0, arg1, arg2);
|
|
|
-
|
|
|
+
|
|
|
// Push return value
|
|
|
if(ANKI_UNLIKELY(ret == nullptr))
|
|
|
{
|
|
|
lua_pushstring(l, "Glue code returned nullptr");
|
|
|
return -1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
voidp = lua_newuserdata(l, sizeof(UserData));
|
|
|
ud = static_cast<UserData*>(voidp);
|
|
|
luaL_setmetatable(l, "LightEvent");
|
|
|
ud->initPointed(840634010629725278, const_cast<LightEvent*>(ret));
|
|
|
-
|
|
|
+
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
@@ -245,7 +251,7 @@ static int wrapEventManagernewLightEvent(lua_State* l)
|
|
|
{
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
lua_error(l);
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -255,7 +261,8 @@ static int wrapEventManagernewLightEvent(lua_State* l)
|
|
|
static inline void wrapEventManager(lua_State* l)
|
|
|
{
|
|
|
LuaBinder::createClass(l, classnameEventManager);
|
|
|
- LuaBinder::pushLuaCFuncMethod(l, "newLightEvent", wrapEventManagernewLightEvent);
|
|
|
+ LuaBinder::pushLuaCFuncMethod(
|
|
|
+ l, "newLightEvent", wrapEventManagernewLightEvent);
|
|
|
lua_settop(l, 0);
|
|
|
}
|
|
|
|
|
|
@@ -269,24 +276,24 @@ static inline int pwrapgetEventManager(lua_State* l)
|
|
|
(void)voidp;
|
|
|
PtrSize size;
|
|
|
(void)size;
|
|
|
-
|
|
|
+
|
|
|
LuaBinder::checkArgsCount(l, 0);
|
|
|
-
|
|
|
+
|
|
|
// Call the function
|
|
|
EventManager* ret = getEventManager(l);
|
|
|
-
|
|
|
+
|
|
|
// Push return value
|
|
|
if(ANKI_UNLIKELY(ret == nullptr))
|
|
|
{
|
|
|
lua_pushstring(l, "Glue code returned nullptr");
|
|
|
return -1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
voidp = lua_newuserdata(l, sizeof(UserData));
|
|
|
ud = static_cast<UserData*>(voidp);
|
|
|
luaL_setmetatable(l, "EventManager");
|
|
|
ud->initPointed(-6959305329499243407, const_cast<EventManager*>(ret));
|
|
|
-
|
|
|
+
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
@@ -299,7 +306,7 @@ static int wrapgetEventManager(lua_State* l)
|
|
|
{
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
lua_error(l);
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -314,4 +321,3 @@ void wrapModuleEvent(lua_State* l)
|
|
|
}
|
|
|
|
|
|
} // end namespace anki
|
|
|
-
|