Jelajahi Sumber

Changed Texture format enum values to closer match naming from GL ones and new Image format enum value names.

Sean Paul Taylor 14 tahun lalu
induk
melakukan
3bde20d644
3 mengubah file dengan 8 tambahan dan 8 penghapusan
  1. 2 2
      gameplay/src/Image.cpp
  2. 2 2
      gameplay/src/Texture.cpp
  3. 4 4
      gameplay/src/Texture.h

+ 2 - 2
gameplay/src/Image.cpp

@@ -65,11 +65,11 @@ Image* Image::create(const char* path)
     switch (colorType)
     {
     case PNG_COLOR_TYPE_RGBA:
-        image->_format = RGBA;
+        image->_format = Image::RGBA;
         break;
 
     case PNG_COLOR_TYPE_RGB:
-        image->_format = RGB;
+        image->_format = Image::RGB;
         break;
 
     default:

+ 2 - 2
gameplay/src/Texture.cpp

@@ -95,9 +95,9 @@ Texture* Texture::create(Image* image, bool generateMipmaps)
     switch (image->getFormat())
     {
     case Image::RGB:
-        return create(RGB888, image->getWidth(), image->getHeight(), image->getData(), generateMipmaps);
+        return create(Texture::RGB, image->getWidth(), image->getHeight(), image->getData(), generateMipmaps);
     case Image::RGBA:
-        return create(RGBA8888, image->getWidth(), image->getHeight(), image->getData(), generateMipmaps);
+        return create(Texture::RGBA, image->getWidth(), image->getHeight(), image->getData(), generateMipmaps);
     }
     
     return NULL;

+ 4 - 4
gameplay/src/Texture.h

@@ -22,10 +22,10 @@ public:
      */
     enum Format
     {
-        ALPHA = GL_ALPHA,
-        RGB888 = GL_RGB,
-        RGBA8888 = GL_RGBA,
-        DEPTH = GL_DEPTH_COMPONENT
+        RGB     = GL_RGB,
+        RGBA    = GL_RGBA,
+        ALPHA   = GL_ALPHA,
+        DEPTH   = GL_DEPTH_COMPONENT
     };
 
     /**