Browse Source

engine: simplify XASH_USE_EVDEV macro usage by giving it's defined positive value

pull/2/head
Alibek Omarov 2 years ago
parent
commit
6e27926a10
  1. 4
      common/defaults.h
  2. 12
      engine/client/input.c
  3. 2
      engine/platform/linux/in_evdev.c
  4. 2
      engine/platform/platform.h

4
common/defaults.h

@ -70,7 +70,7 @@ SETUP BACKENDS DEFINITIONS
#define XASH_MESSAGEBOX MSGBOX_ANDROID #define XASH_MESSAGEBOX MSGBOX_ANDROID
#endif // XASH_MESSAGEBOX #endif // XASH_MESSAGEBOX
#define XASH_USE_EVDEV #define XASH_USE_EVDEV 1
#define XASH_DYNAMIC_DLADDR #define XASH_DYNAMIC_DLADDR
#elif XASH_LINUX #elif XASH_LINUX
// we are building for Linux without SDL2, can draw only to framebuffer yet // we are building for Linux without SDL2, can draw only to framebuffer yet
@ -86,7 +86,7 @@ SETUP BACKENDS DEFINITIONS
#define XASH_SOUND SOUND_ALSA #define XASH_SOUND SOUND_ALSA
#endif // XASH_SOUND #endif // XASH_SOUND
#define XASH_USE_EVDEV #define XASH_USE_EVDEV 1
#elif XASH_DOS4GW #elif XASH_DOS4GW
#ifndef XASH_VIDEO #ifndef XASH_VIDEO
#define XASH_VIDEO VIDEO_DOS #define XASH_VIDEO VIDEO_DOS

12
engine/client/input.c

@ -183,7 +183,7 @@ void IN_ToggleClientMouse( int newstate, int oldstate )
#if XASH_ANDROID #if XASH_ANDROID
Android_ShowMouse( true ); Android_ShowMouse( true );
#endif #endif
#ifdef XASH_USE_EVDEV #if XASH_USE_EVDEV
Evdev_SetGrab( false ); Evdev_SetGrab( false );
#endif #endif
} }
@ -194,7 +194,7 @@ void IN_ToggleClientMouse( int newstate, int oldstate )
#if XASH_ANDROID #if XASH_ANDROID
Android_ShowMouse( false ); Android_ShowMouse( false );
#endif #endif
#ifdef XASH_USE_EVDEV #if XASH_USE_EVDEV
Evdev_SetGrab( true ); Evdev_SetGrab( true );
#endif #endif
} }
@ -399,7 +399,7 @@ void IN_Shutdown( void )
{ {
IN_DeactivateMouse( ); IN_DeactivateMouse( );
#ifdef XASH_USE_EVDEV #if XASH_USE_EVDEV
Evdev_Shutdown(); Evdev_Shutdown();
#endif #endif
@ -426,7 +426,7 @@ void IN_Init( void )
Touch_Init(); Touch_Init();
#ifdef XASH_USE_EVDEV #if XASH_USE_EVDEV
Evdev_Init(); Evdev_Init();
#endif #endif
} }
@ -532,7 +532,7 @@ static void IN_CollectInput( float *forward, float *side, float *pitch, float *y
*pitch += y * m_pitch->value; *pitch += y * m_pitch->value;
*yaw -= x * m_yaw->value; *yaw -= x * m_yaw->value;
#ifdef XASH_USE_EVDEV #if XASH_USE_EVDEV
IN_EvdevMove( yaw, pitch ); IN_EvdevMove( yaw, pitch );
#endif #endif
} }
@ -590,7 +590,7 @@ void IN_EngineAppendMove( float frametime, void *cmd1, qboolean active )
void IN_Commands( void ) void IN_Commands( void )
{ {
#ifdef XASH_USE_EVDEV #if XASH_USE_EVDEV
IN_EvdevFrame(); IN_EvdevFrame();
#endif #endif

2
engine/platform/linux/in_evdev.c

@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
*/ */
#include "platform/platform.h" #include "platform/platform.h"
#ifdef XASH_USE_EVDEV #if XASH_USE_EVDEV
#include "common.h" #include "common.h"

2
engine/platform/platform.h

@ -149,7 +149,7 @@ qboolean SW_CreateBuffer( int width, int height, uint *stride, uint *bpp, uint *
// //
// in_evdev.c // in_evdev.c
// //
#ifdef XASH_USE_EVDEV #if XASH_USE_EVDEV
void Evdev_SetGrab( qboolean grab ); void Evdev_SetGrab( qboolean grab );
void Evdev_Shutdown( void ); void Evdev_Shutdown( void );
void Evdev_Init( void ); void Evdev_Init( void );

Loading…
Cancel
Save