mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
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:
@@ -3440,6 +3440,7 @@ void Game::updatestate()
|
||||
map.finaly = 100;
|
||||
|
||||
graphics.cutscenebarspos = 320;
|
||||
graphics.oldcutscenebarspos = 320;
|
||||
|
||||
teleport_to_new_area = true;
|
||||
teleportscript = "gamecomplete";
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -269,6 +269,7 @@ public:
|
||||
|
||||
bool showcutscenebars;
|
||||
int cutscenebarspos;
|
||||
int oldcutscenebarspos;
|
||||
|
||||
std::vector<SDL_Rect> stars;
|
||||
std::vector<int> starsspeed;
|
||||
|
||||
@@ -65,6 +65,7 @@ void gamecompletelogic()
|
||||
//Fix some graphical things
|
||||
graphics.showcutscenebars = false;
|
||||
graphics.cutscenebarspos = 0;
|
||||
graphics.oldcutscenebarspos = 0;
|
||||
map.scrolldir = 0;
|
||||
map.bypos = 0;
|
||||
//Return to game
|
||||
|
||||
@@ -2593,6 +2593,7 @@ void scriptclass::startgamemode( int t )
|
||||
game.jumpheld = true;
|
||||
graphics.showcutscenebars = true;
|
||||
graphics.cutscenebarspos = 320;
|
||||
graphics.oldcutscenebarspos = 320;
|
||||
|
||||
//set flipmode
|
||||
if (graphics.setflipmode) graphics.flipmode = true;
|
||||
@@ -2849,6 +2850,7 @@ void scriptclass::startgamemode( int t )
|
||||
game.jumpheld = true;
|
||||
graphics.showcutscenebars = true;
|
||||
graphics.cutscenebarspos = 320;
|
||||
graphics.oldcutscenebarspos = 320;
|
||||
|
||||
//set flipmode
|
||||
if (graphics.setflipmode) graphics.flipmode = true;
|
||||
@@ -2876,6 +2878,7 @@ void scriptclass::startgamemode( int t )
|
||||
game.jumpheld = true;
|
||||
graphics.showcutscenebars = true;
|
||||
graphics.cutscenebarspos = 320;
|
||||
graphics.oldcutscenebarspos = 320;
|
||||
|
||||
//set flipmode
|
||||
if (graphics.setflipmode) graphics.flipmode = true;
|
||||
|
||||
Reference in New Issue
Block a user