mirror of
https://github.com/minetest/irrlicht.git
synced 2025-02-22 22:00:26 +01:00
Fix warnings, change to errors
This commit is contained in:
parent
7cddd10a54
commit
516b5a70fa
@ -257,8 +257,12 @@ std::tuple<bool, std::string> CB3DJSONMeshFileLoader::readChunkTEXS() {
|
|||||||
|
|
||||||
// Convert Windows '\' to Posix '/'.
|
// Convert Windows '\' to Posix '/'.
|
||||||
B3DTexture.TextureName.replace('\\','/');
|
B3DTexture.TextureName.replace('\\','/');
|
||||||
|
|
||||||
println(B3DTexture.TextureName.c_str());
|
println(B3DTexture.TextureName.c_str());
|
||||||
|
} else {
|
||||||
|
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) +")."};
|
||||||
}
|
}
|
||||||
|
|
||||||
// This part is a bit complex, for ease of use for the plugin dev/modders advantage.
|
// This part is a bit complex, for ease of use for the plugin dev/modders advantage.
|
||||||
@ -270,7 +274,7 @@ std::tuple<bool, std::string> CB3DJSONMeshFileLoader::readChunkTEXS() {
|
|||||||
// return {false, "TEXS: " + std::get<1>(posSuccess)};
|
// return {false, "TEXS: " + std::get<1>(posSuccess)};
|
||||||
// }
|
// }
|
||||||
// } else {
|
// } else {
|
||||||
// return {false, "Malformed \"pos\" in TEXS block. Must be an array with 2 numbers."};
|
// return {false, "Malformed \"pos\" in TEXS block index (" + std::to_string(index) + "). Must be an array with 2 numbers."};
|
||||||
// }
|
// }
|
||||||
|
|
||||||
index++;
|
index++;
|
||||||
@ -300,9 +304,11 @@ std::tuple<bool, std::string> CB3DJSONMeshFileLoader::load() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Success, failure reason
|
// Success, failure reason
|
||||||
println("reading");
|
|
||||||
std::tuple<bool, std::string> texturesSuccess = this->readChunkTEXS();
|
std::tuple<bool, std::string> texturesSuccess = this->readChunkTEXS();
|
||||||
println("done reading");
|
|
||||||
|
if (!std::get<0>(texturesSuccess)) {
|
||||||
|
return {false, std::get<1>(texturesSuccess)};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -314,7 +320,7 @@ std::tuple<bool, std::string> CB3DJSONMeshFileLoader::load() {
|
|||||||
* Automatically cleans and returns the nullptr so it can be inlined or chained.
|
* Automatically cleans and returns the nullptr so it can be inlined or chained.
|
||||||
*/
|
*/
|
||||||
CSkinnedMesh* CB3DJSONMeshFileLoader::cleanUp(std::string failure) {
|
CSkinnedMesh* CB3DJSONMeshFileLoader::cleanUp(std::string failure) {
|
||||||
os::Printer::log(failure.c_str(), ELL_WARNING);
|
os::Printer::log(failure.c_str(), ELL_ERROR);
|
||||||
if (AnimatedMesh != nullptr) {
|
if (AnimatedMesh != nullptr) {
|
||||||
AnimatedMesh->drop();
|
AnimatedMesh->drop();
|
||||||
AnimatedMesh = 0;
|
AnimatedMesh = 0;
|
||||||
@ -347,7 +353,6 @@ std::tuple<bool, std::string> CB3DJSONMeshFileLoader::parseJSONFile(io::IReadFil
|
|||||||
std::string failureReason = "message: " + std::string(e.what()) + '\n' +
|
std::string failureReason = "message: " + std::string(e.what()) + '\n' +
|
||||||
"exception id: " + std::to_string(e.id) + '\n' +
|
"exception id: " + std::to_string(e.id) + '\n' +
|
||||||
"byte position of error: " + std::to_string(e.byte) + '\n';
|
"byte position of error: " + std::to_string(e.byte) + '\n';
|
||||||
os::Printer::log("JSON: Failed to parse!", ELL_WARNING);
|
|
||||||
return {false, failureReason};
|
return {false, failureReason};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user