Fixed: #1074 sheets_packer using default static relative paths

hg/feature/sound
kervala 14 years ago
parent cfe8f1870f
commit b80b9c4c58

@ -697,26 +697,28 @@ void CContinentManager::reloadSky()
// *************************************************************************** // ***************************************************************************
void CContinentManager::loadContinentLandMarks() void CContinentManager::loadContinentLandMarks()
{ {
std::string dataPath = "../../client/data";
if (ClientCfg.UpdatePackedSheet == false) if (ClientCfg.UpdatePackedSheet == false)
{ {
readLMConts(); readLMConts(dataPath);
} }
else else
{ {
buildLMConts(); buildLMConts("ryzom.world", "../../common/data_leveldesign/primitives", dataPath);
readLMConts(); readLMConts(dataPath);
} }
} }
// *************************************************************************** // ***************************************************************************
void CContinentManager::readLMConts() void CContinentManager::readLMConts(const std::string &dataPath)
{ {
CIFile f; CIFile f;
string sPackedFileName = CPath::lookup(LM_PACKED_FILE, false); string sPackedFileName = CPath::lookup(LM_PACKED_FILE, false);
if (sPackedFileName.empty()) if (sPackedFileName.empty())
sPackedFileName = LM_PACKED_FILE_SAVE; sPackedFileName = CPath::standardizePath(dataPath) + LM_PACKED_FILE;
if (f.open(sPackedFileName)) if (f.open(sPackedFileName))
{ {

@ -127,7 +127,7 @@ public:
protected: protected:
void loadContinentLandMarks(); void loadContinentLandMarks();
void readLMConts(); void readLMConts(const std::string &dataPath);
protected: protected:

@ -67,7 +67,7 @@ void primitiveToLM(CContLandMark &lm, IPrimitive *p)
} }
// *************************************************************************** // ***************************************************************************
bool buildLMConts() bool buildLMConts(const std::string &worldSheet, const std::string &primitivesPath, const std::string &dataPath)
{ {
bool bRebuild = false; bool bRebuild = false;
@ -75,7 +75,7 @@ bool buildLMConts()
map<string, sTmpContinent*> AllContinents; // Map with all continents. map<string, sTmpContinent*> AllContinents; // Map with all continents.
{ {
CEntitySheet *sheet = SheetMngr.get(CSheetId("ryzom.world")); CEntitySheet *sheet = SheetMngr.get(CSheetId(worldSheet));
if (!sheet || sheet->type() != CEntitySheet::WORLD) if (!sheet || sheet->type() != CEntitySheet::WORLD)
{ {
@ -100,7 +100,7 @@ bool buildLMConts()
vector<string> vRegionFiles; vector<string> vRegionFiles;
{ {
vector<string> vTmp; vector<string> vTmp;
CPath::getPathContent("../../common/data_leveldesign/primitives", true, false, true, vTmp); CPath::getPathContent(primitivesPath, true, false, true, vTmp);
for (uint32 i = 0; i < vTmp.size(); ++i) for (uint32 i = 0; i < vTmp.size(); ++i)
{ {
string filename = CFile::getFilename(vTmp[i]); string filename = CFile::getFilename(vTmp[i]);
@ -115,7 +115,7 @@ bool buildLMConts()
string sPackedFileName = CPath::lookup(LM_PACKED_FILE, false); string sPackedFileName = CPath::lookup(LM_PACKED_FILE, false);
if (sPackedFileName.empty()) if (sPackedFileName.empty())
{ {
sPackedFileName = LM_PACKED_FILE_SAVE; sPackedFileName = NLMISC::CPath::standardizePath(dataPath) + LM_PACKED_FILE;
bRebuild = true; bRebuild = true;
} }
else else
@ -253,7 +253,7 @@ bool buildLMConts()
} }
else else
{ {
nlwarning("cannot find continent %s in ryzom.world", contName.c_str()); nlwarning("cannot find continent %s in %s", contName.c_str(), worldSheet.c_str());
} }
} }
} }

@ -83,10 +83,9 @@ public:
} }
}; };
extern bool buildLMConts(); extern bool buildLMConts(const std::string &worldSheet, const std::string &primitivesPath, const std::string &dataPath);
#define LM_PACKED_FILE "lmconts.packed" #define LM_PACKED_FILE "lmconts.packed"
#define LM_PACKED_FILE_SAVE "../../client/data/" LM_PACKED_FILE
#define WORLD_MAP_FILE "global_world_map.primitive" #define WORLD_MAP_FILE "global_world_map.primitive"
#endif // CL_CONTINENT_MANAGER_BUILD_H #endif // CL_CONTINENT_MANAGER_BUILD_H

@ -4,4 +4,7 @@
///////////////////////////////// /////////////////////////////////
///////////////////////////////// /////////////////////////////////
DataPath = { "../../common/data_leveldesign", "../../common/data_common", "../../client/data" }; DataPath = { "../../common/data_leveldesign", "../../common/data_common", "../../client/data" };
WorldSheet = "ryzom.world";
PrimitivesPath = "../../common/data_leveldesign/primitives";
OutputDataPath = "../../client/data";
LigoPrimitiveClass = "world_editor_classes.xml"; LigoPrimitiveClass = "world_editor_classes.xml";

@ -52,7 +52,7 @@
Optimization="4" Optimization="4"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\client\src;..\..\common\src" AdditionalIncludeDirectories="..\..\client\src;..\..\common\src"
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE" PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;LIBXML_STATIC"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
SmallerTypeCheck="true" SmallerTypeCheck="true"
RuntimeLibrary="3" RuntimeLibrary="3"
@ -140,7 +140,7 @@
Optimization="4" Optimization="4"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\client\src;..\..\common\src" AdditionalIncludeDirectories="..\..\client\src;..\..\common\src"
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE" PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;LIBXML_STATIC"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
SmallerTypeCheck="true" SmallerTypeCheck="true"
RuntimeLibrary="3" RuntimeLibrary="3"
@ -148,6 +148,7 @@
PrecompiledHeaderThrough="stdpch.h" PrecompiledHeaderThrough="stdpch.h"
WarningLevel="3" WarningLevel="3"
DebugInformationFormat="3" DebugInformationFormat="3"
OmitDefaultLibName="true"
/> />
<Tool <Tool
Name="VCManagedResourceCompilerTool" Name="VCManagedResourceCompilerTool"
@ -167,7 +168,6 @@
AdditionalLibraryDirectories="../../nel/lib64" AdditionalLibraryDirectories="../../nel/lib64"
IgnoreDefaultLibraryNames="msvcrt.lib" IgnoreDefaultLibraryNames="msvcrt.lib"
GenerateDebugInformation="true" GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)\$(TargetName).pdb"
SubSystem="1" SubSystem="1"
TargetMachine="17" TargetMachine="17"
/> />
@ -232,7 +232,7 @@
OmitFramePointers="true" OmitFramePointers="true"
EnableFiberSafeOptimizations="true" EnableFiberSafeOptimizations="true"
AdditionalIncludeDirectories="..\..\client\src;..\..\common\src" AdditionalIncludeDirectories="..\..\client\src;..\..\common\src"
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE" PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;LIBXML_STATIC"
StringPooling="true" StringPooling="true"
RuntimeLibrary="2" RuntimeLibrary="2"
BufferSecurityCheck="false" BufferSecurityCheck="false"
@ -325,7 +325,7 @@
OmitFramePointers="true" OmitFramePointers="true"
EnableFiberSafeOptimizations="true" EnableFiberSafeOptimizations="true"
AdditionalIncludeDirectories="..\..\client\src;..\..\common\src" AdditionalIncludeDirectories="..\..\client\src;..\..\common\src"
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE" PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;LIBXML_STATIC"
StringPooling="true" StringPooling="true"
RuntimeLibrary="2" RuntimeLibrary="2"
BufferSecurityCheck="false" BufferSecurityCheck="false"

@ -147,12 +147,6 @@ const std::string ConfigFileName = "sheets_packer.cfg";
//--------------------------------------------------- //---------------------------------------------------
CClientConfig::CClientConfig() CClientConfig::CClientConfig()
{ {
SaveConfig = false;
UpdatePackedSheet = true; // Update packed sheet if needed
SceneName = "";
IdFilePath = "";
LanguageCode = "en"; // Default to english
FPExceptions = false; // Disable Floating Point Exceptions.
}// CClientConfig // }// CClientConfig //
@ -178,13 +172,14 @@ void setValues()
} }
catch(EUnknownVar &) {nlwarning("Default value used for 'DataPath' !!!");} catch(EUnknownVar &) {nlwarning("Default value used for 'DataPath' !!!");}
// UpdatePackedSheet // World sheet name
READ_BOOL(UpdatePackedSheet) READ_STRING(WorldSheet)
// Primitives path
// SceneName READ_STRING(PrimitivesPath)
READ_STRING(SceneName) // Output data path
// IdFile Path READ_STRING(OutputDataPath)
READ_STRING(IdFilePath) // Ligo primitive class
READ_STRING(LigoPrimitiveClass)
///////////// /////////////
// FILTERS // // FILTERS //
@ -216,13 +211,6 @@ void setValues()
} }
} }
catch(EUnknownVar &) {} catch(EUnknownVar &) {}
READ_STRING(LigoPrimitiveClass)
// LanguageCode
READ_STRING(LanguageCode)
READ_BOOL(FPExceptions)
}// load // }// load //
@ -261,10 +249,4 @@ void CClientConfig::init(const std::string &configFileName)
//----------------------------------------------- //-----------------------------------------------
void CClientConfig::release () void CClientConfig::release ()
{ {
// Do we have to save the cfg file ?
if (AppCfg.SaveConfig)
{
// Save it
AppCfg.ConfigFile.save ();
}
} }

