Hi Fred
// To avoid having to include DirectX headers in the FlyLegacy
development environment,
// the DDSURFACEDESC2 struct definition is copied here from ddraw.h
//
#ifndef MAKEFOURCC
#define MAKEFOURCC(ch0, ch1, ch2,
ch3) \
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) < 8) | \
((DWORD)(BYTE)(ch2) < 16) | ((DWORD)(BYTE)(ch3) <
24 ))
#endif //defined(MAKEFOURCC)
/*
* FOURCC codes for DX compressed-texture pixel formats
*/
#define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1'))
#define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2'))
#define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3'))
#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4'))
#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5'))
....
....
// Read surface descriptor and set relevant class data members
UINT8 factor = 0;
DDSURFACEDESC2 ddsd;
pread (&ddsd, sizeof(ddsd), 1, p);
mipCount = ddsd.dwMipMapCount;
width = ddsd.dwWidth;
height = ddsd.dwHeight;
switch (ddsd.ddpfPixelFormat.dwFourCC)
{
case FOURCC_DXT1:
if (ddsd.dwAlphaBitDepth > 0) {
format = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
} else {
format = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
}
factor = 2;
break;
case FOURCC_DXT3:
etc.
I reverted to the original switch and get that error now:
.../Utility/ImageDXT.cpp:220: error: duplicate case value
.../Utility/ImageDXT.cpp:212: error: previously used here
Line 212 is the above line with the first case command
Many thanks
Michael