mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Clean up some compressed texture loading code.
This commit is contained in:
@@ -53,7 +53,7 @@ CompressedImageData::CompressedImageData(const std::list<FormatHandler *> &forma
|
||||
if (format == PIXELFORMAT_UNKNOWN)
|
||||
throw love::Exception("Could not parse compressed data: Unknown format.");
|
||||
|
||||
if (dataImages.size() == 0 || memory->size == 0)
|
||||
if (dataImages.size() == 0 || memory->getSize() == 0)
|
||||
throw love::Exception("Could not parse compressed data: No valid data?");
|
||||
}
|
||||
|
||||
@@ -61,8 +61,7 @@ CompressedImageData::CompressedImageData(const CompressedImageData &c)
|
||||
: format(c.format)
|
||||
, sRGB(c.sRGB)
|
||||
{
|
||||
memory.set(new CompressedMemory(c.memory->size), Acquire::NORETAIN);
|
||||
memcpy(memory->data, c.memory->data, memory->size);
|
||||
memory.set(c.memory->clone(), Acquire::NORETAIN);
|
||||
|
||||
for (const auto &i : c.dataImages)
|
||||
{
|
||||
@@ -83,12 +82,12 @@ CompressedImageData::~CompressedImageData()
|
||||
|
||||
size_t CompressedImageData::getSize() const
|
||||
{
|
||||
return memory->size;
|
||||
return memory->getSize();
|
||||
}
|
||||
|
||||
void *CompressedImageData::getData() const
|
||||
{
|
||||
return memory->data;
|
||||
return memory->getData();
|
||||
}
|
||||
|
||||
int CompressedImageData::getMipmapCount() const
|
||||
|
||||
Reference in New Issue
Block a user