From 088fa9a35c55d313f8311742042972fe496d3ec3 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Thu, 31 Aug 2023 10:53:43 -0700 Subject: [PATCH] instrument textures module and clean up gui --- library/lua/gui.lua | 10 +++++----- library/modules/Textures.cpp | 5 +++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/library/lua/gui.lua b/library/lua/gui.lua index 1a4a7f197..bba7222b9 100644 --- a/library/lua/gui.lua +++ b/library/lua/gui.lua @@ -940,21 +940,21 @@ function FRAME_WINDOW(resizable) end return frame end -function FRAME_PANEL(resizable) +function FRAME_PANEL() return make_frame(textures.tp_border_panel, false) end -function FRAME_MEDIUM(resizable) +function FRAME_MEDIUM() return make_frame(textures.tp_border_medium, false) end -function FRAME_BOLD(resizable) +function FRAME_BOLD() return make_frame(textures.tp_border_bold, true) end -function FRAME_INTERIOR(resizable) +function FRAME_INTERIOR() local frame = make_frame(textures.tp_border_thin, false) frame.signature_pen = false return frame end -function FRAME_INTERIOR_MEDIUM(resizable) +function FRAME_INTERIOR_MEDIUM() local frame = make_frame(textures.tp_border_medium, false) frame.signature_pen = false return frame diff --git a/library/modules/Textures.cpp b/library/modules/Textures.cpp index 25af2135a..7a6964732 100644 --- a/library/modules/Textures.cpp +++ b/library/modules/Textures.cpp @@ -191,6 +191,7 @@ void Textures::deleteHandle(TexposHandle handle) { } static void reset_texpos() { + DEBUG(textures).print("resetting texture mappings\n"); g_handle_to_texpos.clear(); } @@ -207,6 +208,7 @@ struct tracking_stage_new_region : df::viewscreen_new_regionst { DEFINE_VMETHOD_INTERPOSE(void, logic, ()) { if (this->m_raw_load_stage != this->raw_load_stage) { + TRACE(textures).print("raw_load_stage %d -> %d\n", this->m_raw_load_stage, this->raw_load_stage); this->m_raw_load_stage = this->raw_load_stage; if (this->m_raw_load_stage == 1) reset_texpos(); @@ -225,6 +227,7 @@ struct tracking_stage_adopt_region : df::viewscreen_adopt_regionst { DEFINE_VMETHOD_INTERPOSE(void, logic, ()) { if (this->m_cur_step != this->cur_step) { + TRACE(textures).print("step %d -> %d\n", this->m_cur_step, this->cur_step); this->m_cur_step = this->cur_step; if (this->m_cur_step == 1) reset_texpos(); @@ -243,6 +246,7 @@ struct tracking_stage_load_region : df::viewscreen_loadgamest { DEFINE_VMETHOD_INTERPOSE(void, logic, ()) { if (this->m_cur_step != this->cur_step) { + TRACE(textures).print("step %d -> %d\n", this->m_cur_step, this->cur_step); this->m_cur_step = this->cur_step; if (this->m_cur_step == 1) reset_texpos(); @@ -261,6 +265,7 @@ struct tracking_stage_new_arena : df::viewscreen_new_arenast { DEFINE_VMETHOD_INTERPOSE(void, logic, ()) { if (this->m_cur_step != this->cur_step) { + TRACE(textures).print("step %d -> %d\n", this->m_cur_step, this->cur_step); this->m_cur_step = this->cur_step; if (this->m_cur_step == 0) reset_texpos();