mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-15 04:00:53 +00:00
- we need to wait a bit before starting the intro scene.
The game timer actually starts before the main loop is ready so we have to wait with the cutscene until the loop is in sync with the timer.
This commit is contained in:
parent
27799def63
commit
b21dadeef0
4 changed files with 12 additions and 2 deletions
|
@ -49,3 +49,4 @@ enum gameaction_t : int
|
||||||
};
|
};
|
||||||
extern gamestate_t gamestate;
|
extern gamestate_t gamestate;
|
||||||
extern gameaction_t gameaction;
|
extern gameaction_t gameaction;
|
||||||
|
extern int intermissiondelay;
|
||||||
|
|
|
@ -105,6 +105,7 @@ bool r_NoInterpolate;
|
||||||
int entertic;
|
int entertic;
|
||||||
int oldentertics;
|
int oldentertics;
|
||||||
int gametic;
|
int gametic;
|
||||||
|
int intermissiondelay;
|
||||||
|
|
||||||
FString BackupSaveGame;
|
FString BackupSaveGame;
|
||||||
|
|
||||||
|
@ -349,6 +350,11 @@ static void GameTicker()
|
||||||
break;
|
break;
|
||||||
case GS_INTERMISSION:
|
case GS_INTERMISSION:
|
||||||
case GS_INTRO:
|
case GS_INTRO:
|
||||||
|
if (intermissiondelay > 0)
|
||||||
|
{
|
||||||
|
intermissiondelay--;
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (ScreenJobTick())
|
if (ScreenJobTick())
|
||||||
{
|
{
|
||||||
// synchronize termination with the playsim.
|
// synchronize termination with the playsim.
|
||||||
|
@ -393,7 +399,7 @@ void Display()
|
||||||
case GS_INTRO:
|
case GS_INTRO:
|
||||||
case GS_INTERMISSION:
|
case GS_INTERMISSION:
|
||||||
// screen jobs are not bound by the game ticker so they need to be ticked in the display loop.
|
// screen jobs are not bound by the game ticker so they need to be ticked in the display loop.
|
||||||
ScreenJobDraw();
|
if (intermissiondelay <= 0) ScreenJobDraw();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GS_LEVEL:
|
case GS_LEVEL:
|
||||||
|
|
|
@ -374,6 +374,8 @@ bool StartCutscene(CutsceneDef& cs, int flags, const CompletionFunc& completion_
|
||||||
runner = nullptr;
|
runner = nullptr;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (flags & SJ_DELAY) intermissiondelay = 10; // need to wait a bit at the start to let the timer catch up.
|
||||||
|
else intermissiondelay = 0;
|
||||||
gameaction = (flags & SJ_BLOCKUI) ? ga_intro : ga_intermission;
|
gameaction = (flags & SJ_BLOCKUI) ? ga_intro : ga_intermission;
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
|
@ -410,7 +412,7 @@ void PlayLogos(gameaction_t complete_ga, gameaction_t def_ga, bool stopmusic)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!StartCutscene(globalCutscenes.Intro, SJ_BLOCKUI, [=](bool) {
|
if (!StartCutscene(globalCutscenes.Intro, SJ_BLOCKUI|SJ_DELAY, [=](bool) {
|
||||||
gameaction = complete_ga;
|
gameaction = complete_ga;
|
||||||
})) gameaction = def_ga;
|
})) gameaction = def_ga;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ void Job_Init();
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
SJ_BLOCKUI = 1,
|
SJ_BLOCKUI = 1,
|
||||||
|
SJ_DELAY = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
void EndScreenJob();
|
void EndScreenJob();
|
||||||
|
|
Loading…
Reference in a new issue