Beispiel #1
0
 // Token: 0x060003E8 RID: 1000 RVA: 0x00034C54 File Offset: 0x00032E54
 public static TextureImporterFormat GetTextureImporterFormatFromTextureFormat(TextureFormat value)
 {
     TextureImporterFormatDatabase.Entry entry = TextureImporterFormatDatabase.Find(value);
     if (entry != null)
     {
         return(entry.Format);
     }
     return(TextureImporterFormat.RGBA32);
 }
Beispiel #2
0
 // Token: 0x060003EA RID: 1002 RVA: 0x00034CA8 File Offset: 0x00032EA8
 public static string GetTextureImporterFormatLongString(TextureImporterFormat value)
 {
     if (value < 0)
     {
         return("Auto");
     }
     TextureImporterFormatDatabase.Entry entry = TextureImporterFormatDatabase.Find(value);
     if (entry != null)
     {
         return(entry.LongName);
     }
     return(value.ToString());
 }
 // Token: 0x060003D4 RID: 980 RVA: 0x00034010 File Offset: 0x00032210
 static TextureImporterFormatDatabase()
 {
     TextureImporterFormatDatabase.Add(1, 1, 1, 8f, true, false, false, false, 0, 0, 0, false, false, true, "Alpha 8");
     TextureImporterFormatDatabase.Add(2, 2, 2, 16f, true, false, false, false, 0, 0, 0, false, false, false, "ARGB 16 bit");
     TextureImporterFormatDatabase.Add(3, 3, 3, 24f, false, false, false, false, 0, 0, 0, false, false, true, "RGB 24 bit");
     TextureImporterFormatDatabase.Add(4, 4, 4, 32f, true, false, false, false, 0, 0, 0, false, false, true, "RGBA 32 bit");
     TextureImporterFormatDatabase.Add(5, 5, 5, 32f, true, false, false, false, 0, 0, 0, false, false, true, "ARGB 32 bit");
     TextureImporterFormatDatabase.Add(7, 7, 7, 16f, false, false, false, false, 0, 0, 0, false, false, false, "RGB 16 bit");
     TextureImporterFormatDatabase.Add(10, 3, 10, 4f, false, false, false, true, 0, 4, 4, false, true, true, "RGB Compressed DXT1");
     TextureImporterFormatDatabase.Add(12, 4, 12, 8f, true, false, false, true, 0, 4, 4, false, true, true, "RGBA Compressed DXT5");
     TextureImporterFormatDatabase.Add(13, 13, 13, 16f, true, false, false, false, 0, 0, 0, false, false, false, "RGBA 16 bit");
     TextureImporterFormatDatabase.Add(17, 17, 17, 16f, true, false, false, false, 0, 0, 0, false, false, false, "RGBA Half");
     TextureImporterFormatDatabase.Add(24, 3, 24, 8f, false, false, false, true, 0, 4, 4, false, false, false, "RGB HDR Compressed BC6H");
     TextureImporterFormatDatabase.Add(25, 3, 25, 8f, true, false, false, true, 0, 4, 4, false, false, false, "RGB(A) Compressed BC7");
     TextureImporterFormatDatabase.Add(26, 3, 26, 4f, false, false, false, true, 0, 4, 4, false, false, false, "R Compressed BC4");
     TextureImporterFormatDatabase.Add(27, 3, 27, 8f, false, false, false, true, 0, 4, 4, false, false, false, "RG Compressed BC5");
     TextureImporterFormatDatabase.Add(28, 3, 28, 4f, false, false, false, true, 0, 4, 4, true, false, true, "RGB Crunched DXT1");
     TextureImporterFormatDatabase.Add(29, 4, 29, 8f, true, false, false, true, 0, 4, 4, true, false, true, "RGBA Crunched DXT5");
     TextureImporterFormatDatabase.Add(30, 3, 30, 2f, true, true, true, true, 8, 0, 4, true, false, false, "ARGB 16 bit");
     TextureImporterFormatDatabase.Add(31, 4, 31, 2f, true, true, true, true, 8, 0, 4, true, false, false, "RGBA Compressed PVRTC 2 bits");
     TextureImporterFormatDatabase.Add(32, 3, 32, 4f, false, true, true, true, 8, 0, 4, true, false, false, "RGB Compressed PVRTC 4 bits");
     TextureImporterFormatDatabase.Add(33, 4, 33, 4f, true, true, true, true, 8, 0, 4, true, false, false, "RGBA Compressed PVRTC 4 bits");
     TextureImporterFormatDatabase.Add(34, 3, 34, 4f, false, false, true, true, 0, 4, 4, true, false, false, "RGB Compressed ETC 4 bits");
     TextureImporterFormatDatabase.Add(41, 3, 41, 4f, false, false, true, true, 0, 4, 4, true, false, false, "R Compressed EAC 4 bit");
     TextureImporterFormatDatabase.Add(42, 3, 42, 4f, false, false, true, true, 0, 4, 4, true, false, false, "EAC_R_SIGNED");
     TextureImporterFormatDatabase.Add(43, 3, 43, 4f, false, false, true, true, 0, 4, 4, true, false, false, "EAC_RG");
     TextureImporterFormatDatabase.Add(44, 3, 44, 4f, false, false, true, true, 0, 4, 4, true, false, false, "EAC_RG_SIGNED");
     TextureImporterFormatDatabase.Add(45, 3, 45, 4f, false, false, false, true, 0, 4, 4, true, false, false, "RGB Compressed ETC2 4 bits");
     TextureImporterFormatDatabase.Add(46, 4, 46, 4f, true, false, false, true, 0, 4, 4, true, false, false, "RGB+1 bit Alpha Compressed ETC2 4 bits");
     TextureImporterFormatDatabase.Add(47, 4, 47, 8f, true, false, false, true, 0, 4, 4, true, false, false, "RGBA Compressed ETC2 8 bits");
     TextureImporterFormatDatabase.Add(48, 3, 48, 0f, false, false, false, true, 0, 0, 4, true, false, false, "RGB Compressed ASTC 4x4 block");
     TextureImporterFormatDatabase.Add(49, 3, 49, 0f, false, false, false, true, 0, 0, 5, true, false, false, "RGB Compressed ASTC 5x5 block");
     TextureImporterFormatDatabase.Add(50, 3, 50, 0f, false, false, false, true, 0, 0, 6, true, false, false, "RGB Compressed ASTC 6x6 block");
     TextureImporterFormatDatabase.Add(51, 3, 51, 0f, false, false, false, true, 0, 0, 8, true, false, false, "RGB Compressed ASTC 8x8 block");
     TextureImporterFormatDatabase.Add(52, 3, 52, 0f, false, false, false, true, 0, 0, 10, true, false, false, "RGB Compressed ASTC 10x10 block");
     TextureImporterFormatDatabase.Add(53, 3, 53, 0f, false, false, false, true, 0, 0, 12, true, false, false, "RGB Compressed ASTC 12x12 block");
     TextureImporterFormatDatabase.Add(54, 4, 54, 0f, true, false, false, true, 0, 0, 4, true, false, false, "RGBA Compressed ASTC 4x4 block");
     TextureImporterFormatDatabase.Add(55, 4, 55, 0f, true, false, false, true, 0, 0, 5, true, false, false, "RGBA Compressed ASTC 5x5 block");
     TextureImporterFormatDatabase.Add(56, 4, 56, 0f, true, false, false, true, 0, 0, 6, true, false, false, "RGBA Compressed ASTC 6x6 block");
     TextureImporterFormatDatabase.Add(57, 4, 57, 0f, true, false, false, true, 0, 0, 8, true, false, false, "RGBA Compressed ASTC 8x8 block");
     TextureImporterFormatDatabase.Add(58, 4, 58, 0f, true, false, false, true, 0, 0, 10, true, false, false, "RGBA Compressed ASTC 10x10 block");
     TextureImporterFormatDatabase.Add(59, 4, 59, 0f, true, false, false, true, 0, 0, 12, true, false, false, "RGBA Compressed ASTC 12x12 block");
     TextureImporterFormatDatabase.Add(64, 3, 64, 4f, false, true, true, true, 0, 4, 4, true, false, false, "RGB Crunched ETC 4 bits");
     TextureImporterFormatDatabase.Add(65, 4, 65, 8f, true, false, false, true, 0, 4, 4, true, false, false, "RGBA Crunched ETC2 8 bits");
     TextureImporterFormatDatabase.Add(63, 63, 63, 8f, false, false, false, true, 0, 0, 0, false, false, false, "R 8");
 }
