aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/agos/animation.cpp16
-rw-r--r--engines/scumm/he/animation_he.cpp41
-rw-r--r--engines/scumm/he/animation_he.h4
-rw-r--r--engines/sword1/animation.cpp2
-rw-r--r--engines/sword2/animation.cpp2
5 files changed, 23 insertions, 42 deletions
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp
index c39e476d5e..328aa75acc 100644
--- a/engines/agos/animation.cpp
+++ b/engines/agos/animation.cpp
@@ -106,14 +106,14 @@ bool MoviePlayer::load(const char *filename) {
void MoviePlayer::playOmniTV() {
// Load OmniTV video
- if (_fd) {
+ if (_fileStream) {
_vm->setBitFlag(42, false);
_omniTV = true;
startSound();
} else {
if (_omniTVFile) {
// Restore state
- _fd = _omniTVFile;
+ _fileStream = _omniTVFile;
_mixer->pauseHandle(_omniTVSound, false);
_vm->setBitFlag(42, false);
@@ -175,14 +175,14 @@ void MoviePlayer::startSound() {
byte *buffer;
uint32 offset, size, tag;
- tag = _fd->readUint32BE();
+ tag = _fileStream->readUint32BE();
if (tag == MKID_BE('WAVE')) {
- size = _fd->readUint32BE();
+ size = _fileStream->readUint32BE();
if (_sequenceNum) {
Common::File in;
- _fd->seek(size, SEEK_CUR);
+ _fileStream->seek(size, SEEK_CUR);
in.open((const char *)"audio.wav");
if (!in.isOpen()) {
@@ -199,7 +199,7 @@ void MoviePlayer::startSound() {
in.close();
} else {
buffer = (byte *)malloc(size);
- _fd->read(buffer, size);
+ _fileStream->read(buffer, size);
}
Common::MemoryReadStream stream(buffer, size);
@@ -226,10 +226,10 @@ void MoviePlayer::nextFrame() {
if (_vm->getBitFlag(42)) {
// Save state
- _omniTVFile = _fd;
+ _omniTVFile = _fileStream;
_mixer->pauseHandle(_omniTVSound, true);
- _fd = 0;
+ _fileStream = 0;
_omniTV = false;
return;
}
diff --git a/engines/scumm/he/animation_he.cpp b/engines/scumm/he/animation_he.cpp
index 24badd2685..3691f7cae1 100644
--- a/engines/scumm/he/animation_he.cpp
+++ b/engines/scumm/he/animation_he.cpp
@@ -33,59 +33,41 @@
namespace Scumm {
MoviePlayer::MoviePlayer(ScummEngine_v90he *vm, Audio::Mixer *mixer)
- : DXAPlayer(), _vm(vm), _mixer(mixer) {
+ : SMKPlayer(), _vm(vm), _mixer(mixer) {
_flags = 0;
_wizResNum = 0;
}
int MoviePlayer::getImageNum() {
- if (!_fd)
+ if (!_fileStream)
return 0;
return _wizResNum;
}
int MoviePlayer::load(const char *filename, int flags, int image) {
- char videoName[100];
-
- if (_fd) {
+ if (_fileStream) {
closeFile();
}
- int baseLen = strlen(filename) - 4;
- memset(baseName, 0, sizeof(baseName));
- memcpy(baseName, filename, baseLen);
-
- // Change file extension to dxa
- sprintf(videoName, "%s.dxa", baseName);
-
- if (!loadFile(videoName)) {
- warning("Failed to load video file %s", videoName);
+ if (!loadFile(filename)) {
+ warning("Failed to load video file %s", filename);
return -1;
}
- debug(1, "Playing video %s", videoName);
-
- // Skip sound tag
- _fd->readUint32BE();
+ debug(1, "Playing video %s", filename);
if (flags & 2) {
- _vm->_wiz->createWizEmptyImage(image, 0, 0, _width, _height);
+ _vm->_wiz->createWizEmptyImage(image, 0, 0, getWidth(), getHeight());
}
_flags = flags;
_wizResNum = image;
- _bgSoundStream = Audio::AudioStream::openStreamFile(baseName);
- if (_bgSoundStream != NULL) {
- _mixer->stopHandle(_bgSound);
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSound, _bgSoundStream);
- }
-
return 0;
}
void MoviePlayer::handleNextFrame() {
- if (_fd == false) {
+ if (_fileStream == false) {
return;
}
@@ -102,16 +84,15 @@ void MoviePlayer::handleNextFrame() {
} else if (_flags & 1) {
copyFrameToBuffer(pvs->getBackPixels(0, 0), 0, 0, _vm->_screenWidth);
- Common::Rect imageRect(_width, _height);
+ Common::Rect imageRect(getWidth(), getHeight());
_vm->restoreBackgroundHE(imageRect);
} else {
copyFrameToBuffer(pvs->getPixels(0, 0), 0, 0, _vm->_screenWidth);
- _vm->markRectAsDirty(kMainVirtScreen, 0, 0, _width, _height);
+ _vm->markRectAsDirty(kMainVirtScreen, 0, 0, getWidth(), getHeight());
}
- _frameNum++;
- if (_frameNum == _framesCount) {
+ if (getCurFrame() == _framesCount) {
closeFile();
}
}
diff --git a/engines/scumm/he/animation_he.h b/engines/scumm/he/animation_he.h
index 1d04c3e5df..7516ce79a4 100644
--- a/engines/scumm/he/animation_he.h
+++ b/engines/scumm/he/animation_he.h
@@ -28,7 +28,7 @@
#include "common/file.h"
-#include "graphics/dxa_player.h"
+#include "graphics/smk_player.h"
#include "sound/mixer.h"
@@ -36,7 +36,7 @@ namespace Scumm {
class ScummEngine_v90he;
-class MoviePlayer : public Graphics::DXAPlayer {
+class MoviePlayer : public Graphics::SMKPlayer {
ScummEngine_v90he *_vm;
Audio::Mixer *_mixer;
diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp
index b621ab0f9c..578f4a8a81 100644
--- a/engines/sword1/animation.cpp
+++ b/engines/sword1/animation.cpp
@@ -409,7 +409,7 @@ bool MoviePlayerDXA::load(uint32 id) {
snprintf(filename, sizeof(filename), "%s.dxa", sequenceList[id]);
if (loadFile(filename)) {
// The Broken Sword games always use external audio tracks.
- if (_fd->readUint32BE() != MKID_BE('NULL'))
+ if (_fileStream->readUint32BE() != MKID_BE('NULL'))
return false;
_frameWidth = getWidth();
_frameHeight = getHeight();
diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp
index 8c4faf4082..c195ba5b50 100644
--- a/engines/sword2/animation.cpp
+++ b/engines/sword2/animation.cpp
@@ -547,7 +547,7 @@ bool MoviePlayerDXA::load() {
if (loadFile(filename)) {
// The Broken Sword games always use external audio tracks.
- if (_fd->readUint32BE() != MKID_BE('NULL'))
+ if (_fileStream->readUint32BE() != MKID_BE('NULL'))
return false;
_frameBuffer = _vm->_screen->getScreen();