1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-16 18:14:05 +02:00

#23 sync cutscene audio

This commit is contained in:
XProger
2017-11-30 07:18:10 +03:00
parent 493c1db0c7
commit 1b4a6dadb0
2 changed files with 10 additions and 1 deletions

View File

@@ -110,6 +110,11 @@ namespace Game {
if (!level->level.isCutsceneLevel())
delta = min(0.2f, delta);
if (level->cutsceneFirstFrame) {
level->cutsceneFirstFrame = false;
delta = 1.0f / 30.0f;
}
Core::deltaTime = delta;
UI::update();

View File

@@ -46,6 +46,7 @@ struct Level : IGame {
bool lastTitle;
bool isEnded;
bool cutsceneFirstFrame;
TR::Effect effect;
float effectTimer;
@@ -517,6 +518,9 @@ struct Level : IGame {
level->sndSoundtrack = Sound::play(stream, vec3(0.0f), 0.01f, 1.0f, Sound::MUSIC);
if (level->sndSoundtrack)
level->sndSoundtrack->setVolume(1.0f, 0.2f);
if (level->level.isCutsceneLevel())
level->cutsceneFirstFrame = true;
}
virtual void playTrack(uint8 track, bool restart = false) {
@@ -571,7 +575,7 @@ struct Level : IGame {
}
//==============================
Level(Stream &stream) : level(stream), inventory(this), lara(NULL), isEnded(false) {
Level(Stream &stream) : level(stream), inventory(this), lara(NULL), isEnded(false), cutsceneFirstFrame(false) {
params->time = 0.0f;
#ifdef _DEBUG