Several fixes

- Show console messages is now a menu toggle
- Rail gun scope now renders correctly
- Vignette now working correctly (again!)
- Movement of floaty HUD is a little snappier
- Floaty HUD will now not be occluded by the weapon (this does mean the weapon can now pass through things like walls etc, hopefully no-one will notice or care)
This commit is contained in:
Simon 2022-04-05 23:05:05 +01:00
parent 8839768f26
commit bfd6ba7744
11 changed files with 60 additions and 41 deletions

View file

@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.drbeef.ioq3quest"
android:installLocation="preferExternal"
android:versionCode="43"
android:versionName="0.30.0">
android:versionCode="44"
android:versionName="0.30.1">
<uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
<uses-feature android:glEsVersion="0x00030001" />
<!-- <uses-feature android:name="oculus.software.overlay_keyboard" android:required="false"/>-->

View file

@ -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();

View file

@ -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;

View file

@ -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++ ) {

View file

@ -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,

View file

@ -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 );

View file

@ -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);

View file

@ -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!

View file

@ -14,7 +14,6 @@ typedef struct {
qboolean weapon_stabilised;
qboolean weapon_zoomed;
qboolean show_console;
float weapon_zoomLevel;
qboolean right_handed;
qboolean virtual_screen;

View file

@ -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

View file

@ -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=