LuaPlus extenssion

This commit is contained in:
2026-03-05 05:05:04 +03:00
parent 33104c3bca
commit d57ac17b69
10 changed files with 183 additions and 50 deletions

View File

@@ -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()

View File

@@ -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;
}

View File

@@ -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);
}
}