mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: move Sys_SendKeyEvents to platform/win32
This commit is contained in:
@@ -633,7 +633,7 @@ Called every frame, even if not generating commands
|
||||
*/
|
||||
void Host_InputFrame( void )
|
||||
{
|
||||
Sys_SendKeyEvents ();
|
||||
Platform_SendKeyEvents();
|
||||
|
||||
IN_Commands();
|
||||
|
||||
|
||||
@@ -234,22 +234,6 @@ qboolean Sys_GetIntFromCmdLine( const char* argName, int *out )
|
||||
return true;
|
||||
}
|
||||
|
||||
void Sys_SendKeyEvents( void )
|
||||
{
|
||||
#if XASH_WIN32
|
||||
MSG msg;
|
||||
|
||||
while( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ))
|
||||
{
|
||||
if( !GetMessage( &msg, NULL, 0, 0 ))
|
||||
Sys_Quit ();
|
||||
|
||||
TranslateMessage( &msg );
|
||||
DispatchMessage( &msg );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// DLL'S MANAGER SYSTEM
|
||||
//=======================================================================
|
||||
|
||||
@@ -227,6 +227,14 @@ static inline void Platform_SetTimer( float time )
|
||||
#endif
|
||||
}
|
||||
|
||||
#if XASH_WIN32
|
||||
void Platform_SendKeyEvents( void );
|
||||
#else
|
||||
static inline void Platform_SendKeyEvents( void )
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
|
||||
@@ -55,3 +55,18 @@ void Platform_MessageBox( const char *title, const char *message, qboolean paren
|
||||
MessageBox( parentMainWindow ? host.hWnd : NULL, message, title, MB_OK|MB_SETFOREGROUND|MB_ICONSTOP );
|
||||
}
|
||||
#endif // XASH_MESSAGEBOX == MSGBOX_WIN32
|
||||
|
||||
// I don't know why we need this or what this does
|
||||
void Platform_SendKeyEvents( void )
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
while( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ))
|
||||
{
|
||||
if( !GetMessage( &msg, NULL, 0, 0 ))
|
||||
Sys_Quit ();
|
||||
|
||||
TranslateMessage( &msg );
|
||||
DispatchMessage( &msg );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user