LuaPlus extenssion
This commit is contained in:
@@ -58,6 +58,11 @@ void registerEngine()
|
||||
|
||||
LuaObject consoleTable = GetLuaState().GetGlobals().CreateTable("console");
|
||||
consoleTable.RegisterDirect("print", &consoleMsg);
|
||||
|
||||
// animations globals
|
||||
GetLuaState().DoString("ANIM_PLAYBACK_NONE = 0");
|
||||
GetLuaState().DoString("ANIM_PLAYBACK_REPEAT = 1");
|
||||
|
||||
}
|
||||
|
||||
void registerClasses()
|
||||
|
||||
@@ -89,3 +89,13 @@ glm::mat4 getMatrixFromLua(LuaPlus::LuaObject& matrix)
|
||||
glm::mat4 return_matrix = glm::identity<glm::mat4>();
|
||||
return return_matrix;
|
||||
}
|
||||
|
||||
void LuaPlusErrorFunction(const char* errorMsg)
|
||||
{
|
||||
Core::Error(errorMsg);
|
||||
}
|
||||
|
||||
namespace LuaPlus
|
||||
{
|
||||
void (*g_errorFunction)(const char*) = LuaPlusErrorFunction;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ void Entity::OnCollide(IEntityBase* other)
|
||||
LuaPlus::LuaObject otherTable = lookup.GetByIndex(other->GetID());
|
||||
if (!otherTable.IsNil())
|
||||
{
|
||||
LuaPlus:: LuaFunctionVoid function = m_onCollideFunction;
|
||||
LuaPlus::LuaFunctionVoid function = m_onCollideFunction;
|
||||
function(m_luaObject, otherTable);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user