Files
SRB2Kart-Saturn/src/sdl/sdlmain.h
T
Alug c4581bd9a6 Only save and keep track of controller ids on SDL versions 2.32.4 and up
Older versions break and have unstable ids on Windows, cant check for linux but ill just add a version check at this point
This was part of updating sdl with v9, which got reverted due to other issues but this was not reverted oopsie
2026-01-24 18:20:54 +01:00

76 lines
1.8 KiB
C++

// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 2006-2018 by Sonic Team Jr.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//-----------------------------------------------------------------------------
/// \file
/// \brief System specific interface stuff.
#ifndef __sdlmain__
#define __sdlmain__
#ifdef __cplusplus
extern "C" {
#endif
#include "SDL_version.h"
#include "../m_fixed.h"
// SDL2 stub macro
#define SDL2STUB() CONS_Printf("SDL2: stubbed: %s:%d\n", __func__, __LINE__)
// So m_menu knows whether to store cv_usejoystick value or string
#define JOYSTICK_HOTPLUG
/** \brief The JoyInfo_s struct
info about joystick
*/
typedef struct SDLJoyInfo_s
{
/// Controller handle
SDL_GameController *dev;
#if (SDL_VERSION_ATLEAST(2,32,4))
/// Controller index
INT32 id;
#endif
/// number of old joystick
int oldjoy;
/// number of axies
//int axises;
/// scale of axises
INT32 scale;
/// number of buttons
//int buttons;
/// number of hats
//int hats;
/// number of balls
//int balls;
} SDLJoyInfo_t;
/** \brief SDL info about controller 1
*/
extern SDLJoyInfo_t JoyInfo[4]; //MAXSPLITSCREENPLAYERS
/** \brief joystick axis deadzone
*/
#define SDL_JDEADZONE 153
#undef SDL_JDEADZONE
#ifdef __cplusplus
} // extern "C"
#endif
#endif