[iortcw] 16/152: SP: Add cg_drawCrosshairBinoc and cg_drawCrosshairReticle cvars

Simon McVittie smcv at debian.org
Fri Sep 8 10:39:39 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.5a
in repository iortcw.

commit becc71839998f61dc93fbc310b310b6477c6a6ca
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Wed Jan 20 20:30:52 2016 -0500

    SP: Add cg_drawCrosshairBinoc and cg_drawCrosshairReticle cvars
    
    These cvars will simulate the look of GL_REPEAT in the sniper and
    binoculars reticles to match look of vanilla game.
    
    Binocular crosshair defaults to off (0)
    Sniper crosshair defaults to on (1)
---
 SP/code/cgame/cg_draw.c  | 11 +++++++++++
 SP/code/cgame/cg_local.h |  2 ++
 SP/code/cgame/cg_main.c  |  4 ++++
 3 files changed, 17 insertions(+)

diff --git a/SP/code/cgame/cg_draw.c b/SP/code/cgame/cg_draw.c
index 08d7ae0..f06940d 100644
--- a/SP/code/cgame/cg_draw.c
+++ b/SP/code/cgame/cg_draw.c
@@ -2141,11 +2141,17 @@ static void CG_DrawWeapReticle( void ) {
 			}
 		}
 
+		if ( cg_drawCrosshairReticle.integer ) {
+			CG_FillRect( 80, 239, 480, 1, color );	// horiz
+			CG_FillRect( 319, 0, 1, 480, color );   // vert
+		}
+
 		// hairs
 		CG_FillRect( 84, 239, 177, 2, color );   // left
 		CG_FillRect( 320, 242, 1, 58, color );   // center top
 		CG_FillRect( 319, 300, 2, 178, color );  // center bot
 		CG_FillRect( 380, 239, 177, 2, color );  // right
+
 	} else if ( weap == WP_SNOOPERSCOPE ) {
 		// sides
 		if ( cg_fixedAspect.integer ) {
@@ -2336,6 +2342,11 @@ static void CG_DrawBinocReticle( void ) {
 			trap_R_DrawStretchPic( w, h, w, h, 1, 1, 0, 0, cgs.media.binocShaderSimpleQ );  // br
 		}
 	}
+
+	if ( cg_drawCrosshairBinoc.integer ) {
+		CG_FillRect( 0, 239, 640, 1, color );	// horiz
+		CG_FillRect( 320, 0, 1, 480, color );   // vert
+	}
 			
 
 	CG_FillRect( 146, 239, 348, 1, color );
diff --git a/SP/code/cgame/cg_local.h b/SP/code/cgame/cg_local.h
index a086ead..fc25e8e 100644
--- a/SP/code/cgame/cg_local.h
+++ b/SP/code/cgame/cg_local.h
@@ -1633,8 +1633,10 @@ extern vmCvar_t cg_drawIcons;
 extern vmCvar_t cg_youGotMail;          //----(SA)	added
 extern vmCvar_t cg_drawAmmoWarning;
 extern vmCvar_t cg_drawCrosshair;
+extern vmCvar_t cg_drawCrosshairBinoc;
 extern vmCvar_t cg_drawCrosshairNames;
 extern vmCvar_t cg_drawCrosshairPickups;
+extern vmCvar_t cg_drawCrosshairReticle;
 extern vmCvar_t cg_hudAlpha;
 extern vmCvar_t cg_useWeapsForZoom;
 extern vmCvar_t cg_weaponCycleDelay;            //----(SA)	added
diff --git a/SP/code/cgame/cg_main.c b/SP/code/cgame/cg_main.c
index e1d8b62..e6f54ad 100644
--- a/SP/code/cgame/cg_main.c
+++ b/SP/code/cgame/cg_main.c
@@ -116,8 +116,10 @@ vmCvar_t cg_drawIcons;
 vmCvar_t cg_youGotMail;         //----(SA)	added
 vmCvar_t cg_drawAmmoWarning;
 vmCvar_t cg_drawCrosshair;
+vmCvar_t cg_drawCrosshairBinoc;
 vmCvar_t cg_drawCrosshairNames;
 vmCvar_t cg_drawCrosshairPickups;
+vmCvar_t cg_drawCrosshairReticle;
 vmCvar_t cg_hudAlpha;
 vmCvar_t cg_weaponCycleDelay;       //----(SA)	added
 vmCvar_t cg_cycleAllWeaps;
@@ -317,8 +319,10 @@ cvarTable_t cvarTable[] = {
 	{ &cg_drawAmmoWarning, "cg_drawAmmoWarning", "1", CVAR_ARCHIVE  },
 	{ &cg_drawAttacker, "cg_drawAttacker", "1", CVAR_ARCHIVE  },
 	{ &cg_drawCrosshair, "cg_drawCrosshair", "4", CVAR_ARCHIVE },
+	{ &cg_drawCrosshairBinoc, "cg_drawCrosshairBinoc", "0", CVAR_ARCHIVE },
 	{ &cg_drawCrosshairNames, "cg_drawCrosshairNames", "1", CVAR_ARCHIVE },
 	{ &cg_drawCrosshairPickups, "cg_drawCrosshairPickups", "1", CVAR_ARCHIVE },
+	{ &cg_drawCrosshairReticle, "cg_drawCrosshairReticle", "1", CVAR_ARCHIVE },
 	{ &cg_drawRewards, "cg_drawRewards", "1", CVAR_ARCHIVE },
 	{ &cg_hudAlpha, "cg_hudAlpha", "0.8", CVAR_ARCHIVE },
 	{ &cg_useWeapsForZoom,  "cg_useWeapsForZoom", "1", CVAR_ARCHIVE },

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list