mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- fixed: 0 is a valid resource ID for Blood.
Unfortunately this means that looking up ID 0 can be a bit more costly than the rest because all ID-less entries in RFF files also use 0. For other file types -1 is used.
This commit is contained in:
parent
dc9d75685e
commit
e35a5bac79
1 changed files with 3 additions and 3 deletions
|
@ -426,7 +426,7 @@ void FileSystem::InitHashChains (void)
|
|||
{
|
||||
hash = int(lump->LumpName[l]) % NumEntries;
|
||||
}
|
||||
else if (l == (int)ELookupMode::IdWithType && lump->ResourceId > 0)
|
||||
else if (l == (int)ELookupMode::IdWithType && lump->ResourceId >= 0)
|
||||
{
|
||||
hash = int(lump->ResourceId) % NumEntries;
|
||||
}
|
||||
|
@ -449,7 +449,7 @@ void FileSystem::AddLump(FResourceLump *lump)
|
|||
{
|
||||
hash = int(lump->LumpName[l]) % NumEntries;
|
||||
}
|
||||
else if (lump->ResourceId > 0)
|
||||
else if (lump->ResourceId >= 0)
|
||||
{
|
||||
hash = int(lump->ResourceId) % NumEntries;
|
||||
}
|
||||
|
@ -933,7 +933,7 @@ bool FileSystem::CreatePathlessCopy(const char *name, int id, int flags)
|
|||
FName fullname = oldlump->LumpName[FResourceLump::FullNameType];
|
||||
|
||||
// If the lump we are about to add already got the right properties, do nothing, aside from loading/locking as requested
|
||||
if (filename == fullname && (id == 0 || id == oldlump->ResourceId))
|
||||
if (filename == fullname && (id == -1 || id == oldlump->ResourceId))
|
||||
{
|
||||
if (flags & DICT_LOCK) oldlump->Lock();
|
||||
else if (flags & DICT_LOAD) oldlump->Get();
|
||||
|
|
Loading…
Reference in a new issue