mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-18 15:11:51 +00:00
Fix the MAXJOYBUTTONS discrepancy between _control.h and gamedefs.h.
git-svn-id: https://svn.eduke32.com/eduke32@4826 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
0869194b60
commit
eca33954db
6 changed files with 21 additions and 14 deletions
|
@ -322,7 +322,7 @@ void CONFIG_SetDefaults(void)
|
|||
CONTROL_MouseSensitivity = DEFAULTMOUSESENSITIVITY;
|
||||
|
||||
memset(ud.config.JoystickFunctions, -1, sizeof(ud.config.JoystickFunctions));
|
||||
for (i=0; i<MAXJOYBUTTONS; i++)
|
||||
for (i=0; i<MAXJOYBUTTONSANDHATS; i++)
|
||||
{
|
||||
ud.config.JoystickFunctions[i][0] = CONFIG_FunctionNameToNum(joystickdefaults[i]);
|
||||
ud.config.JoystickFunctions[i][1] = CONFIG_FunctionNameToNum(joystickclickeddefaults[i]);
|
||||
|
@ -489,7 +489,7 @@ void CONFIG_SetupJoystick(void)
|
|||
|
||||
if (ud.config.scripthandle < 0) return;
|
||||
|
||||
for (i=0; i<MAXJOYBUTTONS; i++)
|
||||
for (i=0; i<MAXJOYBUTTONSANDHATS; i++)
|
||||
{
|
||||
Bsprintf(str,"JoystickButton%d",i);
|
||||
temp[0] = 0;
|
||||
|
@ -539,7 +539,7 @@ void CONFIG_SetupJoystick(void)
|
|||
ud.config.JoystickAnalogueSaturate[i] = scale;
|
||||
}
|
||||
|
||||
for (i=0; i<MAXJOYBUTTONS; i++)
|
||||
for (i=0; i<MAXJOYBUTTONSANDHATS; i++)
|
||||
{
|
||||
CONTROL_MapButton(ud.config.JoystickFunctions[i][0], i, 0, controldevice_joystick);
|
||||
CONTROL_MapButton(ud.config.JoystickFunctions[i][1], i, 1, controldevice_joystick);
|
||||
|
@ -908,7 +908,7 @@ void CONFIG_WriteSetup(uint32_t flags)
|
|||
Bsprintf(tempbuf,"%.2f",CONTROL_MouseSensitivity);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Controls","Mouse_Sensitivity",tempbuf);
|
||||
|
||||
for (dummy=0; dummy<MAXJOYBUTTONS; dummy++)
|
||||
for (dummy=0; dummy<MAXJOYBUTTONSANDHATS; dummy++)
|
||||
{
|
||||
if (CONFIG_FunctionNumToName(ud.config.JoystickFunctions[dummy][0]))
|
||||
{
|
||||
|
|
|
@ -188,7 +188,7 @@ typedef struct {
|
|||
int32_t MouseDigitalFunctions[MAXMOUSEAXES][2];
|
||||
int32_t MouseAnalogueAxes[MAXMOUSEAXES];
|
||||
int32_t MouseAnalogueScale[MAXMOUSEAXES];
|
||||
int32_t JoystickFunctions[MAXJOYBUTTONS][2];
|
||||
int32_t JoystickFunctions[MAXJOYBUTTONSANDHATS][2];
|
||||
int32_t JoystickDigitalFunctions[MAXJOYAXES][2];
|
||||
int32_t JoystickAnalogueAxes[MAXJOYAXES];
|
||||
int32_t JoystickAnalogueScale[MAXJOYAXES];
|
||||
|
|
|
@ -46,16 +46,19 @@ extern "C" {
|
|||
#define SETUPFILENAME "eduke32.cfg"
|
||||
|
||||
// Number of JOY buttons
|
||||
// XXX: out of sync with jmact/_control.h
|
||||
#define MAXJOYBUTTONS (32+4)
|
||||
// KEEPINSYNC jmact/_control.h
|
||||
#define MAXJOYBUTTONS 32
|
||||
#define MAXJOYBUTTONSANDHATS (MAXJOYBUTTONS+4)
|
||||
|
||||
// Number of Mouse Axes
|
||||
// KEEPINSYNC jmact/_control.h
|
||||
#define MAXMOUSEAXES 2
|
||||
#define MAXMOUSEDIGITAL (MAXMOUSEAXES*2)
|
||||
|
||||
// Number of JOY axes
|
||||
// KEEPINSYNC jmact/_control.h
|
||||
#define MAXJOYAXES 8
|
||||
#define MAXJOYDIGITAL (MAXJOYAXES*2)
|
||||
|
||||
// DEFAULT mouse sensitivity scale
|
||||
#define DEFAULTMOUSESENSITIVITY 7
|
||||
|
|
|
@ -66,14 +66,17 @@ extern "C" {
|
|||
// Number of Mouse Axes
|
||||
// KEEPINSYNC gamedefs.h
|
||||
#define MAXMOUSEAXES 2
|
||||
#define MAXMOUSEDIGITAL (MAXMOUSEAXES*2)
|
||||
|
||||
// Number of JOY buttons
|
||||
// XXX: out of sync with gamedefs.h
|
||||
// KEEPINSYNC gamedefs.h
|
||||
#define MAXJOYBUTTONS 32
|
||||
#define MAXJOYBUTTONSANDHATS (MAXJOYBUTTONS+4)
|
||||
|
||||
// Number of JOY axes
|
||||
// KEEPINSYNC gamedefs.h
|
||||
#define MAXJOYAXES 8
|
||||
#define MAXJOYDIGITAL (MAXJOYAXES*2)
|
||||
|
||||
// NORMAL axis scale
|
||||
#define NORMALAXISSCALE 65536
|
||||
|
|
|
@ -478,7 +478,8 @@ enum
|
|||
{
|
||||
MAXMOUSEBUTTONS = 10,
|
||||
MAXMOUSEAXES = 2,
|
||||
MAXJOYBUTTONS = (32+4),
|
||||
MAXJOYBUTTONS = 32,
|
||||
MAXJOYBUTTONSANDHATS = (32+4),
|
||||
MAXJOYAXES = 8,
|
||||
NUMGAMEFUNCTIONS = 56,
|
||||
MAXRIDECULE = 10,
|
||||
|
@ -528,7 +529,7 @@ typedef struct {
|
|||
int32_t MouseDigitalFunctions[MAXMOUSEAXES][2];
|
||||
int32_t MouseAnalogueAxes[MAXMOUSEAXES];
|
||||
int32_t MouseAnalogueScale[MAXMOUSEAXES];
|
||||
int32_t JoystickFunctions[MAXJOYBUTTONS][2];
|
||||
int32_t JoystickFunctions[MAXJOYBUTTONSANDHATS][2];
|
||||
int32_t JoystickDigitalFunctions[MAXJOYAXES][2];
|
||||
int32_t JoystickAnalogueAxes[MAXJOYAXES];
|
||||
int32_t JoystickAnalogueScale[MAXJOYAXES];
|
||||
|
|
|
@ -672,11 +672,11 @@ static MenuEntry_t *MEL_JOYSTICKSETUP[] = {
|
|||
|
||||
#define MAXJOYBUTTONSTRINGLENGTH 32
|
||||
|
||||
static char MenuJoystickNames[MAXJOYBUTTONS<<1][MAXJOYBUTTONSTRINGLENGTH];
|
||||
static char MenuJoystickNames[MAXJOYBUTTONSANDHATS*2][MAXJOYBUTTONSTRINGLENGTH];
|
||||
|
||||
static MenuOption_t MEO_JOYSTICKBTNS[MAXJOYBUTTONS<<1];
|
||||
static MenuEntry_t ME_JOYSTICKBTNS[MAXJOYBUTTONS<<1];
|
||||
static MenuEntry_t *MEL_JOYSTICKBTNS[MAXJOYBUTTONS<<1];
|
||||
static MenuOption_t MEO_JOYSTICKBTNS[MAXJOYBUTTONSANDHATS*2];
|
||||
static MenuEntry_t ME_JOYSTICKBTNS[MAXJOYBUTTONSANDHATS*2];
|
||||
static MenuEntry_t *MEL_JOYSTICKBTNS[MAXJOYBUTTONSANDHATS*2];
|
||||
|
||||
static MenuLink_t MEO_JOYSTICKAXES = { MENU_JOYSTICKAXIS, MA_Advance, };
|
||||
static MenuEntry_t ME_JOYSTICKAXES_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXES, Link );
|
||||
|
|
Loading…
Reference in a new issue