Beispiel #4
0
        // Token: 0x060003D8 RID: 984 RVA: 0x0003466C File Offset: 0x0003286C
        public static TextureUtil2.RuntimeMemoryUsage GetRuntimeMemorySize(TextureImporterFormat format, int width, int height, bool hasmips, bool isreadable, TextureImporterShape shape)
        {
            TextureImporterFormatDatabase.Entry entry = TextureImporterFormatDatabase.Find(format);
            float num = entry.BitsPerPixel;

            switch ((int)format)
            {
            case 48:
            case 49:
            case 50:
            case 51:
            case 52:
            case 53:
            case 54:
            case 55:
            case 56:
            case 57:
            case 58:
            case 59:
                width  = Mathf.CeilToInt((float)width / (float)entry.BlockSize) * entry.BlockSize;
                height = Mathf.CeilToInt((float)height / (float)entry.BlockSize) * entry.BlockSize;
                num    = 1f / (float)(entry.BlockSize * entry.BlockSize) * 128f;
                break;
            }
            float num2 = (float)(width * height) * num / 8f;

            if (hasmips)
            {
                num2 *= 1.33333337f;
            }
            bool flag = (int)shape == 2;

            if (flag)
            {
                num2 *= 6f;
            }
            TextureUtil2.RuntimeMemoryUsage result = default(TextureUtil2.RuntimeMemoryUsage);
            result.Gpu = Mathf.RoundToInt(num2);
            if (isreadable && !flag && entry.CanBeReadable)
            {
                result.Cpu = Mathf.RoundToInt(num2);
            }
            return(result);
        }