@ -41,24 +41,18 @@ struct CClientConfig
void init (const std::string &configFileName); void init (const std::string &configFileName);
/// Save the cfg file when exit the client ?
bool SaveConfig;
/// Data Path. /// Data Path.
std::vector<std::string> DataPath; std::vector<std::string> DataPath;
/// True if we want the packed sheet to be updated if needed
bool UpdatePackedSheet; /// World sheet name
/// Name of the scene to play. std::string WorldSheet;
std::string SceneName; /// Path where to find .primitive files
/// Path for the Id file. std::string PrimitivesPath;
std::string IdFilePath; /// Path where to create lmconts.packed
// Enable/disable Floating Point Exceptions std::string OutputDataPath;
bool FPExceptions;
std::string LigoPrimitiveClass; std::string LigoPrimitiveClass;
// TODO
std::string LanguageCode;
public: public:
/// Constructor. /// Constructor.

@ -98,7 +98,7 @@ bool init()
if (!LigoConfig.readPrimitiveClass (AppCfg.LigoPrimitiveClass.c_str(), false)) if (!LigoConfig.readPrimitiveClass (AppCfg.LigoPrimitiveClass.c_str(), false))
nlwarning ("Can't load primitive class file %s", AppCfg.LigoPrimitiveClass.c_str()); nlwarning ("Can't load primitive class file %s", AppCfg.LigoPrimitiveClass.c_str());
NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &LigoConfig; NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &LigoConfig;
buildLMConts(); buildLMConts(AppCfg.WorldSheet, AppCfg.PrimitivesPath, AppCfg.OutputDataPath);
// The init is a success. // The init is a success.
return true; return true;

Loading…
Cancel
Save