above head icon blending, voicecom menu

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1651 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2008-02-16 18:10:45 +00:00
parent 274724923c
commit 6e04c5a7a8
4 changed files with 16 additions and 14 deletions
+5 -4
View File
@@ -261,22 +261,23 @@ void blendbox(int x1, int y1, int x2, int y2, bool border, int tex, color *c)
}
VARP(aboveheadiconsize, 0, 50, 1000);
VARP(aboveheadiconfadetime, 1, 1000, 10000);
VARP(aboveheadiconfadetime, 1, 2000, 10000);
void renderaboveheadicon(playerent *p)
{
int t = lastmillis-p->lastvoicecom;
if(!aboveheadiconsize || !p->lastvoicecom || t > aboveheadiconfadetime) return;
glPushMatrix();
glDisable(GL_CULL_FACE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glTranslatef(p->o.x, p->o.y, p->o.z+p->aboveeye);
glRotatef(camera1->yaw-180, 0, 0, 1);
glColor3f(1.0f, 1.0f, 1.0f);
glColor3f(1.0f, 0.0f, 0.0f);
static Texture *tex = NULL;
if(!tex) tex = textureload("packages/misc/com.png");
float s = aboveheadiconsize/100.0f;
quad(tex->id, vec(s/2.0f, 0.0f, s), vec(s/-2.0f, 0.0f, 0.0f), 0.0f, 0.0f, 1.0f, 1.0f);
glEnable(GL_CULL_FACE);
glDisable(GL_BLEND);
glPopMatrix();
}