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
@@ -97,7 +97,7 @@ static PixelFormat convertFormat(uint16 texformat)
} // Anonymous namespace.
bool PKMHandler::canParse(const Data *data)
bool PKMHandler::canParseCompressed(Data *data)
{
if (data->getSize() <= sizeof(PKMHeader))
return false;
@@ -114,9 +114,9 @@ bool PKMHandler::canParse(const Data *data)
return true;
}
StrongRef<CompressedMemory> PKMHandler::parse(Data *filedata, std::vector<StrongRef<CompressedSlice>> &images, PixelFormat &format, bool &sRGB)
StrongRef<CompressedMemory> PKMHandler::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 a PKM file?)");
PKMHeader header = *(const PKMHeader *) filedata->getData();