mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-22 03:51:40 +00:00
Merge pull request #68 from lvonasek/feature_pause_fixes
Improve pause behaviour
This commit is contained in:
commit
af76573dc7
4 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) %
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue