MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / ResourceBuffer

Method ResourceBuffer

olcPixelGameEngine.h:2298–2303  ·  view source on GitHub ↗

============================================================= Resource Packs - Allows you to store files in one large scrambled file - Thanks MaGetzUb for debugging a null char in std::stringstream bug

Source from the content-addressed store, hash-verified

2296 // Resource Packs - Allows you to store files in one large
2297 // scrambled file - Thanks MaGetzUb for debugging a null char in std::stringstream bug
2298 ResourceBuffer::ResourceBuffer(std::ifstream& ifs, uint32_t offset, uint32_t size)
2299 {
2300 vMemory.resize(size);
2301 ifs.seekg(offset); ifs.read(vMemory.data(), vMemory.size());
2302 setg(vMemory.data(), vMemory.data(), vMemory.data() + size);
2303 }
2304
2305 ResourcePack::ResourcePack() { }
2306 ResourcePack::~ResourcePack() { baseFile.close(); }

Callers

nothing calls this directly

Calls 2

resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected