mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 04:01:31 +00:00
fixed remaining issues in resource file loading.
This commit is contained in:
parent
f3c7e01195
commit
72a2e5d532
4 changed files with 13 additions and 13 deletions
|
@ -108,7 +108,7 @@ int FDirectory::AddDirectory(const char *dirpath, LumpFilterInfo* filter, FileSy
|
|||
{
|
||||
// extract the base path from the first entry to cover changes made in ScanDirectory.
|
||||
auto full = entry.FilePath.find(entry.FilePathRel);
|
||||
std::string path(entry.FilePath, full);
|
||||
std::string path(entry.FilePath, 0, full);
|
||||
mBasePath = stringpool->Strdup(path.c_str());
|
||||
}
|
||||
if (!entry.isDirectory)
|
||||
|
|
|
@ -159,14 +159,14 @@ bool FWadFile::Open(LumpFilterInfo*, FileSystemMessageFunc Printf)
|
|||
|
||||
GenerateHash(); // Do this before the lump processing below.
|
||||
|
||||
SetNamespace("S_START", "S_END", ns_sprites, Printf);
|
||||
SetNamespace("F_START", "F_END", ns_flats, Printf, true);
|
||||
SetNamespace("C_START", "C_END", ns_colormaps, Printf);
|
||||
SetNamespace("A_START", "A_END", ns_acslibrary, Printf);
|
||||
SetNamespace("TX_START", "TX_END", ns_newtextures, Printf);
|
||||
SetNamespace("V_START", "V_END", ns_strifevoices, Printf);
|
||||
SetNamespace("HI_START", "HI_END", ns_hires, Printf);
|
||||
SetNamespace("VX_START", "VX_END", ns_voxels, Printf);
|
||||
SetNamespace("s_start", "s_end", ns_sprites, Printf);
|
||||
SetNamespace("f_start", "f_end", ns_flats, Printf, true);
|
||||
SetNamespace("c_start", "c_end", ns_colormaps, Printf);
|
||||
SetNamespace("a_start", "a_end", ns_acslibrary, Printf);
|
||||
SetNamespace("tx_start", "tx_end", ns_newtextures, Printf);
|
||||
SetNamespace("v_start", "v_end", ns_strifevoices, Printf);
|
||||
SetNamespace("hi_start", "hi_end", ns_hires, Printf);
|
||||
SetNamespace("vx_start", "vx_end", ns_voxels, Printf);
|
||||
SkinHack(Printf);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -326,7 +326,7 @@ char *MemoryReader::Gets(char *strbuf, ptrdiff_t len)
|
|||
int BufferingReader::FillBuffer(ptrdiff_t newpos)
|
||||
{
|
||||
if (newpos > Length) newpos = Length;
|
||||
if (newpos < bufferpos) return 0;
|
||||
if (newpos <= bufferpos) return 0;
|
||||
auto read = baseReader->Read(&buf[bufferpos], newpos - bufferpos);
|
||||
bufferpos += read;
|
||||
if (bufferpos == Length)
|
||||
|
|
|
@ -468,7 +468,7 @@ bool FResourceFile::FindPrefixRange(const char* filter, uint32_t maxlump, uint32
|
|||
while (min <= max)
|
||||
{
|
||||
mid = min + (max - min) / 2;
|
||||
auto lump = &Entries[mid];
|
||||
auto lump = &lumps[mid];
|
||||
cmp = strnicmp(lump->FileName, filter, strlen(filter));
|
||||
if (cmp == 0)
|
||||
break;
|
||||
|
@ -488,7 +488,7 @@ bool FResourceFile::FindPrefixRange(const char* filter, uint32_t maxlump, uint32
|
|||
while (min <= max)
|
||||
{
|
||||
mid = min + (max - min) / 2;
|
||||
auto lump = &Entries[mid];
|
||||
auto lump = &lumps[mid];
|
||||
cmp = strnicmp(lump->FileName, filter, strlen(filter));
|
||||
// Go left on matches and right on misses.
|
||||
if (cmp == 0)
|
||||
|
@ -503,7 +503,7 @@ bool FResourceFile::FindPrefixRange(const char* filter, uint32_t maxlump, uint32
|
|||
while (min <= max)
|
||||
{
|
||||
mid = min + (max - min) / 2;
|
||||
auto lump = &Entries[mid];
|
||||
auto lump = &lumps[mid];
|
||||
cmp = strnicmp(lump->FileName, filter, strlen(filter));
|
||||
// Go right on matches and left on misses.
|
||||
if (cmp == 0)
|
||||
|
|
Loading…
Reference in a new issue