diff --git a/neo/framework/common_frame.cpp b/neo/framework/common_frame.cpp index c356afa00..e76a76598 100644 --- a/neo/framework/common_frame.cpp +++ b/neo/framework/common_frame.cpp @@ -64,7 +64,7 @@ which should also be nicely contained. */ #define DEFAULT_FIXED_TIC "0" -#define DEFAULT_NO_SLEEP "0" +#define DEFAULT_NO_SLEEP "1" idCVar com_deltaTimeClamp( "com_deltaTimeClamp", "50", CVAR_INTEGER, "don't process more than this time in a single frame" ); @@ -771,7 +771,7 @@ void idCommonLocal::Frame() // debug cvar to force multiple game tics - if( com_fixedTic.GetInteger() > 0 ) + if( com_fixedTic.GetInteger() > 0 && timescale.GetFloat() == 1.0f ) // Carl: Don't fix tics if we're in slow motion mode { numGameFrames = com_fixedTic.GetInteger(); gameFrame += numGameFrames; @@ -806,11 +806,14 @@ void idCommonLocal::Frame() if( numGameFrames > 0 ) { + // Leyland's debt forgiveness code. For me, it just makes things worse. +#if 0 // debt forgiveness if( gameTimeResidual < frameDelay/4.0f ) { gameTimeResidual = 0; } +#endif // ready to actually run them break; @@ -819,7 +822,8 @@ void idCommonLocal::Frame() // if we are vsyncing, we always want to run at least one game // frame and never sleep, which might happen due to scheduling issues // if we were just looking at real time. - if( com_noSleep.GetBool() ) + // Carl: Unless we're in slow-motion mode (timescale). + if( com_noSleep.GetBool() && timescale.GetFloat() == 1.0f ) { numGameFrames = 1; gameFrame += numGameFrames; @@ -827,6 +831,18 @@ void idCommonLocal::Frame() break; } + // Carl: if we're in slow motion mode (timescale) + // always run at least one drawing frame even if there's no game frame + // Unfortunately, these frames have bad headtracking, so I disabled it. +#if 0 + if( com_noSleep.GetBool() && timescale.GetFloat() < 1.0f ) + { + numGameFrames = 0; + gameFrame++; + break; + } +#endif + // not enough time has passed to run a frame, as might happen if // we don't have vsync on, or the monitor is running at 120hz while // com_engineHz is 60, so sleep a bit and check again diff --git a/neo/vr/Vr.cpp b/neo/vr/Vr.cpp index 84c7b7e9b..c78b3373c 100644 --- a/neo/vr/Vr.cpp +++ b/neo/vr/Vr.cpp @@ -534,7 +534,7 @@ bool iVr::OculusInit( void ) ovr_RecenterTrackingOrigin( hmdSession ); hmdWidth = hmdDesc.Resolution.w; hmdHeight = hmdDesc.Resolution.h; - hmdHz = hmdDesc.DisplayRefreshRate; + hmdHz = hmdDesc.DisplayRefreshRate + 0.5f; // Carl: This was 89 because we were rounding down when converting to int com_engineHz.SetInteger( hmdHz ); common->Printf( "Hmd: %s .\n", hmdDesc.ProductName ); common->Printf( "Hmd HZ %d, width %d, height %d\n", hmdHz, hmdWidth, hmdHeight ); @@ -670,7 +670,7 @@ bool iVr::OpenVRInit(void) // get this here so we have a resolution starting point for gl initialization. m_pHMD->GetRecommendedRenderTargetSize( &hmdWidth, &hmdHeight ); - commonVr->hmdHz = (int)m_pHMD->GetFloatTrackedDeviceProperty( vr::k_unTrackedDeviceIndex_Hmd, vr::Prop_DisplayFrequency_Float ); + commonVr->hmdHz = (int)(m_pHMD->GetFloatTrackedDeviceProperty( vr::k_unTrackedDeviceIndex_Hmd, vr::Prop_DisplayFrequency_Float ) + 0.5f); officialIPD = m_pHMD->GetFloatTrackedDeviceProperty( vr::k_unTrackedDeviceIndex_Hmd, vr::Prop_UserIpdMeters_Float ) * 100; diff --git a/vr_assets/Fully Possessed/vr_oculus_default.cfg b/vr_assets/Fully Possessed/vr_oculus_default.cfg index 872a7b9cf..b8776dd43 100644 --- a/vr_assets/Fully Possessed/vr_oculus_default.cfg +++ b/vr_assets/Fully Possessed/vr_oculus_default.cfg @@ -122,6 +122,8 @@ bind "SAY_SOUL_CUBE" "_impulse12" bind "SAY_ARTIFACT" "_impulse12" bind "SAY_RESET_VIEW" "_impulse32" set com_skipIntroVideos "1" +set com_fixedTic "0" +set com_noSleep "1" set com_engineHz "90" set net_inviteOnly "1" set vr_showWIP "0" diff --git a/vr_assets/Fully Possessed/vr_openvr_default.cfg b/vr_assets/Fully Possessed/vr_openvr_default.cfg index 790ae9562..f61badd56 100644 --- a/vr_assets/Fully Possessed/vr_openvr_default.cfg +++ b/vr_assets/Fully Possessed/vr_openvr_default.cfg @@ -122,6 +122,8 @@ bind "SAY_SOUL_CUBE" "_impulse12" bind "SAY_ARTIFACT" "_impulse12" bind "SAY_RESET_VIEW" "_impulse32" set com_skipIntroVideos "1" +set com_fixedTic "0" +set com_noSleep "1" set com_engineHz "90" set net_inviteOnly "1" set vr_showWIP "0"