engine: move Sys_SendKeyEvents to platform/win32

This commit is contained in:
Alibek Omarov 2024-12-24 09:59:47 +03:00
parent f41450127a
commit bd0d6644e0
4 changed files with 24 additions and 17 deletions

View file

@ -633,7 +633,7 @@ Called every frame, even if not generating commands
*/
void Host_InputFrame( void )
{
Sys_SendKeyEvents ();
Platform_SendKeyEvents();
IN_Commands();

View file

@ -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
//=======================================================================

View file

@ -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
/*
==============================================================================

View file

@ -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 );
}
}