diff --git a/engines/myst3/movie.cpp b/engines/myst3/movie.cpp index d9e2a021da5..92d865fb5d8 100644 --- a/engines/myst3/movie.cpp +++ b/engines/myst3/movie.cpp @@ -21,6 +21,7 @@ */ #include "engines/myst3/movie.h" +#include "engines/myst3/ambient.h" #include "engines/myst3/myst3.h" #include "engines/myst3/sound.h" #include "engines/myst3/state.h" @@ -451,6 +452,11 @@ void SimpleMovie::playStartupSound() { } } +void SimpleMovie::refreshAmbientSounds() { + uint32 engineFrames = _bink.getFrameCount() * 2; + _vm->_ambient->playCurrentNode(100, engineFrames); +} + SimpleMovie::~SimpleMovie() { } diff --git a/engines/myst3/movie.h b/engines/myst3/movie.h index be81af25ea8..59f51763ead 100644 --- a/engines/myst3/movie.h +++ b/engines/myst3/movie.h @@ -158,6 +158,7 @@ public: bool endOfVideo(); void playStartupSound(); + void refreshAmbientSounds(); void setSynchronized(bool b) { _synchronized = b; } private: diff --git a/engines/myst3/myst3.cpp b/engines/myst3/myst3.cpp index fefa7734dc7..3ce2d59b4bc 100644 --- a/engines/myst3/myst3.cpp +++ b/engines/myst3/myst3.cpp @@ -1126,7 +1126,7 @@ void Myst3Engine::loadMovie(uint16 id, uint16 condition, bool resetCond, bool lo _movies.push_back(movie); } -void Myst3Engine::playSimpleMovie(uint16 id, bool fullframe) { +void Myst3Engine::playSimpleMovie(uint16 id, bool fullframe, bool refreshAmbientSounds) { SimpleMovie movie = SimpleMovie(this, id); if (!movie.isVideoLoaded()) { @@ -1165,6 +1165,10 @@ void Myst3Engine::playSimpleMovie(uint16 id, bool fullframe) { movie.playStartupSound(); + if (refreshAmbientSounds) { + movie.refreshAmbientSounds(); + } + _drawables.push_back(&movie); bool skip = false; @@ -1564,7 +1568,7 @@ void Myst3Engine::playMovieGoToNode(uint16 movie, uint16 node) { loadNode(node, room, age); - playSimpleMovie(movie, true); + playSimpleMovie(movie, true, true); _state->setLocationNextNode(0); _state->setLocationNextRoom(0); @@ -1585,7 +1589,7 @@ void Myst3Engine::playMovieFullFrame(uint16 movie) { } _state->setCameraSkipAnimation(0); - playSimpleMovie(movie, true); + playSimpleMovie(movie, true, false); if (_state->getViewType() == kCube) { float endPitch, endHeading; diff --git a/engines/myst3/myst3.h b/engines/myst3/myst3.h index 8b7341cf4ab..c13ff474406 100644 --- a/engines/myst3/myst3.h +++ b/engines/myst3/myst3.h @@ -154,7 +154,7 @@ public: void loadMovie(uint16 id, uint16 condition, bool resetCond, bool loop); void playMovieGoToNode(uint16 movie, uint16 node); void playMovieFullFrame(uint16 movie); - void playSimpleMovie(uint16 id, bool fullframe = false); + void playSimpleMovie(uint16 id, bool fullframe = false, bool refreshAmbientSounds = false); void removeMovie(uint16 id); void setMovieLooping(uint16 id, bool loop);