Skip to content

Commit

Permalink
Bugfixes:
Browse files Browse the repository at this point in the history
Pause/menu handling for in game system menus on the PDA were reworked. This avoids situations where the game pause and PDA status were not in sync, which led to the game being unresponsive unless the user used the keyboard to escape out.

Fixed issue where MSAA framebuffers were still being created with 0 samples even when MSAA disabled.

Changed full motion crouch to not update player bounding box every frame, only when close to the defined crouch height.
  • Loading branch information
KozGit committed Dec 29, 2016
1 parent dc958bf commit 740691d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
19 changes: 19 additions & 0 deletions neo/d3xp/physics/Physics_Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1528,6 +1528,23 @@ void idPhysics_Player::CheckDuck()
// but turns out the walk anim with the waist IK doesn't look too terrible for now
// of course, I haven't tested crouching EVERYWHERE in the game yet.....

{
static int currentZ;
currentZ = pm_normalviewheight.GetFloat() + commonVr->poseHmdBodyPositionDelta.z;

if ( currentZ <= ( pm_crouchheight.GetFloat() + 2.0f ) ) // give a little wiggle room.
{
playerSpeed = crouchSpeed;
maxZ = pm_crouchheight.GetFloat();
}
else
{
maxZ = pm_normalheight.GetFloat();
}

}

/* this code makes the bounding box reflect the exact player height
{
maxZ = pm_normalviewheight.GetFloat() + commonVr->poseHmdBodyPositionDelta.z;
maxZ = (int)maxZ; // if this is not cast as an int, it crashes the savegame file!!!!!!! WTF?
Expand All @@ -1538,6 +1555,8 @@ void idPhysics_Player::CheckDuck()
playerSpeed = crouchSpeed;
}
}
*/
else
{

Expand Down
8 changes: 4 additions & 4 deletions neo/framework/common_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,15 +709,15 @@ void idCommonLocal::Frame()
playerd = commonVr->playerDead;
wasl = commonVr->wasLoaded;

common->Printf( "Pause diag: ingame = %d, VR_GAME_PAUSED = %d, pausegame = %d, game->isShellactive = %d playerdead = %d\n", ingame, commonVr->VR_GAME_PAUSED, pauseGame, game->Shell_IsActive(), commonVr->playerDead );
common->Printf( "Pause diag: PDAforcetoggle = %d, PDAforced = %d, savingLoading = %d, wasloaded = %d\n", commonVr->PDAforcetoggle, commonVr->PDAforced, commonVr->gameSavingLoading, commonVr->wasLoaded );
//common->Printf( "Pause diag: ingame = %d, VR_GAME_PAUSED = %d, pausegame = %d, game->isShellactive = %d playerdead = %d\n", ingame, commonVr->VR_GAME_PAUSED, pauseGame, game->Shell_IsActive(), commonVr->playerDead );
//common->Printf( "Pause diag: PDAforcetoggle = %d, PDAforced = %d, savingLoading = %d, wasloaded = %d\n", commonVr->PDAforcetoggle, commonVr->PDAforced, commonVr->gameSavingLoading, commonVr->wasLoaded );
}

if ( ( commonVr->VR_GAME_PAUSED || commonVr->PDAforced ) && !common->Dialog().IsDialogActive() && !game->Shell_IsActive() )
{
// the pda has been forced up, but there is no active shell or dialog.
// force everything closed.
common->Printf( "Pause 1 setting forcetoggle\n" );
//common->Printf( "Pause 1 setting forcetoggle\n" );
commonVr->PDAforcetoggle = true; // tell the pda check code to force it down.
commonVr->VR_GAME_PAUSED = false;
}
Expand All @@ -740,7 +740,7 @@ void idCommonLocal::Frame()
{
if ( !commonVr->playerDead )
{
common->Printf( "Pause 2 setting forcetoggle\n" );
//common->Printf( "Pause 2 setting forcetoggle\n" );
commonVr->PDAforcetoggle = true;
}
}
Expand Down
12 changes: 6 additions & 6 deletions neo/vr/Vr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

idCVar vr_pixelDensity( "vr_pixelDensity", "1.25", CVAR_FLOAT | CVAR_ARCHIVE | CVAR_GAME, "" );
idCVar vr_vignette( "vr_vignette", "1", CVAR_INTEGER | CVAR_ARCHIVE | CVAR_GAME, "unused" );
idCVar vr_FBOAAmode( "vr_FBOAAmode", "1", CVAR_INTEGER | CVAR_ARCHIVE | CVAR_RENDERER, "Antialiasing mode. 0 = Disabled 1 = MSAA 2= FXAA\n" );
idCVar vr_enable( "vr_enable", "1", CVAR_INTEGER | CVAR_ARCHIVE | CVAR_GAME, "Enable VR mode. 0 = Disabled 1 = Enabled." );
idCVar vr_FBOscale( "vr_FBOscale", "1.0", CVAR_FLOAT | CVAR_ARCHIVE | CVAR_RENDERER, "unused" );
idCVar vr_scale( "vr_scale", "1.0", CVAR_FLOAT | CVAR_ARCHIVE | CVAR_GAME, "unused" );
Expand Down Expand Up @@ -525,20 +524,21 @@ void iVr::HMDInitializeDistortion()
if ( !fboCreated )
{ // create the FBOs if needed.

VR_AAmode = vr_FBOAAmode.GetInteger();

VR_AAmode = r_multiSamples.GetInteger() == 0 ? VR_AA_NONE : VR_AA_MSAA;
common->Printf( "vr_FBOAAmode %d r_multisamples %d\n", VR_AAmode, r_multiSamples.GetInteger() );
//if ( VR_AAmode == VR_AA_MSAA && r_multiSamples.GetInteger() == 0 ) VR_AAmode = VR_AA_NONE;


/*
if ( VR_AAmode == VR_AA_FXAA )
{// enable FXAA
VR_AAmode = VR_AA_NONE;
}
*/

if ( VR_AAmode == VR_AA_MSAA )
{// enable MSAA
{ // enable MSAA
GL_CheckErrors();

common->Printf( "Creating %d x %d MSAA framebuffer\n", rendertarget.w, rendertarget.h );
Expand Down

0 comments on commit 740691d

Please sign in to comment.