From b4da17df58415788ca30c45fa5c6d977ae84a102 Mon Sep 17 00:00:00 2001 From: sonil Date: Mon, 24 Oct 2022 16:01:53 +0800 Subject: [PATCH] fix refresh rect --- src/display_monitor.cc | 14 ++++++++------ src/interface.cc | 10 +++++++--- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/display_monitor.cc b/src/display_monitor.cc index 6485f67..5ed676d 100644 --- a/src/display_monitor.cc +++ b/src/display_monitor.cc @@ -59,12 +59,7 @@ static bool gDisplayMonitorInitialized = false; // The rectangle that display monitor occupies in the main interface window. // // 0x518510 -static const Rect gDisplayMonitorRect = { - DISPLAY_MONITOR_X, - DISPLAY_MONITOR_Y, - DISPLAY_MONITOR_X + DISPLAY_MONITOR_WIDTH - 1, - DISPLAY_MONITOR_Y + DISPLAY_MONITOR_HEIGHT - 1, -}; +static Rect gDisplayMonitorRect; // 0x518520 static int gDisplayMonitorScrollDownButton = -1; @@ -106,6 +101,13 @@ static int gConsoleFilePrintCount = 0; int displayMonitorInit() { if (!gDisplayMonitorInitialized) { + gDisplayMonitorRect = { + DISPLAY_MONITOR_X, + DISPLAY_MONITOR_Y, + DISPLAY_MONITOR_X + DISPLAY_MONITOR_WIDTH - 1, + DISPLAY_MONITOR_Y + DISPLAY_MONITOR_HEIGHT - 1, + }; + int oldFont = fontGetCurrent(); fontSetCurrent(DISPLAY_MONITOR_FONT); diff --git a/src/interface.cc b/src/interface.cc index 4ec7fff..1f4bf43 100644 --- a/src/interface.cc +++ b/src/interface.cc @@ -161,7 +161,7 @@ static int gSingleAttackButton = -1; static int gInterfaceCurrentHand = HAND_LEFT; // 0x518F7C -static const Rect gInterfaceBarMainActionRect = { 267 + 160, 26, 455 + 160, 93 }; +static Rect gInterfaceBarMainActionRect; // 0x518F8C static int gChangeHandsButton = -1; @@ -172,7 +172,7 @@ static bool gInterfaceBarEndButtonsIsVisible = false; // Combat mode curtains rect. // // 0x518FA0 -static const Rect gInterfaceBarEndButtonsRect = { 580 + 160, 38, 637 + 160, 96 }; +static Rect gInterfaceBarEndButtonsRect; // 0x518FB0 static int gEndTurnButton = -1; @@ -181,7 +181,7 @@ static int gEndTurnButton = -1; static int gEndCombatButton = -1; // 0x518FD4 -static const Rect gInterfaceBarActionPointsBarRect = { 316 + 160, 14, 406 + 160, 19 }; +static Rect gInterfaceBarActionPointsBarRect; // 0x518FE8 static IndicatorDescription gIndicatorDescriptions[INDICATOR_COUNT] = { @@ -356,6 +356,10 @@ int interfaceInit() CustomInterfaceBarInit(); + gInterfaceBarActionPointsBarRect = { 316 + ifaceOffset, 14, 406 + ifaceOffset, 19 }; + gInterfaceBarEndButtonsRect = { 580 + ifaceOffset, 38, 637 + ifaceOffset, 96 }; + gInterfaceBarMainActionRect = { 267 + ifaceOffset, 26, 455 + ifaceOffset, 93 }; + gInterfaceBarInitialized = 1; int interfaceBarWindowX = (screenGetWidth() - gInterfaceBarWidth) / 2;