1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-02-03 18:14:01 +00:00

Allow custom capes in mods

This commit is contained in:
fgenesis 2015-03-09 04:55:03 +01:00
parent b70de7f94b
commit 9973afbac6
5 changed files with 18 additions and 25 deletions

View file

@ -4110,34 +4110,18 @@ void Avatar::refreshNormalForm()
if (c.empty())
c = "Naija";
refreshModel("Naija", c);
if (true)
if(hair)
{
if (hair)
hair->alphaMod = 1.0;
if (!c.empty() && c!="Naija")
{
if (exists(core->getBaseTextureDirectory() + "naija/cape-"+c+".png"))
{
if (hair)
hair->setTexture("naija/cape-"+c);
}
else
{
if (hair)
if (Texture::textureError != TEXERR_OK)
hair->alphaMod = 0;
}
}
else
{
if (hair)
hair->setTexture("naija/cape");
}
}
else
{
if (hair)
hair->alphaMod = 0.0;
}
}
void Avatar::refreshModel(std::string file, const std::string &skin, bool forceIdle)

View file

@ -4484,7 +4484,7 @@ Texture *Core::doTextureAdd(const std::string &texture, const std::string &loadN
{
t->addRef();
Texture::textureError = TEXERR_OK;
Texture::textureError = t->failed ? TEXERR_FILENOTFOUND : TEXERR_OK;
/*
std::ostringstream os;

View file

@ -1328,8 +1328,11 @@ void RenderObject::setTexture(const std::string &n)
if (name.empty())
return;
if(texture && texture->name == core->getInternalTextureName(name))
if(texture && !texture->failed && texture->name == core->getInternalTextureName(name))
{
Texture::textureError = TEXERR_OK;
return; // no texture change
}
Texture *oldtex = texture;
Texture *t = core->addTexture(name);

View file

@ -68,6 +68,7 @@ Texture::Texture() : Resource()
repeat = false;
repeating = false;
failed = false;
pngSetStandardOrientation(0);
ow = oh = -1;
@ -273,11 +274,13 @@ void Texture::reload()
void Texture::load(std::string file)
{
Texture::textureError = TEXERR_OK;
failed = false;
if (file.size()<4)
{
errorLog("Texture Name is Empty or Too Short");
Texture::textureError = TEXERR_FILENOTFOUND;
failed = true;
return;
}
@ -365,6 +368,7 @@ void Texture::load(std::string file)
Texture::textureError = TEXERR_FILENOTFOUND;
width = 64;
height = 64;
failed = true;
}
}
else
@ -375,6 +379,7 @@ void Texture::load(std::string file)
Texture::textureError = TEXERR_FILENOTFOUND;
width = 64;
height = 64;
failed = true;
}
}
@ -464,6 +469,7 @@ void Texture::loadPNG(const std::string &file)
width = 64;
height = 64;
Texture::textureError = TEXERR_FILENOTFOUND;
failed = true;
}
if(memptr)

View file

@ -62,7 +62,7 @@ public:
static ImageTGA *TGAloadMem(void *mem, int size);
static bool useMipMaps;
bool repeat, repeating;
bool repeat, repeating, failed;
#ifdef BBGE_BUILD_OPENGL
static GLint filter;