diff --git a/ChangeLog.md b/ChangeLog.md index 39d2b3431..5bafdd7fc 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -125,6 +125,7 @@ Nazara Engine: - ⚠️ Removed Vector[2|3]::Distancef method and made Distance method templated - Added Vector2::Distance static method - ⚠️ Fixed compilation errors on MSVC with flag /permissive- on CullingList class +- Added LuaImplQueryArg & LuaImplReplyVal functions for Vector[2|3] - Fixed bug in ENet implementation causing legit reliable packets to be dropped on sequence number overflow Nazara Development Kit: diff --git a/SDK/include/NDK/LuaAPI.inl b/SDK/include/NDK/LuaAPI.inl index 318bb6add..40fe33ec7 100644 --- a/SDK/include/NDK/LuaAPI.inl +++ b/SDK/include/NDK/LuaAPI.inl @@ -269,6 +269,15 @@ namespace Nz return ret; } + inline unsigned int LuaImplQueryArg(const LuaState& state, int index, Vector2i* vec, TypeTag) + { + Vector2d vecDouble; + unsigned int ret = LuaImplQueryArg(state, index, &vecDouble, TypeTag()); + + vec->Set(vecDouble); + return ret; + } + inline unsigned int LuaImplQueryArg(const LuaState& state, int index, Vector3d* vec, TypeTag) { switch (state.GetType(index)) @@ -308,6 +317,15 @@ namespace Nz return ret; } + inline unsigned int LuaImplQueryArg(const LuaState& state, int index, Vector3i* vec, TypeTag) + { + Vector3d vecDouble; + unsigned int ret = LuaImplQueryArg(state, index, &vecDouble, TypeTag()); + + vec->Set(vecDouble); + return ret; + } + inline unsigned int LuaImplQueryArg(const LuaState& state, int index, Ndk::Entity** handle, TypeTag) { if (!state.IsOfType(index, LuaType_Nil)) @@ -538,6 +556,12 @@ namespace Nz return 1; } + inline int LuaImplReplyVal(const LuaState& state, Vector2i&& val, TypeTag) + { + state.PushInstance("Vector2", val); + return 1; + } + inline int LuaImplReplyVal(const LuaState& state, Vector3d&& val, TypeTag) { state.PushInstance("Vector3", val); @@ -556,6 +580,12 @@ namespace Nz return 1; } + inline int LuaImplReplyVal(const LuaState& state, Vector3i&& val, TypeTag) + { + state.PushInstance("Vector3", val); + return 1; + } + inline int LuaImplReplyVal(const LuaState& state, Ndk::Entity* ptr, TypeTag) { state.PushInstance("Entity", ptr);