diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 8ba50455..4ce8a38b 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="44" + android:versionName="0.30.1"> diff --git a/android/app/src/main/cpp/code/cgame/cg_draw.c b/android/app/src/main/cpp/code/cgame/cg_draw.c index 61ad5a99..696945e0 100644 --- a/android/app/src/main/cpp/code/cgame/cg_draw.c +++ b/android/app/src/main/cpp/code/cgame/cg_draw.c @@ -2914,12 +2914,12 @@ void CG_DrawActive( void ) { static float hmd_yaw_y = 1.0f; static float prevPitch = 0.0f; { - hmd_yaw_x = 0.97f * hmd_yaw_x + 0.03f * cosf(DEG2RAD(vr->hmdorientation[YAW])); - hmd_yaw_y = 0.97f * hmd_yaw_y + 0.03f * sinf(DEG2RAD(vr->hmdorientation[YAW])); + hmd_yaw_x = 0.95f * hmd_yaw_x + 0.05f * cosf(DEG2RAD(vr->hmdorientation[YAW])); + hmd_yaw_y = 0.95f * hmd_yaw_y + 0.05f * sinf(DEG2RAD(vr->hmdorientation[YAW])); } angles[YAW] = viewYaw + RAD2DEG(atan2(hmd_yaw_y, hmd_yaw_x)); - angles[PITCH] = 0.97f * prevPitch + 0.03f * vr->hmdorientation[PITCH]; + angles[PITCH] = 0.95f * prevPitch + 0.05f * vr->hmdorientation[PITCH]; prevPitch = angles[PITCH]; angles[ROLL] = 0; AngleVectors(angles, forward, right, up); @@ -2952,20 +2952,23 @@ void CG_DrawActive( void ) { VectorCopy( baseOrg, cg.refdef.vieworg ); { - cg.drawingHUD = qtrue; - - //Tell renderer we want to draw to the HUD buffer - trap_R_HUDBufferStart(qtrue); - - // draw status bar and other floating elements - CG_DrawHUD2D(); - - trap_R_HUDBufferEnd(); - - cg.drawingHUD = qfalse; - - //Now draw the screen 2D stuff + //Now draw the screen 2D stuff CG_DrawScreen2D(); + + if (!vr->weapon_zoomed) + { + cg.drawingHUD = qtrue; + + //Tell renderer we want to draw to the HUD buffer + trap_R_HUDBufferStart(qtrue); + + // draw status bar and other floating elements + CG_DrawHUD2D(); + + trap_R_HUDBufferEnd(); + + cg.drawingHUD = qfalse; + } } CG_EmptySceneHackHackHack(); diff --git a/android/app/src/main/cpp/code/cgame/cg_drawtools.c b/android/app/src/main/cpp/code/cgame/cg_drawtools.c index 425e7991..25706a68 100644 --- a/android/app/src/main/cpp/code/cgame/cg_drawtools.c +++ b/android/app/src/main/cpp/code/cgame/cg_drawtools.c @@ -49,21 +49,19 @@ void CG_AdjustFrom640( float *x, float *y, float *w, float *h ) int hudDrawStatus = (int)trap_Cvar_VariableValue("vr_hudDrawStatus"); //If using floating HUD and we are drawing it, then no need to scale as the HUD //buffer is 640x480 - float screenXScale = cgs.screenXScale; - float screenYScale = cgs.screenYScale; if ( hudDrawStatus == 1 && cg.drawingHUD) { return; } - if (!cg.drawingHUD) + if (!cg.drawingHUD) { - *x *= screenXScale; - *y *= screenYScale; - *w *= screenXScale; - *h *= screenYScale; + *x *= cgs.screenXScale; + *y *= cgs.screenYScale; + *w *= cgs.screenXScale; + *h *= cgs.screenYScale; } - else // scale to clearly visible portion of VR screen + else // scale to clearly visible portion of VR screen { float screenXScale = cgs.screenXScale / 2.8f; float screenYScale = cgs.screenYScale / 2.3f; diff --git a/android/app/src/main/cpp/code/cgame/cg_weapons.c b/android/app/src/main/cpp/code/cgame/cg_weapons.c index 37682fc2..cdb46a4c 100644 --- a/android/app/src/main/cpp/code/cgame/cg_weapons.c +++ b/android/app/src/main/cpp/code/cgame/cg_weapons.c @@ -1822,7 +1822,7 @@ void CG_AddViewWeapon( playerState_t *ps ) { } hand.hModel = weapon->handsModel; - hand.renderfx = RF_DEPTHHACK | RF_FIRST_PERSON | RF_MINLIGHT; + hand.renderfx = /*RF_DEPTHHACK |*/ RF_FIRST_PERSON | RF_MINLIGHT; //scale the whole model for ( int i = 0; i < 3; i++ ) { diff --git a/android/app/src/main/cpp/code/client/cl_console.c b/android/app/src/main/cpp/code/client/cl_console.c index e84a4757..574b9d9b 100644 --- a/android/app/src/main/cpp/code/client/cl_console.c +++ b/android/app/src/main/cpp/code/client/cl_console.c @@ -29,6 +29,7 @@ int g_console_field_width = 78; extern vr_clientinfo_t vr; extern cvar_t *vr_hudDrawStatus; +extern cvar_t *vr_showConsoleMessages; #define NUM_CON_TIMES 4 @@ -606,7 +607,7 @@ void Con_DrawNotify (void) re.SetColor( g_color_table[currentColor] ); } - if (vr.show_console) + if (vr_showConsoleMessages->integer) { SCR_DrawSmallChar( cl_conXOffset->integer + con.xadjust + (x + 1) * SMALLCHAR_WIDTH + xadjust, diff --git a/android/app/src/main/cpp/code/q3_ui/ui_preferences.c b/android/app/src/main/cpp/code/q3_ui/ui_preferences.c index 35342fcf..57c1c777 100644 --- a/android/app/src/main/cpp/code/q3_ui/ui_preferences.c +++ b/android/app/src/main/cpp/code/q3_ui/ui_preferences.c @@ -52,7 +52,8 @@ GAME OPTIONS MENU #define ID_GORE 137 #define ID_SHOWINHAND 138 #define ID_SELECTORWITHHUD 139 -#define ID_BACK 140 +#define ID_SHOWCONSOLE 140 +#define ID_BACK 141 #define NUM_CROSSHAIRS 10 #define NUM_GORE 4 @@ -78,6 +79,7 @@ typedef struct { menulist_s gore; menuradiobutton_s showinhand; menuradiobutton_s selectorwithhud; + menuradiobutton_s showconsole; menubitmap_s back; qhandle_t crosshairShader[NUM_CROSSHAIRS]; @@ -125,6 +127,7 @@ static void Preferences_SetMenuItems( void ) { s_preferences.gore.curvalue = trap_Cvar_VariableValue( "vr_goreLevel" ); s_preferences.showinhand.curvalue = trap_Cvar_VariableValue( "vr_showItemInHand" ) != 0; s_preferences.selectorwithhud.curvalue = trap_Cvar_VariableValue( "vr_weaponSelectorWithHud" ) != 0; + s_preferences.showconsole.curvalue = trap_Cvar_VariableValue( "vr_showConsoleMessages" ) != 0; } @@ -212,6 +215,10 @@ static void Preferences_Event( void* ptr, int notification ) { trap_Cvar_SetValue( "vr_weaponSelectorWithHud", s_preferences.selectorwithhud.curvalue); break; + case ID_SHOWCONSOLE: + trap_Cvar_SetValue( "vr_showConsoleMessages", s_preferences.showconsole.curvalue); + break; + case ID_BACK: UI_PopMenu(); break; @@ -417,6 +424,15 @@ static void Preferences_MenuInit( void ) { s_preferences.selectorwithhud.generic.x = PREFERENCES_X_POS; s_preferences.selectorwithhud.generic.y = y; + y += BIGCHAR_HEIGHT+2; + s_preferences.showconsole.generic.type = MTYPE_RADIOBUTTON; + s_preferences.showconsole.generic.name = "Show Console Messages:"; + s_preferences.showconsole.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; + s_preferences.showconsole.generic.callback = Preferences_Event; + s_preferences.showconsole.generic.id = ID_SHOWCONSOLE; + s_preferences.showconsole.generic.x = PREFERENCES_X_POS; + s_preferences.showconsole.generic.y = y; + y += BIGCHAR_HEIGHT+16; s_preferences.gore.generic.type = MTYPE_SPINCONTROL; s_preferences.gore.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT; @@ -456,6 +472,7 @@ static void Preferences_MenuInit( void ) { Menu_AddItem( &s_preferences.menu, &s_preferences.gore ); Menu_AddItem( &s_preferences.menu, &s_preferences.showinhand ); Menu_AddItem( &s_preferences.menu, &s_preferences.selectorwithhud ); + Menu_AddItem( &s_preferences.menu, &s_preferences.showconsole ); Menu_AddItem( &s_preferences.menu, &s_preferences.back ); diff --git a/android/app/src/main/cpp/code/renderergles3/tr_backend.c b/android/app/src/main/cpp/code/renderergles3/tr_backend.c index bf178cf8..9fe411be 100644 --- a/android/app/src/main/cpp/code/renderergles3/tr_backend.c +++ b/android/app/src/main/cpp/code/renderergles3/tr_backend.c @@ -607,13 +607,6 @@ void RB_SetGL2D (void) { mat4_t matrix; int width, height; - if (backEnd.projection2D && backEnd.last2DFBO == glState.currentFBO) - return; - - backEnd.projection2D = qtrue; - - backEnd.last2DFBO = glState.currentFBO; - if (glState.currentFBO) { width = glState.currentFBO->width; @@ -637,6 +630,14 @@ void RB_SetGL2D (void) { qglScissor(0, 0, width, height); } + if (backEnd.projection2D && backEnd.last2DFBO == glState.currentFBO) + return; + + backEnd.projection2D = qtrue; + + backEnd.last2DFBO = glState.currentFBO; + + Mat4Ortho(0, width, height, 0, 0, 1, matrix); GL_SetProjectionMatrix(matrix); Mat4Identity(matrix); diff --git a/android/app/src/main/cpp/code/vr/vr_base.c b/android/app/src/main/cpp/code/vr/vr_base.c index 88ce2bce..9fd7dde4 100644 --- a/android/app/src/main/cpp/code/vr/vr_base.c +++ b/android/app/src/main/cpp/code/vr/vr_base.c @@ -42,6 +42,7 @@ cvar_t *vr_weaponSelectorMode = NULL; cvar_t *vr_weaponSelectorWithHud = NULL; cvar_t *vr_goreLevel = NULL; cvar_t *vr_hudDrawStatus = NULL; +cvar_t *vr_showConsoleMessages = NULL; engine_t* VR_Init( ovrJava java ) { @@ -86,6 +87,7 @@ void VR_InitCvars( void ) vr_weaponSelectorWithHud = Cvar_Get ("vr_weaponSelectorWithHud", "0", CVAR_ARCHIVE); vr_goreLevel = Cvar_Get ("vr_goreLevel", "2", CVAR_ARCHIVE); vr_hudDrawStatus = Cvar_Get ("vr_hudDrawStatus", "1", CVAR_ARCHIVE); // 0 - no hud, 1 - in-world hud, 2 - performance (static HUD) + vr_showConsoleMessages = Cvar_Get ("vr_showConsoleMessages", "1", CVAR_ARCHIVE); // Values are: scale,right,up,forward,pitch,yaw,roll // VALUES PROVIDED BY SkillFur - Thank-you! diff --git a/android/app/src/main/cpp/code/vr/vr_clientinfo.h b/android/app/src/main/cpp/code/vr/vr_clientinfo.h index 51a2aa4e..d156b80f 100644 --- a/android/app/src/main/cpp/code/vr/vr_clientinfo.h +++ b/android/app/src/main/cpp/code/vr/vr_clientinfo.h @@ -14,7 +14,6 @@ typedef struct { qboolean weapon_stabilised; qboolean weapon_zoomed; - qboolean show_console; float weapon_zoomLevel; qboolean right_handed; qboolean virtual_screen; diff --git a/android/app/src/main/cpp/code/vr/vr_input.c b/android/app/src/main/cpp/code/vr/vr_input.c index 5c342827..c417e5cc 100644 --- a/android/app/src/main/cpp/code/vr/vr_input.c +++ b/android/app/src/main/cpp/code/vr/vr_input.c @@ -493,8 +493,6 @@ static void IN_VRController( qboolean isRightController, ovrTracking remoteTrack (VectorLength(vr.weaponoffset) < 0.24f) && cl.snap.ps.stats[STAT_HEALTH] > 0; - vr.show_console = (VectorLength(vr.offhandoffset) < 0.2f); - if (vr_twoHandedWeapons->integer && vr.weapon_stabilised) { //Apply smoothing to the weapon hand diff --git a/android/run.bat b/android/run.bat index d98f3612..09b00af8 100644 --- a/android/run.bat +++ b/android/run.bat @@ -2,8 +2,8 @@ setlocal -set BUILD_TYPE=release -set VERSION=0.30.0-multiview +set BUILD_TYPE=debug +set VERSION=0.30.1-multiview @REM Define the following environment variables to sign a release build @REM set KEYSTORE=