Merged in shubham_meena/ryzomcore (pull request #70)

Adding comments with more description and removed doxygen errors
This commit is contained in:
Matthew Lagoe 2014-08-18 00:55:01 -07:00
commit 78894a03b5
26 changed files with 106 additions and 7 deletions

View file

@ -232,6 +232,9 @@ private:
// If not NULL, binary mode detected, use this stream in serials
IStream *_BinaryStream;
// System dependant structure for locale
void* _Locale;
};

View file

@ -408,6 +408,12 @@ void CInstanceLighter::light (const CInstanceGroup &igIn, CInstanceGroup &igOut,
string name= _Instances[i].Name;
bool shapeFound= true;
if (toLower (CFile::getExtension (name)) == "pacs_prim")
{
nlwarning("EXPORT BUG: Can't read %s (not a shape), should not be part of .ig!", name.c_str());
continue;
}
// Try to find the shape in the UseShapeMap.
std::map<string, IShape*>::const_iterator iteMap= lightDesc.UserShapeMap.find (name);

View file

@ -24,6 +24,11 @@
// Include from libxml2
#include <libxml/xmlerror.h>
#if defined(NL_OS_WINDOWS) && defined(NL_COMP_VC_VERSION) && NL_COMP_VC_VERSION >= 80
#define USE_LOCALE_ATOF
#include <locale.h>
#endif
using namespace std;
#define NLMISC_READ_BUFFER_SIZE 1024
@ -46,6 +51,22 @@ const char SEPARATOR = ' ';
serialSeparatedBufferIn( number_as_string ); \
dest = (thetype)convfunc( number_as_string.c_str() );
#ifdef USE_LOCALE_ATOF
#define readnumberlocale(dest,thetype,digits,convfunc) \
string number_as_string; \
serialSeparatedBufferIn( number_as_string ); \
dest = (thetype)convfunc( number_as_string.c_str(), (_locale_t)_Locale );
#define nl_atof _atof_l
#else
#define readnumberlocale(dest,thetype,digits,convfunc) readnumber(dest,thetype,digits,convfunc)
#define nl_atof atof
#endif
// ***************************************************************************
inline void CIXml::flushContentString ()
@ -70,6 +91,13 @@ CIXml::CIXml () : IStream (true /* Input mode */)
_ErrorString = "";
_TryBinaryMode = false;
_BinaryStream = NULL;
#ifdef USE_LOCALE_ATOF
// create C numeric locale
_Locale = _create_locale(LC_NUMERIC, "C");
#else
_Locale = NULL;
#endif
}
// ***************************************************************************
@ -85,6 +113,13 @@ CIXml::CIXml (bool tryBinaryMode) : IStream (true /* Input mode */)
_ErrorString = "";
_TryBinaryMode = tryBinaryMode;
_BinaryStream = NULL;
#ifdef USE_LOCALE_ATOF
// create C numeric locale
_Locale = _create_locale(LC_NUMERIC, "C");
#else
_Locale = NULL;
#endif
}
// ***************************************************************************
@ -93,6 +128,10 @@ CIXml::~CIXml ()
{
// Release
release ();
#ifdef USE_LOCALE_ATOF
if (_Locale) _free_locale((_locale_t)_Locale);
#endif
}
// ***************************************************************************
@ -546,7 +585,7 @@ void CIXml::serial(float &b)
}
else
{
readnumber( b, float, 128, atof );
readnumberlocale( b, float, 128, nl_atof );
}
}
@ -560,7 +599,7 @@ void CIXml::serial(double &b)
}
else
{
readnumber( b, double, 128, atof );
readnumberlocale( b, double, 128, nl_atof );
}
}

View file

