summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Tetelman <kevlarman@gmail.com>2009-10-03 12:00:52 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:36 +0000
commit9671a190ea89feb7103a31c878e31a65494e6736 (patch)
treed809d009e44ed75a3226c1af6ffc3a643670b9bb
parent33f9c3de4cc37723e847d78c2a5922bbeb1a314a (diff)
* Add hud support for location entities (ownerdraw CG_PLAYER_LOCATION)
* Fix dumb typo left from debugging in last revision
-rw-r--r--src/cgame/cg_draw.c19
-rw-r--r--ui/menudef.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 223bba86..8f19c341 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -2255,6 +2255,22 @@ static void CG_ScanForCrosshairEntity( void )
/*
=====================
+CG_DrawLocation
+=====================
+*/
+static void CG_DrawLocation( rectDef_t *rect, float scale, vec4_t color )
+{
+ const char *location;
+ float maxX;
+ maxX = rect->x + rect->w;
+ location = CG_ConfigString( CS_LOCATIONS + cgs.clientinfo[ cg.clientNum ].location );
+
+ UI_Text_Paint_Limit( &maxX, rect->x, rect->y, scale, color, location, 0, 0 );
+ trap_R_SetColor( NULL );
+}
+
+/*
+=====================
CG_DrawCrosshairNames
=====================
*/
@@ -2403,6 +2419,9 @@ void CG_OwnerDraw( float x, float y, float w, float h, float text_x,
case CG_SPECTATORS:
CG_DrawTeamSpectators( &rect, scale, textvalign, color, shader );
break;
+ case CG_PLAYER_LOCATION:
+ CG_DrawLocation( &rect, scale, color );
+ break;
case CG_PLAYER_CROSSHAIRNAMES:
CG_DrawCrosshairNames( &rect, scale, textStyle );
break;
diff --git a/ui/menudef.h b/ui/menudef.h
index 629655bf..6290cf42 100644
--- a/ui/menudef.h
+++ b/ui/menudef.h
@@ -178,5 +178,6 @@
#define CG_PLAYER_CHARGE_BAR_BG 76
#define CG_PLAYER_CHARGE_BAR 77
#define CG_PLAYER_CROSSHAIR 78
+#define CG_PLAYER_LOCATION 79
#endif