SpaceWarp drawing blurry HUD is better than no HUD

This commit is contained in:
Lubos 2022-06-16 11:15:41 +02:00
parent 46c7e3682a
commit 81dbbe7fd0
4 changed files with 14 additions and 10 deletions

View file

@ -767,7 +767,11 @@ static float CG_DrawFPS( float y ) {
}
fps = 1000 * FPS_FRAMES / total;
s = va( "%ifps", fps );
if ((int)trap_Cvar_VariableValue( "vr_spaceWarp" )) {
s = va( "%ifps", fps + fps );
} else {
s = va( "%ifps", fps );
}
w = CG_DrawStrlen( s ) * BIGCHAR_WIDTH;
CG_DrawBigString( 635 - w, y + 2, s, 1.0F);
@ -2955,7 +2959,7 @@ void CG_DrawActive( void ) {
//Now draw the screen 2D stuff
CG_DrawScreen2D();
if (!vr->weapon_zoomed)
if (!vr->weapon_zoomed && !vr->drawingMotionVector)
{
cg.drawingHUD = qtrue;
@ -2963,10 +2967,7 @@ void CG_DrawActive( void ) {
trap_R_HUDBufferStart(qtrue);
// draw status bar and other floating elements
if ((int)trap_Cvar_VariableValue( "vr_spaceWarp" ) == 0)
{
CG_DrawHUD2D(); //TODO: move rendering HUD into OpenXR render layer
}
CG_DrawHUD2D();
trap_R_HUDBufferEnd();

View file

@ -566,6 +566,9 @@ Draws the last few lines of output transparently over the game top
*/
void Con_DrawNotify (void)
{
if (vr.drawingMotionVector)
return;
int x, v;
short *text;
int i;

View file

@ -63,6 +63,7 @@ typedef struct {
int *menuCursorX;
int *menuCursorY;
qboolean menuLeftHanded;
qboolean drawingMotionVector;
float recenterYaw;
} vr_clientinfo_t;

View file

@ -27,7 +27,6 @@ XrView* projections;
XrPosef prevXrSpacePoseInWorld;
qboolean fullscreenMode = qfalse;
qboolean stageSupported = qfalse;
qboolean renderMotionVector = qfalse;
void VR_UpdateStageBounds(ovrApp* pappState) {
XrExtent2Df stageBounds = {};
@ -509,9 +508,9 @@ void VR_DrawFrame( engine_t* engine ) {
}
if (vr_spacewarp->integer) {
renderMotionVector = qtrue;
vr.drawingMotionVector = qtrue;
VR_RenderScene( engine, fov, qtrue );
renderMotionVector = qfalse;
vr.drawingMotionVector = qfalse;
VR_RenderScene( engine, fov, qfalse );
} else {
VR_RenderScene( engine, fov, qfalse );
@ -628,5 +627,5 @@ void VR_DrawFrame( engine_t* engine ) {
int VR_RenderMotionVector() {
return renderMotionVector;
return vr.drawingMotionVector;
}