mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Simplified some compressed image parsing code.
--HG-- branch : minor
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user