void MoviePlayer::handleNextFrame() { if (!_video->isVideoLoaded()) return; VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen]; if (_flags & 2) { uint8 *dstPtr = _vm->getResourceAddress(rtImage, _wizResNum); assert(dstPtr); uint8 *dst = _vm->findWrappedBlock(MKTAG('W','I','Z','D'), dstPtr, 0, 0); assert(dst); copyFrameToBuffer(dst, kDstResource, 0, 0, _vm->_screenWidth * _vm->_bytesPerPixel); } else if (_flags & 1) { copyFrameToBuffer(pvs->getBackPixels(0, 0), kDstScreen, 0, 0, pvs->pitch); Common::Rect imageRect(_video->getWidth(), _video->getHeight()); _vm->restoreBackgroundHE(imageRect); } else { copyFrameToBuffer(pvs->getPixels(0, 0), kDstScreen, 0, 0, pvs->pitch); Common::Rect imageRect(_video->getWidth(), _video->getHeight()); _vm->markRectAsDirty(kMainVirtScreen, imageRect); } if (_video->endOfVideo()) _video->close(); }
void MoviePlayer::handleNextFrame() { if (_fd.isOpen() == false) { return; } VirtScreen *pvs = &_vm->virtscr[kMainVirtScreen]; uint8 *dst; decodeFrame(); if (_flags & 2) { uint8 *dstPtr = _vm->getResourceAddress(rtImage, _wizResNum); assert(dstPtr); dst = _vm->findWrappedBlock(MKID_BE('WIZD'), dstPtr, 0, 0); assert(dst); copyFrame(dst, 0, 0); } else if (_flags & 1) { dst = pvs->getBackPixels(0, 0); copyFrame(dst, 0, 0); Common::Rect imageRect(_width, _height); _vm->gdi.copyVirtScreenBuffers(imageRect); } else { dst = pvs->getPixels(0, 0); copyFrame(dst, 0, 0); _vm->markRectAsDirty(kMainVirtScreen, 0, 0, _width, _height); } _frameNum++; if (_frameNum == _framesCount) { close(); } }