Simplified some compressed image parsing code.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-08-30 22:25:26 -03:00
parent 907630b04c
commit a41f78dfe4
26 changed files with 101 additions and 161 deletions
+3 -3
View File
@@ -87,7 +87,7 @@ static PixelFormat convertFormat(uint32 blockX, uint32 blockY, uint32 blockZ)
} // Anonymous namespace.
bool ASTCHandler::canParse(const Data *data)
bool ASTCHandler::canParseCompressed(Data *data)
{
if (data->getSize() <= sizeof(ASTCHeader))
return false;
@@ -105,9 +105,9 @@ bool ASTCHandler::canParse(const Data *data)
return true;
}
StrongRef<CompressedMemory> ASTCHandler::parse(Data *filedata, std::vector<StrongRef<CompressedSlice>> &images, PixelFormat &format, bool &sRGB)
StrongRef<CompressedMemory> ASTCHandler::parseCompressed(Data *filedata, std::vector<StrongRef<CompressedSlice>> &images, PixelFormat &format, bool &sRGB)
{
if (!canParse(filedata))
if (!canParseCompressed(filedata))
throw love::Exception("Could not decode compressed data (not an .astc file?)");
ASTCHeader header = *(const ASTCHeader *) filedata->getData();