* Assumes that the global variable CompFormat stores the format of the * global pointer CompData (that's the pointer to the compressed data). * Decompresses this data into Image->Data, returns if it was successful. * It also uses the globals Width and Height. * * Assumes that iCurImage has valid Width, Height, Depth, Data, SizeOfData, * Bpp, Bpc, Bps, SizeOfPlane, Format and Type fields. It
| 780 | * @TODO: don't use globals, clean this function (and this file) up |
| 781 | */ |
| 782 | ILboolean DdsDecompress(ILuint CompFormat) |
| 783 | { |
| 784 | switch (CompFormat) |
| 785 | { |
| 786 | case PF_ARGB: |
| 787 | case PF_RGB: |
| 788 | case PF_LUMINANCE: |
| 789 | case PF_LUMINANCE_ALPHA: |
| 790 | return DecompressARGB(CompFormat); |
| 791 | |
| 792 | case PF_DXT1: |
| 793 | return DecompressDXT1(Image, CompData); |
| 794 | |
| 795 | case PF_DXT2: |
| 796 | return DecompressDXT2(Image, CompData); |
| 797 | |
| 798 | case PF_DXT3: |
| 799 | return DecompressDXT3(Image, CompData); |
| 800 | |
| 801 | case PF_DXT4: |
| 802 | return DecompressDXT4(Image, CompData); |
| 803 | |
| 804 | case PF_DXT5: |
| 805 | return DecompressDXT5(Image, CompData); |
| 806 | |
| 807 | case PF_ATI1N: |
| 808 | return DecompressAti1n(); |
| 809 | |
| 810 | case PF_3DC: |
| 811 | return Decompress3Dc(); |
| 812 | |
| 813 | case PF_RXGB: |
| 814 | return DecompressRXGB(); |
| 815 | |
| 816 | case PF_A16B16G16R16: |
| 817 | memcpy(Image->Data, CompData, Image->SizeOfData); |
| 818 | return IL_TRUE; |
| 819 | |
| 820 | case PF_R16F: |
| 821 | case PF_G16R16F: |
| 822 | case PF_A16B16G16R16F: |
| 823 | case PF_R32F: |
| 824 | case PF_G32R32F: |
| 825 | case PF_A32B32G32R32F: |
| 826 | return DecompressFloat(CompFormat); |
| 827 | |
| 828 | case PF_UNKNOWN: |
| 829 | return IL_FALSE; |
| 830 | } |
| 831 | |
| 832 | return IL_FALSE; |
| 833 | } |
| 834 | |
| 835 | |
| 836 | ILboolean ReadMipmaps(ILuint CompFormat) |
no test coverage detected