mirror of
https://github.com/love2d/love.git
synced 2026-08-14 01:20:56 +02:00
Merged mage-CompressedData into default
This commit is contained in:
@@ -20,8 +20,6 @@
|
||||
|
||||
#include "ImageData.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
using love::thread::Lock;
|
||||
|
||||
namespace love
|
||||
@@ -30,6 +28,7 @@ namespace image
|
||||
{
|
||||
|
||||
ImageData::ImageData()
|
||||
: data(0)
|
||||
{
|
||||
mutex = thread::newMutex();
|
||||
}
|
||||
@@ -39,14 +38,19 @@ ImageData::~ImageData()
|
||||
delete mutex;
|
||||
}
|
||||
|
||||
int ImageData::getSize() const
|
||||
{
|
||||
return getWidth()*getHeight()*sizeof(pixel);
|
||||
}
|
||||
|
||||
void *ImageData::getData() const
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
int ImageData::getSize() const
|
||||
bool ImageData::inside(int x, int y) const
|
||||
{
|
||||
return getWidth()*getHeight()*sizeof(pixel);
|
||||
return x >= 0 && x < getWidth() && y >= 0 && y < getHeight();
|
||||
}
|
||||
|
||||
int ImageData::getWidth() const
|
||||
@@ -59,11 +63,6 @@ int ImageData::getHeight() const
|
||||
return height;
|
||||
}
|
||||
|
||||
bool ImageData::inside(int x, int y) const
|
||||
{
|
||||
return x >= 0 && x < getWidth() && y >= 0 && y < getHeight();
|
||||
}
|
||||
|
||||
void ImageData::setPixel(int x, int y, pixel c)
|
||||
{
|
||||
if (!inside(x, y))
|
||||
|
||||
Reference in New Issue
Block a user