A few PCVR specific fixes

- Restored missing item selector beam
- Allow much wider angle pitch adjust, hopefully enough for Index users
This commit is contained in:
Simon 2023-07-29 19:14:24 +01:00
parent e0b65748a0
commit 6a09e2d411
9 changed files with 74 additions and 81 deletions

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.drbeef.jkxr"
android:versionCode="61"
android:versionName="1.1.12" android:installLocation="auto" >
android:versionCode="63"
android:versionName="1.1.14" android:installLocation="auto" >
<!-- Tell the system this app requires OpenGL ES 3.1. -->
<uses-feature android:glEsVersion="0x00030002" android:required="true"/>

View file

@ -19,6 +19,8 @@
int NUM_MULTI_SAMPLES = 2;
float SS_MULTIPLIER = 0.0f;
const float ZOOM_FOV_ADJUST = 1.1f;
GLboolean stageSupported = GL_FALSE;
@ -1161,11 +1163,6 @@ void TBXR_finishEyeBuffer(int eye )
ovrFramebuffer_Resolve(frameBuffer);
WIN_SwapWindow();
//Clear the back buffer so we don't randomly have a little screen copy showing up
glViewport(0, 0, gAppState.Width, gAppState.Height);
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
}
ovrFramebuffer_Release(frameBuffer);
@ -1234,10 +1231,10 @@ void TBXR_submitFrame()
XrFovf fov = gAppState.Views[eye].fov;
if (vr.cgzoommode)
{
fov.angleLeft *= 1.2f;
fov.angleRight *= 1.2f;
fov.angleUp *= 1.2f;
fov.angleDown *= 1.2f;
fov.angleLeft /= ZOOM_FOV_ADJUST;
fov.angleRight /= ZOOM_FOV_ADJUST;
fov.angleUp /= ZOOM_FOV_ADJUST;
fov.angleDown /= ZOOM_FOV_ADJUST;
}
memset(&projection_layer_elements[eye], 0, sizeof(XrCompositionLayerProjectionView));

View file

@ -3090,53 +3090,51 @@ void CG_DrawItemSelector( void )
centity_t *cent = &cg_entities[cg.snap->ps.clientNum];
refEntity_t beam;
beam.shaderRGBA[3] = 0xff;
vec3_t sRGB;
int count;
switch (cg.itemSelectorType)
{
case ST_WEAPON: //weapons
if (vr->in_vehicle)
count = vr->vehicle_type == VH_WALKER ? 2 : 1;
else
count = WP_MELEE;
beam.shaderRGBA[0] = 0xff;
beam.shaderRGBA[1] = 0xae;
beam.shaderRGBA[2] = 0x40;
break;
case ST_GADGET: //gadgets
count = INV_GOODIE_KEY;
beam.shaderRGBA[0] = 0x00;
beam.shaderRGBA[1] = 0xff;
beam.shaderRGBA[2] = 0x00;
break;
case ST_FIGHTING_STYLE: //fighting style
count = 3;
beam.shaderRGBA[0] = 0xff;
beam.shaderRGBA[1] = 0xff;
beam.shaderRGBA[2] = 0xff;
break;
case ST_FORCE_POWER: // force powers
count = MAX_SHOWPOWERS;
beam.shaderRGBA[0] = 0x00;
beam.shaderRGBA[1] = 0x00;
beam.shaderRGBA[2] = 0xff;
break;
case ST_QUICK_SAVE:
case ST_WEAPON: //weapons
if (vr->in_vehicle)
count = 2;
beam.shaderRGBA[0] = 0xff;
beam.shaderRGBA[1] = 0xff;
beam.shaderRGBA[2] = 0xff;
break;
else
count = WP_MELEE;
sRGB[0] = 1.0f;
sRGB[1] = 0.8f;
sRGB[2] = 0.2f;
break;
case ST_GADGET: //gadgets
count = INV_GOODIE_KEY;
sRGB[0] = 0.0f;
sRGB[1] = 1.0f;
sRGB[2] = 0.0f;
break;
case ST_FIGHTING_STYLE: //fighting style
count = 3;
sRGB[0] = 0.0f;
sRGB[1] = 1.0f;
sRGB[2] = 1.0f;
break;
case ST_FORCE_POWER: // force powers
count = MAX_SHOWPOWERS;
sRGB[0] = 0.0f;
sRGB[1] = 0.0f;
sRGB[2] = 1.0f;
break;
case ST_QUICK_SAVE:
count = 2;
sRGB[0] = 1.0f;
sRGB[1] = 1.0f;
sRGB[2] = 1.0f;
break;
}
VectorCopy(beamOrigin, beam.oldorigin);
VectorCopy(selectorOrigin, beam.origin );
beam.customShader = cgi_R_RegisterShader( "gfx/misc/whiteline2" );
beam.reType = RT_LINE;
beam.radius = 0.3f;
cgi_R_AddRefEntityToScene( &beam );
//cgi_R_AddRefEntityToScene( &beam );
FX_AddLine(beamOrigin, selectorOrigin, 1.0f, 0.1f, 0.0f,
0.5f, 0.5f,
sRGB, sRGB,
10, cgi_R_RegisterShader("gfx/misc/whiteline2"),
FX_SIZE_LINEAR | FX_ALPHA_LINEAR);
if (cg.itemSelectorType == ST_WEAPON) // weapons

