summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman Tetelman <kevlarman@gmail.com>2009-10-03 12:02:11 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:37 +0000
commitdc94850a57da6e2eba3d0dfcb57265c883438d92 (patch)
tree624bb0db80abc1517d01b0da09b07ab128552c53 /src
parent49068a11006c30cb814104f2a9c5ea5629fc8487 (diff)
* crosshairs now use the center of the rectangle defined by the hud for their position, instead of cg_crosshairX/cg_crosshairY
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_draw.c8
-rw-r--r--src/cgame/cg_local.h2
-rw-r--r--src/cgame/cg_main.c4
3 files changed, 4 insertions, 10 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 0e79fcef..5f28cc57 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -2176,10 +2176,10 @@ static void CG_DrawCrosshair( rectDef_t *rect, vec4_t color )
w = h = wi->crossHairSize * cg_crosshairSize.value;
w *= cgDC.aspectScale;
- //FIXME: find a way to use rect from the hud instead of cg_crosshair[XY]
- //the different sizes of the crosshairs make this a pain
- x = 320 + cg_crosshairX.integer - ( w / 2 );
- y = 240 + cg_crosshairY.integer - ( h / 2 );
+ //FIXME: this still ignores the width/height of the rect, but at least it's
+ //neater than cg_crosshairX/cg_crosshairY
+ x = rect->x + ( rect->w / 2 ) - ( w / 2 );
+ y = rect->y + ( rect->h / 2 ) - ( h / 2 );
hShader = wi->crossHair;
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 72a61fc2..6301919f 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1444,8 +1444,6 @@ extern vmCvar_t cg_drawSnapshot;
extern vmCvar_t cg_drawChargeBar;
extern vmCvar_t cg_drawCrosshair;
extern vmCvar_t cg_drawCrosshairNames;
-extern vmCvar_t cg_crosshairX;
-extern vmCvar_t cg_crosshairY;
extern vmCvar_t cg_crosshairSize;
extern vmCvar_t cg_draw2D;
extern vmCvar_t cg_drawStatus;
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 4abe55f1..7925b659 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -116,8 +116,6 @@ vmCvar_t cg_drawSnapshot;
vmCvar_t cg_drawChargeBar;
vmCvar_t cg_drawCrosshair;
vmCvar_t cg_drawCrosshairNames;
-vmCvar_t cg_crosshairX;
-vmCvar_t cg_crosshairY;
vmCvar_t cg_crosshairSize;
vmCvar_t cg_draw2D;
vmCvar_t cg_drawStatus;
@@ -241,8 +239,6 @@ static cvarTable_t cvarTable[ ] =
{ &cg_drawChargeBar, "cg_drawChargeBar", "1", CVAR_ARCHIVE },
{ &cg_drawCrosshair, "cg_drawCrosshair", "1", CVAR_ARCHIVE },
{ &cg_drawCrosshairNames, "cg_drawCrosshairNames", "1", CVAR_ARCHIVE },
- { &cg_crosshairX, "cg_crosshairX", "0", CVAR_ARCHIVE },
- { &cg_crosshairY, "cg_crosshairY", "0", CVAR_ARCHIVE },
{ &cg_crosshairSize, "cg_crosshairSize", "1", CVAR_ARCHIVE },
{ &cg_brassTime, "cg_brassTime", "2500", CVAR_ARCHIVE },
{ &cg_addMarks, "cg_marks", "1", CVAR_ARCHIVE },