Renamed some internal functions to avoid name conflicts when some third-party code is #included.

This commit is contained in:
Alex Szpakowski
2015-08-03 20:27:46 -03:00
parent f2b4438a57
commit 99acec83c9
5 changed files with 20 additions and 20 deletions
+3 -3
View File
@@ -170,7 +170,7 @@ uint8 *KTXHandler::parse(filesystem::FileData *filedata, std::vector<CompressedI
{
uint32 *headerArray = (uint32 *) &header.glType;
for (int i = 0; i < 12; i++)
headerArray[i] = swap32(headerArray[i]);
headerArray[i] = swapuint32(headerArray[i]);
}
header.numberOfMipmapLevels = std::max(header.numberOfMipmapLevels, 1u);
@@ -203,7 +203,7 @@ uint8 *KTXHandler::parse(filesystem::FileData *filedata, std::vector<CompressedI
uint32 mipsize = *(uint32 *) (filebytes + fileoffset);
if (header.endianness == KTX_ENDIAN_REF_REV)
mipsize = swap32(mipsize);
mipsize = swapuint32(mipsize);
fileoffset += sizeof(uint32);
@@ -235,7 +235,7 @@ uint8 *KTXHandler::parse(filesystem::FileData *filedata, std::vector<CompressedI
uint32 mipsize = *(uint32 *) (filebytes + fileoffset);
if (header.endianness == KTX_ENDIAN_REF_REV)
mipsize = swap32(mipsize);
mipsize = swapuint32(mipsize);
fileoffset += sizeof(uint32);
+1 -1
View File
@@ -38,7 +38,7 @@ inline uint16 swap16big(uint16 x)
#ifdef LOVE_BIG_ENDIAN
return x;
#else
return swap16(x);
return swapuint16(x);
#endif
}
+11 -11
View File
@@ -117,7 +117,7 @@ void ConvertPVRHeader(PVRTexHeaderV2 header2, PVRTexHeaderV3 *header3)
// All of the struct's members are uint32 values, so we can do this.
uint32 *headerArray = (uint32 *) &header2;
for (size_t i = 0; i < sizeof(PVRTexHeaderV2) / sizeof(uint32); i++)
headerArray[i] = swap32(headerArray[i]);
headerArray[i] = swapuint32(headerArray[i]);
}
memset(header3, 0, sizeof(PVRTexHeaderV3));
@@ -309,16 +309,16 @@ uint8 *PVRHandler::parse(filesystem::FileData *filedata, std::vector<CompressedI
if (header3.version == PVRTEX3_IDENT_REV)
{
header3.version = PVRTEX3_IDENT;
header3.flags = swap32(header3.flags);
header3.pixelFormat = swap64(header3.pixelFormat);
header3.colorSpace = swap32(header3.colorSpace);
header3.channelType = swap32(header3.channelType);
header3.height = swap32(header3.height);
header3.width = swap32(header3.width);
header3.depth = swap32(header3.depth);
header3.numFaces = swap32(header3.numFaces);
header3.numMipmaps = swap32(header3.numMipmaps);
header3.metaDataSize = swap32(header3.metaDataSize);
header3.flags = swapuint32(header3.flags);
header3.pixelFormat = swapuint64(header3.pixelFormat);
header3.colorSpace = swapuint32(header3.colorSpace);
header3.channelType = swapuint32(header3.channelType);
header3.height = swapuint32(header3.height);
header3.width = swapuint32(header3.width);
header3.depth = swapuint32(header3.depth);
header3.numFaces = swapuint32(header3.numFaces);
header3.numMipmaps = swapuint32(header3.numMipmaps);
header3.metaDataSize = swapuint32(header3.metaDataSize);
}
if (header3.depth > 1)
+2 -2
View File
@@ -63,7 +63,7 @@ public:
// Store the size of the uncompressed data as a header.
#ifdef LOVE_BIG_ENDIAN
// Make sure it's little-endian for storage.
*(uint32 *) compressedbytes = swap32((uint32) dataSize);
*(uint32 *) compressedbytes = swapuint32((uint32) dataSize);
#else
*(uint32 *) compressedbytes = (uint32) dataSize;
#endif
@@ -110,7 +110,7 @@ public:
// Extract the original uncompressed size (stored in our custom header.)
#ifdef LOVE_BIG_ENDIAN
// Convert from stored little-endian to big-endian.
uint32 rawsize = swap32(*(uint32 *) data);
uint32 rawsize = swapuint32(*(uint32 *) data);
#else
uint32 rawsize = *(uint32 *) data;
#endif