Skip to content

Commit

Permalink
Optional Apply() for #7
Browse files Browse the repository at this point in the history
  • Loading branch information
sarbian committed Nov 19, 2014
1 parent 71ed3ba commit 3390024
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions DatabaseLoaderTexture_DDS.cs
Expand Up @@ -40,7 +40,7 @@ public override IEnumerator Load(UrlDir.UrlFile urlFile, FileInfo file)
// http://msdn.microsoft.com/en-us/library/bb943992.aspx
// http://msdn.microsoft.com/en-us/library/windows/desktop/bb205578(v=vs.85).aspx
// mipmapBias limits the number of mipmap when > 0
public static GameDatabase.TextureInfo LoadDDS(string path, bool keepReadable = false, bool asNormal = false, int mipmapBias = -1)
public static GameDatabase.TextureInfo LoadDDS(string path, bool keepReadable = false, bool asNormal = false, int mipmapBias = -1, bool apply = true)
{
if (!File.Exists(path))
{
Expand Down Expand Up @@ -203,7 +203,8 @@ public static GameDatabase.TextureInfo LoadDDS(string path, bool keepReadable =

Texture2D texture = new Texture2D(dwWidth, dwHeight, textureFormat, dwMipMapCount > 1);
texture.LoadRawTextureData(dxtBytes);
texture.Apply(false, !keepReadable);
if (apply)
texture.Apply(false, !keepReadable);

return new GameDatabase.TextureInfo(texture, isNormalMap, keepReadable, isCompressed);
}
Expand Down

0 comments on commit 3390024

Please sign in to comment.