From 2890c4b075474f3b679d2e5f7b13b91b65606988 Mon Sep 17 00:00:00 2001 From: SuuperW Date: Wed, 15 Aug 2018 00:47:27 -0500 Subject: [PATCH] Regression fix: Lua functions which draw to the screen work again. --- desmume/src/frontend/windows/display.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desmume/src/frontend/windows/display.cpp b/desmume/src/frontend/windows/display.cpp index 471463a5f..7c7bd3b74 100644 --- a/desmume/src/frontend/windows/display.cpp +++ b/desmume/src/frontend/windows/display.cpp @@ -693,6 +693,8 @@ void DoDisplay() ColorspaceApplyIntensityToBuffer32(video.buffer, pixCount, displayInfo.backlightIntensity[NDSDisplayID_Main]); ColorspaceApplyIntensityToBuffer32(video.buffer + pixCount, pixCount, displayInfo.backlightIntensity[NDSDisplayID_Touch]); + // Lua draws to the HUD buffer, so clear it here instead of right before redrawing the HUD. + aggDraw.hud->clear(); if (AnyLuaActive()) { if (sthread_isself(display_thread)) @@ -707,7 +709,6 @@ void DoDisplay() } // draw hud - aggDraw.hud->clear(); DoDisplay_DrawHud(); if (displayMethod == DISPMETHOD_DDRAW_HW || displayMethod == DISPMETHOD_DDRAW_SW) {