Even more conversion, lots of superfluous macro removal
This commit is contained in:
+12
-12
@@ -32,8 +32,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#include "SDL.h"
|
||||
#endif
|
||||
|
||||
static qboolean windowhasfocus = true; //just in case sdl fails to tell us...
|
||||
static qboolean textmode;
|
||||
static bool windowhasfocus = true; //just in case sdl fails to tell us...
|
||||
static bool textmode;
|
||||
|
||||
static convar in_debugkeys{"in_debugkeys", "0"};
|
||||
|
||||
@@ -68,7 +68,7 @@ static SDL_JoystickID joy_active_instaceid = -1;
|
||||
static SDL_GameController *joy_active_controller = NULL;
|
||||
#endif
|
||||
|
||||
static qboolean no_mouse = false;
|
||||
static bool no_mouse = false;
|
||||
|
||||
static int buttonremap[] =
|
||||
{
|
||||
@@ -231,7 +231,7 @@ void IN_Activate(void) {
|
||||
total_dy = 0;
|
||||
}
|
||||
|
||||
void IN_Deactivate(qboolean free_cursor) {
|
||||
void IN_Deactivate(bool free_cursor) {
|
||||
if (no_mouse)
|
||||
return;
|
||||
|
||||
@@ -331,7 +331,7 @@ void IN_Init(void) {
|
||||
else
|
||||
SDL_StopTextInput();
|
||||
#endif
|
||||
if (safemode || COM_CheckParm("-nomouse")) {
|
||||
if (safemode || common::check_param("-nomouse").has_value()) {
|
||||
no_mouse = true;
|
||||
/* discard all mouse events when input is deactivated */
|
||||
IN_BeginIgnoringMouseEvents();
|
||||
@@ -381,7 +381,7 @@ typedef struct joyaxis_s {
|
||||
} joyaxis_t;
|
||||
|
||||
typedef struct joy_buttonstate_s {
|
||||
qboolean buttondown[SDL_CONTROLLER_BUTTON_MAX];
|
||||
bool buttondown[SDL_CONTROLLER_BUTTON_MAX];
|
||||
} joybuttonstate_t;
|
||||
|
||||
typedef struct axisstate_s {
|
||||
@@ -499,7 +499,7 @@ and generates key repeats if the button is held down.
|
||||
Adapted from DarkPlaces by lordhavoc
|
||||
================
|
||||
*/
|
||||
static void IN_JoyKeyEvent(qboolean wasdown, qboolean isdown, int key, double *timer) {
|
||||
static void IN_JoyKeyEvent(bool wasdown, bool isdown, int key, double *timer) {
|
||||
// we can't use `realtime` for key repeats because it is not monotomic
|
||||
const double currenttime = Sys_DoubleTime();
|
||||
|
||||
@@ -544,8 +544,8 @@ void IN_Commands(void) {
|
||||
|
||||
// emit key events for controller buttons
|
||||
for (i = 0; i < SDL_CONTROLLER_BUTTON_MAX; i++) {
|
||||
qboolean newstate = SDL_GameControllerGetButton(joy_active_controller, (SDL_GameControllerButton) i);
|
||||
qboolean oldstate = joy_buttonstate.buttondown[i];
|
||||
bool newstate = SDL_GameControllerGetButton(joy_active_controller, (SDL_GameControllerButton) i);
|
||||
bool oldstate = joy_buttonstate.buttondown[i];
|
||||
|
||||
joy_buttonstate.buttondown[i] = newstate;
|
||||
|
||||
@@ -700,7 +700,7 @@ void IN_ClearStates(void) {
|
||||
}
|
||||
|
||||
void IN_UpdateInputMode(void) {
|
||||
qboolean want_textmode = Key_TextEntry();
|
||||
bool want_textmode = Key_TextEntry();
|
||||
if (textmode != want_textmode) {
|
||||
textmode = want_textmode;
|
||||
#if !defined(USE_SDL2)
|
||||
@@ -942,7 +942,7 @@ static void IN_DebugKeyEvent(SDL_Event *event) {
|
||||
void IN_SendKeyEvents(void) {
|
||||
SDL_Event event;
|
||||
int key;
|
||||
qboolean down;
|
||||
bool down;
|
||||
|
||||
while (SDL_PollEvent(&event)) {
|
||||
switch (event.type) {
|
||||
@@ -1012,7 +1012,7 @@ void IN_SendKeyEvents(void) {
|
||||
case SDL_MOUSEBUTTONDOWN:
|
||||
case SDL_MOUSEBUTTONUP:
|
||||
if (event.button.button < 1 ||
|
||||
event.button.button > Q_COUNTOF(buttonremap)) {
|
||||
event.button.button > std::size(buttonremap)) {
|
||||
Con_Printf("Ignored event for mouse button %d\n",
|
||||
event.button.button);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user