From 5d2b0a98e51eb70e96f04bcb196fd319ca5cb16f Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Thu, 24 Nov 2016 21:54:19 -0400 Subject: [PATCH] =?UTF-8?q?Add=20missing=20applyTransform=20and=20replaceT?= =?UTF-8?q?ransform=20functions=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : minor --- src/modules/graphics/opengl/wrap_Graphics.cpp | 17 +++++++++++++++++ src/modules/math/wrap_Transform.h | 1 + 2 files changed, 18 insertions(+) diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index 9833b2b05..8bcdd7c82 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -28,6 +28,7 @@ #include "video/VideoStream.h" #include "image/wrap_Image.h" #include "common/Reference.h" +#include "math/wrap_Transform.h" #include #include @@ -2124,6 +2125,20 @@ int w_origin(lua_State * /*L*/) return 0; } +int w_applyTransform(lua_State *L) +{ + math::Transform *t = math::luax_checktransform(L, 1); + instance()->applyTransform(t); + return 0; +} + +int w_replaceTransform(lua_State *L) +{ + math::Transform *t = math::luax_checktransform(L, 1); + instance()->replaceTransform(t); + return 0; +} + int w_transformPoint(lua_State *L) { Vector p; @@ -2252,6 +2267,8 @@ static const luaL_Reg functions[] = { "translate", w_translate }, { "shear", w_shear }, { "origin", w_origin }, + { "applyTransform", w_applyTransform }, + { "replaceTransform", w_replaceTransform }, { "transformPoint", w_transformPoint }, { "inverseTransformPoint", w_inverseTransformPoint }, diff --git a/src/modules/math/wrap_Transform.h b/src/modules/math/wrap_Transform.h index 1ad732c34..f3791dbc5 100644 --- a/src/modules/math/wrap_Transform.h +++ b/src/modules/math/wrap_Transform.h @@ -29,6 +29,7 @@ namespace love namespace math { +Transform *luax_checktransform(lua_State *L, int idx); extern "C" int luaopen_transform(lua_State *L); } // math