Fixed: #1074 sheets_packer using default static relative paths
This commit is contained in:
parent
cfe8f1870f
commit
b80b9c4c58
9 changed files with 38 additions and 58 deletions
|
@ -697,26 +697,28 @@ void CContinentManager::reloadSky()
|
|||
// ***************************************************************************
|
||||
void CContinentManager::loadContinentLandMarks()
|
||||
{
|
||||
std::string dataPath = "../../client/data";
|
||||
|
||||
if (ClientCfg.UpdatePackedSheet == false)
|
||||
{
|
||||
readLMConts();
|
||||
readLMConts(dataPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
buildLMConts();
|
||||
readLMConts();
|
||||
buildLMConts("ryzom.world", "../../common/data_leveldesign/primitives", dataPath);
|
||||
readLMConts(dataPath);
|
||||
}
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
void CContinentManager::readLMConts()
|
||||
void CContinentManager::readLMConts(const std::string &dataPath)
|
||||
{
|
||||
CIFile f;
|
||||
|
||||
string sPackedFileName = CPath::lookup(LM_PACKED_FILE, false);
|
||||
if (sPackedFileName.empty())
|
||||
sPackedFileName = LM_PACKED_FILE_SAVE;
|
||||
sPackedFileName = CPath::standardizePath(dataPath) + LM_PACKED_FILE;
|
||||
|
||||
if (f.open(sPackedFileName))
|
||||
{
|
||||
|
|
|
@ -127,7 +127,7 @@ public:
|
|||
protected:
|
||||
|
||||
void loadContinentLandMarks();
|
||||
void readLMConts();
|
||||
void readLMConts(const std::string &dataPath);
|
||||
|
||||
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;
|
||||
|
||||
|
@ -75,7 +75,7 @@ bool buildLMConts()
|
|||
|
||||
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)
|
||||
{
|
||||
|
@ -100,7 +100,7 @@ bool buildLMConts()
|
|||
vector<string> vRegionFiles;
|
||||
{
|
||||
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)
|
||||
{
|
||||
string filename = CFile::getFilename(vTmp[i]);
|
||||
|
@ -115,7 +115,7 @@ bool buildLMConts()
|
|||
string sPackedFileName = CPath::lookup(LM_PACKED_FILE, false);
|
||||
if (sPackedFileName.empty())
|
||||
{
|
||||
sPackedFileName = LM_PACKED_FILE_SAVE;
|
||||
sPackedFileName = NLMISC::CPath::standardizePath(dataPath) + LM_PACKED_FILE;
|
||||
bRebuild = true;
|
||||
}
|
||||
else
|
||||
|
@ -253,7 +253,7 @@ bool buildLMConts()
|
|||
}
|
||||
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_SAVE "../../client/data/" LM_PACKED_FILE
|
||||
#define WORLD_MAP_FILE "global_world_map.primitive"
|
||||
|
||||
#endif // CL_CONTINENT_MANAGER_BUILD_H
|
||||
|
|
|
@ -4,4 +4,7 @@
|
|||
/////////////////////////////////
|
||||
/////////////////////////////////
|
||||
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";
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
Optimization="4"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\client\src;..\..\common\src"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;LIBXML_STATIC"
|
||||
BasicRuntimeChecks="3"
|
||||
SmallerTypeCheck="true"
|
||||
RuntimeLibrary="3"
|
||||
|
@ -140,7 +140,7 @@
|
|||
Optimization="4"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\client\src;..\..\common\src"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;LIBXML_STATIC"
|
||||
BasicRuntimeChecks="3"
|
||||
SmallerTypeCheck="true"
|
||||
RuntimeLibrary="3"
|
||||
|
@ -148,6 +148,7 @@
|
|||
PrecompiledHeaderThrough="stdpch.h"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
OmitDefaultLibName="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
|
@ -167,7 +168,6 @@
|
|||
AdditionalLibraryDirectories="../../nel/lib64"
|
||||
IgnoreDefaultLibraryNames="msvcrt.lib"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)\$(TargetName).pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
|
@ -232,7 +232,7 @@
|
|||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
AdditionalIncludeDirectories="..\..\client\src;..\..\common\src"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;LIBXML_STATIC"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="2"
|
||||
BufferSecurityCheck="false"
|
||||
|
@ -325,7 +325,7 @@
|
|||
OmitFramePointers="true"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
AdditionalIncludeDirectories="..\..\client\src;..\..\common\src"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;LIBXML_STATIC"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="2"
|
||||
BufferSecurityCheck="false"
|
||||
|
|
|
@ -147,12 +147,6 @@ const std::string ConfigFileName = "sheets_packer.cfg";
|
|||
//---------------------------------------------------
|
||||
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 //
|
||||
|
||||
|
||||
|
@ -178,13 +172,14 @@ void setValues()
|
|||
}
|
||||
catch(EUnknownVar &) {nlwarning("Default value used for 'DataPath' !!!");}
|
||||
|
||||
// UpdatePackedSheet
|
||||
READ_BOOL(UpdatePackedSheet)
|
||||
|
||||
// SceneName
|
||||
READ_STRING(SceneName)
|
||||
// IdFile Path
|
||||
READ_STRING(IdFilePath)
|
||||
// World sheet name
|
||||
READ_STRING(WorldSheet)
|
||||
// Primitives path
|
||||
READ_STRING(PrimitivesPath)
|
||||
// Output data path
|
||||
READ_STRING(OutputDataPath)
|
||||
// Ligo primitive class
|
||||
READ_STRING(LigoPrimitiveClass)
|
||||
|
||||
/////////////
|
||||
// FILTERS //
|
||||
|
@ -216,13 +211,6 @@ void setValues()
|
|||
}
|
||||
}
|
||||
catch(EUnknownVar &) {}
|
||||
|
||||
READ_STRING(LigoPrimitiveClass)
|
||||
|
||||
// LanguageCode
|
||||
READ_STRING(LanguageCode)
|
||||
|
||||
READ_BOOL(FPExceptions)
|
||||
}// load //
|
||||
|
||||
|
||||
|
@ -261,10 +249,4 @@ void CClientConfig::init(const std::string &configFileName)
|
|||
//-----------------------------------------------
|
||||
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);
|
||||
|
||||
/// Save the cfg file when exit the client ?
|
||||
bool SaveConfig;
|
||||
|
||||
/// Data Path.
|
||||
std::vector<std::string> DataPath;
|
||||
/// True if we want the packed sheet to be updated if needed
|
||||
bool UpdatePackedSheet;
|
||||
/// Name of the scene to play.
|
||||
std::string SceneName;
|
||||
/// Path for the Id file.
|
||||
std::string IdFilePath;
|
||||
// Enable/disable Floating Point Exceptions
|
||||
bool FPExceptions;
|
||||
|
||||
/// World sheet name
|
||||
std::string WorldSheet;
|
||||
/// Path where to find .primitive files
|
||||
std::string PrimitivesPath;
|
||||
/// Path where to create lmconts.packed
|
||||
std::string OutputDataPath;
|
||||
|
||||
|
||||
std::string LigoPrimitiveClass;
|
||||
// TODO
|
||||
std::string LanguageCode;
|
||||
|
||||
public:
|
||||
/// Constructor.
|
||||
|
|
|
@ -98,7 +98,7 @@ bool init()
|
|||
if (!LigoConfig.readPrimitiveClass (AppCfg.LigoPrimitiveClass.c_str(), false))
|
||||
nlwarning ("Can't load primitive class file %s", AppCfg.LigoPrimitiveClass.c_str());
|
||||
NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &LigoConfig;
|
||||
buildLMConts();
|
||||
buildLMConts(AppCfg.WorldSheet, AppCfg.PrimitivesPath, AppCfg.OutputDataPath);
|
||||
|
||||
// The init is a success.
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue