From 1cd31d14c95f9d52e30fbc611df5da4b46f048d9 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 19 Nov 2021 15:33:48 +0800 Subject: *misc --- Runtime/Math/Vector2.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Runtime/Math/Vector2.h') 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 - 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(index, 1, 0); } } + + static int GetDataSize() + { + return 2 * sizeof(T); + } T x, y; -- cgit v1.1-26-g67d0