mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
cache1d: Bikeshed some formatting in kopen_internal().
git-svn-id: https://svn.eduke32.com/eduke32@5442 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
4d9b61c085
commit
9f2911e773
1 changed files with 23 additions and 28 deletions
|
@ -990,10 +990,7 @@ static int32_t check_filename_mismatch(const char * const filename, int ofs)
|
|||
|
||||
static int32_t kopen_internal(const char *filename, char **lastpfn, char searchfirst, char checkcase, char tryzip, int32_t newhandle, uint8_t *arraygrp, intptr_t *arrayhan, int32_t *arraypos)
|
||||
{
|
||||
int32_t j, k, fil;
|
||||
char bad, *gfileptr;
|
||||
intptr_t i;
|
||||
|
||||
int32_t fil;
|
||||
if (searchfirst == 0 && (fil = openfrompath_internal(filename, lastpfn, BO_BINARY|BO_RDONLY, BS_IREAD)) >= 0)
|
||||
{
|
||||
#ifdef FILENAME_CASE_CHECK
|
||||
|
@ -1040,6 +1037,7 @@ static int32_t kopen_internal(const char *filename, char **lastpfn, char searchf
|
|||
#ifdef WITHKPLIB
|
||||
if (tryzip)
|
||||
{
|
||||
intptr_t i;
|
||||
if ((kzcurhand != newhandle) && (kztell() >= 0))
|
||||
{
|
||||
if (kzcurhand >= 0) arraypos[kzcurhand] = kztell();
|
||||
|
@ -1059,26 +1057,22 @@ static int32_t kopen_internal(const char *filename, char **lastpfn, char searchf
|
|||
UNREFERENCED_PARAMETER(tryzip);
|
||||
#endif
|
||||
|
||||
for (k=numgroupfiles-1; k>=0; k--)
|
||||
for (int32_t k = searchfirst != 1 ? numgroupfiles-1 : 0; k >= 0; --k)
|
||||
{
|
||||
if (searchfirst == 1) k = 0;
|
||||
if (groupfil[k] >= 0)
|
||||
{
|
||||
for (i=gnumfiles[k]-1; i>=0; i--)
|
||||
{
|
||||
gfileptr = (char *)&gfilelist[k][i<<4];
|
||||
if (groupfil[k] < 0)
|
||||
continue;
|
||||
|
||||
bad = 0;
|
||||
for (j=0; j<13; j++)
|
||||
for (int32_t i = gnumfiles[k]-1; i >= 0; --i)
|
||||
{
|
||||
char const * const gfileptr = (char *)&gfilelist[k][i<<4];
|
||||
|
||||
unsigned int j;
|
||||
for (j = 0; j < 13; ++j)
|
||||
{
|
||||
if (!filename[j]) break;
|
||||
if (toupperlookup[filename[j]] != toupperlookup[gfileptr[j]])
|
||||
{
|
||||
bad = 1;
|
||||
break;
|
||||
goto gnumfiles_continue;
|
||||
}
|
||||
}
|
||||
if (bad) continue;
|
||||
if (j<13 && gfileptr[j]) continue; // JBF: because e1l1.map might exist before e1l1
|
||||
if (j==13 && filename[j]) continue; // JBF: long file name
|
||||
|
||||
|
@ -1086,7 +1080,8 @@ static int32_t kopen_internal(const char *filename, char **lastpfn, char searchf
|
|||
arrayhan[newhandle] = i;
|
||||
arraypos[newhandle] = 0;
|
||||
return newhandle;
|
||||
}
|
||||
|
||||
gnumfiles_continue: ;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue