Browse Source

Fix texture import compression when running under a headless context (like AtomicTool)

Matt Benic 8 năm trước cách đây
mục cha
commit
f9ff6bd8bf
1 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 4 3
      Source/ToolCore/Assets/TextureImporter.cpp

+ 4 - 3
Source/ToolCore/Assets/TextureImporter.cpp

@@ -97,9 +97,10 @@ bool TextureImporter::Import()
         }
 
         if (image->SaveDDS(compressedPath))
-        {            
-            Renderer * renderer = GetSubsystem<Renderer>();
-            renderer->ReloadTextures();
+        {
+            Renderer* renderer = GetSubsystem<Renderer>();
+            if (renderer != NULL) // May be importing through headless process
+                renderer->ReloadTextures();
         }
     }