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:
kichikuou
2026-03-15 11:13:08 +09:00
parent 022d6af4f1
commit 4a5cd4a1c1
3 changed files with 15 additions and 6 deletions
+7 -2
View File
@@ -96,8 +96,13 @@ static void Init() {
int p3 = getCaliValue();
int *var = getCaliVariable();
alk_t *alk = alk_new("dDEMO.alk");
if (!nact->files.alk[0]) {
WARNING("dDEMO.alk not found");
return;
}
alk_t *alk = alk_new(nact->files.alk[0]); // dDEMO.alk
if (!alk) {
WARNING("Cannot open %s", nact->files.alk[0]);
*var = 0;
return;
}
@@ -936,7 +941,7 @@ static void Run() {
break;
}
SDL_RenderPresent(gfx_renderer);
SDL_Delay(16);
sys_wait_vsync();
}
muscd_stop();
+6 -2
View File
@@ -62,9 +62,13 @@ static void SetLoopFlag() {
}
static void Run() {
alk_t *alk = alk_new("tDEMO.alk");
if (!nact->files.alk[0]) {
WARNING("tDEMO.alk not found");
return;
}
alk_t *alk = alk_new(nact->files.alk[0]); // tDEMO.alk
if (!alk) {
WARNING("Cannot open tDEMO.alk");
WARNING("Cannot open %s", nact->files.alk[0]);
return;
}