From f722ffb3c82910319d2a1aff6026c98b881bc9ee Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Tue, 28 Nov 2023 09:25:41 -0500 Subject: [PATCH] Add some basic things --- source/Irrlicht/CB3DJSONMeshFileLoader.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/source/Irrlicht/CB3DJSONMeshFileLoader.cpp b/source/Irrlicht/CB3DJSONMeshFileLoader.cpp index 0cdbc540..f43378f7 100644 --- a/source/Irrlicht/CB3DJSONMeshFileLoader.cpp +++ b/source/Irrlicht/CB3DJSONMeshFileLoader.cpp @@ -337,13 +337,33 @@ std::tuple CB3DJSONMeshFileLoader::readChunkBRUS() { //* Textures Array. if (b.contains("textures") && b["textures"].is_array()) { + json internalArray = b["textures"]; + int internalIndex = 0; + for (auto internalReference = internalArray.begin(); internalReference != internalArray.end(); ++internalReference) { + + json texName = *internalReference; + + if (!texName.is_string()) { + return {false, "BRUS: Element (" + std::to_string(index) + ") texture element (" + std::to_string(internalIndex) + ") is not a string."}; + } + + std::string finalizedName = texName; + + println("this is what we got: " + finalizedName); + + internalIndex++; + } + } else { + if (!b.contains("textures")) { return {false, "BRUS: Element (" + std::to_string(index) + ") is missing \"textures\"."}; } + return {false, "BRUS: Element (" + std::to_string(index) + ") is not an array."}; } + index++; }