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:
@@ -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();
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user