From e48e2e65341ee9daf2e5daa3fb35c4733dda6dec Mon Sep 17 00:00:00 2001 From: Warmist Date: Sat, 14 May 2016 19:41:51 +0300 Subject: [PATCH 01/12] A twbt utils plugin for misc stuff used in twbt by mifki. Currently only render map function. --- plugins/CMakeLists.txt | 1 + plugins/lua/twbt-utils.lua | 11 ++++ plugins/twbt-utils.cpp | 122 +++++++++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 plugins/lua/twbt-utils.lua create mode 100644 plugins/twbt-utils.cpp diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index b6e05b749..5d2d40813 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -149,6 +149,7 @@ if (BUILD_SUPPORTED) add_subdirectory(rendermax) DFHACK_PLUGIN(resume resume.cpp) DFHACK_PLUGIN(reveal reveal.cpp) + DFHACK_PLUGIN(twbt-utils twbt-utils.cpp LINK_LIBRARIES lua) DFHACK_PLUGIN(search search.cpp) DFHACK_PLUGIN(seedwatch seedwatch.cpp) DFHACK_PLUGIN(showmood showmood.cpp) diff --git a/plugins/lua/twbt-utils.lua b/plugins/lua/twbt-utils.lua new file mode 100644 index 000000000..56bdb0b19 --- /dev/null +++ b/plugins/lua/twbt-utils.lua @@ -0,0 +1,11 @@ +local _ENV = mkmodule('plugins.twbt-utils') + +--[[ + + Native functions: + + * render_map_rect(x,y,z,w,h) + +--]] + +return _ENV \ No newline at end of file diff --git a/plugins/twbt-utils.cpp b/plugins/twbt-utils.cpp new file mode 100644 index 000000000..7524ac29e --- /dev/null +++ b/plugins/twbt-utils.cpp @@ -0,0 +1,122 @@ +#include "Core.h" +#include "Console.h" +#include "Export.h" +#include "PluginManager.h" +#include "VersionInfo.h" +#include "VTableInterpose.h" +#include "LuaTools.h" + +#include "DataDefs.h" + +#include "df/viewscreen_dwarfmodest.h" +#include "df/init.h" +#include "df/renderer.h" +#include "df/graphic.h" + +using std::string; +using std::vector; +using namespace DFHack; +using namespace df::enums; + +DFHACK_PLUGIN("twbt-utils"); +REQUIRE_GLOBAL(window_x) +REQUIRE_GLOBAL(window_y) +REQUIRE_GLOBAL(window_z) +REQUIRE_GLOBAL_NO_USE(gps) + +#ifdef WIN32 + // On Windows there's no convert_magenta parameter. Arguments are pushed onto stack, + // except for tex_pos and filename, which go into ecx and edx. Simulating this with __fastcall. + typedef void(__fastcall *LOAD_MULTI_PDIM)(long *tex_pos, const string &filename, void *tex, long dimx, long dimy, long *disp_x, long *disp_y); + + // On Windows there's no parameter pointing to the map_renderer structure + typedef void(_stdcall *RENDER_MAP)(int); + typedef void(_stdcall *RENDER_UPDOWN)(); + + RENDER_MAP _render_map; + void render_map(){ _render_map(0); } +#else + typedef void(*LOAD_MULTI_PDIM)(void *tex, const string &filename, long *tex_pos, long dimx, long dimy, bool convert_magenta, long *disp_x, long *disp_y); + + typedef void(*RENDER_MAP)(void*, int); + typedef void(*RENDER_UPDOWN)(void*); + + RENDER_MAP _render_map; + void render_map(){ _render_map(); } +#endif +static int render_map_rect(lua_State* L) +{ + CoreSuspender suspender; + + int x = luaL_checkint(L, 1); + int y = luaL_checkint(L, 2); + int z = luaL_checkint(L, 3); + int w = luaL_checkint(L, 4); + int h = luaL_checkint(L, 5); + //backup state + uint8_t *s = df::global::gps->screen; + int32_t win_h = df::global::gps->dimy; + int32_t was_x = *window_x; + int32_t was_y = *window_y; + int32_t was_z = *window_z; + int32_t gx = df::global::init->display.grid_x; + int32_t gy = df::global::init->display.grid_y; + df::global::init->display.grid_x = w+1; + df::global::init->display.grid_y = h+1; + *window_x = x; + *window_y = y; + *window_z = z; + //force full redraw + df::global::gps->force_full_display_count = 1; + for (int ty = 0; ty < h; ty++) + for (int tx = 0; tx < w; tx++) + { + for (int i = 0; i < 4; i++) + { + int t = (tx + 1)*win_h + ty + 1; + s[t * 4 + i] = 0; + } + } + render_map(); + //restore state + *window_x = was_x; + *window_y = was_y; + *window_z = was_z; + df::global::init->display.grid_x = gx; + df::global::init->display.grid_y = gy; + + lua_createtable(L,w*h*4,0); + + int counter = 0; + for (int ty = 0; ty < h; ty++) + for (int tx = 0; tx < w; tx++) + { + for (int i = 0; i < 4;i++) + { + int t = (tx + 1)*win_h + ty + 1; + lua_pushnumber(L, s[t*4+i]); + lua_rawseti(L, -2, counter); + counter++; + } + } + return 1; +} + +DFHACK_PLUGIN_LUA_COMMANDS{ + DFHACK_LUA_COMMAND(render_map_rect), + DFHACK_LUA_END +}; + +DFhackCExport command_result plugin_init(color_ostream &out, std::vector &commands) +{ + auto addr =reinterpret_cast(Core::getInstance().vinfo->getAddress("twbt_render_map")); + if (addr == nullptr) + return CR_FAILURE; + _render_map = addr; + return CR_OK; +} + +DFhackCExport command_result plugin_shutdown(color_ostream &out) +{ + return CR_OK; +} From 6a65ad2fcbb6d4cb3a6d4cc6ddc53837c3079db2 Mon Sep 17 00:00:00 2001 From: Warmist Date: Sat, 21 Oct 2017 14:07:07 +0300 Subject: [PATCH 02/12] add more functions (not used yet) and fix linux --- plugins/twbt-utils.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/plugins/twbt-utils.cpp b/plugins/twbt-utils.cpp index 7524ac29e..4532f3320 100644 --- a/plugins/twbt-utils.cpp +++ b/plugins/twbt-utils.cpp @@ -12,6 +12,8 @@ #include "df/init.h" #include "df/renderer.h" #include "df/graphic.h" +#include "df/enabler.h" +#include "df/map_renderer.h" using std::string; using std::vector; @@ -23,6 +25,7 @@ REQUIRE_GLOBAL(window_x) REQUIRE_GLOBAL(window_y) REQUIRE_GLOBAL(window_z) REQUIRE_GLOBAL_NO_USE(gps) +REQUIRE_GLOBAL_NO_USE(enabler) #ifdef WIN32 // On Windows there's no convert_magenta parameter. Arguments are pushed onto stack, @@ -34,15 +37,31 @@ REQUIRE_GLOBAL_NO_USE(gps) typedef void(_stdcall *RENDER_UPDOWN)(); RENDER_MAP _render_map; + RENDER_UPDOWN _render_updown; + LOAD_MULTI_PDIM _load_multi_pdim; + void render_map(){ _render_map(0); } + void render_updown() { _render_updown(); } + void load_tileset(const string &filename, long * tex_pos, long dimx, long dimy, long* disp_x,long* disp_y) { + _load_multi_pdim(tex_pos, filename, &df::global::enabler->textures, dimx, dimy, disp_x, disp_y); + } #else +REQUIRE_GLOBAL_NO_USE(map_renderer) + typedef void(*LOAD_MULTI_PDIM)(void *tex, const string &filename, long *tex_pos, long dimx, long dimy, bool convert_magenta, long *disp_x, long *disp_y); typedef void(*RENDER_MAP)(void*, int); typedef void(*RENDER_UPDOWN)(void*); - RENDER_MAP _render_map; - void render_map(){ _render_map(); } + RENDER_MAP _render_map; + RENDER_UPDOWN _render_updown; + LOAD_MULTI_PDIM _load_multi_pdim; + + void render_map(){ _render_map(df::global::map_renderer,0); } + void render_updown() { _render_updown(df::global::map_renderer); } + void load_tileset(const string &filename, long * tex_pos, long dimx, long dimy, long* disp_x, long* disp_y) { + _load_multi_pdim(&df::global::enabler->textures, filename,tex_pos, &df::global::enabler->textures, dimx, dimy,true, disp_x, disp_y); + } #endif static int render_map_rect(lua_State* L) { From 04465f59f5bb7a3f60e3d643b41b6f43ccdf97ab Mon Sep 17 00:00:00 2001 From: Warmist Date: Sat, 21 Oct 2017 14:27:08 +0300 Subject: [PATCH 03/12] Fix spaces and fix linux (again) --- plugins/twbt-utils.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/plugins/twbt-utils.cpp b/plugins/twbt-utils.cpp index 4532f3320..dd63418ca 100644 --- a/plugins/twbt-utils.cpp +++ b/plugins/twbt-utils.cpp @@ -37,14 +37,14 @@ REQUIRE_GLOBAL_NO_USE(enabler) typedef void(_stdcall *RENDER_UPDOWN)(); RENDER_MAP _render_map; - RENDER_UPDOWN _render_updown; - LOAD_MULTI_PDIM _load_multi_pdim; + RENDER_UPDOWN _render_updown; + LOAD_MULTI_PDIM _load_multi_pdim; void render_map(){ _render_map(0); } - void render_updown() { _render_updown(); } - void load_tileset(const string &filename, long * tex_pos, long dimx, long dimy, long* disp_x,long* disp_y) { - _load_multi_pdim(tex_pos, filename, &df::global::enabler->textures, dimx, dimy, disp_x, disp_y); - } + void render_updown() { _render_updown(); } + void load_tileset(const string &filename, long * tex_pos, long dimx, long dimy, long* disp_x,long* disp_y) { + _load_multi_pdim(tex_pos, filename, &df::global::enabler->textures, dimx, dimy, disp_x, disp_y); + } #else REQUIRE_GLOBAL_NO_USE(map_renderer) @@ -53,15 +53,15 @@ REQUIRE_GLOBAL_NO_USE(map_renderer) typedef void(*RENDER_MAP)(void*, int); typedef void(*RENDER_UPDOWN)(void*); - RENDER_MAP _render_map; - RENDER_UPDOWN _render_updown; - LOAD_MULTI_PDIM _load_multi_pdim; + RENDER_MAP _render_map; + RENDER_UPDOWN _render_updown; + LOAD_MULTI_PDIM _load_multi_pdim; void render_map(){ _render_map(df::global::map_renderer,0); } - void render_updown() { _render_updown(df::global::map_renderer); } - void load_tileset(const string &filename, long * tex_pos, long dimx, long dimy, long* disp_x, long* disp_y) { - _load_multi_pdim(&df::global::enabler->textures, filename,tex_pos, &df::global::enabler->textures, dimx, dimy,true, disp_x, disp_y); - } + void render_updown() { _render_updown(df::global::map_renderer); } + void load_tileset(const string &filename, long * tex_pos, long dimx, long dimy, long* disp_x, long* disp_y) { + _load_multi_pdim(&df::global::enabler->textures, filename,tex_pos, dimx, dimy,true, disp_x, disp_y); + } #endif static int render_map_rect(lua_State* L) { From d6df9cd257ddada6394cb1e08af7cbe0416adef0 Mon Sep 17 00:00:00 2001 From: Warmist Date: Sun, 31 Dec 2017 11:39:51 +0200 Subject: [PATCH 04/12] tidying up --- plugins/twbt-utils.cpp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/plugins/twbt-utils.cpp b/plugins/twbt-utils.cpp index dd63418ca..4dbe3ca45 100644 --- a/plugins/twbt-utils.cpp +++ b/plugins/twbt-utils.cpp @@ -26,42 +26,23 @@ REQUIRE_GLOBAL(window_y) REQUIRE_GLOBAL(window_z) REQUIRE_GLOBAL_NO_USE(gps) REQUIRE_GLOBAL_NO_USE(enabler) +REQUIRE_GLOBAL_NO_USE(twbt_render_map) #ifdef WIN32 - // On Windows there's no convert_magenta parameter. Arguments are pushed onto stack, - // except for tex_pos and filename, which go into ecx and edx. Simulating this with __fastcall. - typedef void(__fastcall *LOAD_MULTI_PDIM)(long *tex_pos, const string &filename, void *tex, long dimx, long dimy, long *disp_x, long *disp_y); - // On Windows there's no parameter pointing to the map_renderer structure typedef void(_stdcall *RENDER_MAP)(int); - typedef void(_stdcall *RENDER_UPDOWN)(); RENDER_MAP _render_map; - RENDER_UPDOWN _render_updown; - LOAD_MULTI_PDIM _load_multi_pdim; void render_map(){ _render_map(0); } - void render_updown() { _render_updown(); } - void load_tileset(const string &filename, long * tex_pos, long dimx, long dimy, long* disp_x,long* disp_y) { - _load_multi_pdim(tex_pos, filename, &df::global::enabler->textures, dimx, dimy, disp_x, disp_y); - } #else REQUIRE_GLOBAL_NO_USE(map_renderer) - typedef void(*LOAD_MULTI_PDIM)(void *tex, const string &filename, long *tex_pos, long dimx, long dimy, bool convert_magenta, long *disp_x, long *disp_y); - typedef void(*RENDER_MAP)(void*, int); - typedef void(*RENDER_UPDOWN)(void*); RENDER_MAP _render_map; - RENDER_UPDOWN _render_updown; - LOAD_MULTI_PDIM _load_multi_pdim; void render_map(){ _render_map(df::global::map_renderer,0); } - void render_updown() { _render_updown(df::global::map_renderer); } - void load_tileset(const string &filename, long * tex_pos, long dimx, long dimy, long* disp_x, long* disp_y) { - _load_multi_pdim(&df::global::enabler->textures, filename,tex_pos, dimx, dimy,true, disp_x, disp_y); - } #endif static int render_map_rect(lua_State* L) { From cb9c964722ebe10ac313a61f853b0960b0094e15 Mon Sep 17 00:00:00 2001 From: Warmist Date: Fri, 12 Oct 2018 10:40:20 +0300 Subject: [PATCH 05/12] Rename twbt-utils to map-render --- plugins/CMakeLists.txt | 2 +- plugins/{twbt-utils.cpp => map-render.cpp} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename plugins/{twbt-utils.cpp => map-render.cpp} (99%) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 7a26188b5..f2e2ee030 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -135,6 +135,7 @@ if (BUILD_SUPPORTED) DFHACK_PLUGIN(liquids liquids.cpp Brushes.h LINK_LIBRARIES lua) DFHACK_PLUGIN(luasocket luasocket.cpp LINK_LIBRARIES clsocket lua dfhack-tinythread) DFHACK_PLUGIN(manipulator manipulator.cpp) + DFHACK_PLUGIN(map-render map-render.cpp LINK_LIBRARIES lua) DFHACK_PLUGIN(misery misery.cpp) DFHACK_PLUGIN(mode mode.cpp) DFHACK_PLUGIN(mousequery mousequery.cpp) @@ -151,7 +152,6 @@ if (BUILD_SUPPORTED) add_subdirectory(rendermax) DFHACK_PLUGIN(resume resume.cpp) DFHACK_PLUGIN(reveal reveal.cpp) - DFHACK_PLUGIN(twbt-utils twbt-utils.cpp LINK_LIBRARIES lua) DFHACK_PLUGIN(search search.cpp) DFHACK_PLUGIN(seedwatch seedwatch.cpp) DFHACK_PLUGIN(showmood showmood.cpp) diff --git a/plugins/twbt-utils.cpp b/plugins/map-render.cpp similarity index 99% rename from plugins/twbt-utils.cpp rename to plugins/map-render.cpp index 4dbe3ca45..c3506ff59 100644 --- a/plugins/twbt-utils.cpp +++ b/plugins/map-render.cpp @@ -20,7 +20,7 @@ using std::vector; using namespace DFHack; using namespace df::enums; -DFHACK_PLUGIN("twbt-utils"); +DFHACK_PLUGIN("map-render"); REQUIRE_GLOBAL(window_x) REQUIRE_GLOBAL(window_y) REQUIRE_GLOBAL(window_z) From f74ee143ddbc8b09169813430d963f583b71bc50 Mon Sep 17 00:00:00 2001 From: Warmist Date: Fri, 12 Oct 2018 10:40:44 +0300 Subject: [PATCH 06/12] Might as well use REQUIRE_GLOBAL --- plugins/map-render.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/map-render.cpp b/plugins/map-render.cpp index c3506ff59..52a7f7699 100644 --- a/plugins/map-render.cpp +++ b/plugins/map-render.cpp @@ -36,13 +36,13 @@ REQUIRE_GLOBAL_NO_USE(twbt_render_map) void render_map(){ _render_map(0); } #else -REQUIRE_GLOBAL_NO_USE(map_renderer) +REQUIRE_GLOBAL(map_renderer) typedef void(*RENDER_MAP)(void*, int); RENDER_MAP _render_map; - void render_map(){ _render_map(df::global::map_renderer,0); } + void render_map(){ _render_map(map_renderer,0); } #endif static int render_map_rect(lua_State* L) { From d9d470e4b6d474f6d4b2347a5e1b21dc6369d237 Mon Sep 17 00:00:00 2001 From: Warmist Date: Fri, 12 Oct 2018 10:41:43 +0300 Subject: [PATCH 07/12] Missing REQUIRE_GLOBAL(init) --- plugins/map-render.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/map-render.cpp b/plugins/map-render.cpp index 52a7f7699..1de871741 100644 --- a/plugins/map-render.cpp +++ b/plugins/map-render.cpp @@ -27,6 +27,7 @@ REQUIRE_GLOBAL(window_z) REQUIRE_GLOBAL_NO_USE(gps) REQUIRE_GLOBAL_NO_USE(enabler) REQUIRE_GLOBAL_NO_USE(twbt_render_map) +REQUIRE_GLOBAL(init) #ifdef WIN32 // On Windows there's no parameter pointing to the map_renderer structure @@ -59,10 +60,10 @@ static int render_map_rect(lua_State* L) int32_t was_x = *window_x; int32_t was_y = *window_y; int32_t was_z = *window_z; - int32_t gx = df::global::init->display.grid_x; - int32_t gy = df::global::init->display.grid_y; - df::global::init->display.grid_x = w+1; - df::global::init->display.grid_y = h+1; + int32_t gx = init->display.grid_x; + int32_t gy = init->display.grid_y; + init->display.grid_x = w+1; + init->display.grid_y = h+1; *window_x = x; *window_y = y; *window_z = z; @@ -82,8 +83,8 @@ static int render_map_rect(lua_State* L) *window_x = was_x; *window_y = was_y; *window_z = was_z; - df::global::init->display.grid_x = gx; - df::global::init->display.grid_y = gy; + init->display.grid_x = gx; + init->display.grid_y = gy; lua_createtable(L,w*h*4,0); From 5c1b7030e739ddf32683cd9d3e87086ab93bd7c5 Mon Sep 17 00:00:00 2001 From: Warmist Date: Fri, 12 Oct 2018 10:44:56 +0300 Subject: [PATCH 08/12] Also rename the plugin lua file --- plugins/lua/{twbt-utils.lua => map-render.lua} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename plugins/lua/{twbt-utils.lua => map-render.lua} (63%) diff --git a/plugins/lua/twbt-utils.lua b/plugins/lua/map-render.lua similarity index 63% rename from plugins/lua/twbt-utils.lua rename to plugins/lua/map-render.lua index 56bdb0b19..9785c365e 100644 --- a/plugins/lua/twbt-utils.lua +++ b/plugins/lua/map-render.lua @@ -1,4 +1,4 @@ -local _ENV = mkmodule('plugins.twbt-utils') +local _ENV = mkmodule('plugins.map-render') --[[ From ff452f9181ed51dd3be1d05640cf78f0096330f1 Mon Sep 17 00:00:00 2001 From: Warmist Date: Fri, 12 Oct 2018 13:37:49 +0300 Subject: [PATCH 09/12] Add more comments --- plugins/map-render.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/map-render.cpp b/plugins/map-render.cpp index 1de871741..d299c237c 100644 --- a/plugins/map-render.cpp +++ b/plugins/map-render.cpp @@ -54,8 +54,9 @@ static int render_map_rect(lua_State* L) int z = luaL_checkint(L, 3); int w = luaL_checkint(L, 4); int h = luaL_checkint(L, 5); + uint8_t *s = df::global::gps->screen; //backup state - uint8_t *s = df::global::gps->screen; + //TODO: figure out if we can replace screen with other pointer. That way it could be a bit more tidy int32_t win_h = df::global::gps->dimy; int32_t was_x = *window_x; int32_t was_y = *window_y; @@ -69,6 +70,7 @@ static int render_map_rect(lua_State* L) *window_z = z; //force full redraw df::global::gps->force_full_display_count = 1; + //this modifies screen so it REALLY wants to redraw stuff for (int ty = 0; ty < h; ty++) for (int tx = 0; tx < w; tx++) { From 96d11d1f543883bfb63147bfaefce9df16a812b2 Mon Sep 17 00:00:00 2001 From: Warmist Date: Fri, 12 Oct 2018 13:48:53 +0300 Subject: [PATCH 10/12] Add to docs --- docs/Lua API.rst | 16 ++++++++++++++++ docs/Plugins.rst | 1 + 2 files changed, 17 insertions(+) diff --git a/docs/Lua API.rst b/docs/Lua API.rst index 3eb053e73..a5894a3a5 100644 --- a/docs/Lua API.rst +++ b/docs/Lua API.rst @@ -3920,6 +3920,22 @@ A class with all the tcp functionality. Tries connecting to that address and port. Returns ``client`` object. + +.. _map-render: + +map-render +========== + +A way to ask df to render a slice of map. This uses native df rendering function so it's highly dependant on +df settings (e.g. used tileset, colors, if using graphics or not and so on...) + +Functions +--------- + +- ``render_map_rect(x,y,z,w,h)`` + + returns a table with w*h*4 entries of rendered tiles. The format is same as ``df.global.gps.screen`` (tile,foreground,bright,background). + .. _cxxrandom: cxxrandom diff --git a/docs/Plugins.rst b/docs/Plugins.rst index 62ddf29e6..458a43722 100644 --- a/docs/Plugins.rst +++ b/docs/Plugins.rst @@ -2745,4 +2745,5 @@ in the `lua-api` file under `lua-plugins`: * `eventful` * `building-hacks` * `luasocket` +* `map-render` * `cxxrandom` From b43ecf5fb1f9ea69088ac55ff95cba9b8667a930 Mon Sep 17 00:00:00 2001 From: Warmist Date: Thu, 6 Dec 2018 15:20:33 +0200 Subject: [PATCH 11/12] Update Lua API.rst Remove trailing whitespace --- docs/Lua API.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Lua API.rst b/docs/Lua API.rst index a5894a3a5..a4130096b 100644 --- a/docs/Lua API.rst +++ b/docs/Lua API.rst @@ -3926,7 +3926,7 @@ A class with all the tcp functionality. map-render ========== -A way to ask df to render a slice of map. This uses native df rendering function so it's highly dependant on +A way to ask df to render a slice of map. This uses native df rendering function so it's highly dependant on df settings (e.g. used tileset, colors, if using graphics or not and so on...) Functions From b1f9486edde856f43542259c860c9861e57f33fe Mon Sep 17 00:00:00 2001 From: Warmist Date: Thu, 6 Dec 2018 15:21:19 +0200 Subject: [PATCH 12/12] Update map-render.cpp Remove tabs --- plugins/map-render.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/map-render.cpp b/plugins/map-render.cpp index d299c237c..f89d8ab4e 100644 --- a/plugins/map-render.cpp +++ b/plugins/map-render.cpp @@ -54,9 +54,9 @@ static int render_map_rect(lua_State* L) int z = luaL_checkint(L, 3); int w = luaL_checkint(L, 4); int h = luaL_checkint(L, 5); - uint8_t *s = df::global::gps->screen; + uint8_t *s = df::global::gps->screen; //backup state - //TODO: figure out if we can replace screen with other pointer. That way it could be a bit more tidy + //TODO: figure out if we can replace screen with other pointer. That way it could be a bit more tidy int32_t win_h = df::global::gps->dimy; int32_t was_x = *window_x; int32_t was_y = *window_y; @@ -70,7 +70,7 @@ static int render_map_rect(lua_State* L) *window_z = z; //force full redraw df::global::gps->force_full_display_count = 1; - //this modifies screen so it REALLY wants to redraw stuff + //this modifies screen so it REALLY wants to redraw stuff for (int ty = 0; ty < h; ty++) for (int tx = 0; tx < w; tx++) {