VOYEUR: Moved RL2Decoder into Voyeur namespace, and merged with VoyeurRL2Decoder

This commit is contained in:
Paul Gilbert 2014-02-03 23:44:50 -05:00
parent 90b7d10a77
commit d5231aa862
4 changed files with 11 additions and 28 deletions

View File

@ -29,7 +29,7 @@
#include "audio/decoders/raw.h"
#include "graphics/surface.h"
namespace Video {
namespace Voyeur {
// Number of audio frames to keep audio track topped up when playing back video
#define SOUND_FRAMES_READAHEAD 3
@ -467,13 +467,7 @@ Audio::AudioStream *RL2Decoder::RL2AudioTrack::getAudioStream() const {
return _audStream;
}
} // End of namespace Video
/*------------------------------------------------------------------------*/
namespace Voyeur {
void VoyeurRL2Decoder::play(VoyeurEngine *vm, int resourceOffset,
void RL2Decoder::play(VoyeurEngine *vm, int resourceOffset,
byte *frames, byte *imgPos) {
vm->flipPageAndWait();
int paletteStart = getPaletteStart();
@ -513,4 +507,4 @@ void VoyeurRL2Decoder::play(VoyeurEngine *vm, int resourceOffset,
}
}
} // End of namespace Video
} // End of namespace Voyeur

View File

@ -37,17 +37,13 @@ namespace Voyeur {
class VoyeurEngine;
}
namespace Video {
/**
* Decoder for RL2 videos.
*
* Video decoder used in engines:
* - voyeur
*/
class RL2Decoder : public VideoDecoder {
class RL2Decoder : public Video::VideoDecoder {
private:
class RL2FileHeader {
public:
@ -180,14 +176,7 @@ public:
int getPaletteStart() const { return _paletteStart; }
int getPaletteCount() const { return _header._colorCount; }
const RL2FileHeader &getHeader() { return _header; }
};
} // End of namespace Video
namespace Voyeur {
class VoyeurRL2Decoder: public Video::RL2Decoder {
public:
/**
* Play back a given Voyeur RL2 video
* @param vm Engine reference
@ -198,6 +187,6 @@ public:
void play(VoyeurEngine *vm, int resourceOffset = 0, byte *frames = NULL, byte *imgPos = NULL);
};
}
} // End of namespace Voyeur
#endif /* VOYEUR_ANIMATION_H */

View File

@ -470,7 +470,7 @@ void VoyeurEngine::doOpening() {
(*_graphicsManager._vPort)->setupViewPort();
flipPageAndWait();
::Video::RL2Decoder decoder;
RL2Decoder decoder;
decoder.loadFile("a2300100.rl2");
decoder.start();
@ -486,7 +486,7 @@ void VoyeurEngine::doOpening() {
Common::copy((const byte *)frame->getPixels(), (const byte *)frame->getPixels() + 320 * 200,
(byte *)_graphicsManager._screenSurface.getPixels());
if (decoder.getCurFrame() >= READ_LE_UINT32(frameTable + frameIndex * 4)) {
if (decoder.getCurFrame() >= (int32)READ_LE_UINT32(frameTable + frameIndex * 4)) {
if (creditShow) {
// Show a credit
textPic = _bVoy->boltEntry(frameIndex / 2 + 0x202)._picResource;
@ -524,7 +524,7 @@ void VoyeurEngine::doOpening() {
}
void VoyeurEngine::playRL2Video(const Common::String &filename) {
::Video::RL2Decoder decoder;
RL2Decoder decoder;
decoder.loadFile(filename);
decoder.start();
@ -562,7 +562,7 @@ void VoyeurEngine::playAVideoDuration(int videoId, int duration) {
pic = _bVoy->boltEntry(0xE00 + _eventsManager._videoDead)._picResource;
}
::Video::RL2Decoder decoder;
RL2Decoder decoder;
decoder.loadVideo(videoId);
decoder.start();

View File

@ -233,7 +233,7 @@ void VoyeurEngine::doTailTitle() {
_graphicsManager.screenReset();
if (_bVoy->getBoltGroup(0x600)) {
VoyeurRL2Decoder decoder;
RL2Decoder decoder;
decoder.loadFile("a1100200.rl2");
decoder.start();
decoder.play(this);
@ -743,7 +743,7 @@ void VoyeurEngine::doGossip() {
return;
// Load the gossip animation
VoyeurRL2Decoder decoder;
RL2Decoder decoder;
decoder.loadFile("a2050100.rl2", false);
decoder.start();