mojodds.c
changeset 11 7e2785b01d10
parent 10 1e5f3d130b53
equal deleted inserted replaced
10:1e5f3d130b53 11:7e2785b01d10
   172     {
   172     {
   173         switch (header->ddspf.dwFourCC)
   173         switch (header->ddspf.dwFourCC)
   174         {
   174         {
   175             case FOURCC_DXT1:
   175             case FOURCC_DXT1:
   176                 *_glfmt = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
   176                 *_glfmt = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
   177                 calcSize = ((width ? ((width + 3) / 4) : 1) * 8) * height;
   177                 calcSize = ((width ? ((width + 3) / 4) : 1) * 8) *
       
   178                            (height ? ((height + 3) / 4) : 1);
   178                 break;
   179                 break;
   179             case FOURCC_DXT3:
   180             case FOURCC_DXT3:
   180                 *_glfmt = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
   181                 *_glfmt = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
   181                 calcSize = ((width ? ((width + 3) / 4) : 1) * 16) * height;
   182                 calcSize = ((width ? ((width + 3) / 4) : 1) * 16) *
       
   183                            (height ? ((height + 3) / 4) : 1);
   182                 break;
   184                 break;
   183             case FOURCC_DXT5:
   185             case FOURCC_DXT5:
   184                 *_glfmt = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
   186                 *_glfmt = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
   185                 calcSize = ((width ? ((width + 3) / 4) : 1) * 16) * height;
   187                 calcSize = ((width ? ((width + 3) / 4) : 1) * 16) *
       
   188                            (height ? ((height + 3) / 4) : 1);
   186                 break;
   189                 break;
   187 
   190 
   188             // !!! FIXME: DX10 is an extended header, introduced by DirectX 10.
   191             // !!! FIXME: DX10 is an extended header, introduced by DirectX 10.
   189             //case FOURCC_DX10: do_something(); break;
   192             //case FOURCC_DX10: do_something(); break;
   190 
   193