Images/[Compressed]ImageData can be created using any Data, instead of just files or FileData.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-08-05 23:55:20 -03:00
parent 9654376bdd
commit 2dd6408d00
29 changed files with 130 additions and 72 deletions
+3 -2
View File
@@ -19,6 +19,7 @@
**/
#include "ddsHandler.h"
#include "common/Exception.h"
namespace love
{
@@ -27,12 +28,12 @@ namespace image
namespace magpie
{
bool DDSHandler::canParse(const filesystem::FileData *data)
bool DDSHandler::canParse(const Data *data)
{
return dds::isCompressedDDS(data->getData(), data->getSize());
}
StrongRef<CompressedMemory> DDSHandler::parse(filesystem::FileData *filedata, std::vector<StrongRef<CompressedSlice>> &images, PixelFormat &format, bool &sRGB)
StrongRef<CompressedMemory> DDSHandler::parse(Data *filedata, std::vector<StrongRef<CompressedSlice>> &images, PixelFormat &format, bool &sRGB)
{
if (!dds::isDDS(filedata->getData(), filedata->getSize()))
throw love::Exception("Could not decode compressed data (not a DDS file?)");