This repository has been archived on 2023-10-28. You can view files and clone it, but cannot push or open issues or pull requests.
frostbite/snowlib/GobFile.h
2020-02-06 00:23:46 +00:00

39 lines
613 B
C++

#pragma once
#include "LmpRepository.h"
/// A Gob file is a collection of Lmp files.
class GobFile : public LmpRepository
{
string gobPath;
GameType gameType;
unsigned char* gobData;
int gobDataLength;
unordered_map<string, LmpFile*> lmpFileMap;
void readGobFile();
void buildLmpFileMap();
public:
GobFile(string gobPath, GameType gameType)
{
this->gobPath = gobPath;
this->gameType = gameType;
gobData = nullptr;
gobDataLength = 0;
}
~GobFile()
{
for (auto& x : lmpFileMap){
delete x.second;
}
lmpFileMap.clear();
delete[] gobData;
}
LmpFile* getLmp(string lmpName);
};