mirror of
https://github.com/minetest/irrlicht.git
synced 2025-02-22 05:40:26 +01:00
Flags & Blend
This commit is contained in:
parent
d65fe36081
commit
5becfee6bb
@ -246,6 +246,7 @@ std::tuple<bool, std::string> CB3DJSONMeshFileLoader::readChunkTEXS() {
|
||||
// This part should probably be it's own function.
|
||||
//todo: look into making this it's own function.
|
||||
|
||||
//* Name.
|
||||
if (t.contains("name") && t["name"].is_string()) {
|
||||
|
||||
// Strings are implicitly converted.
|
||||
@ -261,10 +262,39 @@ std::tuple<bool, std::string> CB3DJSONMeshFileLoader::readChunkTEXS() {
|
||||
if (t.contains("name") && !t["name"].is_string()) {
|
||||
return {false, "\"name\" in TEXS block index (" + std::to_string(index) +") is not a string."};
|
||||
}
|
||||
|
||||
|
||||
return {false, "Missing \"name\" in TEXS block index (" + std::to_string(index) +")."};
|
||||
}
|
||||
|
||||
//* Flags.
|
||||
if (t.contains("flags") && t["flags"].is_number_integer()) {
|
||||
|
||||
B3DTexture.Flags = t["flags"];
|
||||
|
||||
} else {
|
||||
|
||||
if (t.contains("flags") && !t["flags"].is_number_integer()) {
|
||||
return {false, "\"flags\" in TEXS block index(" + std::to_string(index)+") is not an integer."};
|
||||
}
|
||||
|
||||
return {false, "Missing \"flags\" in TEXS block index(" + std::to_string(index)+")."};
|
||||
}
|
||||
|
||||
//* Blend.
|
||||
if (t.contains("blend") && t["blend"].is_number_integer()) {
|
||||
|
||||
B3DTexture.Blend = t["blend"];
|
||||
|
||||
} else {
|
||||
|
||||
if (t.contains("blend") && !t["blend"].is_number_integer()) {
|
||||
return {false, "\"blend\" in TEXS block index(" + std::to_string(index)+") is not an integer."};
|
||||
}
|
||||
|
||||
return {false, "Missing \"blend\" in TEXS block index(" + std::to_string(index)+")."};
|
||||
}
|
||||
|
||||
|
||||
// This part is a bit complex, for ease of use for the plugin dev/modders advantage.
|
||||
|
||||
// if (t.contains("pos") && t["pos"].is_array()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user