Skip to content

Commit a67d6da

Browse files
committed
Cleanuping old find directory code making ps2_drivers finding the wad.
1 parent be220ac commit a67d6da

1 file changed

Lines changed: 0 additions & 88 deletions

File tree

prboom2/src/SDL/i_system.c

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,6 @@ const char *I_DoomExeDir(void)
351351

352352
if (!base) // cache multiple requests
353353
{
354-
#ifdef __PS2__
355-
base = malloc(strlen(prboom_dir) + 1);
356-
strcpy(base, prboom_dir);
357-
#else
358354
char *home = M_getenv("HOME");
359355
char *p_home = strdup(home);
360356
size_t len = strlen(home);
@@ -366,7 +362,6 @@ const char *I_DoomExeDir(void)
366362
base = malloc(p_len);
367363
snprintf(base, p_len, "%s/.%s", p_home, prboom_dir);
368364
free(p_home);
369-
#endif
370365
// if ~/.$prboom_dir doesn't exist,
371366
// create and use directory in XDG_DATA_HOME
372367
if (M_stat(base, &data_dir) || !S_ISDIR(data_dir.st_mode))
@@ -556,89 +551,6 @@ const char* I_FindFile2(const char* wfname, const char* ext)
556551
return (const char*) I_FindFileInternal(wfname, ext, true);
557552
}
558553

559-
#elif defined(__PS2__)
560-
char* I_FindFileInternal(const char* wfname, const char* ext, dboolean isStatic)
561-
{
562-
int i;
563-
/* Precalculate a length we will need in the loop */
564-
size_t pl = strlen(wfname) + strlen(ext) + 4;
565-
566-
for(i = 0; i < 7; i++)
567-
{
568-
char * p;
569-
const char * d = NULL;
570-
const char * s = NULL;
571-
572-
/* Each entry in the switch sets d to directory to look in
573-
* and optionally s to a subdirectory of d*/
574-
switch(i)
575-
{
576-
case 0:
577-
d = "";
578-
break;
579-
580-
case 1:
581-
d = "host:";
582-
break;
583-
584-
case 2:
585-
d = "hdd0:/+DOOM/";
586-
break;
587-
588-
case 3:
589-
d = "mass:/";
590-
break;
591-
592-
case 4:
593-
d = "cdrom:\\";
594-
break;
595-
596-
case 5:
597-
d = "mc0:/";
598-
break;
599-
600-
case 6:
601-
d = "mc1:/";
602-
break;
603-
604-
case 7:
605-
d = I_DoomExeDir();
606-
break;
607-
608-
}
609-
610-
if (!isStatic)
611-
p = (char*)malloc((d ? strlen(d) : 0) + (s ? strlen(s) : 0) + pl);
612-
sprintf(p, "%s%s%s%s%s", d ? d : "", (d && !HasTrailingSlash(d)) ? "/" : "",
613-
s ? s : "", (s && !HasTrailingSlash(s)) ? "/" : "",
614-
wfname);
615-
616-
if (ext && M_access(p,F_OK))
617-
strcat(p, ext);
618-
if (!M_access(p,F_OK)) {
619-
if (!isStatic)
620-
lprintf(LO_INFO, " found %s\n", p);
621-
return p;
622-
}
623-
if (!isStatic)
624-
free(p);
625-
626-
}
627-
628-
return NULL;
629-
}
630-
631-
char* I_FindFile(const char* wfname, const char* ext)
632-
{
633-
return I_FindFileInternal(wfname, ext, false);
634-
}
635-
636-
const char* I_FindFile2(const char* wfname, const char* ext)
637-
{
638-
return (const char*) I_FindFileInternal(wfname, ext, true);
639-
}
640-
641-
642554
#endif
643555

644556
#endif // PRBOOM_SERVER

0 commit comments

Comments
 (0)