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

12
engine/client/input.c

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

2
engine/platform/linux/in_evdev.c

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

2
engine/platform/platform.h

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

Loading…
Cancel
Save