MCPcopy Create free account
hub / github.com/AbyssEngine/AbyssEngineOld / DC6

Method DC6

src/Abyss/DataTypes/DC6.cpp:10–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace Abyss::DataTypes {
9
10DC6::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
34DC6::DC6(const std::string_view path, const Palette &palette) : DC6(path) { setPalette(palette); }
35uint32_t DC6::getVersion() const { return _version; }

Callers

nothing calls this directly

Calls 4

readUInt32Method · 0.80
readBytesMethod · 0.80
resizeMethod · 0.80
loadFileMethod · 0.45

Tested by

no test coverage detected