mirror of
https://github.com/minetest/irrlicht.git
synced 2024-09-27 23:10:25 +02:00
Set up BRUS
This commit is contained in:
parent
9efa535c78
commit
56857365f5
|
@ -211,7 +211,15 @@ std::tuple<bool, std::string> parseNode(json data, SMeshBuffer* meshBuffer) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns (success, failure reason).
|
* 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() {
|
std::tuple<bool, std::string> CB3DJSONMeshFileLoader::readChunkTEXS() {
|
||||||
|
|
||||||
|
@ -364,6 +372,7 @@ std::tuple<bool, std::string> CB3DJSONMeshFileLoader::readChunkTEXS() {
|
||||||
B3DTexture.Angle = t["angle"];
|
B3DTexture.Angle = t["angle"];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (t.contains("angle")) {
|
if (t.contains("angle")) {
|
||||||
return {false, "\"angle\" in TEXS block index (" + std::to_string(index) + ") is not a number."};
|
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"};
|
return {false, "Wrong version in B3D JSON! Expected: 1"};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Success, failure reason
|
// Grab TEXS (textures).
|
||||||
std::tuple<bool, std::string> texturesSuccess = this->readChunkTEXS();
|
std::tuple<bool, std::string> texturesSuccess = this->readChunkTEXS();
|
||||||
|
|
||||||
if (!std::get<0>(texturesSuccess)) {
|
if (!std::get<0>(texturesSuccess)) {
|
||||||
return {false, std::get<1>(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;
|
// return animatedMesh;
|
||||||
|
|
|
@ -37,6 +37,7 @@ private:
|
||||||
std::tuple<bool, std::string> parseJSONFile(io::IReadFile* file);
|
std::tuple<bool, std::string> parseJSONFile(io::IReadFile* file);
|
||||||
std::tuple<bool, std::string> load();
|
std::tuple<bool, std::string> load();
|
||||||
std::tuple<bool, std::string> readChunkTEXS();
|
std::tuple<bool, std::string> readChunkTEXS();
|
||||||
|
std::tuple<bool, std::string> readChunkBRUS();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user