mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-17 18:36:43 +02:00
#23 sync cutscene audio
This commit is contained in:
@@ -110,6 +110,11 @@ namespace Game {
|
|||||||
if (!level->level.isCutsceneLevel())
|
if (!level->level.isCutsceneLevel())
|
||||||
delta = min(0.2f, delta);
|
delta = min(0.2f, delta);
|
||||||
|
|
||||||
|
if (level->cutsceneFirstFrame) {
|
||||||
|
level->cutsceneFirstFrame = false;
|
||||||
|
delta = 1.0f / 30.0f;
|
||||||
|
}
|
||||||
|
|
||||||
Core::deltaTime = delta;
|
Core::deltaTime = delta;
|
||||||
UI::update();
|
UI::update();
|
||||||
|
|
||||||
|
@@ -46,6 +46,7 @@ struct Level : IGame {
|
|||||||
|
|
||||||
bool lastTitle;
|
bool lastTitle;
|
||||||
bool isEnded;
|
bool isEnded;
|
||||||
|
bool cutsceneFirstFrame;
|
||||||
|
|
||||||
TR::Effect effect;
|
TR::Effect effect;
|
||||||
float effectTimer;
|
float effectTimer;
|
||||||
@@ -517,6 +518,9 @@ struct Level : IGame {
|
|||||||
level->sndSoundtrack = Sound::play(stream, vec3(0.0f), 0.01f, 1.0f, Sound::MUSIC);
|
level->sndSoundtrack = Sound::play(stream, vec3(0.0f), 0.01f, 1.0f, Sound::MUSIC);
|
||||||
if (level->sndSoundtrack)
|
if (level->sndSoundtrack)
|
||||||
level->sndSoundtrack->setVolume(1.0f, 0.2f);
|
level->sndSoundtrack->setVolume(1.0f, 0.2f);
|
||||||
|
|
||||||
|
if (level->level.isCutsceneLevel())
|
||||||
|
level->cutsceneFirstFrame = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void playTrack(uint8 track, bool restart = false) {
|
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;
|
params->time = 0.0f;
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
|
Reference in New Issue
Block a user