View file

@ -23,7 +23,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
// Current version of the single player game
#include "../win32/AutoVersion.h"
#define JKXR_VERSION "1.1.13-ea"
#define JKXR_VERSION "1.1.14-ea"
#ifdef _DEBUG
#define Q3_VERSION "(debug)OpenJK: v" VERSION_STRING_DOTTED " JKXR: " JKXR_VERSION

View file

@ -2908,8 +2908,7 @@ void CG_DrawItemSelector( void )
centity_t *cent = &cg_entities[cg.snap->ps.clientNum];
refEntity_t beam;
beam.shaderRGBA[3] = 0xff;
vec3_t sRGB;
int count;
switch (cg.itemSelectorType)
{
@ -2918,43 +2917,42 @@ void CG_DrawItemSelector( void )
count = 2;
else
count = WP_MELEE;
beam.shaderRGBA[0] = 0xff;
beam.shaderRGBA[1] = 0xae;
beam.shaderRGBA[2] = 0x40;
sRGB[0] = 1.0f;
sRGB[1] = 0.8f;
sRGB[2] = 0.2f;
break;
case ST_GADGET: //gadgets
count = INV_GOODIE_KEY;
beam.shaderRGBA[0] = 0x00;
beam.shaderRGBA[1] = 0xff;
beam.shaderRGBA[2] = 0x00;
sRGB[0] = 0.0f;
sRGB[1] = 1.0f;
sRGB[2] = 0.0f;
break;
case ST_FIGHTING_STYLE: //fighting style
count = 3;
beam.shaderRGBA[0] = 0xff;
beam.shaderRGBA[1] = 0xff;
beam.shaderRGBA[2] = 0xff;
sRGB[0] = 0.0f;
sRGB[1] = 1.0f;
sRGB[2] = 1.0f;
break;
case ST_FORCE_POWER: // force powers
count = MAX_SHOWPOWERS;
beam.shaderRGBA[0] = 0x00;
beam.shaderRGBA[1] = 0x00;
beam.shaderRGBA[2] = 0xff;
sRGB[0] = 0.0f;
sRGB[1] = 0.0f;
sRGB[2] = 1.0f;
break;
case ST_QUICK_SAVE:
count = 2;
beam.shaderRGBA[0] = 0xff;
beam.shaderRGBA[1] = 0xff;
beam.shaderRGBA[2] = 0xff;
sRGB[0] = 1.0f;
sRGB[1] = 1.0f;
sRGB[2] = 1.0f;
break;
}
VectorCopy(beamOrigin, beam.oldorigin);
VectorCopy(selectorOrigin, beam.origin );
beam.customShader = cgi_R_RegisterShader( "gfx/misc/whiteline2" );
beam.reType = RT_LINE;
beam.radius = 0.3f;
cgi_R_AddRefEntityToScene( &beam );
//cgi_R_AddRefEntityToScene( &beam );
FX_AddLine(beamOrigin, selectorOrigin, 0.1f, 0.1f, 0.0f,
1.0f, 0.0f, 0.0f,
sRGB, sRGB, 1.0f,
10, cgi_R_RegisterShader("gfx/misc/whiteline2"),
FX_SIZE_LINEAR | FX_ALPHA_LINEAR);
if (cg.itemSelectorType == ST_WEAPON) // weapons

View file

@ -1074,7 +1074,7 @@
group weaponcontrols
type ITEM_TYPE_SLIDER
text @MENUS_VR_WEAPON_PITCH_ITEM
cvarfloat "vr_weapon_pitchadjust" 0 -25 5
cvarfloat "vr_weapon_pitchadjust" 20 -45 5
rect 260 220 340 14
textalign ITEM_ALIGN_RIGHT
textalignx 174

View file

@ -1256,7 +1256,7 @@
group weaponcontrols
type ITEM_TYPE_SLIDER
text @MENUS_VR_WEAPON_PITCH_ITEM
cvarfloat "vr_weapon_pitchadjust" 0 -25 5
cvarfloat "vr_weapon_pitchadjust" 20 -45 5
rect 260 220 340 14
textalign ITEM_ALIGN_RIGHT
textalignx 174

View file

@ -1568,7 +1568,7 @@
group weaponcontrols
type ITEM_TYPE_SLIDER
text @MENUS_VR_WEAPON_PITCH_ITEM
cvarfloat "vr_weapon_pitchadjust" 0 -25 5
cvarfloat "vr_weapon_pitchadjust" 20 -45 5
rect 305 211 300 20
textalign ITEM_ALIGN_RIGHT
textalignx 151

View file

@ -1567,7 +1567,7 @@
group weaponcontrols
type ITEM_TYPE_SLIDER
text @MENUS_VR_WEAPON_PITCH_ITEM
cvarfloat "vr_weapon_pitchadjust" 0 -25 5
cvarfloat "vr_weapon_pitchadjust" 20 -45 5
rect 305 211 300 20
textalign ITEM_ALIGN_RIGHT
textalignx 151