mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Fixed loading BC4 compressed textures
This commit is contained in:
@@ -2048,7 +2048,7 @@
|
||||
08FB7793FE84155DC02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0500;
|
||||
LastUpgradeCheck = 0510;
|
||||
};
|
||||
buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "love-framework" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
29B97313FDCFA39411CA2CEA /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0500;
|
||||
LastUpgradeCheck = 0510;
|
||||
};
|
||||
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "love" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
|
||||
@@ -237,36 +237,37 @@ size_t Parser::getMipmapCount() const
|
||||
|
||||
size_t Parser::parseImageSize(Format fmt, int width, int height) const
|
||||
{
|
||||
size_t size = 0;
|
||||
size_t numBlocksWide = 0;
|
||||
size_t numBlocksHigh = 0;
|
||||
size_t numBytesPerBlock = 0;
|
||||
|
||||
switch (fmt)
|
||||
{
|
||||
case FORMAT_DXT1:
|
||||
case FORMAT_BC4:
|
||||
case FORMAT_BC4s:
|
||||
numBytesPerBlock = 8;
|
||||
break;
|
||||
case FORMAT_DXT3:
|
||||
case FORMAT_DXT5:
|
||||
case FORMAT_BC5s:
|
||||
case FORMAT_BC5:
|
||||
case FORMAT_BC6H:
|
||||
case FORMAT_BC7:
|
||||
case FORMAT_BC7srgb:
|
||||
{
|
||||
int numBlocksWide = 0;
|
||||
if (width > 0)
|
||||
numBlocksWide = std::max(1, (width + 3) / 4);
|
||||
|
||||
int numBlocksHigh = 0;
|
||||
if (height > 0)
|
||||
numBlocksHigh = std::max(1, (height + 3) / 4);
|
||||
|
||||
int numBytesPerBlock = (fmt == FORMAT_DXT1 ? 8 : 16);
|
||||
|
||||
size = numBlocksWide * numBytesPerBlock * numBlocksHigh;
|
||||
}
|
||||
numBytesPerBlock = 16;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return size;
|
||||
if (width > 0)
|
||||
numBlocksWide = std::max(1, (width + 3) / 4);
|
||||
|
||||
if (height > 0)
|
||||
numBlocksHigh = std::max(1, (height + 3) / 4);
|
||||
|
||||
return numBlocksWide * numBytesPerBlock * numBlocksHigh;
|
||||
}
|
||||
|
||||
bool Parser::parseTexData(const uint8_t *data, size_t dataSize, Format fmt, int w, int h, int mips)
|
||||
|
||||
@@ -716,10 +716,6 @@ static const struct luaL_Reg enet_peer_funcs [] = {
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
static const struct luaL_Reg enet_event_funcs [] = {
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
int luaopen_enet(lua_State *l) {
|
||||
enet_initialize();
|
||||
atexit(enet_deinitialize);
|
||||
|
||||
Reference in New Issue
Block a user