From 19cbb6b37b9a35df7892bde5aad138266496eb8f Mon Sep 17 00:00:00 2001 From: TeTpaAka Date: Fri, 15 May 2015 22:16:39 +0200 Subject: Add push_ARGB8 to script/common/c_converter --- src/script/common/c_converter.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/script/common/c_converter.cpp') diff --git a/src/script/common/c_converter.cpp b/src/script/common/c_converter.cpp index fc489ea95..9d6829815 100644 --- a/src/script/common/c_converter.cpp +++ b/src/script/common/c_converter.cpp @@ -39,6 +39,19 @@ extern "C" { #define CHECK_POS_TAB(index) CHECK_TYPE(index, "position", LUA_TTABLE) +void push_ARGB8(lua_State *L, video::SColor color) +{ + lua_newtable(L); + lua_pushnumber(L, color.getAlpha()); + lua_setfield(L, -2, "a"); + lua_pushnumber(L, color.getRed()); + lua_setfield(L, -2, "r"); + lua_pushnumber(L, color.getGreen()); + lua_setfield(L, -2, "g"); + lua_pushnumber(L, color.getBlue()); + lua_setfield(L, -2, "b"); +} + void push_v3f(lua_State *L, v3f p) { lua_newtable(L); -- cgit v1.2.3