/Finally/ fixing the longstanding flicker bug in Woodruff. I was completely mistaken about its cause, too

svn-id: r42572
This commit is contained in:
Sven Hesse 2009-07-17 20:03:41 +00:00
parent df52a5d58e
commit 025702ba40
2 changed files with 12 additions and 7 deletions

View File

@ -325,6 +325,7 @@ bool VideoPlayer::primaryPlay(int16 startFrame, int16 lastFrame, int16 breakKey,
endFrame = lastFrame;
palCmd &= 0x3F;
int16 realStartFrame = startFrame;
if (video.getCurrentFrame() != startFrame) {
if (!forceSeek && (video.getFeatures() & Graphics::CoktelVideo::kFeaturesSound))
startFrame = video.getCurrentFrame();
@ -340,7 +341,9 @@ bool VideoPlayer::primaryPlay(int16 startFrame, int16 lastFrame, int16 breakKey,
bool canceled = false;
while (startFrame <= lastFrame) {
if (doPlay(startFrame, breakKey, palCmd, palStart, palEnd, palFrame, endFrame)) {
if (doPlay(startFrame, breakKey,
palCmd, palStart, palEnd, palFrame, endFrame, startFrame < realStartFrame)) {
canceled = true;
break;
}
@ -630,7 +633,7 @@ Common::MemoryReadStream *VideoPlayer::getExtraData(const char *fileName, int sl
void VideoPlayer::playFrame(int16 frame, int16 breakKey,
uint16 palCmd, int16 palStart, int16 palEnd,
int16 palFrame, int16 endFrame) {
int16 palFrame, int16 endFrame, bool noRetrace) {
if (!_primaryVideo)
return;
@ -703,7 +706,9 @@ void VideoPlayer::playFrame(int16 frame, int16 breakKey,
_vm->_draw->blitInvalidated();
} else
_vm->_video->dirtyRectsAdd(state.left, state.top, state.right, state.bottom);
_vm->_video->retrace();
if (!noRetrace)
_vm->_video->retrace();
}
@ -713,9 +718,9 @@ void VideoPlayer::playFrame(int16 frame, int16 breakKey,
bool VideoPlayer::doPlay(int16 frame, int16 breakKey,
uint16 palCmd, int16 palStart, int16 palEnd,
int16 palFrame, int16 endFrame) {
int16 palFrame, int16 endFrame, bool noRetrace) {
playFrame(frame, breakKey, palCmd, palStart, palEnd, palFrame, endFrame);
playFrame(frame, breakKey, palCmd, palStart, palEnd, palFrame, endFrame, noRetrace);
_vm->_util->processInput();

View File

@ -70,7 +70,7 @@ public:
void playFrame(int16 frame, int16 breakKey = kShortKeyEscape,
uint16 palCmd = 8, int16 palStart = 0, int16 palEnd = 255,
int16 palFrame = -1 , int16 endFrame = -1);
int16 palFrame = -1 , int16 endFrame = -1, bool noRetrace = false);
int slotOpen(const char *videoFile, Type which = kVideoTypeTry);
void slotPlay(int slot, int16 frame = -1);
@ -164,7 +164,7 @@ private:
void copyPalette(Graphics::CoktelVideo &video, int16 palStart = -1, int16 palEnd = -1);
bool doPlay(int16 frame, int16 breakKey,
uint16 palCmd, int16 palStart, int16 palEnd,
int16 palFrame, int16 endFrame);
int16 palFrame, int16 endFrame, bool noRetrace = false);
void evalBgShading(Graphics::CoktelVideo &video);
};