android: fix SDL_QUIT

This commit is contained in:
nillerusr 2021-11-14 13:21:01 +03:00
parent 7a69af7b00
commit 1233e05fcb
2 changed files with 0 additions and 24 deletions

View File

@ -1869,9 +1869,6 @@ void CSDLMgr::PumpWindowsMessageLoop()
} }
break; break;
} }
// FIXME(nillerusr): SDL posts SDL_QUIT when map loaded on android, idk why.
#ifndef ANDROID
case SDL_QUIT: case SDL_QUIT:
{ {
CCocoaEvent theEvent; CCocoaEvent theEvent;
@ -1879,7 +1876,6 @@ void CSDLMgr::PumpWindowsMessageLoop()
PostEvent( theEvent ); PostEvent( theEvent );
break; break;
} }
#endif
default: default:
break; break;
} }

View File

@ -358,27 +358,7 @@ void CEngine::Frame( void )
// Calculate how long we need to wait. // Calculate how long we need to wait.
int nSleepMS = (int)( ( m_flMinFrameTime - m_flFrameTime ) * 1000 - fBusyWaitMS ); int nSleepMS = (int)( ( m_flMinFrameTime - m_flFrameTime ) * 1000 - fBusyWaitMS );
if ( nSleepMS > 0 ) if ( nSleepMS > 0 )
{
ThreadSleep( nSleepMS ); ThreadSleep( nSleepMS );
}
else
{
// On x86, busy-wait using PAUSE instruction which encourages
// power savings by idling for ~10 cycles (also yielding to
// the other logical hyperthread core if the CPU supports it)
for (int i = 2000; i >= 0; --i)
{
#if defined(POSIX)
#ifdef __arm__
raise(SIGINT);
#else
__asm( "pause" ); __asm( "pause" ); __asm( "pause" ); __asm( "pause" );
#endif
#elif defined(IS_WINDOWS_PC)
_asm { pause }; _asm { pause }; _asm { pause }; _asm { pause };
#endif
}
}
// Go back to the top of the loop and see if it is time yet. // Go back to the top of the loop and see if it is time yet.
} }