Merge pull request #68 from lvonasek/feature_pause_fixes

Improve pause behaviour
This commit is contained in:
Simon 2022-04-27 20:11:06 +01:00 committed by GitHub
commit af76573dc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 1 deletions

View file

@ -216,6 +216,11 @@ engine_t* VR_GetEngine( void ) {
return &vr_engine;
}
bool VR_isPauseable( void )
{
return (bool)( ( clc.state == CA_ACTIVE) && !Cvar_VariableValue ("cl_paused") );
}
bool VR_useScreenLayer( void )
{
//intermission is never full screen

View file

@ -12,6 +12,7 @@ void VR_EnterVR( engine_t* engine, ovrJava java );
void VR_LeaveVR( engine_t* engine );
engine_t* VR_GetEngine( void );
bool VR_isPauseable( void );
bool VR_useScreenLayer( void );
float radians(float deg);

View file

@ -341,6 +341,8 @@ void VR_DrawFrame( engine_t* engine ) {
re.SetVRHeadsetParms(&projectionMatrix, &monoVRMatrix,
engine->framebuffers.framebuffers[engine->framebuffers.swapchainIndex]);
VR_ClearFrameBuffer(engine->framebuffers.framebuffers[engine->framebuffers.swapchainIndex], eyeW, eyeH);
Com_Frame();
engine->framebuffers.swapchainIndex = (engine->framebuffers.swapchainIndex + 1) %

View file

@ -89,7 +89,7 @@ int main(int argc, char* argv[]) {
while (1) {
if (hasFocus != g_HasFocus) {
hasFocus = g_HasFocus;
if (!hasFocus && !Cvar_VariableValue ("cl_paused")) {
if (!hasFocus && VR_isPauseable()) {
Com_QueueEvent( Sys_Milliseconds(), SE_KEY, K_ESCAPE, qtrue, 0, NULL );
//Com_QueueEvent( Sys_Milliseconds(), SE_KEY, K_CONSOLE, qtrue, 0, NULL );
paused = true;