Refine the previous commit a bit. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4802 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2014-12-08 07:32:58 +00:00
parent 0b91499ee0
commit 735525758d
5 changed files with 40 additions and 40 deletions

View file

@ -761,7 +761,6 @@ char *Bgetenv(const char *name);
#endif
char *Bgethomedir(void);
char *Bgetsupportdir(void);
char *Bgetappdir(void);
uint32_t Bgetsysmemsize(void);
int32_t Bcorrectfilename(char *filename, int32_t removefn);

View file

@ -10,9 +10,9 @@ int32_t osx_msgbox(const char *name, const char *msg);
int32_t osx_ynbox(const char *name, const char *msg);
char *osx_gethomedir(void);
char *osx_getsupportdir(void);
char *osx_getsupportdir(int32_t local);
char *osx_getappdir(void);
char *osx_getapplicationsdir(void);
char *osx_getapplicationsdir(int32_t local);
#ifdef __cplusplus
}

View file

@ -419,15 +419,6 @@ char *Bgethomedir(void)
#endif
}
char *Bgetsupportdir(void)
{
#if defined __APPLE__
return osx_getsupportdir();
#else
return Bgethomedir();
#endif
}
char *Bgetappdir(void)
{
char *dir = NULL;

View file

@ -73,9 +73,9 @@ char *osx_gethomedir(void)
return returnpath;
}
char *osx_getsupportdir(void)
char *osx_getsupportdir(int32_t local)
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, local ? NSUserDomainMask : NSLocalDomainMask, YES);
char *returnpath = NULL;
if ([paths count] > 0)
@ -130,9 +130,9 @@ char *osx_getappdir(void)
return dir;
}
char *osx_getapplicationsdir(void)
char *osx_getapplicationsdir(int32_t local)
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSAllApplicationsDirectory, NSLocalDomainMask, YES);
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSAllApplicationsDirectory, local ? NSUserDomainMask : NSLocalDomainMask, YES);
char *returnpath = NULL;
if ([paths count] > 0)

View file

@ -801,25 +801,35 @@ void G_AddSearchPaths(void)
addsearchpath("/usr/local/share/games/eduke32");
#elif defined(__APPLE__)
char buf[BMAX_PATH];
char *applications = osx_getapplicationsdir();
char *support = Bgetsupportdir();
int32_t i;
char *applications[] = { osx_getapplicationsdir(0), osx_getapplicationsdir(1) };
char *support[] = { osx_getsupportdir(0), osx_getsupportdir(1) };
Bsnprintf(buf, sizeof(buf), "%s/Steam", support);
for (i = 0; i < 2; i++)
{
Bsnprintf(buf, sizeof(buf), "%s/Steam", support[i]);
G_AddSteamPathsApple(buf);
Bsnprintf(buf, sizeof(buf), "%s/Steam/steamapps/libraryfolders.vdf", support);
Bsnprintf(buf, sizeof(buf), "%s/Steam/steamapps/libraryfolders.vdf", support[i]);
G_ParseSteamKeyValuesForPaths(buf);
Bsnprintf(buf, sizeof(buf), "%s/Duke Nukem 3D.app/Contents/Resources/Duke Nukem 3D.boxer/C.harddisk", applications);
Bsnprintf(buf, sizeof(buf), "%s/Duke Nukem 3D.app/Contents/Resources/Duke Nukem 3D.boxer/C.harddisk", applications[i]);
addsearchpath(buf);
}
Bsnprintf(buf, sizeof(buf), "%s/JFDuke3D", support);
for (i = 0; i < 2; i++)
{
Bsnprintf(buf, sizeof(buf), "%s/JFDuke3D", support[i]);
addsearchpath(buf);
Bsnprintf(buf, sizeof(buf), "%s/EDuke32", support);
Bsnprintf(buf, sizeof(buf), "%s/EDuke32", support[i]);
addsearchpath(buf);
}
Bfree(applications);
Bfree(support);
for (i = 0; i < 2; i++)
{
Bfree(applications[i]);
Bfree(support[i]);
}
#elif defined (_WIN32)
char buf[BMAX_PATH];
const char* instpath;