mirror of
https://github.com/love2d/love.git
synced 2026-08-20 20:49:54 +02:00
Images/[Compressed]ImageData can be created using any Data, instead of just files or FileData.
--HG-- branch : minor
This commit is contained in:
@@ -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?)");
|
||||
|
||||
Reference in New Issue
Block a user