Beispiel #5
0
 // Token: 0x060003F0 RID: 1008 RVA: 0x00034DB1 File Offset: 0x00032FB1
 public static TextureImporterFormat GetUncompressedFormat(TextureImporterFormat format)
 {
     return(TextureImporterFormatDatabase.Find(format).UncompressedFormat);
 }
Beispiel #6
0
 // Token: 0x060003EF RID: 1007 RVA: 0x00034DA4 File Offset: 0x00032FA4
 public static bool IsPOTRequiredForMipMaps(TextureImporterFormat format)
 {
     return(TextureImporterFormatDatabase.Find(format).MustBePotForMipMaps);
 }
Beispiel #7
0
 // Token: 0x060003ED RID: 1005 RVA: 0x00034D8A File Offset: 0x00032F8A
 public static bool IsSquareRequired(TextureImporterFormat format)
 {
     return(TextureImporterFormatDatabase.Find(format).MustBeSquare);
 }
Beispiel #8
0
 // Token: 0x060003EC RID: 1004 RVA: 0x00034D7D File Offset: 0x00032F7D
 public static int GetMultipleOf(TextureImporterFormat format)
 {
     return(TextureImporterFormatDatabase.Find(format).MustBeMultipleOf);
 }
Beispiel #9
0
 // Token: 0x060003E7 RID: 999 RVA: 0x00034C28 File Offset: 0x00032E28
 public static bool IsCompressedFormat(TextureImporterFormat value)
 {
     TextureImporterFormatDatabase.Entry entry = TextureImporterFormatDatabase.Find(value);
     return(entry != null && entry.Format != entry.UncompressedFormat);
 }
Beispiel #10
0
 // Token: 0x060003E6 RID: 998 RVA: 0x00034C08 File Offset: 0x00032E08
 public static bool CanUseCompressionQuality(TextureImporterFormat value)
 {
     TextureImporterFormatDatabase.Entry entry = TextureImporterFormatDatabase.Find(value);
     return(entry != null && entry.CanUseCompressionQuality);
 }
Beispiel #11
0
 // Token: 0x060003E2 RID: 994 RVA: 0x00034B38 File Offset: 0x00032D38
 public static bool HasAlphaChannel(TextureImporterFormat value)
 {
     TextureImporterFormatDatabase.Entry entry = TextureImporterFormatDatabase.Find(value);
     return(entry != null && entry.HasAlphaChannel);
 }