Set up BRUS

This commit is contained in:
jordan4ibanez 2023-11-28 08:03:34 -05:00
parent 9efa535c78
commit 56857365f5
2 changed files with 21 additions and 2 deletions

View File

@ -211,7 +211,15 @@ std::tuple<bool, std::string> parseNode(json data, SMeshBuffer* meshBuffer) {
/**
* Returns (success, failure reason).
* This is an optional component of B3D.
*/
std::tuple<bool, std::string> CB3DJSONMeshFileLoader::readChunkBRUS() {
return {true, ""};
}
/**
* Returns (success, failure reason).
*/
std::tuple<bool, std::string> CB3DJSONMeshFileLoader::readChunkTEXS() {
@ -364,6 +372,7 @@ std::tuple<bool, std::string> CB3DJSONMeshFileLoader::readChunkTEXS() {
B3DTexture.Angle = t["angle"];
} else {
if (t.contains("angle")) {
return {false, "\"angle\" in TEXS block index (" + std::to_string(index) + ") is not a number."};
}
@ -398,13 +407,22 @@ std::tuple<bool, std::string> CB3DJSONMeshFileLoader::load() {
return {false, "Wrong version in B3D JSON! Expected: 1"};
}
// Success, failure reason
// Grab TEXS (textures).
std::tuple<bool, std::string> texturesSuccess = this->readChunkTEXS();
if (!std::get<0>(texturesSuccess)) {
return {false, std::get<1>(texturesSuccess)};
}
// Grab BRUS (brushes). Defines where materials go.
std::tuple<bool, std::string> brushesSuccess = this->readChunkBRUS();
if (!std::get<0>(brushesSuccess)) {
return {false, std::get<1>(brushesSuccess)};
}
// return animatedMesh;

View File

@ -37,6 +37,7 @@ private:
std::tuple<bool, std::string> parseJSONFile(io::IReadFile* file);
std::tuple<bool, std::string> load();
std::tuple<bool, std::string> readChunkTEXS();
std::tuple<bool, std::string> readChunkBRUS();
public: