mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-28 07:16:53 +00:00
VIDEO/GOB: Fix IMD playing
Fix IMD playing for some fringe cases, especially when seeking beforehand. svn-id: r51871
This commit is contained in:
parent
2bcc02a27a
commit
2296aad042
@ -1129,6 +1129,8 @@ void Mult_v2::playImd(const char *imdFile, Mult::Mult_ImdKey &key, int16 dir,
|
||||
return;
|
||||
}
|
||||
|
||||
_vm->_vidPlayer->evaluateFlags(props);
|
||||
|
||||
int slot;
|
||||
if ((slot = _vm->_vidPlayer->openVideo(true, imdFile, props)) < 0)
|
||||
return;
|
||||
@ -1141,13 +1143,16 @@ void Mult_v2::playImd(const char *imdFile, Mult::Mult_ImdKey &key, int16 dir,
|
||||
|
||||
uint32 baseFrame = startFrame % (props.lastFrame - props.palFrame + 1);
|
||||
|
||||
props.endFrame = props.lastFrame;
|
||||
props.startFrame = baseFrame + props.palFrame;
|
||||
props.lastFrame = baseFrame + props.palFrame;
|
||||
|
||||
props.flags &= 0x7F;
|
||||
|
||||
debugC(2, kDebugVideo, "Playing mult video \"%s\" @ %d+%d, frame %d, "
|
||||
"paletteCmd %d (%d - %d), flags %X", imdFile,
|
||||
"paletteCmd %d (%d - %d; %d), flags %X", imdFile,
|
||||
props.x, props.y, props.startFrame,
|
||||
props.palCmd, props.palStart, props.palEnd, props.flags);
|
||||
props.palCmd, props.palStart, props.palEnd, props.endFrame, props.flags);
|
||||
|
||||
_vm->_vidPlayer->play(slot, props);
|
||||
}
|
||||
|
@ -79,8 +79,8 @@ public:
|
||||
int16 breakKey; ///< Keycode of the break/abort key.
|
||||
|
||||
uint16 palCmd; ///< Palette command.
|
||||
uint16 palStart; ///< Palette entry to start with.
|
||||
uint16 palEnd; ///< Palette entry to end at.
|
||||
int16 palStart; ///< Palette entry to start with.
|
||||
int16 palEnd; ///< Palette entry to end at.
|
||||
int32 palFrame; ///< Frame to apply the palette command at.
|
||||
|
||||
bool fade; ///< Fade in?
|
||||
|
@ -679,7 +679,7 @@ bool IMDDecoder::seek(int32 frame, int whence, bool restart) {
|
||||
else
|
||||
return false;
|
||||
|
||||
if ((frame < -1) || (((uint32) frame) >= _frameCount))
|
||||
if ((frame < -1) || (frame >= ((int32) _frameCount)))
|
||||
// Out of range
|
||||
return false;
|
||||
|
||||
@ -708,8 +708,6 @@ bool IMDDecoder::seek(int32 frame, int whence, bool restart) {
|
||||
for (int i = ((frame > _curFrame) ? _curFrame : 0); i <= frame; i++)
|
||||
processFrame();
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
warning("IMDDecoder::seek(): Frame %d is not directly accessible", frame + 1);
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user