1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-11-16 16:09:42 +01:00

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.
This commit is contained in:
Misa 2021-03-05 10:41:35 -08:00 committed by Ethan Lee
parent 84928f8210
commit 9f69506acf
2 changed files with 8 additions and 7 deletions

View file

@ -1527,6 +1527,14 @@ void gamelogic(void)
game.activeactivity = obj.checkactivity(); 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; game.oldreadytotele = game.readytotele;
if (game.activetele && !game.advancetext && game.hascontrol && !script.running && !game.intimetrial) if (game.activetele && !game.advancetext && game.hascontrol && !script.running && !game.intimetrial)
{ {

View file

@ -1688,13 +1688,6 @@ void gamerender(void)
} }
float act_alpha = graphics.lerp(game.prev_act_fade, game.act_fade) / 10.0f; 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) 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); graphics.drawtextbox(16, 4, 36, 3, game.activity_r*act_alpha, game.activity_g*act_alpha, game.activity_b*act_alpha);