Do not create dummy normalmaps (#4180)
authoryou <ovvv@web.de>
Fri, 19 May 2017 06:08:12 +0000 (08:08 +0200)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Fri, 19 May 2017 06:08:12 +0000 (08:08 +0200)
fixes #1811

src/client/tile.cpp

index f0f1800b083200367fc28f759037c4d8da39ca21..99495132b53acfd0ad8c017a06d74cb872639223 100644 (file)
@@ -1208,17 +1208,17 @@ bool TextureSource::generateImagePart(std::string part_of_name,
 #endif
                if (image == NULL) {
                        if (part_of_name != "") {
-                               if (part_of_name.find("_normal.png") == std::string::npos){
-                                       errorstream<<"generateImage(): Could not load image \""
-                                               <<part_of_name<<"\""<<" while building texture"<<std::endl;
-                                       errorstream<<"generateImage(): Creating a dummy"
-                                               <<" image for \""<<part_of_name<<"\""<<std::endl;
-                               } else {
-                                       infostream<<"generateImage(): Could not load normal map \""
-                                               <<part_of_name<<"\""<<std::endl;
-                                       infostream<<"generateImage(): Creating a dummy"
-                                               <<" normal map for \""<<part_of_name<<"\""<<std::endl;
+
+                               // Do not create normalmap dummies
+                               if (part_of_name.find("_normal.png") != std::string::npos) {
+                                       warningstream << "generateImage(): Could not load normal map \""
+                                               << part_of_name << "\"" << std::endl;
+                                       return true;
                                }
+
+                               errorstream << "generateImage(): Could not load image \""
+                                       << part_of_name << "\" while building texture; "
+                                       "Creating a dummy image" << std::endl;
                        }
 
                        // Just create a dummy image