@ -167,6 +167,12 @@ void CIgLighterLib::lightIg(CInstanceLighter &instanceLighter,
string name= igIn.getShapeName(i);
bool shapeFound= true;
if (toLower (CFile::getExtension (name)) == "pacs_prim")
{
nlwarning("EXPORT BUG: Can't read %s (not a shape), should not be part of .ig!", name.c_str());
continue;
}
// Try to find the shape in the UseShapeMap.
std::map<string, IShape*>::const_iterator iteMap= lightDesc.UserShapeMap.find (name);

View file

@ -410,6 +410,12 @@ int main(int argc, char* argv[])
if(group->getInstance(instance).DontCastShadow || group->getInstance(instance).DontCastShadowForExterior)
continue;
if (toLower (CFile::getExtension (name)) == "pacs_prim")
{
nlwarning("EXPORT BUG: Can't read %s (not a shape), should not be part of .ig!", name.c_str());
continue;
}
// Add a .shape at the end ?
if (!name.empty())
{

View file

@ -202,7 +202,7 @@ static void loadIGFromContinent(NLMISC::CConfigFile &parameter, std::list<CInsta
// Load the form
NLGEORGES::UFormLoader *loader = NLGEORGES::UFormLoader::createLoader();
//
std::string pathName = level_design_world_directory.asString() + "/" + continentName;
std::string pathName = CPath::lookup(continentName); // level_design_world_directory.asString() + "/" + continentName;
if (pathName.empty())
{
nlwarning("Can't find continent form : %s", continentName.c_str());
@ -699,6 +699,12 @@ int main(int argc, char* argv[])
if(group->getInstance(instance).DontCastShadow || group->getInstance(instance).DontCastShadowForExterior)
continue;
if (toLower (CFile::getExtension (name)) == "pacs_prim")
{
nlwarning("EXPORT BUG: Can't read %s (not a shape), should not be part of .ig!", name.c_str());
continue;
}
// PS ?
if (toLower (CFile::getExtension (name)) == "ps")
continue;

View file

@ -0,0 +1,9 @@
title Ryzom Core: 3_install.py
3_install.py
title Ryzom Core: a1_worldedit_data.py
a1_worldedit_data.py
title Ryzom Core: b1_client_dev.py
b1_client_dev.py
title Ryzom Core: b2_shard_data.py
b2_shard_data.py
title Ryzom Core: Ready

View file

@ -56,6 +56,7 @@ fn runNelMaxExport inputMaxFile =
-- unselect
max select none
clearSelection()
-- Exported object count
exported = 0

View file

@ -36,6 +36,7 @@ fn runNelMaxExport inputMaxFile =
-- Select all collision mesh
max select none
clearSelection()
for m in geometry do
(
if (isToBeExported m) == true then

View file

@ -61,6 +61,7 @@ fn runNelMaxExport inputMaxFile =
-- unselect
max select none
clearSelection()
-- Exported object count
exported = 0
@ -109,6 +110,7 @@ fn runNelMaxExport inputMaxFile =
(
-- Select none
max select none
clearSelection()
-- Select all node in this ig
for node in geometry do

View file

@ -10,6 +10,7 @@ fn runNelMaxExport inputMaxFile =
-- Select none
max select none
clearSelection()
-- Select all PACS primitives
for i in geometry do

View file

@ -199,6 +199,7 @@ fn runNelMaxExportSub inputMaxFile retryCount =
-- unselect
max select none
clearSelection()
-- Exported object count
exported = 0

View file

@ -46,6 +46,7 @@ fn runNelMaxExport inputMaxFile =
-- unselect
max select none
clearSelection()
-- Exported object count
exported = 0

View file

@ -40,6 +40,7 @@ fn runNelMaxExport inputMaxFile =
-- Select none
max select none
clearSelection()
-- Found it ?
find = false

View file

@ -122,6 +122,7 @@ fn runNelMaxExport inputMaxFile =
-- unselect
max select none
clearSelection()
-- Exported object count
exported = 0

View file

@ -127,6 +127,7 @@ fn runNelMaxExport inputMaxFile =
-- unselect
max select none
clearSelection()
-- Exported object count
exported = 0
@ -175,6 +176,7 @@ fn runNelMaxExport inputMaxFile =
(
-- Select none
max select none
clearSelection()
-- Select all node in this ig
for node in geometry do

View file

@ -228,6 +228,7 @@ fn exportCollisionsFromZone outputNelDir filename =
(
-- Select all collision mesh
max select none
clearSelection()
for m in geometry do
(
if (isToBeExportedCollision m) == true then
@ -311,6 +312,7 @@ fn exportInstanceGroupFromZone inputFile outputPath igName transitionZone cellSi
-- unselect
max select none
clearSelection()
-- Exported object count
exported = 0
@ -372,6 +374,7 @@ fn exportInstanceGroupFromZone inputFile outputPath igName transitionZone cellSi
(
-- Select none
max select none
clearSelection()
for node in objects where classOf node == XRefObject do
(

View file

@ -76,6 +76,7 @@ fn runNelMaxExport inputMaxFile =
-- Select none
max select none
clearSelection()
-- Select all PACS primitives
for i in geometry do

View file

@ -102,6 +102,7 @@ fn runNelMaxExport inputMaxFile =
-- Select all collision mesh
max select none
clearSelection()
for m in geometry do
(
if (isToBeExported m) == true then

View file

@ -69,6 +69,7 @@ if BuildShadowSkinEnabled:
printLog(log, ">>> Setup build directories <<<")
mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory)
mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory)
mkPath(log, ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory)
mkPath(log, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory)
mkPath(log, ExportBuildDirectory + "/" + ShapeLightmap16BitsBuildDirectory)

View file

@ -77,16 +77,19 @@ else:
# copy lightmap_not_optimized to lightmap
printLog(log, ">>> Optimize lightmaps <<<")
loPathLightmapsOriginal = ExportBuildDirectory + "/" + ShapeLightmapNotOptimizedExportDirectory
loPathShapesOriginal = ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory
mkPath(log, loPathLightmapsOriginal)
loPathLightmaps = ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory
loPathShapes = ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory
loPathShapes = ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory
loPathTags = ExportBuildDirectory + "/" + ShapeTagExportDirectory
mkPath(log, loPathLightmaps)
mkPath(log, loPathShapes)
mkPath(log, loPathTags)
if needUpdateDirByTagLog(log, loPathLightmapsOriginal, ".txt", loPathLightmaps, ".txt") or needUpdateDirNoSubdir(log, loPathLightmapsOriginal, loPathLightmaps) or needUpdateDirNoSubdir(log, loPathShapes, loPathLightmaps) or needUpdateDirNoSubdir(log, loPathTags, loPathLightmaps):
if needUpdateDirByTagLog(log, loPathLightmapsOriginal, ".txt", loPathLightmaps, ".txt") or needUpdateDirNoSubdir(log, loPathLightmapsOriginal, loPathLightmaps) or needUpdateDirNoSubdir(log, loPathShapesOriginal, loPathShapes) or needUpdateDirNoSubdir(log, loPathShapes, loPathLightmaps) or needUpdateDirNoSubdir(log, loPathTags, loPathLightmaps):
removeFilesRecursive(log, loPathLightmaps)
copyFiles(log, loPathLightmapsOriginal, loPathLightmaps)
removeFilesRecursive(log, loPathShapes)
copyFiles(log, loPathShapesOriginal, loPathShapes)
# Optimize lightmaps if any. Additionnaly, output a file indicating which lightmaps are 8 bits
# lightmap_optimizer <path_lightmaps> <path_shapes> [path_tags] [path_flag8bit]
subprocess.call([ LightmapOptimizer, loPathLightmaps, loPathShapes, loPathTags, ExportBuildDirectory + "/" + ShapeLightmapBuildDirectory + "/list_lm_8bit.txt" ])

View file

@ -46,8 +46,8 @@ printLog(log, "")
printLog(log, ">>> Install shape <<<")
installPath = InstallDirectory + "/" + ShapeInstallDirectory
mkPath(log, installPath)
mkPath(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory)
copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeClodtexBuildDirectory, installPath, ".shape")
mkPath(log, ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory)
copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeOptimizedBuildDirectory, installPath, ".shape")
mkPath(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory)
copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, installPath, ".shape")
copyFilesExtNoTreeIfNeeded(log, ExportBuildDirectory + "/" + ShapeWithCoarseMeshBuildDirectory, installPath, ".dds")

View file

@ -265,6 +265,7 @@ fn runNelMaxExportSub inputMaxFile retryCount =
-- unselect
max select none
clearSelection()
-- Exported object count
exported = 0

View file

@ -112,6 +112,7 @@ fn runNelMaxExport inputMaxFile =
-- unselect
max select none
clearSelection()
-- Exported object count
exported = 0

View file

@ -103,6 +103,7 @@ fn runNelMaxExport inputMaxFile =
-- Select none
max select none
clearSelection()
-- Found it ?
find = false

View file

@ -55,6 +55,7 @@ for dir in WaterMapSourceDirectories:
destDir = DatabaseDirectory + "/" + dir
mkPath(log, destDir)
copyFilesExtNoTreeIfNeeded(log, srcDir, destDir, ".tga")
copyFilesExtNoTreeIfNeeded(log, srcDir, destDir, ".png")
printLog(log, "")
log.close()