Add some basic things

This commit is contained in:
jordan4ibanez
2023-11-28 09:25:41 -05:00
parent 206df1f545
commit f722ffb3c8

View File

@ -337,13 +337,33 @@ std::tuple<bool, std::string> CB3DJSONMeshFileLoader::readChunkBRUS() {
//* Textures Array. //* Textures Array.
if (b.contains("textures") && b["textures"].is_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 { } else {
if (!b.contains("textures")) { if (!b.contains("textures")) {
return {false, "BRUS: Element (" + std::to_string(index) + ") is missing \"textures\"."}; return {false, "BRUS: Element (" + std::to_string(index) + ") is missing \"textures\"."};
} }
return {false, "BRUS: Element (" + std::to_string(index) + ") is not an array."}; return {false, "BRUS: Element (" + std::to_string(index) + ") is not an array."};
} }
index++; index++;
} }