mirror of
https://github.com/nillerusr/source-engine.git
synced 2024-12-22 14:16:50 +00:00
android: fix SDL_QUIT
This commit is contained in:
parent
7a69af7b00
commit
1233e05fcb
@ -1869,9 +1869,6 @@ void CSDLMgr::PumpWindowsMessageLoop()
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// FIXME(nillerusr): SDL posts SDL_QUIT when map loaded on android, idk why.
|
||||
#ifndef ANDROID
|
||||
case SDL_QUIT:
|
||||
{
|
||||
CCocoaEvent theEvent;
|
||||
@ -1879,7 +1876,6 @@ void CSDLMgr::PumpWindowsMessageLoop()
|
||||
PostEvent( theEvent );
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -358,27 +358,7 @@ void CEngine::Frame( void )
|
||||
// Calculate how long we need to wait.
|
||||
int nSleepMS = (int)( ( m_flMinFrameTime - m_flFrameTime ) * 1000 - fBusyWaitMS );
|
||||
if ( nSleepMS > 0 )
|
||||
{
|
||||
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.
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user