mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-04 15:51:42 +00:00
TITANIC: Handle brief freeze if prologue credits are skipped
This commit is contained in:
parent
a42172485e
commit
bc29ee474a
engines/titanic
@ -686,18 +686,21 @@ void CGameObject::playRandomClip(const char *const *names, uint flags) {
|
||||
playClip(name, flags);
|
||||
}
|
||||
|
||||
void CGameObject::playCutscene(uint startFrame, uint endFrame) {
|
||||
bool CGameObject::playCutscene(uint startFrame, uint endFrame) {
|
||||
if (!_surface) {
|
||||
if (!_resource.empty())
|
||||
loadResource(_resource);
|
||||
_resource.clear();
|
||||
}
|
||||
|
||||
bool result = true;
|
||||
if (_surface && _surface->loadIfReady() && _surface->_movie) {
|
||||
disableMouse();
|
||||
_surface->_movie->playCutscene(_bounds, startFrame, endFrame);
|
||||
result = _surface->_movie->playCutscene(_bounds, startFrame, endFrame);
|
||||
enableMouse();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void CGameObject::savePosition() {
|
||||
|
@ -393,8 +393,9 @@ protected:
|
||||
|
||||
/**
|
||||
* Play a cutscene
|
||||
* @returns True if the cutscene was not interrupted
|
||||
*/
|
||||
void playCutscene(uint startFrame, uint endFrame);
|
||||
bool playCutscene(uint startFrame, uint endFrame);
|
||||
|
||||
/**
|
||||
* Play a clip randomly from a passed list of names
|
||||
|
@ -61,11 +61,13 @@ bool CCredits::TimerMsg(CTimerMsg *msg) {
|
||||
loadSound("a#16.wav");
|
||||
loadSound("a#24.wav");
|
||||
|
||||
playCutscene(0, 18);
|
||||
playGlobalSound("a#16.wav", VOL_NORMAL, false, false, 0);
|
||||
playCutscene(19, 642);
|
||||
playSound("a#24.wav");
|
||||
playCutscene(643, 750);
|
||||
if (playCutscene(0, 18)) {
|
||||
playGlobalSound("a#16.wav", VOL_NORMAL, false, false, 0);
|
||||
if (playCutscene(19, 642)) {
|
||||
playSound("a#24.wav");
|
||||
playCutscene(643, 750);
|
||||
}
|
||||
}
|
||||
|
||||
COpeningCreditsMsg creditsMsg;
|
||||
creditsMsg.execute("Service Elevator Entity");
|
||||
|
@ -471,7 +471,7 @@ Graphics::ManagedSurface *AVISurface::duplicateTransparency() const {
|
||||
}
|
||||
}
|
||||
|
||||
void AVISurface::playCutscene(const Rect &r, uint startFrame, uint endFrame) {
|
||||
bool AVISurface::playCutscene(const Rect &r, uint startFrame, uint endFrame) {
|
||||
bool isDifferent = false;
|
||||
|
||||
if (_currentFrame != ((int)startFrame - 1) || startFrame == 0) {
|
||||
@ -487,6 +487,7 @@ void AVISurface::playCutscene(const Rect &r, uint startFrame, uint endFrame) {
|
||||
isDifferent = _movieFrameSurface[0]->w != r.width() ||
|
||||
_movieFrameSurface[0]->h != r.height();
|
||||
|
||||
bool isFinished = true;
|
||||
while (_currentFrame < (int)endFrame && !g_vm->shouldQuit()) {
|
||||
if (isNextFrame()) {
|
||||
renderFrame();
|
||||
@ -507,11 +508,14 @@ void AVISurface::playCutscene(const Rect &r, uint startFrame, uint endFrame) {
|
||||
}
|
||||
|
||||
// Brief wait, and check at the same time for clicks to abort the clip
|
||||
if (g_vm->_events->waitForPress(10))
|
||||
if (g_vm->_events->waitForPress(10)) {
|
||||
isFinished = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
stop();
|
||||
return isFinished;
|
||||
}
|
||||
|
||||
uint AVISurface::getBitDepth() const {
|
||||
|
@ -215,8 +215,9 @@ public:
|
||||
|
||||
/**
|
||||
* Plays an interruptable cutscene
|
||||
* @returns True if the cutscene was not interrupted
|
||||
*/
|
||||
void playCutscene(const Rect &r, uint startFrame, uint endFrame);
|
||||
bool playCutscene(const Rect &r, uint startFrame, uint endFrame);
|
||||
|
||||
/**
|
||||
* Returns the pixel depth of the movie in bits
|
||||
|
@ -116,7 +116,7 @@ void OSMovie::play(uint startFrame, uint endFrame, uint initialFrame, uint flags
|
||||
movieStarted();
|
||||
}
|
||||
|
||||
void OSMovie::playCutscene(const Rect &drawRect, uint startFrame, uint endFrame) {
|
||||
bool OSMovie::playCutscene(const Rect &drawRect, uint startFrame, uint endFrame) {
|
||||
if (!_movieSurface)
|
||||
_movieSurface = CScreenManager::_screenManagerPtr->createSurface(600, 340, 32);
|
||||
|
||||
@ -124,9 +124,10 @@ void OSMovie::playCutscene(const Rect &drawRect, uint startFrame, uint endFrame)
|
||||
CEventTarget eventTarget;
|
||||
g_vm->_events->addTarget(&eventTarget);
|
||||
|
||||
_aviSurface.playCutscene(drawRect, startFrame, endFrame);
|
||||
bool result = _aviSurface.playCutscene(drawRect, startFrame, endFrame);
|
||||
|
||||
g_vm->_events->removeTarget();
|
||||
return result;
|
||||
}
|
||||
|
||||
void OSMovie::pause() {
|
||||
|
@ -86,8 +86,9 @@ public:
|
||||
/**
|
||||
* Plays a sub-section of a movie, and doesn't return until either
|
||||
* the playback ends or a key has been pressed
|
||||
* @returns True if the cutscene was not interrupted
|
||||
*/
|
||||
virtual void playCutscene(const Rect &drawRect, uint startFrame, uint endFrame) = 0;
|
||||
virtual bool playCutscene(const Rect &drawRect, uint startFrame, uint endFrame) = 0;
|
||||
|
||||
/**
|
||||
* Pauses a movie
|
||||
@ -193,8 +194,9 @@ public:
|
||||
/**
|
||||
* Plays a sub-section of a movie, and doesn't return until either
|
||||
* the playback ends or a key has been pressed
|
||||
* @returns True if the cutscene was not interrupted
|
||||
*/
|
||||
virtual void playCutscene(const Rect &drawRect, uint startFrame, uint endFrame);
|
||||
virtual bool playCutscene(const Rect &drawRect, uint startFrame, uint endFrame);
|
||||
|
||||
/**
|
||||
* Pauses a movie
|
||||
|
Loading…
x
Reference in New Issue
Block a user