From dcc9520d8fd68ceaee96a526257565e8d418f80c Mon Sep 17 00:00:00 2001 From: Misa Date: Wed, 29 Apr 2020 16:54:36 -0700 Subject: [PATCH] Interpolate trophy text Just to make sure it's extra smooth. Not that it will be noticeable, and you can't access the Secret Lab in slowmode without modifying the game, but it's nice to have this. --- desktop_version/src/Entity.cpp | 1 + desktop_version/src/Entity.h | 1 + desktop_version/src/Graphics.cpp | 7 ++++--- desktop_version/src/Logic.cpp | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index 90b7761e..dee34ca9 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -62,6 +62,7 @@ void entityclass::init() customenemy=0; customwarpmode=false; customwarpmodevon=false; customwarpmodehon=false; trophytext = 0 ; + oldtrophytext = 0; trophytype = 0; altstates = 0; diff --git a/desktop_version/src/Entity.h b/desktop_version/src/Entity.h index b15dcfbf..c409ec70 100644 --- a/desktop_version/src/Entity.h +++ b/desktop_version/src/Entity.h @@ -197,6 +197,7 @@ public: //Trophy Text int trophytext, trophytype; + int oldtrophytext; //Secret lab scripts int altstates; diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index d749c970..5650f38c 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -1369,9 +1369,10 @@ void Graphics::drawtrophytext() if (obj.trophytext < 15) { - temp = (196 * obj.trophytext) / 15; - temp2 = (196 * obj.trophytext) / 15; - temp3 = ((255 - help.glow) * obj.trophytext) / 15; + int usethismult = lerp(obj.oldtrophytext, obj.trophytext); + temp = (196 * usethismult) / 15; + temp2 = (196 * usethismult) / 15; + temp3 = ((255 - help.glow) * usethismult) / 15; } else { diff --git a/desktop_version/src/Logic.cpp b/desktop_version/src/Logic.cpp index 0f3a7298..eb9e55a8 100644 --- a/desktop_version/src/Logic.cpp +++ b/desktop_version/src/Logic.cpp @@ -247,6 +247,8 @@ void gamelogic() obj.upset = 0; } + obj.oldtrophytext = obj.trophytext; + if (map.towermode) { if(!game.completestop)