From d99208418f3743e2f0e7d36cfeebf2dc19f8f16e Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Sun, 26 Nov 2023 03:37:35 -0500 Subject: [PATCH] Start building up the staircase --- source/Irrlicht/CB3DJSONMeshFileLoader.cpp | 25 +++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/source/Irrlicht/CB3DJSONMeshFileLoader.cpp b/source/Irrlicht/CB3DJSONMeshFileLoader.cpp index 33dbf1aa..211c16b2 100644 --- a/source/Irrlicht/CB3DJSONMeshFileLoader.cpp +++ b/source/Irrlicht/CB3DJSONMeshFileLoader.cpp @@ -4,6 +4,7 @@ #include "IReadFile.h" #include "path.h" #include "json/json.hpp" +#include "os.h" namespace irr { @@ -13,7 +14,8 @@ namespace scene //! Remember to remove this function. It's very dumb. void println(const char* data) { - printf(data, "\n"); + printf(data); + printf("\n"); } @@ -32,15 +34,28 @@ bool CB3DJSONMeshFileLoader::isALoadableFileExtension( } IAnimatedMesh* CB3DJSONMeshFileLoader::createMesh(io::IReadFile* file) { + + // Less than zero? What is this file a black hole? + if (file->getSize() <= 0) { + os::Printer::log("B3D JSON severe error! File size is 0!", ELL_WARNING); + return nullptr; + } + println("I am loading your cool file, yay"); printf("the file is called: "); println(file->getFileName().c_str()); - // Less than zero? What is this file a black hole? - if (file->getSize() <= 0) { - return nullptr; - } + // So here we turn this mangled disaster into a C string. + + // These two hold error message pointers, basically. + std::string err {}; + std::string warn {}; + + // Try changing the type from auto to see why it's auto. + auto buf = std::make_unique(file->getSize()); + + //! I'm sure this isn't a horrible idea! return nullptr; }