diff options
Diffstat (limited to 'Runtime/Math/Vector2.h')
-rw-r--r-- | Runtime/Math/Vector2.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Runtime/Math/Vector2.h b/Runtime/Math/Vector2.h index f83a521..5dd8fe6 100644 --- a/Runtime/Math/Vector2.h +++ b/Runtime/Math/Vector2.h @@ -2,11 +2,12 @@ #include "MathHelper.h" #include "Runtime/Utilities/Assert.h" #include "Runtime/Lua/LuaHelper.h" +#include "ITransData.h" namespace Internal { template<typename T> - struct Vector2T : public LuaBind::ILuaClass + struct Vector2T { Vector2T(T x = 0, T y = 0) { @@ -50,7 +51,7 @@ namespace Internal return res; } - void CastToLuaObject(LuaBind::State& state) const override + void CastToLuaObject(LuaBind::State& state) const { int top = state.GetTop(); if (LuaHelper::GetLuaClass(state, "GameLab.Engine.Math.Vector2")) @@ -68,7 +69,7 @@ namespace Internal } } - void RestoreFromLuaObject(LuaBind::State& state, int index) override + void RestoreFromLuaObject(LuaBind::State& state, int index) { if (lua_isnil(state, index)) return; @@ -84,6 +85,11 @@ namespace Internal y = state.GetField<float>(index, 1, 0); } } + + static int GetDataSize() + { + return 2 * sizeof(T); + } T x, y; |