From dc886332b5e0903e60893c89ca750c9f92e88717 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Tue, 28 Nov 2023 05:43:22 -0500 Subject: [PATCH] Deprecate old implementation & note --- source/Irrlicht/CB3DJSONMeshFileLoader.cpp | 55 +++++++++++++--------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/source/Irrlicht/CB3DJSONMeshFileLoader.cpp b/source/Irrlicht/CB3DJSONMeshFileLoader.cpp index 04c47f0d..98809374 100644 --- a/source/Irrlicht/CB3DJSONMeshFileLoader.cpp +++ b/source/Irrlicht/CB3DJSONMeshFileLoader.cpp @@ -60,6 +60,9 @@ const char* buildVec3fError(std::string key) { * Returns true if failure occurs. */ bool grabVec3f(json data, std::string key, irr::core::vector3df& refVec) { + + // todo: make a CurrentElement thing in the class header so that we can print nice debug info. + if (data.contains(key) && data[key].is_array() && data[key].size() == 3) { auto jsonVec3 = data[key]; int i = 0; @@ -170,27 +173,7 @@ std::tuple CB3DJSONMeshFileLoader::load() { return {false, "Wrong version in B3D JSON! Expected: 1"}; } - //! Remember: This is basically a linked tree. - - // SMesh* baseMesh(new SMesh {}); - - // SMeshBuffer* meshBuffer(new SMeshBuffer {}); - - // And now we begin the recursion! - - // std::cout << data["NODE"] << "\n"; - - // if (data.contains("NODE") && data["NODE"].is_object()) { - // println("Yep, that's a node!"); - - // // If it fails, give up basically. - // if (parseNode(data["NODE"], meshBuffer)) { - // return nullptr; - // } - // } - - // SAnimatedMesh* animatedMesh(new SAnimatedMesh {}); - // animatedMesh->addMesh(baseMesh); + // return animatedMesh; return {true, nullptr}; @@ -275,4 +258,32 @@ IAnimatedMesh* CB3DJSONMeshFileLoader::createMesh(io::IReadFile* file) { } } // namespace scene -} // namespace irr \ No newline at end of file +} // namespace irr + +/* + +? This is old reference material. Remember to remove this before PR is made. + +//! Remember: This is basically a linked tree. + +// SMesh* baseMesh(new SMesh {}); + +// SMeshBuffer* meshBuffer(new SMeshBuffer {}); + +// And now we begin the recursion! + +// std::cout << data["NODE"] << "\n"; + +// if (data.contains("NODE") && data["NODE"].is_object()) { +// println("Yep, that's a node!"); + +// // If it fails, give up basically. +// if (parseNode(data["NODE"], meshBuffer)) { +// return nullptr; +// } +// } + +// SAnimatedMesh* animatedMesh(new SAnimatedMesh {}); +// animatedMesh->addMesh(baseMesh); + +*/ \ No newline at end of file