From 3a6b7fc130834c0d17068304f11f4756ac1c3d04 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 26 Aug 2012 17:01:45 +0200 Subject: [PATCH] Added: #1440 Extended parser for GeomObject --HG-- branch : build_pipeline_v3 --- .../pipeline/max/builtin/geom_object.cpp | 19 ++++++++- .../pipeline/max/builtin/poly_object.cpp | 42 +++++++++++++++++-- .../tools/pipeline/max/builtin/tri_object.cpp | 25 +++++++++-- 3 files changed, 79 insertions(+), 7 deletions(-) diff --git a/code/nel/tools/pipeline/max/builtin/geom_object.cpp b/code/nel/tools/pipeline/max/builtin/geom_object.cpp index 992c0cef6..1ad2d0985 100644 --- a/code/nel/tools/pipeline/max/builtin/geom_object.cpp +++ b/code/nel/tools/pipeline/max/builtin/geom_object.cpp @@ -127,7 +127,24 @@ const ISceneClassDesc *CGeomObject::classDesc() const void CGeomObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const { - CObject::toStringLocal(ostream, pad); + if (filter == 0) + { + CObject::toStringLocal(ostream, pad); + } + else if (filter == PMB_GEOM_OBJECT_PARSE_FILTER) + { + std::string padpad = pad + "\t"; + if (m_Unknown0900) + { + ostream << "\n" << pad << "GeomObject Unknown 0x0900: "; + m_Unknown0900->toString(ostream, padpad); + } + if (m_GeomBuffers) + { + ostream << "\n" << pad << "GeomBuffers: "; + m_GeomBuffers->toString(ostream, padpad); + } + } } IStorageObject *CGeomObject::createChunkById(uint16 id, bool container) diff --git a/code/nel/tools/pipeline/max/builtin/poly_object.cpp b/code/nel/tools/pipeline/max/builtin/poly_object.cpp index bfda7611c..25cd334d4 100644 --- a/code/nel/tools/pipeline/max/builtin/poly_object.cpp +++ b/code/nel/tools/pipeline/max/builtin/poly_object.cpp @@ -60,7 +60,21 @@ const CPolyObjectClassDesc PolyObjectClassDesc(&DllPluginDescBuiltin); void CPolyObject::parse(uint16 version, uint filter) { - CGeomObject::parse(version); + if (filter == 0) + { + CGeomObject::parse(version); + } + else if (filter == PMB_POLY_OBJECT_PARSE_FILTER) + { + if (!m_ChunksOwnsPointers) + { + CGeomObject::parse(version, PMB_GEOM_OBJECT_PARSE_FILTER); + // 0x0906 + // 0x0908 + // 0x090a + // 0x090c + } + } } void CPolyObject::clean() @@ -70,7 +84,18 @@ void CPolyObject::clean() void CPolyObject::build(uint16 version, uint filter) { - CGeomObject::build(version); + if (filter == 0) + { + CGeomObject::build(version); + } + else if (filter == PMB_POLY_OBJECT_PARSE_FILTER) + { + CGeomObject::build(version, PMB_GEOM_OBJECT_PARSE_FILTER); + // 0x0906 + // 0x0908 + // 0x090a + // 0x090c + } } void CPolyObject::disown() @@ -96,7 +121,18 @@ const ISceneClassDesc *CPolyObject::classDesc() const void CPolyObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const { - CGeomObject::toStringLocal(ostream, pad); + if (filter == 0) + { + CGeomObject::toStringLocal(ostream, pad); + } + else if (filter == PMB_POLY_OBJECT_PARSE_FILTER) + { + CGeomObject::toStringLocal(ostream, pad, PMB_GEOM_OBJECT_PARSE_FILTER); + // 0x0906 + // 0x0908 + // 0x090a + // 0x090c + } } IStorageObject *CPolyObject::createChunkById(uint16 id, bool container) diff --git a/code/nel/tools/pipeline/max/builtin/tri_object.cpp b/code/nel/tools/pipeline/max/builtin/tri_object.cpp index daddfa5bd..71184d038 100644 --- a/code/nel/tools/pipeline/max/builtin/tri_object.cpp +++ b/code/nel/tools/pipeline/max/builtin/tri_object.cpp @@ -68,7 +68,11 @@ void CTriObject::parse(uint16 version, uint filter) { if (!m_ChunksOwnsPointers) { - + CGeomObject::parse(version, PMB_GEOM_OBJECT_PARSE_FILTER); + // 0x0901 + // 0x0902 + // 0x0904 + // 0x0903 } } } @@ -86,7 +90,11 @@ void CTriObject::build(uint16 version, uint filter) } else if (filter == PMB_TRI_OBJECT_PARSE_FILTER) { - + CGeomObject::build(version, PMB_GEOM_OBJECT_PARSE_FILTER); + // 0x0901 + // 0x0902 + // 0x0904 + // 0x0903 } } @@ -113,7 +121,18 @@ const ISceneClassDesc *CTriObject::classDesc() const void CTriObject::toStringLocal(std::ostream &ostream, const std::string &pad, uint filter) const { - CGeomObject::toStringLocal(ostream, pad); + if (filter == 0) + { + CGeomObject::toStringLocal(ostream, pad); + } + else if (filter == PMB_TRI_OBJECT_PARSE_FILTER) + { + CGeomObject::toStringLocal(ostream, pad, PMB_GEOM_OBJECT_PARSE_FILTER); + // 0x0901 + // 0x0902 + // 0x0904 + // 0x0903 + } } IStorageObject *CTriObject::createChunkById(uint16 id, bool container)