diff options
author | Paul Gilbert | 2014-08-28 07:36:11 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-08-28 07:36:11 -0400 |
commit | 819cad3a179260d0b0a973342765a0caff4b13b4 (patch) | |
tree | 200079b363e7f4005ae7e2aef4d7714a141e0525 /engines/access/video.cpp | |
parent | 5abe5b89932adfcc705beb7529d323aa15a85bbd (diff) | |
download | scummvm-rg350-819cad3a179260d0b0a973342765a0caff4b13b4.tar.gz scummvm-rg350-819cad3a179260d0b0a973342765a0caff4b13b4.tar.bz2 scummvm-rg350-819cad3a179260d0b0a973342765a0caff4b13b4.zip |
ACCESS: Implemented setVideo
Diffstat (limited to 'engines/access/video.cpp')
-rw-r--r-- | engines/access/video.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/engines/access/video.cpp b/engines/access/video.cpp index 4774703a03..da397a4359 100644 --- a/engines/access/video.cpp +++ b/engines/access/video.cpp @@ -45,7 +45,37 @@ void VideoPlayer::setVideo(ASurface *vidSurface, const Common::Point &pt, FileId _videoData = _vm->_files->loadFile(videoFile); // Load in header + _frameCount = _videoData->_stream->readUint16LE(); + _header._width = _videoData->_stream->readUint16LE(); + _header._height = _videoData->_stream->readUint16LE(); + _videoData->_stream->skip(1); + _header._flags = (VideoFlags)_videoData->_stream->readByte(); + _startCoord = (byte *)vidSurface->getBasePtr(pt.x, pt.y); + _frameCount = _header._frameCount - 2; + _xCount = _header._width; + _scanCount = _header._height; + _vidFrame = 0; + + getFrame(); + + if (_header._flags == VIDEOFLAG_BG) { + // Draw the background + const byte *pSrc = _vm->_plotBuffer; + for (int y = 0; y < _scanCount; ++y) { + byte *pDest = (byte *)vidSurface->getBasePtr(pt.x, pt.y + y); + Common::copy(pSrc, pSrc + _xCount, pDest); + pSrc += _xCount; + } + + if (vidSurface == _vm->_screen) + _vm->_newRects.push_back(Common::Rect(pt.x, pt.y, pt.x + _xCount, pt.y + _scanCount)); + + + getFrame(); + } + + _videoEnd = false; } void VideoPlayer::freeVideo() { @@ -53,5 +83,18 @@ void VideoPlayer::freeVideo() { _videoData = nullptr; } +void VideoPlayer::getFrame() { + _frameSize = _videoData->_stream->readUint16LE(); + _videoData->_stream->read(_vm->_plotBuffer, _frameSize); +} + +void VideoPlayer::playVideo() { + if (_vm->_timers[31]._flag) + return; + ++_vm->_timers[31]._flag; + + +} + } // End of namespace Access |