27 lines
841 B
C++
27 lines
841 B
C++
|
|
#include "remorse/file_system.h"
|
||
|
|
#include "remorse/flex_archive.h"
|
||
|
|
|
||
|
|
#include <cassert>
|
||
|
|
#include <filesystem>
|
||
|
|
|
||
|
|
int main()
|
||
|
|
{
|
||
|
|
const auto root = remorse::findGameDataRoot(std::filesystem::current_path());
|
||
|
|
assert(root.has_value());
|
||
|
|
|
||
|
|
const auto combatPath = remorse::resolveGameDataPath(*root, std::filesystem::path("STATIC") / "COMBAT.DAT");
|
||
|
|
assert(combatPath.has_value());
|
||
|
|
|
||
|
|
const auto archive = remorse::loadFlexArchive(*combatPath);
|
||
|
|
assert(archive.has_value());
|
||
|
|
assert(archive->populatedEntries.size() == 14);
|
||
|
|
|
||
|
|
const auto firstEntry = remorse::readFlexEntry(*archive, 0);
|
||
|
|
assert(firstEntry.has_value());
|
||
|
|
assert(firstEntry->size() == 0x4f);
|
||
|
|
assert((*firstEntry)[0] == 'D');
|
||
|
|
assert((*firstEntry)[1] == 'u');
|
||
|
|
assert((*firstEntry)[2] == 'm');
|
||
|
|
assert((*firstEntry)[3] == 'b');
|
||
|
|
return 0;
|
||
|
|
}
|