22#ifndef VOYEUR_ANIMATION_H
23#define VOYEUR_ANIMATION_H
25#include "video/video_decoder.h"
26#include "audio/audiostream.h"
27#include "audio/mixer.h"
28#include "common/array.h"
29#include "common/list.h"
30#include "common/rect.h"
31#include "common/stream.h"
32#include "voyeur/files.h"
61 int *_frameSoundSizes;
65 uint32 *_frameOffsets;
85 SoundFrame(
int offset,
int size);
90 const RL2FileHeader &_header;
97 ~RL2AudioTrack()
override;
100 bool isSeekable()
const override {
return true; }
108 RL2VideoTrack(
const RL2FileHeader &header, RL2AudioTrack *audioTrack,
110 ~RL2VideoTrack()
override;
117 int getCurFrame()
const override {
return _curFrame; }
118 int getFrameCount()
const override {
return _header._numFrames; }
120 const byte *
getPalette()
const override { _dirtyPalette =
false;
return _header._palette; }
121 int getPaletteCount()
const {
return _header._colorCount; }
124 void clearDirtyRects() { _dirtyRects.
clear(); }
125 void copyDirtyRectsToBuffer(uint8 *dst, uint pitch);
127 Common::Rational getFrameRate()
const override {
return _header.getFrameRate(); }
128 bool isSeekable()
const override {
return true; }
132 const RL2FileHeader &_header;
137 mutable bool _dirtyPalette;
142 uint32 *_frameOffsets;
146 void copyFrame(uint8 *data);
147 void rl2DecodeFrameWithTransparency(
int screenOffset);
148 void rl2DecodeFrameWithoutTransparency(
int screenOffset = -1);
149 void initBackSurface();
153 RL2AudioTrack *_audioTrack;
154 RL2VideoTrack *_videoTrack;
156 RL2FileHeader _header;
159 int _soundFrameNumber;
162 void clearDirtyRects();
163 void copyDirtyRectsToBuffer(uint8 *dst, uint pitch);
164 int getPaletteStart()
const {
return _paletteStart; }
165 const RL2FileHeader &getHeader() {
return _header; }
166 void readNextPacket()
override;
176 bool loadRL2File(
const Common::Path &file,
bool palFlag);
177 bool loadVideo(
int videoId);
178 int getPaletteCount()
const {
return _header._colorCount; }
187 void play(
VoyeurEngine *vm,
int resourceOffset = 0,
byte *frames =
nullptr,
byte *imgPos =
nullptr);
188 RL2VideoTrack *getRL2VideoTrack() {
return _videoTrack; }
189 RL2AudioTrack *getRL2AudioTrack() {
return _audioTrack; }
Definition: audiostream.h:50
SoundType
Definition: mixer.h:73
Definition: audiostream.h:370
virtual uint32 numQueuedStreams() const =0
Definition: timestamp.h:83
void clear()
Definition: list.h:245
Definition: rational.h:40
Definition: video_decoder.h:759
Definition: video_decoder.h:734
Definition: video_decoder.h:53
bool seek(const Audio::Timestamp &time)
Graphics::PixelFormat getPixelFormat() const
bool hasDirtyPalette() const
Definition: video_decoder.h:337
virtual uint16 getHeight() const
const byte * getPalette()
virtual bool isSeekable() const
virtual const Graphics::Surface * decodeNextFrame()
uint32 getFrameCount() const
virtual uint16 getWidth() const
Definition: animation.h:48
bool loadStream(Common::SeekableReadStream *stream) override
void play(VoyeurEngine *vm, int resourceOffset=0, byte *frames=nullptr, byte *imgPos=nullptr)
Definition: animation.h:38