mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-10-10 08:08:34 +03:00
dDemo/tDemo: Fix .alk filename case sensitivity
Instead of hardcoding "dDEMO.alk" / "tDEMO.alk", use the actual filename stored in nact->files.alk[0] from the directory scan. This fixes loading failures on case-sensitive filesystems where the actual file may be named "dDemo.alk" or "tDemo.alk". Also update gameresource.c to store .alk files without a numeric suffix at index 0 (these games have only one .alk file).
This commit is contained in:
+2
-2
@@ -85,8 +85,8 @@ bool initGameResourceFromDir(GameResource *gr, DIR *dir, const char *savedir, st
|
||||
} else if (len >= 4 && strcasecmp(filename + len - 4, ".bgi") == 0) {
|
||||
gr->bgi = strdup(filename);
|
||||
} else if (len >= 5 && strcasecmp(filename + len - 4, ".alk") == 0) {
|
||||
if (!isdigit(filename[len - 5])) continue;
|
||||
gr->alk[filename[len - 5] - '0'] = strdup(filename);
|
||||
int idx = isdigit(filename[len - 5]) ? filename[len - 5] - '0' : 0;
|
||||
gr->alk[idx] = strdup(filename);
|
||||
} else if (len >= 6 && strcasecmp(filename + len - 4, ".ald") == 0) {
|
||||
int dno = toupper(filename[len - 5]) - 'A';
|
||||
if (dno < 0 || dno >= DRIFILEMAX) continue;
|
||||
|
||||
Reference in New Issue
Block a user