From a129982e569d2d38e4c7b4d083812cfd95efabfe Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 9 Jul 2017 21:06:54 -0300 Subject: [PATCH] Fix Texture:get/setWrap for 3D textures. --HG-- branch : minor --- src/modules/graphics/wrap_Texture.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/graphics/wrap_Texture.cpp b/src/modules/graphics/wrap_Texture.cpp index 56cbcfa53..2da808c0b 100644 --- a/src/modules/graphics/wrap_Texture.cpp +++ b/src/modules/graphics/wrap_Texture.cpp @@ -210,11 +210,14 @@ int w_Texture_setWrap(lua_State *L) const char *sstr = luaL_checkstring(L, 2); const char *tstr = luaL_optstring(L, 3, sstr); + const char *rstr = luaL_optstring(L, 4, sstr); if (!Texture::getConstant(sstr, w.s)) return luaL_error(L, "Invalid wrap mode: %s", sstr); if (!Texture::getConstant(tstr, w.t)) return luaL_error(L, "Invalid wrap mode, %s", tstr); + if (!Texture::getConstant(rstr, w.r)) + return luaL_error(L, "Invalid wrap mode, %s", rstr); luax_pushboolean(L, t->setWrap(w)); return 1; @@ -239,7 +242,7 @@ int w_Texture_getWrap(lua_State *L) lua_pushstring(L, sstr); lua_pushstring(L, tstr); lua_pushstring(L, rstr); - return 2; + return 3; } int w_Texture_getFormat(lua_State *L)