Explorar o código

Fixed missing defines for windows.

setaylor %!s(int64=14) %!d(string=hai) anos
pai
achega
22495d3dbe
Modificáronse 2 ficheiros con 2 adicións e 21 borrados
  1. 0 1
      gameplay/src/Base.h
  2. 2 20
      gameplay/src/Texture.cpp

+ 0 - 1
gameplay/src/Base.h

@@ -204,7 +204,6 @@ extern void printError(const char* format, ...);
 #elif WIN32
     #define WIN32_LEAN_AND_MEAN
     #include <GL/glew.h>
-	#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG		0x8C02
 #elif __APPLE__
     #include "TargetConditionals.h"
     #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR

+ 2 - 20
gameplay/src/Texture.cpp

@@ -152,6 +152,7 @@ Texture* Texture::createCompressedPVR(const char* path)
 	    PVRTextureFlagTypePVRTC_2 = 24,
 	    PVRTextureFlagTypePVRTC_4
 	};
+
 	struct pvr_file_header
 	{
 		unsigned int size;          		// size of the structure
@@ -198,6 +199,7 @@ Texture* Texture::createCompressedPVR(const char* path)
 		fclose(file);
 	    return NULL;
 	}
+
 	// Format flags for GLenum format
 	GLenum format;
 	unsigned int formatFlags = header.formatflags & 0xff;
@@ -254,33 +256,13 @@ Texture* Texture::createCompressedPVR(const char* path)
 	{
 		if (formatFlags == PVRTextureFlagTypePVRTC_4)
 		{
-			/*
-			blockSize = 4 * 4; 		// Pixel by pixel block size for 4bpp
-			widthBlocks = width / 4;
-			heightBlocks = height / 4;
-			bpp = 4;
-			*/
 			dataSize = ( max((int)width, 8) * max((int)height, 8) * 4 + 7) / 8;
 		}
 		else
 		{
-			/*
-			blockSize = 8 * 4; 		// Pixel by pixel block size for 2bpp
-			widthBlocks = width / 8;
-			heightBlocks = height / 4;
-			bpp = 2;
-			*/
 			dataSize = ( max((int)width, 16) * max((int)height, 8) * 2 + 7) / 8;
 		}
 
-		/* Clamp to minimum number of blocks
-		if (widthBlocks < 2)
-			widthBlocks = 2;
-		if (heightBlocks < 2)
-			heightBlocks = 2;
-*/
-		//dataSize = widthBlocks * heightBlocks * ((blockSize * bpp) / 8);
-
 		GL_ASSERT( glCompressedTexImage2D(GL_TEXTURE_2D, level, (GLenum)format, width, height, 0, dataSize, dataOffset) );
 
 		dataOffset += dataSize;