summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/gfx/2d/numbers_alt/0.tgabin1038 -> 12306 bytes
-rw-r--r--assets/gfx/2d/numbers_alt/1.tgabin772 -> 12306 bytes
-rw-r--r--assets/gfx/2d/numbers_alt/2.tgabin854 -> 12306 bytes
-rw-r--r--assets/gfx/2d/numbers_alt/3.tgabin786 -> 12306 bytes
-rw-r--r--assets/gfx/2d/numbers_alt/4.tgabin860 -> 12306 bytes
-rw-r--r--assets/gfx/2d/numbers_alt/5.tgabin834 -> 12306 bytes
-rw-r--r--assets/gfx/2d/numbers_alt/6.tgabin904 -> 12306 bytes
-rw-r--r--assets/gfx/2d/numbers_alt/7.tgabin710 -> 12306 bytes
-rw-r--r--assets/gfx/2d/numbers_alt/8.tgabin1102 -> 12306 bytes
-rw-r--r--assets/gfx/2d/numbers_alt/9.tgabin904 -> 12306 bytes
-rw-r--r--assets/gfx/2d/numbers_alt/minus.tgabin282 -> 12306 bytes
-rw-r--r--assets/gfx/2d/numbers_alt/slash.tgabin0 -> 12306 bytes
-rw-r--r--src/cgame/cg_draw.c56
-rw-r--r--src/cgame/cg_local.h2
-rw-r--r--src/cgame/cg_main.c5
-rw-r--r--src/game/g_combat.c47
16 files changed, 52 insertions, 58 deletions
diff --git a/assets/gfx/2d/numbers_alt/0.tga b/assets/gfx/2d/numbers_alt/0.tga
index ed72ed5..73afce3 100644
--- a/assets/gfx/2d/numbers_alt/0.tga
+++ b/assets/gfx/2d/numbers_alt/0.tga
Binary files differ
diff --git a/assets/gfx/2d/numbers_alt/1.tga b/assets/gfx/2d/numbers_alt/1.tga
index 8267352..787a23f 100644
--- a/assets/gfx/2d/numbers_alt/1.tga
+++ b/assets/gfx/2d/numbers_alt/1.tga
Binary files differ
diff --git a/assets/gfx/2d/numbers_alt/2.tga b/assets/gfx/2d/numbers_alt/2.tga
index 92414db..68d71a5 100644
--- a/assets/gfx/2d/numbers_alt/2.tga
+++ b/assets/gfx/2d/numbers_alt/2.tga
Binary files differ
diff --git a/assets/gfx/2d/numbers_alt/3.tga b/assets/gfx/2d/numbers_alt/3.tga
index 862606a..3c60a17 100644
--- a/assets/gfx/2d/numbers_alt/3.tga
+++ b/assets/gfx/2d/numbers_alt/3.tga
Binary files differ
diff --git a/assets/gfx/2d/numbers_alt/4.tga b/assets/gfx/2d/numbers_alt/4.tga
index bd7e6cc..43124f1 100644
--- a/assets/gfx/2d/numbers_alt/4.tga
+++ b/assets/gfx/2d/numbers_alt/4.tga
Binary files differ
diff --git a/assets/gfx/2d/numbers_alt/5.tga b/assets/gfx/2d/numbers_alt/5.tga
index 0de619f..42ae6ec 100644
--- a/assets/gfx/2d/numbers_alt/5.tga
+++ b/assets/gfx/2d/numbers_alt/5.tga
Binary files differ
diff --git a/assets/gfx/2d/numbers_alt/6.tga b/assets/gfx/2d/numbers_alt/6.tga
index 770ee54..747b73e 100644
--- a/assets/gfx/2d/numbers_alt/6.tga
+++ b/assets/gfx/2d/numbers_alt/6.tga
Binary files differ
diff --git a/assets/gfx/2d/numbers_alt/7.tga b/assets/gfx/2d/numbers_alt/7.tga
index cf173e7..4431943 100644
--- a/assets/gfx/2d/numbers_alt/7.tga
+++ b/assets/gfx/2d/numbers_alt/7.tga
Binary files differ
diff --git a/assets/gfx/2d/numbers_alt/8.tga b/assets/gfx/2d/numbers_alt/8.tga
index 21a0b54..5339ef6 100644
--- a/assets/gfx/2d/numbers_alt/8.tga
+++ b/assets/gfx/2d/numbers_alt/8.tga
Binary files differ
diff --git a/assets/gfx/2d/numbers_alt/9.tga b/assets/gfx/2d/numbers_alt/9.tga
index d548695..f05f81c 100644
--- a/assets/gfx/2d/numbers_alt/9.tga
+++ b/assets/gfx/2d/numbers_alt/9.tga
Binary files differ
diff --git a/assets/gfx/2d/numbers_alt/minus.tga b/assets/gfx/2d/numbers_alt/minus.tga
index 2129858..d7570d5 100644
--- a/assets/gfx/2d/numbers_alt/minus.tga
+++ b/assets/gfx/2d/numbers_alt/minus.tga
Binary files differ
diff --git a/assets/gfx/2d/numbers_alt/slash.tga b/assets/gfx/2d/numbers_alt/slash.tga
new file mode 100644
index 0000000..f44acda
--- /dev/null
+++ b/assets/gfx/2d/numbers_alt/slash.tga
Binary files differ
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index f57e44a..09777b6 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -3888,7 +3888,7 @@ static void CG_DrawNumber( float x, float y, float h, char *str )
char *p;
len = strlen( str );
- w = h * cgDC.aspectScale * 0.5f;
+ w = h * cgDC.aspectScale * 0.75f;
y -= h / 2;
x -= len * w / 2;
@@ -3897,10 +3897,14 @@ static void CG_DrawNumber( float x, float y, float h, char *str )
{
if( *p >= '0' && *p <= '9' )
index = *p - '0';
- else
+ else if( *p == '.' )
index = 10;
-
- CG_DrawPic( x, y, w, h, cgs.media.numberShadersAlt[ index ] );
+ else
+ index = 11;
+
+ if( *p != ' ' )
+ CG_DrawPic( x, y, w, h, cgs.media.numberShadersAlt[ index ] );
+
x += w;
}
}
@@ -3932,7 +3936,7 @@ static void CG_DrawDamageBlobs( void )
fade = 1.0f - (float)( cg.time - blob->spawnTime ) / DAMAGE_BLOB_TIME;
- scale = cg_damageBlobSize.value /
+ scale = 0.75f * cg_damageBlobSize.value /
pow( Distance( blob->origin, cg.refdef.vieworg ), 0.5f );
Com_sprintf( str, sizeof( str ), "%d", blob->value );
@@ -3984,7 +3988,7 @@ typedef struct
static int CompareHealthBars( const healthBar_t *a, const healthBar_t *b )
{
- return a->dist < b->dist;
+ return ( a->dist < b->dist ? 1 : -1 );
}
static void CG_DrawHealthBars( void )
@@ -4047,44 +4051,50 @@ static void CG_DrawHealthBars( void )
qsort( bars, bare - bars, sizeof( healthBar_t ),
(int(*)(const void*,const void*))CompareHealthBars );
-/*
- TODO: figure out why qsort fails for more than 5 bars
-
- for( i = 0; i < bare - bars - 1; i++ )
- if( CompareHealthBars( bars + i, bars + i + 1 ) )
- {
- Com_Printf( "qsort is retarded\n" );
- break;
- }
-*/
-
for( bar = bars; bar < bare; bar++ )
{
- float x, y, w, h, hf;
+ float x, y, w, h, hf, cf;
char buffer[ 64 ];
vec4_t color;
+ if( bar->value >= bar->max )
+ continue;
+
if( !CG_WorldToScreen( bar->origin, &x, &y ) )
continue;
hf = (float)bar->value / bar->max;
h = cg_healthBarSize.value / bar->dist;
- w = 4 * h * cgDC.aspectScale;
+ w = 6 * h * cgDC.aspectScale;
- Com_sprintf( buffer, sizeof( buffer ), "%d", bar->value );
+ Com_sprintf( buffer, sizeof( buffer ), "%d/%d", bar->value, bar->max );
color[ 3 ] = cg_healthBarAlpha.value;
- VectorSet( color, 0.1, 0.7, 0.1 );
+ if( hf <= 1.0f && hf > 0.5f )
+ {
+ cf = ( hf - 0.5f ) / 0.5f;
+ VectorSet( color, 1 - cf, 1.0f, 0.0f );
+ }
+ else
+ {
+ cf = hf / 0.5f;
+ VectorSet( color, 1.0f, cf, 0.0f );
+ }
+
+ VectorScale( color, 0.5f, color );
+
trap_R_SetColor( color );
CG_DrawPic( x - w/2, y - h/2, w * hf, h, cgs.media.whiteShader );
- VectorSet( color, 0.7, 0.1, 0.1 );
+
+
+ VectorSet( color, 0.1, 0.1, 0.1 );
trap_R_SetColor( color );
CG_DrawPic( x - w/2 + w * hf, y - h/2, w * ( 1 - hf ), h, cgs.media.whiteShader );
- VectorSet( color, 0, 0, 0 );
+ VectorSet( color, 1, 1, 1 );
trap_R_SetColor( color );
CG_DrawNumber( x, y, h, buffer );
}
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 83cac63..2d2598c 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1198,7 +1198,7 @@ typedef struct
qhandle_t teamOverlayShader;
qhandle_t numberShaders[ 11 ];
- qhandle_t numberShadersAlt[ 11 ];
+ qhandle_t numberShadersAlt[ 12 ];
qhandle_t shadowMarkShader;
qhandle_t wakeMarkShader;
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 0fdb028..9e51258 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -781,7 +781,7 @@ static void CG_RegisterGraphics( void )
"gfx/2d/numbers/nine_32b",
"gfx/2d/numbers/minus_32b",
};
- static char *sb_nums_alt[ 11 ] =
+ static char *sb_nums_alt[ 12 ] =
{
"gfx/2d/numbers_alt/0",
"gfx/2d/numbers_alt/1",
@@ -794,6 +794,7 @@ static void CG_RegisterGraphics( void )
"gfx/2d/numbers_alt/8",
"gfx/2d/numbers_alt/9",
"gfx/2d/numbers_alt/minus",
+ "gfx/2d/numbers_alt/slash",
};
static char *buildWeaponTimerPieShaders[ 8 ] =
{
@@ -817,7 +818,7 @@ static void CG_RegisterGraphics( void )
for( i = 0; i < 11; i++ )
cgs.media.numberShaders[ i ] = trap_R_RegisterShader( sb_nums[ i ] );
- for( i = 0; i < 11; i++ )
+ for( i = 0; i < 12; i++ )
cgs.media.numberShadersAlt[ i ] = trap_R_RegisterShader( sb_nums_alt[ i ] );
cgs.media.viewBloodShader = trap_R_RegisterShader( "gfx/damage/fullscreen_painblend" );
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 1a54981..0c6086d 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -1447,52 +1447,35 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
G_CombatStats_HitMOD( attacker, targ, mod, take );
- if( attacker && attacker->client && take && attacker != targ )
+ if( attacker && attacker->client && take && attacker != targ &&
+ attacker->client->bufferedBlobCount < MAX_BUFFERED_BLOBS )
{
g_damageBlob_t *blob;
- int flags = 0;
- if( attacker->client->bufferedBlobCount == MAX_BUFFERED_BLOBS )
- return;
+ blob = attacker->client->blobBuffer +
+ ( attacker->client->bufferedBlobCount++ );
+
+ blob->flags = 0;
+ blob->value = take;
if( OnSameTeam( attacker, targ ) ||
( targ->s.eType == ET_BUILDABLE &&
attacker->client->pers.teamSelection == targ->buildableTeam ) )
- flags |= DAMAGE_BLOB_FRIENDLY;
+ blob->flags |= DAMAGE_BLOB_FRIENDLY;
if( targ->s.eType == ET_BUILDABLE )
- flags |= DAMAGE_BLOB_BUILDABLE;
+ blob->flags |= DAMAGE_BLOB_BUILDABLE;
if( dflags & DAMAGE_RADIUS )
{
- vec3_t mins = {0}, maxs = {0};
-
- flags |= DAMAGE_BLOB_SPLASH;
-
- switch( targ->s.eType )
- {
- case ET_BUILDABLE:
- BG_BuildableBoundingBox( targ->s.modelindex, mins, maxs );
- break;
-
- case ET_PLAYER:
- BG_ClassBoundingBox( targ->client->ps.stats[ STAT_CLASS ], mins, maxs, NULL, NULL, NULL );
- break;
- }
-
- VectorAdd( mins, maxs, point );
- VectorScale( point, 0.5f, point );
- VectorAdd( point, targ->s.origin, point );
+ blob->flags |= DAMAGE_BLOB_SPLASH;
+ VectorAdd( targ->r.absmin, targ->r.absmax, blob->origin );
+ VectorScale( blob->origin, 0.5f, blob->origin );
}
else if( inflictor->s.eType == ET_MISSILE )
- VectorCopy( inflictor->r.currentOrigin, point );
-
- blob = attacker->client->blobBuffer +
- ( attacker->client->bufferedBlobCount++ );
-
- VectorCopy( point, blob->origin );
- blob->value = take;
- blob->flags = flags;
+ VectorCopy( inflictor->r.currentOrigin, blob->origin );
+ else
+ VectorCopy( point, blob->origin );
}
if( targ->health <= 0 )