mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
Revert "Allow specifying DATA_DIR by compiler option"
This reverts commit 3c488ff5c7
.
This commit is contained in:
parent
dbc8321c56
commit
a9a71094dd
|
@ -5,6 +5,9 @@
|
||||||
#include <engine/storage.h>
|
#include <engine/storage.h>
|
||||||
#include "linereader.h"
|
#include "linereader.h"
|
||||||
|
|
||||||
|
// compiled-in data-dir path
|
||||||
|
#define DATA_DIR "data"
|
||||||
|
|
||||||
class CStorage : public IStorage
|
class CStorage : public IStorage
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -169,19 +172,13 @@ public:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(DATA_DIR)
|
|
||||||
// 2) use compiled-in data-dir if present
|
// 2) use compiled-in data-dir if present
|
||||||
if(fs_is_dir(DATA_DIR "/mapres"))
|
if(fs_is_dir(DATA_DIR "/mapres"))
|
||||||
{
|
{
|
||||||
str_copy(m_aDatadir, DATA_DIR, sizeof(m_aDatadir));
|
str_copy(m_aDatadir, DATA_DIR, sizeof(m_aDatadir));
|
||||||
#if defined(BINARY_DIR)
|
|
||||||
str_copy(m_aBinarydir, BINARY_DIR, sizeof(m_aBinarydir));
|
|
||||||
#else
|
|
||||||
str_copy(m_aBinarydir, "", sizeof(m_aBinarydir));
|
str_copy(m_aBinarydir, "", sizeof(m_aBinarydir));
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// 3) check for usable path in argv[0]
|
// 3) check for usable path in argv[0]
|
||||||
{
|
{
|
||||||
|
@ -194,13 +191,14 @@ public:
|
||||||
{
|
{
|
||||||
char aBaseDir[MAX_PATH_LENGTH];
|
char aBaseDir[MAX_PATH_LENGTH];
|
||||||
str_copy(aBaseDir, pArgv0, Pos+1);
|
str_copy(aBaseDir, pArgv0, Pos+1);
|
||||||
str_append(aBaseDir, "/data/mapres", sizeof(aBaseDir));
|
|
||||||
if(fs_is_dir(aBaseDir))
|
|
||||||
{
|
|
||||||
str_copy(m_aBinarydir, aBaseDir, sizeof(m_aBinarydir));
|
str_copy(m_aBinarydir, aBaseDir, sizeof(m_aBinarydir));
|
||||||
str_format(m_aDatadir, sizeof(m_aDatadir), "%s/data", aBaseDir);
|
str_format(m_aDatadir, sizeof(m_aDatadir), "%s/data", aBaseDir);
|
||||||
|
str_append(aBaseDir, "/data/mapres", sizeof(aBaseDir));
|
||||||
|
|
||||||
|
if(fs_is_dir(aBaseDir))
|
||||||
return;
|
return;
|
||||||
}
|
else
|
||||||
|
m_aDatadir[0] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue