mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-10 19:09:45 +01:00
Update cutscene bars in fixed-timestep loop
This prevents cutscene bars from going really really fast.
This commit is contained in:
parent
a479c61141
commit
6655ae418c
3 changed files with 18 additions and 4 deletions
|
@ -839,8 +839,6 @@ void Graphics::cutscenebars()
|
|||
{
|
||||
if (showcutscenebars)
|
||||
{
|
||||
cutscenebarspos += 25;
|
||||
cutscenebarspos = std::min(cutscenebarspos, 361);
|
||||
FillRect(backBuffer, 0, 0, cutscenebarspos, 16, 0x000000);
|
||||
FillRect(backBuffer, 360-cutscenebarspos, 224, cutscenebarspos, 16, 0x000000);
|
||||
}
|
||||
|
@ -849,8 +847,6 @@ void Graphics::cutscenebars()
|
|||
//disappearing
|
||||
if (cutscenebarspos > 0)
|
||||
{
|
||||
cutscenebarspos -= 25;
|
||||
cutscenebarspos = std::max(cutscenebarspos, 0);
|
||||
//draw
|
||||
FillRect(backBuffer, 0, 0, cutscenebarspos, 16, 0x000000);
|
||||
FillRect(backBuffer, 360-cutscenebarspos, 224, cutscenebarspos, 16, 0x000000);
|
||||
|
@ -858,6 +854,21 @@ void Graphics::cutscenebars()
|
|||
}
|
||||
}
|
||||
|
||||
void Graphics::cutscenebarstimer()
|
||||
{
|
||||
if (showcutscenebars)
|
||||
{
|
||||
cutscenebarspos += 25;
|
||||
cutscenebarspos = std::min(cutscenebarspos, 361);
|
||||
}
|
||||
else if (cutscenebarspos > 0)
|
||||
{
|
||||
//disappearing
|
||||
cutscenebarspos -= 25;
|
||||
cutscenebarspos = std::max(cutscenebarspos, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void Graphics::drawcrewman( int x, int y, int t, bool act, bool noshift /*=false*/ )
|
||||
{
|
||||
if (!act)
|
||||
|
|
|
@ -91,6 +91,7 @@ public:
|
|||
int crewcolour(const int t);
|
||||
|
||||
void cutscenebars();
|
||||
void cutscenebarstimer();
|
||||
|
||||
void drawpartimage(int t, int xp, int yp, int wp, int hp);
|
||||
|
||||
|
|
|
@ -390,6 +390,8 @@ int main(int argc, char *argv[])
|
|||
Mix_Resume(-1);
|
||||
Mix_ResumeMusic();
|
||||
game.gametimer++;
|
||||
graphics.cutscenebarstimer();
|
||||
|
||||
switch(game.gamestate)
|
||||
{
|
||||
case PRELOADER:
|
||||
|
|
Loading…
Reference in a new issue