Просмотр исходного кода

[Atlas] Workaround MonoGame TextureProcessor bug.

MonoGame TextureProcessor overwrites existing mipmaps.
Nikos Kastellanos 6 лет назад
Родитель
Сommit
22a7bb37db
1 измененных файлов с 12 добавлено и 1 удалено
  1. 12 1
      Content.Pipeline/AtlasImporter/Processors/TextureAtlasProcessor.cs

+ 12 - 1
Content.Pipeline/AtlasImporter/Processors/TextureAtlasProcessor.cs

@@ -122,7 +122,18 @@ namespace tainicom.Aether.Content.Pipeline
                 }
             }
             
-            base.Process(output, context);
+            // Workaround MonoGame TextureProcessor bug.
+            // MonoGame TextureProcessor overwrites existing mipmaps.
+            if (MipmapsPerSprite && GenerateMipmaps)
+            {
+                GenerateMipmaps = false;
+                base.Process(output, context);
+                GenerateMipmaps = true;
+            }
+            else
+            {
+                base.Process(output, context);
+            }
             
             return output;
         }