mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 09:21:36 +00:00
On Windows, check file name case with 'sound' and 'music' CON commands.
This is done by kopen4loadfrommod'ing and immediately closing the file (since the checker is still run from there when not ingame). On my system, times were like 0.12 ms, 0.2 ms and 0.5 ms for each openfrompath/findfrompath, openfrompath/Bopen and SHGetFileInfo respectively, so it shouldn't have a too noticable impact on initial loading times. git-svn-id: https://svn.eduke32.com/eduke32@2704 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
c081f3ab2e
commit
efa0079474
1 changed files with 17 additions and 0 deletions
|
@ -2009,6 +2009,17 @@ static void C_Include(const char *confile)
|
||||||
Bfree(mptr);
|
Bfree(mptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
static void check_filename_case(const char *fn)
|
||||||
|
{
|
||||||
|
int32_t fp;
|
||||||
|
if ((fp = kopen4loadfrommod(fn, g_loadFromGroupOnly)) >= 0)
|
||||||
|
kclose(fp);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static void check_filename_case(const char *fn) { UNREFERENCED_PARAMETER(fn); }
|
||||||
|
#endif
|
||||||
|
|
||||||
static int32_t C_ParseCommand(int32_t loop)
|
static int32_t C_ParseCommand(int32_t loop)
|
||||||
{
|
{
|
||||||
int32_t i, j=0, k=0, tw, otw;
|
int32_t i, j=0, k=0, tw, otw;
|
||||||
|
@ -2468,6 +2479,8 @@ static int32_t C_ParseCommand(int32_t loop)
|
||||||
|
|
||||||
Bstrcpy(MapInfo[(k*MAXLEVELS)+i].musicfn,tempbuf);
|
Bstrcpy(MapInfo[(k*MAXLEVELS)+i].musicfn,tempbuf);
|
||||||
|
|
||||||
|
check_filename_case(tempbuf);
|
||||||
|
|
||||||
textptr += j;
|
textptr += j;
|
||||||
if (i > MAXLEVELS-1) break;
|
if (i > MAXLEVELS-1) break;
|
||||||
i++;
|
i++;
|
||||||
|
@ -2488,6 +2501,8 @@ static int32_t C_ParseCommand(int32_t loop)
|
||||||
}
|
}
|
||||||
EnvMusicFilename[i][j] = '\0';
|
EnvMusicFilename[i][j] = '\0';
|
||||||
|
|
||||||
|
check_filename_case(EnvMusicFilename[i]);
|
||||||
|
|
||||||
textptr += j;
|
textptr += j;
|
||||||
if (i > MAXVOLUMES-1) break;
|
if (i > MAXVOLUMES-1) break;
|
||||||
i++;
|
i++;
|
||||||
|
@ -5409,6 +5424,8 @@ repeatcase:
|
||||||
}
|
}
|
||||||
g_sounds[k].filename[i] = '\0';
|
g_sounds[k].filename[i] = '\0';
|
||||||
|
|
||||||
|
check_filename_case(g_sounds[k].filename);
|
||||||
|
|
||||||
C_GetNextValue(LABEL_DEFINE);
|
C_GetNextValue(LABEL_DEFINE);
|
||||||
g_sounds[k].ps = *(g_scriptPtr-1);
|
g_sounds[k].ps = *(g_scriptPtr-1);
|
||||||
C_GetNextValue(LABEL_DEFINE);
|
C_GetNextValue(LABEL_DEFINE);
|
||||||
|
|
Loading…
Reference in a new issue