aboutsummaryrefslogtreecommitdiff
path: root/src/script/common
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2023-02-27 22:58:41 +0000
committerGitHub <noreply@github.com>2023-02-27 22:58:41 +0000
commit39f4d26177ec1c8f246133c532a42ef7429bc36d (patch)
tree910b6a6635adf37eaba1d7410e83fad14f15bb90 /src/script/common
parentfbbdae93ee324584089efaf8e880a1378f6a2ad6 (diff)
downloadminetest-39f4d26177ec1c8f246133c532a42ef7429bc36d.tar.xz
Add minetest.get_player_window_information() (#12367)
Diffstat (limited to 'src/script/common')
-rw-r--r--src/script/common/c_converter.cpp9
-rw-r--r--src/script/common/c_converter.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/script/common/c_converter.cpp b/src/script/common/c_converter.cpp
index 90b78a081..22aa1c5d7 100644
--- a/src/script/common/c_converter.cpp
+++ b/src/script/common/c_converter.cpp
@@ -128,6 +128,15 @@ void push_v2s32(lua_State *L, v2s32 p)
lua_setfield(L, -2, "y");
}
+void push_v2u32(lua_State *L, v2u32 p)
+{
+ lua_createtable(L, 0, 2);
+ lua_pushinteger(L, p.X);
+ lua_setfield(L, -2, "x");
+ lua_pushinteger(L, p.Y);
+ lua_setfield(L, -2, "y");
+}
+
v2s32 read_v2s32(lua_State *L, int index)
{
v2s32 p;
diff --git a/src/script/common/c_converter.h b/src/script/common/c_converter.h
index f1e4e47ec..90358147a 100644
--- a/src/script/common/c_converter.h
+++ b/src/script/common/c_converter.h
@@ -108,6 +108,7 @@ size_t read_stringlist (lua_State *L, int index,
void push_v2s16 (lua_State *L, v2s16 p);
void push_v2s32 (lua_State *L, v2s32 p);
+void push_v2u32 (lua_State *L, v2u32 p);
void push_v3s16 (lua_State *L, v3s16 p);
void push_aabb3f (lua_State *L, aabb3f box);
void push_ARGB8 (lua_State *L, video::SColor color);