mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-03-21 18:31:10 +00:00
more access methods for FResourceFile
This commit is contained in:
parent
aaea3d52aa
commit
dc52cac89e
2 changed files with 17 additions and 5 deletions
|
@ -219,6 +219,11 @@ public:
|
|||
auto l = GetLump(entry);
|
||||
return l ? l->LumpSize : -1;
|
||||
}
|
||||
size_t Offset(int entry)
|
||||
{
|
||||
auto l = GetLump(entry);
|
||||
return l ? l->GetFileOffset() : -1;
|
||||
}
|
||||
|
||||
FileReader GetEntryReader(int entry, bool newreader = true)
|
||||
{
|
||||
|
@ -232,6 +237,18 @@ public:
|
|||
return l ? l->Flags : 0;
|
||||
}
|
||||
|
||||
int GetEntryNamespace(int entry)
|
||||
{
|
||||
auto l = GetLump(entry);
|
||||
return l ? l->GetNamespace() : 0;
|
||||
}
|
||||
|
||||
int GetEntryResourceID(int entry)
|
||||
{
|
||||
auto l = GetLump(entry);
|
||||
return l ? l->GetIndexNum() : 0;
|
||||
}
|
||||
|
||||
ResourceData Read(int entry)
|
||||
{
|
||||
auto fr = GetEntryReader(entry, false);
|
||||
|
|
|
@ -206,11 +206,6 @@ void FileSystem::DeleteAll ()
|
|||
Hashes.clear();
|
||||
NumEntries = 0;
|
||||
|
||||
// explicitly delete all manually added lumps.
|
||||
for (auto &frec : FileInfo)
|
||||
{
|
||||
if (frec.rfnum == -1) delete frec.lump;
|
||||
}
|
||||
FileInfo.clear();
|
||||
for (int i = (int)Files.size() - 1; i >= 0; --i)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue