| 8 | namespace Abyss::DataTypes { |
| 9 | |
| 10 | DC6::DC6(const std::string_view path) |
| 11 | : _version(0), _flags(0), _encoding(0), _directions(0), _framesPerDirection(0), _texture(nullptr, &SDL_DestroyTexture), _blendMode(Enums::BlendMode::None) { |
| 12 | auto stream = Singletons::getFileProvider().loadFile(path); |
| 13 | Streams::StreamReader sr(stream); |
| 14 | _version = sr.readUInt32(); |
| 15 | _flags = sr.readUInt32(); |
| 16 | _encoding = sr.readUInt32(); |
| 17 | sr.readBytes(_termination); |
| 18 | _directions = sr.readUInt32(); |
| 19 | _framesPerDirection = sr.readUInt32(); |
| 20 | |
| 21 | const auto frameCount = _directions * _framesPerDirection; |
| 22 | |
| 23 | _framePointers.resize(frameCount); |
| 24 | |
| 25 | for (auto &framePointer : _framePointers) { |
| 26 | framePointer = sr.readUInt32(); |
| 27 | } |
| 28 | |
| 29 | for ([[maybe_unused]] auto &framePointer : _framePointers) { |
| 30 | _frames.emplace_back(sr); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | DC6::DC6(const std::string_view path, const Palette &palette) : DC6(path) { setPalette(palette); } |
| 35 | uint32_t DC6::getVersion() const { return _version; } |
nothing calls this directly
no test coverage detected