Improve pause behaviour

This commit is contained in:
Lubos 2022-04-19 21:50:56 +02:00 committed by Simon
parent be0852e2e7
commit a572513b01
4 changed files with 9 additions and 1 deletions

View file

@ -234,6 +234,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

@ -318,6 +318,8 @@ void VR_DrawFrame( engine_t* engine ) {
framebuffers[0].framebuffers[framebuffers[0].swapchainIndex],
framebuffers[1].framebuffers[framebuffers[1].swapchainIndex]);
VR_ClearFrameBuffer(engine->framebuffers.framebuffers[engine->framebuffers.swapchainIndex], eyeW, eyeH);
Com_Frame();
for (int eye = 0; eye < VRAPI_FRAME_LAYER_EYE_MAX; ++eye) {

View file

@ -95,7 +95,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;