mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Renamed some internal functions to avoid name conflicts when some third-party code is #included.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ inline uint16 swap16big(uint16 x)
|
||||
#ifdef LOVE_BIG_ENDIAN
|
||||
return x;
|
||||
#else
|
||||
return swap16(x);
|
||||
return swapuint16(x);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user