diff options
author | Sven Hesse | 2009-07-24 21:36:16 +0000 |
---|---|---|
committer | Sven Hesse | 2009-07-24 21:36:16 +0000 |
commit | 54b63ac239a8b555b191d40733e05090b3b08e3a (patch) | |
tree | f153ffd5c3f7de24949cbdd3744da681d92b802e /graphics/video | |
parent | c4baedc6dbffbec01cf9a0f7d57f1922b0bceaec (diff) | |
download | scummvm-rg350-54b63ac239a8b555b191d40733e05090b3b08e3a.tar.gz scummvm-rg350-54b63ac239a8b555b191d40733e05090b3b08e3a.tar.bz2 scummvm-rg350-54b63ac239a8b555b191d40733e05090b3b08e3a.zip |
Moving all implementations into the cpp
svn-id: r42714
Diffstat (limited to 'graphics/video')
-rw-r--r-- | graphics/video/coktelvideo/coktelvideo.cpp | 71 | ||||
-rw-r--r-- | graphics/video/coktelvideo/coktelvideo.h | 107 |
2 files changed, 137 insertions, 41 deletions
diff --git a/graphics/video/coktelvideo/coktelvideo.cpp b/graphics/video/coktelvideo/coktelvideo.cpp index 8dd3d4f328..02893bb73e 100644 --- a/graphics/video/coktelvideo/coktelvideo.cpp +++ b/graphics/video/coktelvideo/coktelvideo.cpp @@ -40,6 +40,67 @@ Imd::~Imd() { clear(); } +uint32 Imd::getFeatures() const { + return _features; +} + +uint16 Imd::getFlags() const { + return _flags; +} + +int16 Imd::getX() const { + return _x; +} + +int16 Imd::getY() const { + return _y; +} + +int16 Imd::getWidth() const { + return _width; +} + +int16 Imd::getHeight() const { + return _height; +} + +uint16 Imd::getFramesCount() const { + return _framesCount; +} + +uint16 Imd::getCurrentFrame() const { + return _curFrame; +} + +int16 Imd::getFrameRate() const { + if (!_hasSound) + return _frameRate; + + return 1000 / (_soundSliceLength >> 16); +} + +uint32 Imd::getSyncLag() const { + return _skipFrames; +} + +const byte *Imd::getPalette() const { + return _palette; +} + +bool Imd::getFrameCoords(int16 frame, + int16 &x, int16 &y, int16 &width, int16 &height) { + + return false; +} + +bool Imd::hasExtraData(const char *fileName) const { + return false; +} + +Common::MemoryReadStream *Imd::getExtraData(const char *fileName) { + return 0; +} + bool Imd::load(Common::SeekableReadStream &stream) { unload(); @@ -191,6 +252,9 @@ void Imd::unload() { clear(); } +void Imd::notifyPaused(uint32 duration) { +} + void Imd::setFrameRate(int16 frameRate) { if (frameRate == 0) frameRate = 1; @@ -251,6 +315,9 @@ void Imd::setVideoMemory() { } } +void Imd::setDoubleMode(bool doubleMode) { +} + void Imd::enableSound(Audio::Mixer &mixer) { // Only possible on the first frame if (_curFrame > 0) @@ -857,6 +924,10 @@ void Imd::deLZ77(byte *dest, byte *src) { } } +inline void Imd::unsignedToSigned(byte *buffer, int length) { + while (length-- > 0) *buffer++ ^= 0x80; +} + Vmd::ExtraData::ExtraData() { memset(name, 0, 16); diff --git a/graphics/video/coktelvideo/coktelvideo.h b/graphics/video/coktelvideo/coktelvideo.h index 874df8e290..ecb9a1505f 100644 --- a/graphics/video/coktelvideo/coktelvideo.h +++ b/graphics/video/coktelvideo/coktelvideo.h @@ -202,29 +202,28 @@ public: Imd(); ~Imd(); - uint32 getFeatures() const { return _features; } - uint16 getFlags() const { return _flags; } - int16 getX() const { return _x; } - int16 getY() const { return _y; } - int16 getWidth() const { return _width; } - int16 getHeight() const { return _height; } - uint16 getFramesCount() const { return _framesCount; } - uint16 getCurrentFrame() const { return _curFrame; } - int16 getFrameRate() const { - if (_hasSound) - return 1000 / (_soundSliceLength >> 16); - return _frameRate; - } - uint32 getSyncLag() const { return _skipFrames; } - const byte *getPalette() const { return _palette; } + uint32 getFeatures() const; + uint16 getFlags() const; + + int16 getX() const; + int16 getY() const; + int16 getWidth() const; + int16 getHeight() const; + + uint16 getFramesCount() const; + uint16 getCurrentFrame() const; + int16 getFrameRate() const; + uint32 getSyncLag() const; + + const byte *getPalette() const; bool getFrameCoords(int16 frame, - int16 &x, int16 &y, int16 &width, int16 &height) { return false; } + int16 &x, int16 &y, int16 &width, int16 &height); - bool hasExtraData(const char *fileName) const { return false; } - Common::MemoryReadStream *getExtraData(const char *fileName) { return 0; } + bool hasExtraData(const char *fileName) const; + Common::MemoryReadStream *getExtraData(const char *fileName); - void notifyPaused(uint32 duration) { } + void notifyPaused(uint32 duration); void setFrameRate(int16 frameRate); @@ -235,7 +234,7 @@ public: void setVideoMemory(byte *vidMem, uint16 width, uint16 height); void setVideoMemory(); - void setDoubleMode(bool doubleMode) { } + void setDoubleMode(bool doubleMode); void enableSound(Audio::Mixer &mixer); void disableSound(); @@ -260,49 +259,72 @@ protected: } PACKED_STRUCT; Common::SeekableReadStream *_stream; + + // Properties uint16 _version; uint32 _features; uint16 _flags; - int16 _x, _y, _width, _height; - int16 _stdX, _stdY, _stdWidth, _stdHeight; - uint16 _framesCount, _curFrame; + + // Current coordinates + int16 _x; + int16 _y; + int16 _width; + int16 _height; + + // Standard coordinates gives by the header + int16 _stdX; + int16 _stdY; + int16 _stdWidth; + int16 _stdHeight; + + uint16 _framesCount; + uint16 _curFrame; + uint32 *_framesPos; - uint32 _firstFramePos; + uint32 _firstFramePos; Coord *_frameCoords; - uint32 _frameDataSize, _vidBufferSize; - byte *_frameData, *_vidBuffer; + // Buffer for raw frame data + byte *_frameData; + uint32 _frameDataSize; uint32 _frameDataLen; - byte _palette[768]; + // Buffer for uncompressed raw frame data + byte *_vidBuffer; + uint32 _vidBufferSize; - bool _hasOwnVidMem; - byte *_vidMem; - uint16 _vidMemWidth, _vidMemHeight; + byte _palette[768]; - bool _hasSound; - bool _soundEnabled; - uint8 _soundStage; // (0: no sound, 1: loaded, 2: playing) - uint32 _skipFrames; + // Video memory + bool _hasOwnVidMem; + byte *_vidMem; + uint16 _vidMemWidth; + uint16 _vidMemHeight; + // Sound properties uint16 _soundFlags; - int16 _soundFreq; - int16 _soundSliceSize; - int16 _soundSlicesCount; + int16 _soundFreq; + int16 _soundSliceSize; + int16 _soundSlicesCount; uint32 _soundSliceLength; + // Current sound state + bool _hasSound; + bool _soundEnabled; + uint8 _soundStage; // (0: no sound, 1: loaded, 2: playing) + uint32 _skipFrames; + Audio::AppendableAudioStream *_audioStream; Audio::SoundHandle _audioHandle; - int16 _frameRate; + // Current video state + int16 _frameRate; uint32 _frameLength; uint32 _lastFrameTime; Audio::Mixer *_mixer; - void unsignedToSigned(byte *buffer, int length) { - while (length-- > 0) *buffer++ ^= 0x80; - } + void unsignedToSigned(byte *buffer, int length); void deleteVidMem(bool del = true); void clear(bool del = true); @@ -384,6 +406,7 @@ protected: ~Frame(); } PACKED_STRUCT; + // Tables for the audio decompressors static const uint16 _tableDPCM[128]; static const int32 _tableADPCM[]; static const int32 _tableADPCMStep[]; @@ -397,12 +420,14 @@ protected: Common::Array<ExtraData> _extraData; + // Sound properties byte _soundBytesPerSample; byte _soundStereo; // (0: mono, 1: old-style stereo, 2: new-style stereo) uint32 _soundHeaderSize; uint32 _soundDataSize; AudioFormat _audioFormat; + // Video properties bool _externalCodec; byte _blitMode; byte _bytesPerPixel; |