Interpolate cutscene bars position

Cutscene bars will now smoothly fade in and out at above 30 FPS instead
of at 30 FPS only.
This commit is contained in:
Misa
2020-04-28 17:16:24 -07:00
committed by Ethan Lee
parent 6655ae418c
commit 2510d3a6ba
5 changed files with 13 additions and 4 deletions

View File

@@ -33,6 +33,7 @@ void Graphics::init()
showcutscenebars = false;
cutscenebarspos = 0;
oldcutscenebarspos = 0;
notextoutline = false;
flipmode = false;
@@ -837,10 +838,11 @@ void Graphics::drawpartimage( int t, int xp, int yp, int wp, int hp)
void Graphics::cutscenebars()
{
int usethispos = lerp(oldcutscenebarspos, cutscenebarspos);
if (showcutscenebars)
{
FillRect(backBuffer, 0, 0, cutscenebarspos, 16, 0x000000);
FillRect(backBuffer, 360-cutscenebarspos, 224, cutscenebarspos, 16, 0x000000);
FillRect(backBuffer, 0, 0, usethispos, 16, 0x000000);
FillRect(backBuffer, 360-usethispos, 224, usethispos, 16, 0x000000);
}
else
{
@@ -848,14 +850,15 @@ void Graphics::cutscenebars()
if (cutscenebarspos > 0)
{
//draw
FillRect(backBuffer, 0, 0, cutscenebarspos, 16, 0x000000);
FillRect(backBuffer, 360-cutscenebarspos, 224, cutscenebarspos, 16, 0x000000);
FillRect(backBuffer, 0, 0, usethispos, 16, 0x000000);
FillRect(backBuffer, 360-usethispos, 224, usethispos, 16, 0x000000);
}
}
}
void Graphics::cutscenebarstimer()
{
oldcutscenebarspos = cutscenebarspos;
if (showcutscenebars)
{
cutscenebarspos += 25;