From 54db4fac2983895db09a67e7352db7374712098a Mon Sep 17 00:00:00 2001 From: driAn Date: Sat, 2 Jun 2007 17:33:50 +0000 Subject: [PATCH] no message git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1089 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 1 + source/src/renderhud.cpp | 5 +++-- source/src/weapon.cpp | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 2ff339ba..ec2f152e 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -373,6 +373,7 @@ void dodamage(int damage, int actor, playerent *act, bool gib, playerent *pl) damageblend(damage); demoblend(damage); } + pl->lastpain = lastmillis; int ad = damage*30/100; // let armour absorb when possible if(ad>pl->armour) ad = pl->armour; pl->armour -= ad; diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index 9e6877da..5a2a1a75 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -120,8 +120,9 @@ void drawequipicons() void drawradarent(float x, float y, float yaw, int col, int row, float iconsize, bool pulse, char *label = NULL, ...) { - if(!pulse) glColor3f(1, 1, 1); glPushMatrix(); + if(pulse) glColor4f(1.0f, 1.0f, 1.0f, 0.2f+(sinf(lastmillis/30.0f)+1.0f)/2.0f); + else glColor4f(1, 1, 1, 1); glTranslatef(x, y, 0); glRotatef(yaw, 0, 0, 1); drawradaricon(-iconsize/2.0f, -iconsize/2.0f, iconsize, col, row); @@ -134,6 +135,7 @@ void drawradarent(float x, float y, float yaw, int col, int row, float iconsize, glScalef(1/2.0f, 1/2.0f, 1/2.0f); s_sprintfdv(lbl, label); draw_text(lbl, (int)(x*2), (int)(y*2)); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glDisable(GL_BLEND); glPopMatrix(); } @@ -185,7 +187,6 @@ void drawradar(int w, int h) circle(minimaptex, radarviewsize/2, radarviewsize/2, radarviewsize/2, centerpos.x/worldsize, centerpos.y/worldsize, res/2/worldsize); } glTranslatef(-(centerpos.x-res/2)/worldsize*radarsize, -(centerpos.y-res/2)/worldsize*radarsize, 0); - glColor4f(1.0f, 1.0f, 1.0f, 0.2f+(sinf(lastmillis/50.0f)+1.0f)/2.0f); drawradarent(player1->o.x*coordtrans, player1->o.y*coordtrans, player1->yaw, player1->state==CS_ALIVE ? (isattacking(player1) ? 2 : 0) : 1, 2, iconsize, isattacking(player1), player1->name); // local player diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index fd473304..f9d40488 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -244,7 +244,6 @@ void newprojectile(vec &from, vec &to, float speed, bool local, playerent *owner void hit(int target, int damage, playerent *d, playerent *at, bool gib=false) { - d->lastpain = lastmillis; if(d==player1 || d->type==ENT_BOT) dodamage(damage, -1, at, gib, d); else {