mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 09:28:15 +03:00
Update cutscene bars in fixed-timestep loop
This prevents cutscene bars from going really really fast.
This commit is contained in:
@@ -839,8 +839,6 @@ void Graphics::cutscenebars()
|
|||||||
{
|
{
|
||||||
if (showcutscenebars)
|
if (showcutscenebars)
|
||||||
{
|
{
|
||||||
cutscenebarspos += 25;
|
|
||||||
cutscenebarspos = std::min(cutscenebarspos, 361);
|
|
||||||
FillRect(backBuffer, 0, 0, cutscenebarspos, 16, 0x000000);
|
FillRect(backBuffer, 0, 0, cutscenebarspos, 16, 0x000000);
|
||||||
FillRect(backBuffer, 360-cutscenebarspos, 224, cutscenebarspos, 16, 0x000000);
|
FillRect(backBuffer, 360-cutscenebarspos, 224, cutscenebarspos, 16, 0x000000);
|
||||||
}
|
}
|
||||||
@@ -849,8 +847,6 @@ void Graphics::cutscenebars()
|
|||||||
//disappearing
|
//disappearing
|
||||||
if (cutscenebarspos > 0)
|
if (cutscenebarspos > 0)
|
||||||
{
|
{
|
||||||
cutscenebarspos -= 25;
|
|
||||||
cutscenebarspos = std::max(cutscenebarspos, 0);
|
|
||||||
//draw
|
//draw
|
||||||
FillRect(backBuffer, 0, 0, cutscenebarspos, 16, 0x000000);
|
FillRect(backBuffer, 0, 0, cutscenebarspos, 16, 0x000000);
|
||||||
FillRect(backBuffer, 360-cutscenebarspos, 224, 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*/ )
|
void Graphics::drawcrewman( int x, int y, int t, bool act, bool noshift /*=false*/ )
|
||||||
{
|
{
|
||||||
if (!act)
|
if (!act)
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ public:
|
|||||||
int crewcolour(const int t);
|
int crewcolour(const int t);
|
||||||
|
|
||||||
void cutscenebars();
|
void cutscenebars();
|
||||||
|
void cutscenebarstimer();
|
||||||
|
|
||||||
void drawpartimage(int t, int xp, int yp, int wp, int hp);
|
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_Resume(-1);
|
||||||
Mix_ResumeMusic();
|
Mix_ResumeMusic();
|
||||||
game.gametimer++;
|
game.gametimer++;
|
||||||
|
graphics.cutscenebarstimer();
|
||||||
|
|
||||||
switch(game.gamestate)
|
switch(game.gamestate)
|
||||||
{
|
{
|
||||||
case PRELOADER:
|
case PRELOADER:
|
||||||
|
|||||||
Reference in New Issue
Block a user