From 9f69506acf713be01e19f70d70dd6d65eba4985c Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 5 Mar 2021 10:41:35 -0800 Subject: [PATCH] Move activity prompt render updating to gamerenderfixed() This probably should've been moved to RenderFixed a while ago, because it's unnecessary to run this on every single deltaframe. The only minor wrinkle here is that this means rendering of activity zone fades will be delayed for 1 frame, but #535 will fix that. --- desktop_version/src/Logic.cpp | 8 ++++++++ desktop_version/src/Render.cpp | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/desktop_version/src/Logic.cpp b/desktop_version/src/Logic.cpp index fb28c4a4..43cf3c24 100644 --- a/desktop_version/src/Logic.cpp +++ b/desktop_version/src/Logic.cpp @@ -1527,6 +1527,14 @@ void gamelogic(void) game.activeactivity = obj.checkactivity(); + if (INBOUNDS_VEC(game.activeactivity, obj.entities)) + { + game.activity_lastprompt = obj.blocks[game.activeactivity].prompt; + game.activity_r = obj.blocks[game.activeactivity].r; + game.activity_g = obj.blocks[game.activeactivity].g; + game.activity_b = obj.blocks[game.activeactivity].b; + } + game.oldreadytotele = game.readytotele; if (game.activetele && !game.advancetext && game.hascontrol && !script.running && !game.intimetrial) { diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index d70a6b50..1df3543c 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -1688,13 +1688,6 @@ void gamerender(void) } float act_alpha = graphics.lerp(game.prev_act_fade, game.act_fade) / 10.0f; - if (INBOUNDS_VEC(game.activeactivity, obj.entities)) - { - game.activity_lastprompt = obj.blocks[game.activeactivity].prompt; - game.activity_r = obj.blocks[game.activeactivity].r; - game.activity_g = obj.blocks[game.activeactivity].g; - game.activity_b = obj.blocks[game.activeactivity].b; - } if(game.act_fade>5 || game.prev_act_fade>5) { graphics.drawtextbox(16, 4, 36, 3, game.activity_r*act_alpha, game.activity_g*act_alpha, game.activity_b*act_alpha);