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

Refactor texture loading code; should fix a crash that started appearing recently.

This commit is contained in:
fgenesis 2015-03-24 00:06:51 +01:00
parent 66cf20ffa9
commit f0d580d873
22 changed files with 255 additions and 387 deletions

View file

@ -83,18 +83,14 @@ public:
static RenderObjectLayer *rlayer;
enum AddRefChoice { NO_ADD_REF = 0, ADD_REF = 1};
void setTexturePointer(Texture *t, AddRefChoice addRefChoice)
void setTexturePointer(CountedPtr<Texture> t)
{
this->texture = t;
if (addRefChoice == ADD_REF)
texture->addRef();
onSetTexture();
}
void setStateDataObject(StateData *state);
void setTexture(const std::string &name);
bool setTexture(const std::string &name);
void toggleAlpha(float t = 0.2);
void matrixChain();
@ -239,7 +235,7 @@ public:
InterpolatedVector offset, rotationOffset, internalOffset, beforeScaleOffset;
InterpolatedVector velocity, gravity;
Texture *texture;
CountedPtr<Texture> texture;
//int mode;