45 lines
815 B
C++
45 lines
815 B
C++
#ifndef WC3RE_MVEDECODER_HH__
|
|
#define WC3RE_MVEDECODER_HH__
|
|
|
|
#include <vector>
|
|
#include <array>
|
|
|
|
#include "IffFile.hh"
|
|
|
|
class MveDecoder {
|
|
public:
|
|
MveDecoder(char const* base, size_t length);
|
|
|
|
size_t numBranches() const {
|
|
return branches_.size();
|
|
}
|
|
|
|
void play(unsigned branch) const;
|
|
private:
|
|
IffFile iff_;
|
|
|
|
using Palette = std::array<uint8_t, 768>;
|
|
|
|
struct Frame {
|
|
std::vector<uint8_t> pixels;
|
|
};
|
|
|
|
struct Shot {
|
|
Palette const& palt;
|
|
std::vector<IffFile::Object const*> AUDIs;
|
|
std::vector<IffFile::Object const*> VGAs;
|
|
};
|
|
|
|
unsigned width_, height_;
|
|
|
|
//std::vector<Shot> shots_;
|
|
std::vector<Palette> palts_;
|
|
std::vector<std::vector<Shot> > branches_;
|
|
|
|
Frame parseVGA(IffFile::Object const& vga, Frame const* prev) const;
|
|
|
|
friend struct AudioCBData;
|
|
};
|
|
|
|
#endif
|