Merged mage-CompressedData into default

This commit is contained in:
Alex Szpakowski
2013-04-09 23:44:00 -03:00
41 changed files with 2485 additions and 342 deletions
+8 -9
View File
@@ -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))