From a17a1bb51728b1b9a36f7c6db876459e70a613af Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Tue, 24 Feb 2026 22:18:54 +0100 Subject: [PATCH] =?UTF-8?q?-=20[CHG]=20surf.target()=20i=20surf.source()?= =?UTF-8?q?=20sense=20par=C3=A0metres=20ara=20el=20que=20fan=20es=20tornar?= =?UTF-8?q?=20les=20surfaces=20actuals=20de=20target=20i=20de=20source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua.cpp | 8 ++++---- mini.cpp | 12 ++++++++++++ mini.h | 2 ++ version.h | 2 +- vscode/library.lua | 8 ++++++++ 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/lua.cpp b/lua.cpp index b0bdbff..3d66bcc 100644 --- a/lua.cpp +++ b/lua.cpp @@ -97,8 +97,8 @@ extern "C" { const int numargs = lua_gettop(L); switch (numargs) { case 0: { - setdest(0); - return 0; + lua_pushinteger(L, getdest()); + return 1; } case 1: { uint8_t surface = luaL_checkinteger(L, 1); @@ -114,8 +114,8 @@ extern "C" { const int numargs = lua_gettop(L); switch (numargs) { case 0: { - setsource(0); - return 0; + lua_pushinteger(L, getsource()); + return 1; } case 1: { uint8_t surface = luaL_checkinteger(L, 1); diff --git a/mini.cpp b/mini.cpp index 88fe463..e73b292 100644 --- a/mini.cpp +++ b/mini.cpp @@ -359,6 +359,18 @@ void setmap(uint8_t surface) { map_surface = &surfaces[surface]; } +uint8_t getdest() +{ + for (unsigned int i=0; i