aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2006-06-28 14:06:54 +0000
committerTravis Howell2006-06-28 14:06:54 +0000
commitdd57c5798221419ab6ac20330462fe117631aad6 (patch)
tree1b6788431742cb6df6bb522d397684018176d07b /engines
parentc367dbfc36af58f589ff320ff69eb072dac518e5 (diff)
downloadscummvm-rg350-dd57c5798221419ab6ac20330462fe117631aad6.tar.gz
scummvm-rg350-dd57c5798221419ab6ac20330462fe117631aad6.tar.bz2
scummvm-rg350-dd57c5798221419ab6ac20330462fe117631aad6.zip
Add eriktorbjorn's patch for DXA unification, with more changes
svn-id: r23332
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/he/animation_he.cpp186
-rw-r--r--engines/scumm/he/animation_he.h26
-rw-r--r--engines/scumm/he/script_v90he.cpp2
-rw-r--r--engines/simon/animation.cpp384
-rw-r--r--engines/simon/animation.h22
5 files changed, 147 insertions, 473 deletions
diff --git a/engines/scumm/he/animation_he.cpp b/engines/scumm/he/animation_he.cpp
index 327cde6d87..3fa58cac90 100644
--- a/engines/scumm/he/animation_he.cpp
+++ b/engines/scumm/he/animation_he.cpp
@@ -26,71 +26,26 @@
#include "scumm/he/animation_he.h"
#include "scumm/he/intern_he.h"
-#ifdef USE_ZLIB
-#include <zlib.h>
-#endif
-
namespace Scumm {
MoviePlayer::MoviePlayer(ScummEngine_v90he *vm)
- : _vm(vm) {
-
- _frameBuffer1 = 0;
- _frameBuffer2 = 0;
-
- _width = 0;
- _height = 0;
-
- _frameSize = 0;
- _framesCount = 0;
- _frameNum = 0;
- _framesPerSec = 0;
- _frameTicks = 0;
+ : DXAPlayer(), _vm(vm) {
_flags = 0;
_wizResNum = 0;
}
-MoviePlayer::~MoviePlayer() {
-}
-
-int MoviePlayer::getWidth() {
- if (_fd.isOpen() == false)
- return 0;
- return _width;
-}
-
-int MoviePlayer::getHeight() {
- if (_fd.isOpen() == false)
- return 0;
- return _height;
-}
-
-int MoviePlayer::getCurFrame() {
- if (_fd.isOpen() == false)
- return -1;
- return _frameNum;
-}
-
-int MoviePlayer::getFrameCount() {
- if (_fd.isOpen() == false)
- return 0;
- return _framesCount;
-}
-
int MoviePlayer::getImageNum() {
- if (_fd.isOpen() == false)
+ if (!_fd.isOpen())
return 0;
return _wizResNum;
}
int MoviePlayer::load(const char *filename, int flags, int image) {
char videoName[100];
- uint32 tag;
- int32 frameRate;
- if (_fd.isOpen() == true) {
- close();
+ if (_fd.isOpen()) {
+ closeFile();
}
// Change file extension to dxa
@@ -100,173 +55,60 @@ int MoviePlayer::load(const char *filename, int flags, int image) {
videoName[len++] = 'x';
videoName[len++] = 'a';
- if (_fd.open(videoName) == false) {
+ if (!loadFile(videoName)) {
warning("Failed to load video file %s", videoName);
return -1;
}
debug(1, "Playing video %s", videoName);
- tag = _fd.readUint32BE();
- assert(tag == MKID_BE('DEXA'));
-
- _fd.readByte();
- _framesCount = _fd.readUint16BE();
- frameRate = _fd.readUint32BE();
-
- if (frameRate > 0)
- _framesPerSec = 1000 / frameRate;
- else if (frameRate < 0)
- _framesPerSec = 100000 / (-frameRate);
- else
- _framesPerSec = 10;
-
- if (frameRate < 0)
- _frameTicks = -frameRate / 100;
- else
- _frameTicks = frameRate;
-
- _width = _fd.readUint16BE();
- _height = _fd.readUint16BE();
-
// Skip sound tag
_fd.readUint32BE();
- _frameSize = _width * _height;
- _frameBuffer1 = (uint8 *)malloc(_frameSize);
- _frameBuffer2 = (uint8 *)malloc(_frameSize);
- if (!_frameBuffer1 || !_frameBuffer2) {
- error("error allocating frame tables, size %d\n", _frameSize);
- }
-
if (flags & 2) {
_vm->_wiz->createWizEmptyImage(image, 0, 0, _width, _height);
}
- _frameNum = 0;
-
_flags = flags;
_wizResNum = image;
return 0;
}
-void MoviePlayer::close() {
- if (_fd.isOpen() == false)
- return;
-
- _fd.close();
- free(_frameBuffer1);
- free(_frameBuffer2);
-}
-
void MoviePlayer::handleNextFrame() {
if (_fd.isOpen() == false) {
return;
}
VirtScreen *pvs = &_vm->virtscr[kMainVirtScreen];
- uint8 *dst;
+ ;
- decodeFrame();
+ decodeNextFrame();
if (_flags & 2) {
uint8 *dstPtr = _vm->getResourceAddress(rtImage, _wizResNum);
assert(dstPtr);
- dst = _vm->findWrappedBlock(MKID_BE('WIZD'), dstPtr, 0, 0);
+ uint8 *dst = _vm->findWrappedBlock(MKID_BE('WIZD'), dstPtr, 0, 0);
assert(dst);
- copyFrame(dst, 0, 0);
+ copyFrameToBuffer(dst, 0, 0, _vm->_screenWidth);
} else if (_flags & 1) {
- dst = pvs->getBackPixels(0, 0);
- copyFrame(dst, 0, 0);
+ copyFrameToBuffer(pvs->getBackPixels(0, 0), 0, 0, _vm->_screenWidth);
Common::Rect imageRect(_width, _height);
_vm->gdi.copyVirtScreenBuffers(imageRect);
} else {
- dst = pvs->getPixels(0, 0);
- copyFrame(dst, 0, 0);
+ copyFrameToBuffer(pvs->getPixels(0, 0), 0, 0, _vm->_screenWidth);
_vm->markRectAsDirty(kMainVirtScreen, 0, 0, _width, _height);
}
_frameNum++;
if (_frameNum == _framesCount) {
- close();
- }
-}
-
-void MoviePlayer::copyFrame(byte *dst, uint x, uint y) {
- uint h = _height;
- uint w = _width;
-
- dst += y * _vm->_screenWidth + x;
- byte *src = _frameBuffer1;
-
- do {
- memcpy(dst, src, w);
- dst += _vm->_screenWidth;
- src += _width;
- } while (--h);
-}
-
-void MoviePlayer::decodeZlib(uint8 *data, int size, int totalSize) {
-#ifdef USE_ZLIB
- uint8 *temp = (uint8 *)malloc(size);
- if (temp) {
- memcpy(temp, data, size);
- z_stream d_stream;
- d_stream.zalloc = (alloc_func)0;
- d_stream.zfree = (free_func)0;
- d_stream.opaque = (voidpf)0;
- d_stream.next_in = temp;
- d_stream.avail_in = size;
- d_stream.total_in = size;
- d_stream.next_out = data;
- d_stream.avail_out = totalSize;
- inflateInit(&d_stream);
- inflate(&d_stream, Z_FINISH);
- inflateEnd(&d_stream);
- free(temp);
+ closeFile();
}
-#endif
}
-void MoviePlayer::decodeFrame() {
- uint32 tag;
-
- tag = _fd.readUint32BE();
- if (tag == MKID_BE('CMAP')) {
- uint8 rgb[768];
-
- _fd.read(rgb, ARRAYSIZE(rgb));
- _vm->setPaletteFromPtr(rgb, 256);
- }
-
- tag = _fd.readUint32BE();
- if (tag == MKID_BE('FRAM')) {
- uint8 type = _fd.readByte();
- uint32 size = _fd.readUint32BE();
-
- _fd.read(_frameBuffer2, size);
-
- switch (type) {
- case 2:
- case 3:
- decodeZlib(_frameBuffer2, size, _frameSize);
- break;
- default:
- error("decodeFrame: Unknown compression type %d", type);
- }
- if (type == 2) {
- memcpy(_frameBuffer1, _frameBuffer2, _frameSize);
- } else {
- for (int j = 0; j < _height; ++j) {
- for (int i = 0; i < _width; ++i) {
- const int offs = j * _width + i;
- _frameBuffer1[offs] ^= _frameBuffer2[offs];
- }
- }
- }
- }
+void MoviePlayer::setPalette(byte *pal) {
+ _vm->setPaletteFromPtr(pal, 256);
}
} // End of namespace Simon
diff --git a/engines/scumm/he/animation_he.h b/engines/scumm/he/animation_he.h
index d55f2feb05..f1c40a65a9 100644
--- a/engines/scumm/he/animation_he.h
+++ b/engines/scumm/he/animation_he.h
@@ -25,46 +25,28 @@
#define ANIMATION_H
#include "common/file.h"
+#include "graphics/dxa_player.h"
namespace Scumm {
class ScummEngine_v90he;
-class MoviePlayer {
+class MoviePlayer : public Graphics::DXAPlayer {
ScummEngine_v90he *_vm;
- Common::File _fd;
- uint8 *_frameBuffer1;
- uint8 *_frameBuffer2;
- uint16 _width;
- uint16 _height;
- uint16 _framesCount;
- uint32 _framesPerSec;
- uint16 _frameNum;
- uint32 _frameSize;
- uint32 _frameTicks;
-
uint32 _flags;
uint32 _wizResNum;
public:
MoviePlayer(ScummEngine_v90he *vm);
- ~MoviePlayer();
- int getWidth();
- int getHeight();
- int getCurFrame();
- int getFrameCount();
int getImageNum();
int load(const char *filename, int flags, int image = 0);
void handleNextFrame();
- void close();
-private:
- void copyFrame(byte *dst, uint x, uint y);
- void decodeFrame();
- void decodeZlib(uint8 *data, int size, int totalSize);
+protected:
+ virtual void setPalette(byte *pal);
};
} // End of namespace Simon
diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp
index f18a049785..c8937a1035 100644
--- a/engines/scumm/he/script_v90he.cpp
+++ b/engines/scumm/he/script_v90he.cpp
@@ -550,7 +550,7 @@ void ScummEngine_v90he::o90_videoOps() {
}
} else if (_videoParams.status == 165) {
// Stop video
- _moviePlay->close();
+ _moviePlay->closeFile();
}
break;
default:
diff --git a/engines/simon/animation.cpp b/engines/simon/animation.cpp
index f6018b03a1..85d77e77c7 100644
--- a/engines/simon/animation.cpp
+++ b/engines/simon/animation.cpp
@@ -35,47 +35,23 @@
#include "sound/audiostream.h"
#include "sound/wave.h"
-
-#ifdef USE_ZLIB
-#include <zlib.h>
-#endif
-
namespace Simon {
MoviePlayer::MoviePlayer(SimonEngine *vm, Audio::Mixer *mixer)
- : _vm(vm), _mixer(mixer) {
+ : DXAPlayer(), _vm(vm), _mixer(mixer) {
_omniTV = false;
- _playing = false;
_leftButtonDown = false;
_rightButtonDown = false;
- _frameBuffer1 = 0;
- _frameBuffer2 = 0;
-
- _width = 0;
- _height = 0;
-
- _frameSize = 0;
- _framesCount = 0;
- _frameNum = 0;
- _framesPerSec = 0;
- _frameTicks = 0;
- _frameSkipped = 0;
-
memset(baseName, 0, sizeof(baseName));
_sequenceNum = 0;
_ticks = 0;
}
-MoviePlayer::~MoviePlayer() {
-}
-
bool MoviePlayer::load(const char *filename) {
char videoName[20];
- uint32 tag;
- int32 frameRate;
uint i;
int baseLen = strlen(filename) - 4;
@@ -84,8 +60,8 @@ bool MoviePlayer::load(const char *filename) {
// Change file extension to dxa
sprintf(videoName, "%s.dxa", baseName);
-
- if (_fd.open(videoName) == false) {
+
+ if (!loadFile(videoName)) {
// Check short filename to work around
// bug in a German Windows 2CD version.
if (baseLen >= 8) {
@@ -93,16 +69,14 @@ bool MoviePlayer::load(const char *filename) {
memset(shortName, 0, sizeof(shortName));
memcpy(shortName, filename, 6);
- sprintf(shortName, "%s~1.dxa", shortName);
+ sprintf(shortName, "%s~1", shortName);
+ if (!loadFile(shortName))
+ error("Failed to load video file %s or %s", videoName, shortName);
+
memset(baseName, 0, sizeof(baseName));
memcpy(baseName, shortName, 8);
-
- if (_fd.open(shortName) == false) {
- error("Failed to load video file %s or %s", videoName, shortName);
- } else {
- debug(0, "Playing video %s", shortName);
- }
+ debug(0, "Playing video %s", shortName);
} else {
error("Failed to load video file %s", videoName);
}
@@ -116,50 +90,17 @@ bool MoviePlayer::load(const char *filename) {
_vm->_language != Common::EN_ANY) {
_sequenceNum = 0;
for (i = 0; i < 90; i++) {
- if (!scumm_stricmp(videoName, _sequenceList[i]))
+ if (!scumm_stricmp(baseName, _sequenceList[i]))
_sequenceNum = i;
}
}
- tag = _fd.readUint32BE();
- assert(tag == MKID_BE('DEXA'));
-
- _fd.readByte();
- _framesCount = _fd.readUint16BE();
- frameRate = _fd.readUint32BE();
-
- if (frameRate > 0)
- _framesPerSec = 1000 / frameRate;
- else if (frameRate < 0)
- _framesPerSec = 100000 / (-frameRate);
- else
- _framesPerSec = 10;
-
- if (frameRate < 0)
- _frameTicks = -frameRate / 100;
- else
- _frameTicks = frameRate;
-
- _width = _fd.readUint16BE();
- _height = _fd.readUint16BE();
- debug(0, "frames_count %d width %d height %d rate %d ticks %d", _framesCount, _width, _height, _framesPerSec, _frameTicks);
-
- _frameSize = _width * _height;
- _frameBuffer1 = (uint8 *)malloc(_frameSize);
- _frameBuffer2 = (uint8 *)malloc(_frameSize);
- if (!_frameBuffer1 || !_frameBuffer2) {
- error("error allocating frame tables, size %d\n", _frameSize);
- }
-
- _frameNum = 0;
- _frameSkipped = 0;
-
return true;
}
void MoviePlayer::playOmniTV() {
// Load OmniTV video
- if (_fd.isOpen() == false) {
+ if (!_fd.isOpen()) {
_vm->_variableArray[254] = 6747;
return;
} else {
@@ -177,7 +118,7 @@ void MoviePlayer::play() {
return;
}
- if (_fd.isOpen() == false) {
+ if (!_fd.isOpen()) {
return;
}
@@ -198,7 +139,7 @@ void MoviePlayer::play() {
while (_frameNum < _framesCount)
handleNextFrame();
- close();
+ closeFile();
_vm->o_killAnimate();
@@ -214,12 +155,6 @@ void MoviePlayer::play() {
_vm->_fastFadeOutFlag = true;
}
-void MoviePlayer::close() {
- _fd.close();
- free(_frameBuffer1);
- free(_frameBuffer2);
-}
-
void MoviePlayer::startSound() {
byte *buffer;
uint32 offset, size, tag;
@@ -234,7 +169,7 @@ void MoviePlayer::startSound() {
_fd.seek(size, SEEK_CUR);
in.open((const char *)"audio.wav");
- if (in.isOpen() == false) {
+ if (!in.isOpen()) {
error("Can't read offset file 'audio.wav'");
}
@@ -253,15 +188,14 @@ void MoviePlayer::startSound() {
Common::MemoryReadStream stream(buffer, size);
_bgSoundStream = Audio::makeWAVStream(stream);
- _mixer->stopHandle(_bgSound);
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSound, _bgSoundStream);
free(buffer);
} else {
_bgSoundStream = Audio::AudioStream::openStreamFile(baseName);
- if (_bgSoundStream != NULL) {
- _mixer->stopHandle(_bgSound);
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSound, _bgSoundStream);
- }
+ }
+
+ if (_bgSoundStream != NULL) {
+ _mixer->stopHandle(_bgSound);
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_bgSound, _bgSoundStream);
}
}
@@ -271,28 +205,28 @@ void MoviePlayer::nextFrame() {
if (_vm->getBitFlag(42)) {
_omniTV = false;
- close();
+ closeFile();
return;
}
if (_mixer->isSoundHandleActive(_bgSound) && (_mixer->getSoundElapsedTime(_bgSound) * _framesPerSec) / 1000 < _frameNum) {
- copyFrame(_vm->getBackBuf(), 465, 222);
+ copyFrameToBuffer(_vm->getBackBuf(), 465, 222, _vm->_screenWidth);
return;
}
if (_frameNum < _framesCount) {
- decodeFrame();
- copyFrame(_vm->getBackBuf(), 465, 222);
+ decodeNextFrame();
+ copyFrameToBuffer(_vm->getBackBuf(), 465, 222, _vm->_screenWidth);
_frameNum++;
} else {
_omniTV = false;
- close();
+ closeFile();
_vm->_variableArray[254] = 6747;
}
}
void MoviePlayer::handleNextFrame() {
- decodeFrame();
+ decodeNextFrame();
processFrame();
_vm->_system->updateScreen();
@@ -332,92 +266,22 @@ void MoviePlayer::handleNextFrame() {
}
}
-void MoviePlayer::copyFrame(byte *dst, uint x, uint y) {
- uint h = _height;
- uint w = _width;
-
- dst += y * _vm->_screenWidth + x;
- byte *src = _frameBuffer1;
-
- do {
- memcpy(dst, src, w);
- dst += _vm->_screenWidth;
- src += _width;
- } while (--h);
-}
+void MoviePlayer::setPalette(byte *pal) {
+ byte palette[1024];
+ byte *p = palette;
-void MoviePlayer::decodeZlib(uint8 *data, int size, int totalSize) {
-#ifdef USE_ZLIB
- uint8 *temp = (uint8 *)malloc(size);
- if (temp) {
- memcpy(temp, data, size);
- z_stream d_stream;
- d_stream.zalloc = (alloc_func)0;
- d_stream.zfree = (free_func)0;
- d_stream.opaque = (voidpf)0;
- d_stream.next_in = temp;
- d_stream.avail_in = size;
- d_stream.total_in = size;
- d_stream.next_out = data;
- d_stream.avail_out = totalSize;
- inflateInit(&d_stream);
- inflate(&d_stream, Z_FINISH);
- inflateEnd(&d_stream);
- free(temp);
+ for (int i = 0; i <= 256; i++) {
+ *p++ = *pal++;
+ *p++ = *pal++;
+ *p++ = *pal++;
+ *p++ = 0;
}
-#endif
-}
-
-void MoviePlayer::decodeFrame() {
- uint32 tag;
- tag = _fd.readUint32BE();
- if (tag == MKID_BE('CMAP')) {
- uint8 rgb[768];
- byte palette[1024];
- byte *p = palette;
-
- _fd.read(rgb, ARRAYSIZE(rgb));
- for (int i = 0; i <= 256; i++) {
- *p++ = rgb[i * 3 + 0];
- *p++ = rgb[i * 3 + 1];
- *p++ = rgb[i * 3 + 2];
- *p++ = 0;
- }
- _vm->_system->setPalette(palette, 0, 256);
- }
-
- tag = _fd.readUint32BE();
- if (tag == MKID_BE('FRAM')) {
- uint8 type = _fd.readByte();
- uint32 size = _fd.readUint32BE();
- debug(5, "frame %d type %d size %d", _frameNum, type, size);
-
- _fd.read(_frameBuffer2, size);
-
- switch (type) {
- case 2:
- case 3:
- decodeZlib(_frameBuffer2, size, _frameSize);
- break;
- default:
- error("decodeFrame: Unknown compression type %d", type);
- }
- if (type == 2) {
- memcpy(_frameBuffer1, _frameBuffer2, _frameSize);
- } else {
- for (int j = 0; j < _height; ++j) {
- for (int i = 0; i < _width; ++i) {
- const int offs = j * _width + i;
- _frameBuffer1[offs] ^= _frameBuffer2[offs];
- }
- }
- }
- }
+ _vm->_system->setPalette(palette, 0, 256);
}
void MoviePlayer::processFrame() {
- copyFrame(_vm->getFrontBuf(), (_vm->_screenWidth - _width) / 2, (_vm->_screenHeight - _height) / 2);
+ copyFrameToBuffer(_vm->getFrontBuf(), (_vm->_screenWidth - _width) / 2, (_vm->_screenHeight - _height) / 2, _vm->_screenWidth);
_vm->_system->copyRectToScreen(_vm->getFrontBuf(), _vm->_screenWidth, 0, 0, _vm->_screenWidth, _vm->_screenHeight);
if ((_bgSoundStream == NULL) || ((int)(_mixer->getSoundElapsedTime(_bgSound) * _framesPerSec) / 1000 < _frameNum + 1) ||
@@ -447,96 +311,96 @@ void MoviePlayer::processFrame() {
}
const char * MoviePlayer::_sequenceList[90] = {
- "agent32.dxa",
- "Airlock.dxa",
- "Badluck.dxa",
- "bentalk1.dxa",
- "bentalk2.dxa",
- "bentalk3.dxa",
- "BigFight.dxa",
- "BLOWLAB.dxa",
- "breakdown.dxa",
- "bridge.dxa",
- "button2.dxa",
- "cargo.dxa",
- "COACH.dxa",
- "Colatalk.dxa",
- "cygnus2.dxa",
- "dream.dxa",
- "escape2.dxa",
- "FASALL.dxa",
- "fbikewurb.dxa",
- "feebdel.dxa",
- "Feebohno.dxa",
- "feebpump.dxa",
- "feefone1.dxa",
- "feefone2.dxa",
- "founder2.dxa",
- "founder3.dxa",
- "founder4.dxa",
- "fxmadsam.dxa",
- "fxwakeup.dxa",
- "gate.dxa",
- "Get Car.dxa",
- "getaxe.dxa",
- "getlift.dxa",
- "icetrench.dxa",
- "intomb1.dxa",
- "intomb2.dxa",
- "Jackpot.dxa",
- "knockout.dxa",
- "labocto.dxa",
- "longfeeb.dxa",
- "Mainmin.dxa",
- "maznat.dxa",
- "meetsquid.dxa",
- "mflirt.dxa",
- "mfxHappy.dxa",
- "Mix_Feeb1.dxa",
- "Mix_Feeb2.dxa",
- "Mix_Feeb3.dxa",
- "Mix_Guardscn.dxa",
- "Mlights1.dxa",
- "MLights2.dxa",
- "MProtest.dxa",
- "mudman.dxa",
- "munlock.dxa",
- "MUS5P2.dxa",
- "MUSOSP1.dxa",
- "Omenter.dxa",
- "Omnicofe.dxa",
- "OUTMIN~1.dxa",
- "Readbook.dxa",
- "Rebelhq.dxa",
- "RebelHQ2.dxa",
- "Reedin.dxa",
- "rescue1.dxa",
- "rescue2.dxa",
- "samcar.dxa",
- "Samdead.dxa",
- "scanner.dxa",
- "Sleepy.dxa",
- "spitbrai.dxa",
- "statue1.dxa",
- "statue2.dxa",
- "sva1.dxa",
- "sva2.dxa",
- "Teeter.dxa",
- "Temple2.dxa",
- "Temple3.dxa",
- "Temple4.dxa",
- "Temple5.dxa",
- "Temple6.dxa",
- "Temple7.dxa",
- "Temple8.dxa",
- "Tic-tac2.dxa",
- "torture.dxa",
- "transmit.dxa",
- "Typey.dxa",
- "ventfall.dxa",
- "ventoff.dxa",
- "wasting.dxa",
- "wurbatak.dxa"
+ "agent32",
+ "Airlock",
+ "Badluck",
+ "bentalk1",
+ "bentalk2",
+ "bentalk3",
+ "BigFight",
+ "BLOWLAB",
+ "breakdown",
+ "bridge",
+ "button2",
+ "cargo",
+ "COACH",
+ "Colatalk",
+ "cygnus2",
+ "dream",
+ "escape2",
+ "FASALL",
+ "fbikewurb",
+ "feebdel",
+ "Feebohno",
+ "feebpump",
+ "feefone1",
+ "feefone2",
+ "founder2",
+ "founder3",
+ "founder4",
+ "fxmadsam",
+ "fxwakeup",
+ "gate",
+ "Get Car",
+ "getaxe",
+ "getlift",
+ "icetrench",
+ "intomb1",
+ "intomb2",
+ "Jackpot",
+ "knockout",
+ "labocto",
+ "longfeeb",
+ "Mainmin",
+ "maznat",
+ "meetsquid",
+ "mflirt",
+ "mfxHappy",
+ "Mix_Feeb1",
+ "Mix_Feeb2",
+ "Mix_Feeb3",
+ "Mix_Guardscn",
+ "Mlights1",
+ "MLights2",
+ "MProtest",
+ "mudman",
+ "munlock",
+ "MUS5P2",
+ "MUSOSP1",
+ "Omenter",
+ "Omnicofe",
+ "OUTMIN~1",
+ "Readbook",
+ "Rebelhq",
+ "RebelHQ2",
+ "Reedin",
+ "rescue1",
+ "rescue2",
+ "samcar",
+ "Samdead",
+ "scanner",
+ "Sleepy",
+ "spitbrai",
+ "statue1",
+ "statue2",
+ "sva1",
+ "sva2",
+ "Teeter",
+ "Temple2",
+ "Temple3",
+ "Temple4",
+ "Temple5",
+ "Temple6",
+ "Temple7",
+ "Temple8",
+ "Tic-tac2",
+ "torture",
+ "transmit",
+ "Typey",
+ "ventfall",
+ "ventoff",
+ "wasting",
+ "wurbatak"
};
} // End of namespace Simon
diff --git a/engines/simon/animation.h b/engines/simon/animation.h
index 5f815ed631..782cea87a9 100644
--- a/engines/simon/animation.h
+++ b/engines/simon/animation.h
@@ -27,13 +27,14 @@
#include "common/file.h"
#include "common/stream.h"
+#include "graphics/dxa_player.h"
#include "sound/mixer.h"
namespace Simon {
class SimonEngine;
-class MoviePlayer {
+class MoviePlayer : public Graphics::DXAPlayer {
SimonEngine *_vm;
Audio::Mixer *_mixer;
@@ -42,20 +43,8 @@ class MoviePlayer {
Audio::AudioStream *_bgSoundStream;
bool _omniTV;
- bool _playing;
bool _leftButtonDown;
bool _rightButtonDown;
- Common::File _fd;
- uint8 *_frameBuffer1;
- uint8 *_frameBuffer2;
- uint16 _width;
- uint16 _height;
- uint16 _framesCount;
- uint32 _framesPerSec;
- uint16 _frameNum;
- uint32 _frameSize;
- uint16 _frameSkipped;
- uint32 _frameTicks;
uint32 _ticks;
char baseName[40];
@@ -63,21 +52,18 @@ class MoviePlayer {
uint8 _sequenceNum;
public:
MoviePlayer(SimonEngine *vm, Audio::Mixer *mixer);
- ~MoviePlayer();
bool load(const char *filename);
void play();
void nextFrame();
+protected:
+ virtual void setPalette(byte *pal);
private:
void playOmniTV();
- void close();
- void copyFrame(byte *dst, uint x, uint y);
- void decodeFrame();
void handleNextFrame();
void processFrame();
void startSound();
- void decodeZlib(uint8 *data, int size, int totalSize);
};
} // End of namespace Simon