Browse Source

Added ETC1 compressed texture support.

sgrenier 12 years ago
parent
commit
3538eb7c33
1 changed files with 9 additions and 0 deletions
  1. 9 0
      gameplay/src/Texture.cpp

+ 9 - 0
gameplay/src/Texture.cpp

@@ -39,6 +39,11 @@
 #define ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
 #define ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
 #endif
 #endif
 
 
+// ETC1 (OES_compressed_ETC1_RGB8_texture) : All OpenGL ES chipsets
+#ifndef ETC1_RGB8
+#define ETC1_RGB8 0x8D64
+#endif
+
 namespace gameplay
 namespace gameplay
 {
 {
 
 
@@ -624,6 +629,10 @@ Texture* Texture::createCompressedDDS(const char* path)
             format = internalFormat = ATC_RGBA_INTERPOLATED_ALPHA_AMD;
             format = internalFormat = ATC_RGBA_INTERPOLATED_ALPHA_AMD;
             bytesPerBlock = 16;
             bytesPerBlock = 16;
             break;
             break;
+        case ('E'|('T'<<8)|('C'<<16)|('1'<<24)):
+            format = internalFormat = ETC1_RGB8;
+            bytesPerBlock = 8;
+            break;
         default:
         default:
             GP_ERROR("Unsupported compressed texture format (%d) for DDS file '%s'.", header.ddspf.dwFourCC, path);
             GP_ERROR("Unsupported compressed texture format (%d) for DDS file '%s'.", header.ddspf.dwFourCC, path);
             SAFE_DELETE_ARRAY(mipLevels);
             SAFE_DELETE_ARRAY(mipLevels);