equiptransparency 0||1 - enables transparent items.png - code adapted from SKB

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5187 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
flowtron
2010-06-12 16:13:57 +00:00
parent f3d30dd6dd
commit 18a25de75f
+9 -2
View File
@@ -7,15 +7,22 @@ void drawicon(Texture *tex, float x, float y, float s, int col, int row, float t
if(tex && tex->xs == tex->ys) quad(tex->id, x, y, s, ts*col, ts*row, ts);
}
VARP(equiptransparency, 0, 0, 1);
void drawequipicon(float x, float y, int col, int row, float blend)
{
static Texture *tex = NULL;
if(!tex) tex = textureload("packages/misc/items.png", 4);
if(tex)
{
if(blend) glEnable(GL_BLEND);
if(blend||equiptransparency) glEnable(GL_BLEND);
if(equiptransparency)
{
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4ub(255, 255, 255, 255);
}
drawicon(tex, x, y, 120, col, row, 1/4.0f);
if(blend) glDisable(GL_BLEND);
if(blend||equiptransparency) glDisable(GL_BLEND);
}
}