Revert "Allow specifying DATA_DIR by compiler option"

This reverts commit 3c488ff5c7.
This commit is contained in:
def 2018-04-03 19:18:27 +02:00
parent dbc8321c56
commit a9a71094dd

View file

@ -5,6 +5,9 @@
#include <engine/storage.h>
#include "linereader.h"
// compiled-in data-dir path
#define DATA_DIR "data"
class CStorage : public IStorage
{
public:
@ -169,19 +172,13 @@ public:
return;
}
#if defined(DATA_DIR)
// 2) use compiled-in data-dir if present
if(fs_is_dir(DATA_DIR "/mapres"))
{
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));
#endif
return;
}
#endif
// 3) check for usable path in argv[0]
{
@ -194,13 +191,14 @@ public:
{
char aBaseDir[MAX_PATH_LENGTH];
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_format(m_aDatadir, sizeof(m_aDatadir), "%s/data", aBaseDir);
str_append(aBaseDir, "/data/mapres", sizeof(aBaseDir));
if(fs_is_dir(aBaseDir))
return;
}
else
m_aDatadir[0] = 0;
}
}