mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
engine: move some input code
This commit is contained in:
parent
df7f8259a1
commit
b4aecfbf23
@ -567,23 +567,16 @@ static void IN_JoyAppendMove( usercmd_t *cmd, float forwardmove, float sidemove
|
||||
|
||||
void IN_CollectInput( float *forward, float *side, float *pitch, float *yaw, qboolean includeMouse, qboolean includeSdlMouse )
|
||||
{
|
||||
if( includeMouse )
|
||||
if( includeMouse
|
||||
#if XASH_SDL
|
||||
&& includeSdlMouse
|
||||
#endif
|
||||
)
|
||||
{
|
||||
#if XASH_INPUT == INPUT_SDL
|
||||
/// TODO: check if we may move this to platform
|
||||
if( includeSdlMouse )
|
||||
{
|
||||
int x, y;
|
||||
SDL_GetRelativeMouseState( &x, &y );
|
||||
*pitch += y * m_pitch->value;
|
||||
*yaw -= x * m_yaw->value;
|
||||
}
|
||||
#else
|
||||
float x, y;
|
||||
Platform_MouseMove( &x, &y );
|
||||
*pitch += y * m_pitch->value;
|
||||
*yaw -= x * m_yaw->value;
|
||||
#endif // SDL
|
||||
|
||||
#ifdef XASH_USE_EVDEV
|
||||
IN_EvdevMove( yaw, pitch );
|
||||
|
@ -55,6 +55,21 @@ void GAME_EXPORT Platform_SetMousePos( int x, int y )
|
||||
SDL_WarpMouseInWindow( host.hWnd, x, y );
|
||||
}
|
||||
|
||||
/*
|
||||
========================
|
||||
Platform_MouseMove
|
||||
|
||||
========================
|
||||
*/
|
||||
void Platform_MouseMove( float *x, float *y )
|
||||
{
|
||||
int m_x, m_y;
|
||||
SDL_GetMouseState( &m_x, &m_y );
|
||||
*x = (float)m_x;
|
||||
*y = (float)m_y;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
Platform_GetClipobardText
|
||||
|
Loading…
x
Reference in New Issue
Block a user