summaryrefslogtreecommitdiffstats
path: root/src/Bindings
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-22 10:33:15 +0200
committerMattes D <github@xoft.cz>2014-08-22 10:33:15 +0200
commit51df169ad58f4712312d0400043cf2094fc9dfd6 (patch)
tree6fd57bdda1463bbf79cdfb79660955a4e4f569ea /src/Bindings
parentToLua++ lib: Assert when usertype is not known. (diff)
downloadcuberite-51df169ad58f4712312d0400043cf2094fc9dfd6.tar
cuberite-51df169ad58f4712312d0400043cf2094fc9dfd6.tar.gz
cuberite-51df169ad58f4712312d0400043cf2094fc9dfd6.tar.bz2
cuberite-51df169ad58f4712312d0400043cf2094fc9dfd6.tar.lz
cuberite-51df169ad58f4712312d0400043cf2094fc9dfd6.tar.xz
cuberite-51df169ad58f4712312d0400043cf2094fc9dfd6.tar.zst
cuberite-51df169ad58f4712312d0400043cf2094fc9dfd6.zip
Diffstat (limited to '')
-rw-r--r--src/Bindings/LuaState.cpp46
-rw-r--r--src/Bindings/LuaState.h3
2 files changed, 44 insertions, 5 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index e123a87c9..9fe93ccc2 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -460,7 +460,43 @@ void cLuaState::Push(const Vector3d & a_Vector)
{
ASSERT(IsValid());
- tolua_pushusertype(m_LuaState, (void *)&a_Vector, "Vector3d");
+ tolua_pushusertype(m_LuaState, (void *)&a_Vector, "Vector3<double>");
+ m_NumCurrentFunctionArgs += 1;
+}
+
+
+
+
+
+void cLuaState::Push(const Vector3d * a_Vector)
+{
+ ASSERT(IsValid());
+
+ tolua_pushusertype(m_LuaState, (void *)a_Vector, "Vector3<double>");
+ m_NumCurrentFunctionArgs += 1;
+}
+
+
+
+
+
+void cLuaState::Push(const Vector3i & a_Vector)
+{
+ ASSERT(IsValid());
+
+ tolua_pushusertype(m_LuaState, (void *)&a_Vector, "Vector3<int>");
+ m_NumCurrentFunctionArgs += 1;
+}
+
+
+
+
+
+void cLuaState::Push(const Vector3i * a_Vector)
+{
+ ASSERT(IsValid());
+
+ tolua_pushusertype(m_LuaState, (void *)a_Vector, "Vector3<int>");
m_NumCurrentFunctionArgs += 1;
}
@@ -708,11 +744,11 @@ void cLuaState::Push(TakeDamageInfo * a_TDI)
-void cLuaState::Push(Vector3i * a_Vector)
+void cLuaState::Push(Vector3d * a_Vector)
{
ASSERT(IsValid());
- tolua_pushusertype(m_LuaState, a_Vector, "Vector3i");
+ tolua_pushusertype(m_LuaState, a_Vector, "Vector3<double>");
m_NumCurrentFunctionArgs += 1;
}
@@ -720,11 +756,11 @@ void cLuaState::Push(Vector3i * a_Vector)
-void cLuaState::Push(Vector3d * a_Vector)
+void cLuaState::Push(Vector3i * a_Vector)
{
ASSERT(IsValid());
- tolua_pushusertype(m_LuaState, a_Vector, "Vector3d");
+ tolua_pushusertype(m_LuaState, a_Vector, "Vector3<int>");
m_NumCurrentFunctionArgs += 1;
}
diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h
index afac77ce8..eeb93fd4d 100644
--- a/src/Bindings/LuaState.h
+++ b/src/Bindings/LuaState.h
@@ -186,6 +186,9 @@ public:
void Push(const HTTPRequest * a_Request);
void Push(const HTTPTemplateRequest * a_Request);
void Push(const Vector3d & a_Vector);
+ void Push(const Vector3d * a_Vector);
+ void Push(const Vector3i & a_Vector);
+ void Push(const Vector3i * a_Vector);
// Push a value onto the stack (keep alpha-sorted):
void Push(bool a_Value);