Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/freestyle/intern/application/AppConfig.cpp')
-rw-r--r--source/blender/freestyle/intern/application/AppConfig.cpp73
1 files changed, 37 insertions, 36 deletions
diff --git a/source/blender/freestyle/intern/application/AppConfig.cpp b/source/blender/freestyle/intern/application/AppConfig.cpp
index 20d8c68ef0e..3e3a939a8fe 100644
--- a/source/blender/freestyle/intern/application/AppConfig.cpp
+++ b/source/blender/freestyle/intern/application/AppConfig.cpp
@@ -37,61 +37,62 @@ namespace Config {
Path *Path::_pInstance = 0;
Path::Path()
{
- // get the root directory
- // soc
- setRootDir(BKE_appdir_folder_id(BLENDER_SYSTEM_SCRIPTS, NULL));
+ // get the root directory
+ // soc
+ setRootDir(BKE_appdir_folder_id(BLENDER_SYSTEM_SCRIPTS, NULL));
- _pInstance = this;
+ _pInstance = this;
}
-void Path::setRootDir(const string& iRootDir)
+void Path::setRootDir(const string &iRootDir)
{
- _ProjectDir = iRootDir + string(DIR_SEP.c_str()) + "freestyle";
- _ModelsPath = "";
- _PatternsPath = _ProjectDir + string(DIR_SEP.c_str()) + "data" + string(DIR_SEP.c_str()) + "textures" +
- string(DIR_SEP.c_str()) + "variation_patterns" + string(DIR_SEP.c_str());
- _BrushesPath = _ProjectDir + string(DIR_SEP.c_str()) + "data" + string(DIR_SEP.c_str()) + "textures" +
- string(DIR_SEP.c_str()) + "brushes" + string(DIR_SEP.c_str());
- _PythonPath = _ProjectDir + string(DIR_SEP.c_str()) + "modules" + string(DIR_SEP.c_str());
- if (getenv("PYTHONPATH")) {
- _PythonPath += string(PATH_SEP.c_str()) + string(getenv("PYTHONPATH"));
- }
- _EnvMapDir = _ProjectDir + string(DIR_SEP.c_str()) + "data" + string(DIR_SEP.c_str()) + "env_map" +
- string(DIR_SEP.c_str());
- _MapsDir = _ProjectDir + string(DIR_SEP.c_str()) + "data" + string(DIR_SEP.c_str()) + "maps" +
- string(DIR_SEP.c_str());
+ _ProjectDir = iRootDir + string(DIR_SEP.c_str()) + "freestyle";
+ _ModelsPath = "";
+ _PatternsPath = _ProjectDir + string(DIR_SEP.c_str()) + "data" + string(DIR_SEP.c_str()) +
+ "textures" + string(DIR_SEP.c_str()) + "variation_patterns" +
+ string(DIR_SEP.c_str());
+ _BrushesPath = _ProjectDir + string(DIR_SEP.c_str()) + "data" + string(DIR_SEP.c_str()) +
+ "textures" + string(DIR_SEP.c_str()) + "brushes" + string(DIR_SEP.c_str());
+ _PythonPath = _ProjectDir + string(DIR_SEP.c_str()) + "modules" + string(DIR_SEP.c_str());
+ if (getenv("PYTHONPATH")) {
+ _PythonPath += string(PATH_SEP.c_str()) + string(getenv("PYTHONPATH"));
+ }
+ _EnvMapDir = _ProjectDir + string(DIR_SEP.c_str()) + "data" + string(DIR_SEP.c_str()) +
+ "env_map" + string(DIR_SEP.c_str());
+ _MapsDir = _ProjectDir + string(DIR_SEP.c_str()) + "data" + string(DIR_SEP.c_str()) + "maps" +
+ string(DIR_SEP.c_str());
}
-void Path::setHomeDir(const string& iHomeDir)
+void Path::setHomeDir(const string &iHomeDir)
{
- _HomeDir = iHomeDir;
+ _HomeDir = iHomeDir;
}
Path::~Path()
{
- _pInstance = 0;
+ _pInstance = 0;
}
Path *Path::getInstance()
{
- return _pInstance;
+ return _pInstance;
}
-string Path::getEnvVar(const string& iEnvVarName)
+string Path::getEnvVar(const string &iEnvVarName)
{
- string value;
- if (!getenv(iEnvVarName.c_str())) {
- cerr << "Warning: You may want to set the $" << iEnvVarName <<
- " environment variable to use Freestyle." << endl <<
- " Otherwise, the current directory will be used instead." << endl;
- value = ".";
- }
- else {
- value = getenv(iEnvVarName.c_str());
- }
- return value;
+ string value;
+ if (!getenv(iEnvVarName.c_str())) {
+ cerr << "Warning: You may want to set the $" << iEnvVarName
+ << " environment variable to use Freestyle." << endl
+ << " Otherwise, the current directory will be used instead." << endl;
+ value = ".";
+ }
+ else {
+ value = getenv(iEnvVarName.c_str());
+ }
+ return value;
}
-} // End of namepace Config
+} // namespace Config
} /* namespace Freestyle */