From 0bb213b1e3bbf412e7d9dbe8088d24ac4f1f904c Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 22 Jul 2020 23:48:22 +0100 Subject: [PATCH] Mde using the MG42 far more comfortable --- Projects/Android/jni/rtcw/src/cgame/cg_draw.c | 4 +++- .../Android/jni/rtcw/src/cgame/cg_drawtools.c | 2 +- Projects/Android/jni/rtcw/src/cgame/cg_local.h | 5 +++-- Projects/Android/jni/rtcw/src/cgame/cg_view.c | 17 +++++++++-------- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Projects/Android/jni/rtcw/src/cgame/cg_draw.c b/Projects/Android/jni/rtcw/src/cgame/cg_draw.c index ba4233d..4ac2266 100644 --- a/Projects/Android/jni/rtcw/src/cgame/cg_draw.c +++ b/Projects/Android/jni/rtcw/src/cgame/cg_draw.c @@ -2243,9 +2243,11 @@ static void CG_DrawCrosshair( void ) { // CG_FillRect (319, 242, 2, 16, hcolor); // vertical // option 2 + hudflags |= HUD_FLAGS_MG42_CROSSHAIR; CG_FillRect( 305, 240, 30, 2, hcolor ); // horizontal CG_FillRect( 314, 256, 12, 2, hcolor ); // horizontal2 CG_FillRect( 319, 242, 2, 32, hcolor ); // vertical + hudflags &= ~HUD_FLAGS_MG42_CROSSHAIR; return; } @@ -3416,7 +3418,7 @@ static void CG_Draw2D( void ) { // don't draw any status if dead if ( cg.snap->ps.stats[STAT_HEALTH] > 0 ) { - if (cg.zoomedScope || cg.zoomedBinoc) { + if (cg.zoomedScope || cg.zoomedBinoc || ( cg.snap->ps.eFlags & EF_MG42_ACTIVE )) { CG_DrawCrosshair(); } diff --git a/Projects/Android/jni/rtcw/src/cgame/cg_drawtools.c b/Projects/Android/jni/rtcw/src/cgame/cg_drawtools.c index 28c9326..d480e4c 100644 --- a/Projects/Android/jni/rtcw/src/cgame/cg_drawtools.c +++ b/Projects/Android/jni/rtcw/src/cgame/cg_drawtools.c @@ -84,7 +84,7 @@ void CG_AdjustFrom640( float *x, float *y, float *w, float *h ) { float screenXScale = cgs.screenXScale / 2.75f; float screenYScale = cgs.screenYScale / 2.75f; - int xoffset = -24; + int xoffset = (hudflags & HUD_FLAGS_MG42_CROSSHAIR) ? -12 : -24; if (cg.refdef.stereoView == 1) { xoffset *= -1; } diff --git a/Projects/Android/jni/rtcw/src/cgame/cg_local.h b/Projects/Android/jni/rtcw/src/cgame/cg_local.h index 4783dfa..bf4ee7e 100644 --- a/Projects/Android/jni/rtcw/src/cgame/cg_local.h +++ b/Projects/Android/jni/rtcw/src/cgame/cg_local.h @@ -109,8 +109,9 @@ If you have questions concerning this license or the applicable additional terms // -NERVE - SMF //VR HUD -#define HUD_FLAGS_FULLSCREEN 1 -#define HUD_FLAGS_STEREO 2 +#define HUD_FLAGS_FULLSCREEN 1 +#define HUD_FLAGS_STEREO 2 +#define HUD_FLAGS_MG42_CROSSHAIR 4 //================================================= diff --git a/Projects/Android/jni/rtcw/src/cgame/cg_view.c b/Projects/Android/jni/rtcw/src/cgame/cg_view.c index 163488a..d704be6 100644 --- a/Projects/Android/jni/rtcw/src/cgame/cg_view.c +++ b/Projects/Android/jni/rtcw/src/cgame/cg_view.c @@ -720,7 +720,7 @@ float zoomTable[ZOOM_MAX_ZOOMS][2] = { {20, 4}, // sniper {60, 20}, // snooper {55, 55}, // fg42 - {55, 55} // mg42 + {104, 104} // mg42 - don't zoom much for VR }; void CG_AdjustZoomVal( float val, int type ) { @@ -891,10 +891,10 @@ static int CG_CalcFov( void ) { cg.refdef.rdflags &= ~RDF_SNOOPERVIEW; } - - if ( cg.snap->ps.persistant[PERS_HWEAPON_USE] ) { - fov_x = 55; - } + //Don't do this for the MG42 in VR +// if ( cg.snap->ps.persistant[PERS_HWEAPON_USE] ) { +// fov_x = 55; +// } x = cg.refdef.width / tan( fov_x / 360 * M_PI ); fov_y = atan2( cg.refdef.height, x ); @@ -1396,9 +1396,10 @@ void CG_DrawSkyBoxPortal( void ) { cg.refdef.rdflags &= ~RDF_SNOOPERVIEW; } - if ( cg.snap->ps.persistant[PERS_HWEAPON_USE] ) { - fov_x = 55; - } + //MG42? + //if ( cg.snap->ps.persistant[PERS_HWEAPON_USE] ) { + // fov_x = 55; + //} x = cg.refdef.width / tan( fov_x / 360 * M_PI ); fov_y = atan2( cg.refdef.height, x );