]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/tile.cpp
Hide pause menu prior drawing "shutting down..." message
[dragonfireclient.git] / src / tile.cpp
index 71c7290b771d9aec47b9f6241be88a320ee0e569..310630b84a842a98b2e2802fe792ad8908eb1f76 100644 (file)
@@ -433,8 +433,6 @@ TextureSource::TextureSource(IrrlichtDevice *device):
 {
        assert(m_device);
 
-       m_textureinfo_cache_mutex.Init();
-
        m_main_thread = get_current_thread_id();
 
        // Add a NULL TextureInfo as the first index, named ""
@@ -732,9 +730,6 @@ u32 TextureSource::getTextureIdDirect(const std::string &name)
        m_textureinfo_cache.push_back(ti);
        m_name_to_id[name] = id;
 
-       /*infostream<<"getTextureIdDirect(): "
-                       <<"Returning id="<<id<<" for name \""<<name<<"\""<<std::endl;*/
-
        return id;
 }
 
@@ -777,6 +772,7 @@ void TextureSource::processQueue()
        /*
                Fetch textures
        */
+       //NOTE this is only thread safe for ONE consumer thread!
        if(!m_get_texture_queue.empty())
        {
                GetRequest<std::string, u32, u8, u8>
@@ -963,13 +959,33 @@ bool TextureSource::generateImage(std::string part_of_name, video::IImage *& bas
        {
                video::IImage *image = m_sourcecache.getOrLoad(part_of_name, m_device);
 
-               if(image == NULL)
-               {
-                       if(part_of_name != ""){
-                               errorstream<<"generateImage(): Could not load image \""
+               if (image != NULL) {
+                       if (!driver->queryFeature(irr::video::EVDF_TEXTURE_NPOT)) {
+                               core::dimension2d<u32> dim = image->getDimension();
+
+
+                               if ((dim.Height %2 != 0) ||
+                                               (dim.Width %2 != 0)) {
+                                       infostream << "TextureSource::generateImage "
+                                                       << part_of_name << " size npot2 x=" << dim.Width
+                                                       << " y=" << dim.Height << std::endl;
+                               }
+                       }
+               }
+
+               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"
+                                       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;
+                               }
                        }
 
                        // Just create a dummy image