1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-07-03 06:24:32 +00:00

remove semi-broken editor tile alignment functions and related code

This commit is contained in:
fgenesis 2023-05-25 17:54:38 +02:00
parent 74ad8f7804
commit c7c9cae999
4 changed files with 0 additions and 137 deletions

View file

@ -137,62 +137,6 @@ void Texture::destroy()
core->removeTexture(this);
}
// FIXME: this should be recorded at load-time -- fg
int Texture::getPixelWidth()
{
int w = 0, h = 0;
unsigned int size = 0;
unsigned char *data = getBufferAndSize(&w, &h, &size);
if (!data)
return 0;
size_t smallestx = -1, largestx = 0;
for (unsigned int x = 0; x < unsigned(w); x++)
{
for (unsigned int y = 0; y < unsigned(h); y++)
{
unsigned int p = (y*unsigned(w)*4) + (x*4) + 3;
if (p < size && data[p] >= 254)
{
if (x < smallestx)
smallestx = x;
if (x > largestx)
largestx = x;
}
}
}
free(data);
return largestx - smallestx;
}
// FIXME: same as above
int Texture::getPixelHeight()
{
int w = 0, h = 0;
unsigned int size = 0;
unsigned char *data = getBufferAndSize(&w, &h, &size);
if (!data)
return 0;
size_t smallesty = -1, largesty = 0;
for (unsigned int x = 0; x < unsigned(w); x++)
{
for (unsigned int y = 0; y < unsigned(h); y++)
{
size_t p = (y*unsigned(w)*4) + (x*4) + 3;
if (p < size && data[p] >= 254)
{
if (y < smallesty)
smallesty = y;
if (y > largesty)
largesty = y;
}
}
}
free(data);
return largesty - smallesty;
}
void Texture::reload()
{
debugLog("RELOADING TEXTURE: " + name + " with loadName " + loadName + "...");

View file

@ -43,9 +43,6 @@ public:
void apply(bool repeat = false) const;
void unload();
int getPixelWidth();
int getPixelHeight();
void destroy();
int width, height;