diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 14b44ec6..e4d3462f 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -150,6 +150,7 @@ void Game::init(void) completestop = false; activeactivity = -1; act_fade = 0; + prev_act_fade = 0; backgroundtext = false; startscript = false; newscript = ""; diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index d9a647b8..48a669f1 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -327,6 +327,7 @@ public: bool backgroundtext; int activeactivity, act_fade; + int prev_act_fade; bool press_left, press_right, press_action, press_map; diff --git a/desktop_version/src/Logic.cpp b/desktop_version/src/Logic.cpp index 7a6a4340..f9086f6c 100644 --- a/desktop_version/src/Logic.cpp +++ b/desktop_version/src/Logic.cpp @@ -1516,6 +1516,7 @@ void gamelogic() } #endif + game.prev_act_fade = game.act_fade; if (game.activeactivity > -1) { if (game.act_fade < 5) diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index 66bf397e..055901d7 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -1629,21 +1629,22 @@ void gamerender() } } + float act_alpha = graphics.lerp(game.prev_act_fade, game.act_fade) / 10.0f; if (game.activeactivity > -1) { 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; - graphics.drawtextbox(16, 4, 36, 3, game.activity_r*(game.act_fade/10.0f), game.activity_g*(game.act_fade/10.0f), game.activity_b*(game.act_fade/10.0f)); - graphics.Print(5, 12, game.activity_lastprompt, game.activity_r*(game.act_fade/10.0f), game.activity_g*(game.act_fade/10.0f), game.activity_b*(game.act_fade/10.0f), true); + graphics.drawtextbox(16, 4, 36, 3, game.activity_r*act_alpha, game.activity_g*act_alpha, game.activity_b*act_alpha); + graphics.Print(5, 12, game.activity_lastprompt, game.activity_r*act_alpha, game.activity_g*act_alpha, game.activity_b*act_alpha, true); } else { if(game.act_fade>5) { - graphics.drawtextbox(16, 4, 36, 3, game.activity_r*(game.act_fade/10.0f), game.activity_g*(game.act_fade/10.0f), game.activity_b*(game.act_fade/10.0f)); - graphics.Print(5, 12, game.activity_lastprompt, game.activity_r*(game.act_fade/10.0f), game.activity_g*(game.act_fade/10.0f), game.activity_b*(game.act_fade/10.0f), true); + graphics.drawtextbox(16, 4, 36, 3, game.activity_r*act_alpha, game.activity_g*act_alpha, game.activity_b*act_alpha); + graphics.Print(5, 12, game.activity_lastprompt, game.activity_r*act_alpha, game.activity_g*act_alpha, game.activity_b*act_alpha, true); } }