mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-27 01:26:30 +00:00
Changed: Centralize config.h to avoid recompiling too many files in config.h each time config.h is modified
This commit is contained in:
parent
eff90c8ada
commit
e68d348f66
5 changed files with 38 additions and 28 deletions
|
@ -33,6 +33,7 @@
|
|||
#include "view.h" // For the cameraDistance funtion
|
||||
#include "user_entity.h"
|
||||
#include "misc.h"
|
||||
#include "user_agent.h"
|
||||
|
||||
// 3D Interface.
|
||||
#include "nel/3d/u_driver.h"
|
||||
|
@ -40,10 +41,6 @@
|
|||
// Game Share.
|
||||
#include "game_share/time_weather_season/time_and_season.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif // HAVE_CONFIG_H
|
||||
|
||||
#ifdef NL_OS_MAC
|
||||
#include "app_bundle_utils.h"
|
||||
#endif // NL_OS_MAC
|
||||
|
@ -1994,10 +1991,10 @@ void CClientConfig::init(const string &configFileName)
|
|||
if (varPtr)
|
||||
{
|
||||
string str = varPtr->asString ();
|
||||
if (str != RYZOM_VERSION && ClientCfg.SaveConfig)
|
||||
if (str != getVersion() && ClientCfg.SaveConfig)
|
||||
{
|
||||
nlinfo ("Update and save the ClientVersion variable in config file %s -> %s", str.c_str(), RYZOM_VERSION);
|
||||
varPtr->setAsString (RYZOM_VERSION);
|
||||
nlinfo ("Update and save the ClientVersion variable in config file %s -> %s", str.c_str(), getVersion().c_str());
|
||||
varPtr->setAsString (getVersion());
|
||||
ClientCfg.ConfigFile.save ();
|
||||
}
|
||||
}
|
||||
|
@ -2211,12 +2208,12 @@ bool CClientConfig::getDefaultConfigLocation(std::string& p_name) const
|
|||
#ifdef NL_OS_MAC
|
||||
// on mac, client_default.cfg should be searched in .app/Contents/Resources/
|
||||
defaultConfigPath = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources/");
|
||||
#elif defined(RYZOM_ETC_PREFIX)
|
||||
#elif defined(NL_OS_UNIX)
|
||||
// if RYZOM_ETC_PREFIX is defined, client_default.cfg might be over there
|
||||
defaultConfigPath = CPath::standardizePath(RYZOM_ETC_PREFIX);
|
||||
if (!getRyzomEtcPrefix().empty()) defaultConfigPath = CPath::standardizePath(getRyzomEtcPrefix());
|
||||
#else
|
||||
// some other prefix here :)
|
||||
#endif // RYZOM_ETC_PREFIX
|
||||
#endif // NL_OS_UNIX
|
||||
|
||||
// look in the current working directory first
|
||||
if (CFile::isExists(defaultConfigFileName))
|
||||
|
|
|
@ -99,10 +99,7 @@
|
|||
#include "far_tp.h"
|
||||
#include "zone_util.h"
|
||||
#include "nel/gui/lua_manager.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
#include "user_agent.h"
|
||||
|
||||
|
||||
//
|
||||
|
@ -690,10 +687,10 @@ NLMISC_COMMAND(bugReport, "Call the bug report tool with dump", "<AddScreenshot>
|
|||
sys += "AttachedFile "+filename+" ";
|
||||
}
|
||||
|
||||
sys += "ClientVersion "RYZOM_VERSION" ";
|
||||
sys += NLMISC::toString("ClientVersion %s ", getVersion().c_str());
|
||||
|
||||
// for now, set the same version than client one
|
||||
sys += "ShardVersion "RYZOM_VERSION" ";
|
||||
sys += NLMISC::toString("ShardVersion %s ", getVersion().c_str());
|
||||
|
||||
if (ClientCfg.Local)
|
||||
sys += "ShardName OFFLINE ";
|
||||
|
|
|
@ -95,14 +95,6 @@
|
|||
|
||||
#include "browse_faq.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifndef RYZOM_CLIENT_ICON
|
||||
#define RYZOM_CLIENT_ICON "ryzom_client"
|
||||
#endif
|
||||
|
||||
// XMLLib
|
||||
#include <libxml/xmlmemory.h>
|
||||
|
||||
|
@ -682,8 +674,8 @@ void addSearchPaths(IProgressCallback &progress)
|
|||
|
||||
#ifdef NL_OS_MAC
|
||||
defaultDirectory = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources");
|
||||
#elif defined(NL_OS_UNIX) && defined(RYZOM_SHARE_PREFIX)
|
||||
defaultDirectory = CPath::standardizePath(std::string(RYZOM_SHARE_PREFIX));
|
||||
#elif defined(NL_OS_UNIX)
|
||||
if (!getRyzomSharePrefix().empty()) defaultDirectory = CPath::standardizePath(getRyzomSharePrefix());
|
||||
#endif
|
||||
|
||||
// add in last position, a specific possibly read only directory
|
||||
|
@ -727,8 +719,9 @@ void addPreDataPaths(NLMISC::IProgressCallback &progress)
|
|||
|
||||
#ifdef NL_OS_MAC
|
||||
defaultDirectory = CPath::standardizePath(getAppBundlePath() + "/Contents/Resources");
|
||||
#elif defined(NL_OS_UNIX) && defined(RYZOM_SHARE_PREFIX)
|
||||
#elif defined(NL_OS_UNIX)
|
||||
defaultDirectory = CPath::standardizePath(std::string(RYZOM_SHARE_PREFIX));
|
||||
if (!getRyzomSharePrefix().empty()) defaultDirectory = CPath::standardizePath(getRyzomSharePrefix());
|
||||
#endif
|
||||
|
||||
// add in last position, a specific possibly read only directory
|
||||
|
@ -767,7 +760,7 @@ static bool addRyzomIconBitmap(const std::string &directory, vector<CBitmap> &bi
|
|||
if (CFile::isDirectory(directory))
|
||||
{
|
||||
// build filename from directory and default ryzom client icon name
|
||||
std::string filename = NLMISC::toString("%s/%s.png", directory.c_str(), RYZOM_CLIENT_ICON);
|
||||
std::string filename = NLMISC::toString("%s/%s.png", directory.c_str(), getRyzomClientIcon().c_str());
|
||||
|
||||
if (CFile::fileExists(filename))
|
||||
{
|
||||
|
|
|
@ -43,6 +43,10 @@
|
|||
#define RYZOM_SYSTEM "unknown"
|
||||
#endif
|
||||
|
||||
#ifndef RYZOM_CLIENT_ICON
|
||||
#define RYZOM_CLIENT_ICON "ryzom_client"
|
||||
#endif
|
||||
|
||||
std::string getUserAgent()
|
||||
{
|
||||
return getUserAgentName() + "/" + getUserAgentVersion();
|
||||
|
@ -114,3 +118,18 @@ bool isStereoAvailable()
|
|||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string getRyzomClientIcon()
|
||||
{
|
||||
return RYZOM_CLIENT_ICON;
|
||||
}
|
||||
|
||||
std::string getRyzomEtcPrefix()
|
||||
{
|
||||
return RYZOM_ETC_PREFIX;
|
||||
}
|
||||
|
||||
std::string getRyzomSharePrefix()
|
||||
{
|
||||
return RYZOM_SHARE_PREFIX;
|
||||
}
|
||||
|
|
|
@ -27,6 +27,10 @@ std::string getDebugVersion();
|
|||
|
||||
bool isStereoAvailable();
|
||||
|
||||
std::string getRyzomClientIcon();
|
||||
std::string getRyzomEtcPrefix();
|
||||
std::string getRyzomSharePrefix();
|
||||
|
||||
#endif // CL_USER_AGENT_H
|
||||
|
||||
/* End of user_agent.h */
|
||||
|
|
Loading…
Reference in a new issue