Skip to content

Commit

Permalink
ACCESS: Split setVideo into 2 functions to allow the loading of files…
Browse files Browse the repository at this point in the history
… out of a container
  • Loading branch information
Strangerke committed Jan 31, 2015
1 parent 4cd155c commit e0a9c92
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
20 changes: 15 additions & 5 deletions engines/access/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,13 @@ VideoPlayer::~VideoPlayer() {
closeVideo();
}


void VideoPlayer::setVideo(ASurface *vidSurface, const Common::Point &pt, const FileIdent &videoFile, int rate) {
void VideoPlayer::setVideo(ASurface *vidSurface, const Common::Point &pt, int rate) {
_vidSurface = vidSurface;
vidSurface->_orgX1 = pt.x;
vidSurface->_orgY1 = pt.y;
_vm->_timers[31]._timer = rate;
_vm->_timers[31]._initTm = rate;

// Open up video stream
_videoData = _vm->_files->loadFile(videoFile);

// Load in header
_header._frameCount = _videoData->_stream->readUint16LE();
_header._width = _videoData->_stream->readUint16LE();
Expand Down Expand Up @@ -80,6 +76,20 @@ void VideoPlayer::setVideo(ASurface *vidSurface, const Common::Point &pt, const
_videoEnd = false;
}

void VideoPlayer::setVideo(ASurface *vidSurface, const Common::Point &pt, const Common::String filename, int rate) {
// Open up video stream
_videoData = _vm->_files->loadFile(filename);

setVideo(vidSurface, pt, rate);
}

void VideoPlayer::setVideo(ASurface *vidSurface, const Common::Point &pt, const FileIdent &videoFile, int rate) {
// Open up video stream
_videoData = _vm->_files->loadFile(videoFile);

setVideo(vidSurface, pt, rate);
}

void VideoPlayer::closeVideo() {
delete _videoData;
_videoData = nullptr;
Expand Down
2 changes: 2 additions & 0 deletions engines/access/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class VideoPlayer : public Manager {
Common::Rect _videoBounds;

void getFrame();
void setVideo(ASurface *vidSurface, const Common::Point &pt, int rate);
public:
int _videoFrame;
bool _soundFlag;
Expand All @@ -64,6 +65,7 @@ class VideoPlayer : public Manager {
* Start up a video
*/
void setVideo(ASurface *vidSurface, const Common::Point &pt, const FileIdent &videoFile, int rate);
void setVideo(ASurface *vidSurface, const Common::Point &pt, const Common::String filename, int rate);

/**
* Decodes a frame of the video
Expand Down

0 comments on commit e0a9c92

Please sign in to comment.