Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 7968 → Rev 7967

/source/duke3d/src/_functio.h
279,7 → 279,7
{
};
 
#if defined GEKKO
#if defined(GEKKO)
static const char * joystickdefaults[MAXJOYBUTTONSANDHATS] =
{
"Open", // A
334,6 → 334,25
static const char * joystickdigitaldefaults[MAXJOYDIGITAL] =
{
};
#else
static const char * joystickdefaults[MAXJOYBUTTONSANDHATS] =
{
};
 
 
static const char * joystickclickeddefaults[MAXJOYBUTTONSANDHATS] =
{
};
 
 
static const char * joystickanalogdefaults[MAXJOYAXES] =
{
};
 
 
static const char * joystickdigitaldefaults[MAXJOYDIGITAL] =
{
};
#endif
 
#endif
/source/duke3d/src/config.cpp
96,34 → 96,6
}
 
 
static void CONFIG_SetJoystickButtonFunction(int i, int j, int function)
{
ud.config.JoystickFunctions[i][j] = function;
CONTROL_MapButton(function, i, j, controldevice_joystick);
}
static void CONFIG_SetJoystickAnalogAxisScale(int i, int scale)
{
ud.config.JoystickAnalogueScale[i] = scale;
CONTROL_SetAnalogAxisScale(i, scale, controldevice_joystick);
}
static void CONFIG_SetJoystickAnalogAxisDeadSaturate(int i, int dead, int saturate)
{
ud.config.JoystickAnalogueDead[i] = dead;
ud.config.JoystickAnalogueSaturate[i] = saturate;
joySetDeadZone(i, dead, saturate);
}
static void CONFIG_SetJoystickDigitalAxisFunction(int i, int j, int function)
{
ud.config.JoystickDigitalFunctions[i][j] = function;
CONTROL_MapDigitalAxis(i, function, j, controldevice_joystick);
}
static void CONFIG_SetJoystickAnalogAxisFunction(int i, int function)
{
ud.config.JoystickAnalogueAxes[i] = function;
CONTROL_MapAnalogAxis(i, function, controldevice_joystick);
}
 
 
void CONFIG_SetDefaultKeys(const char (*keyptr)[MAXGAMEFUNCLEN], bool lazy/*=false*/)
{
static char const s_gamefunc_[] = "gamefunc_";
366,9 → 338,6
CONTROL_MapAnalogAxis(i, ud.config.MouseAnalogueAxes[i], controldevice_mouse);
}
 
#if !defined GEKKO
CONFIG_SetGameControllerDefaultsStandard();
#else
for (int i=0; i<MAXJOYBUTTONSANDHATS; i++)
{
ud.config.JoystickFunctions[i][0] = CONFIG_FunctionNameToNum(joystickdefaults[i]);
392,7 → 361,6
ud.config.JoystickAnalogueAxes[i] = CONFIG_AnalogNameToNum(joystickanalogdefaults[i]);
CONTROL_MapAnalogAxis(i, ud.config.JoystickAnalogueAxes[i], controldevice_joystick);
}
#endif
 
VM_OnEvent(EVENT_SETDEFAULTS, g_player[myconnectindex].ps->i, myconnectindex);
}
576,188 → 544,7
}
}
 
struct GameControllerButtonSetting
{
GameControllerButton button;
int function;
 
void apply() const
{
CONFIG_SetJoystickButtonFunction(button, 0, function);
}
};
struct GameControllerAnalogAxisSetting
{
GameControllerAxis axis;
int function;
 
void apply() const
{
CONFIG_SetJoystickAnalogAxisFunction(axis, function);
}
};
struct GameControllerDigitalAxisSetting
{
GameControllerAxis axis;
int polarity;
int function;
 
void apply() const
{
CONFIG_SetJoystickDigitalAxisFunction(axis, polarity, function);
}
};
 
static void CONFIG_SetGameControllerAxesModern()
{
static GameControllerAnalogAxisSetting const analogAxes[] =
{
{ GAMECONTROLLER_AXIS_LEFTX, analog_strafing },
{ GAMECONTROLLER_AXIS_LEFTY, analog_moving },
{ GAMECONTROLLER_AXIS_RIGHTX, analog_turning },
{ GAMECONTROLLER_AXIS_RIGHTY, analog_lookingupanddown },
};
 
for (auto const & analogAxis : analogAxes)
analogAxis.apply();
}
 
void CONFIG_SetGameControllerDefaultsStandard()
{
CONFIG_SetGameControllerDefaultsClear();
CONFIG_SetGameControllerAxesModern();
 
static GameControllerButtonSetting const buttons[] =
{
{ GAMECONTROLLER_BUTTON_A, gamefunc_Jump },
{ GAMECONTROLLER_BUTTON_X, gamefunc_Open },
{ GAMECONTROLLER_BUTTON_Y, gamefunc_Quick_Kick },
{ GAMECONTROLLER_BUTTON_BACK, gamefunc_Map },
{ GAMECONTROLLER_BUTTON_LEFTSTICK, gamefunc_Run },
{ GAMECONTROLLER_BUTTON_RIGHTSTICK, gamefunc_Crouch },
{ GAMECONTROLLER_BUTTON_LEFTSHOULDER, gamefunc_Crouch },
{ GAMECONTROLLER_BUTTON_RIGHTSHOULDER, gamefunc_Jump },
{ GAMECONTROLLER_BUTTON_DPAD_UP, gamefunc_Previous_Weapon },
{ GAMECONTROLLER_BUTTON_DPAD_DOWN, gamefunc_Next_Weapon },
};
 
static GameControllerButtonSetting const dukebuttons[] =
{
{ GAMECONTROLLER_BUTTON_B, gamefunc_Inventory },
{ GAMECONTROLLER_BUTTON_DPAD_LEFT, gamefunc_Inventory_Left },
{ GAMECONTROLLER_BUTTON_DPAD_RIGHT, gamefunc_Inventory_Right },
};
 
static GameControllerButtonSetting const furybuttons[] =
{
{ GAMECONTROLLER_BUTTON_B, gamefunc_Steroids },
{ GAMECONTROLLER_BUTTON_DPAD_LEFT, gamefunc_MedKit },
{ GAMECONTROLLER_BUTTON_DPAD_RIGHT, gamefunc_NightVision },
};
 
for (auto const & button : buttons)
button.apply();
 
if (FURY)
{
for (auto const & button : furybuttons)
button.apply();
}
else
{
for (auto const & button : dukebuttons)
button.apply();
}
 
static GameControllerDigitalAxisSetting const digitalAxes[] =
{
{ GAMECONTROLLER_AXIS_TRIGGERLEFT, 1, gamefunc_Alt_Fire },
{ GAMECONTROLLER_AXIS_TRIGGERRIGHT, 1, gamefunc_Fire },
};
 
for (auto const & digitalAxis : digitalAxes)
digitalAxis.apply();
}
 
void CONFIG_SetGameControllerDefaultsPro()
{
CONFIG_SetGameControllerDefaultsClear();
CONFIG_SetGameControllerAxesModern();
 
static GameControllerButtonSetting const buttons[] =
{
{ GAMECONTROLLER_BUTTON_A, gamefunc_Open },
{ GAMECONTROLLER_BUTTON_B, gamefunc_Quick_Kick },
{ GAMECONTROLLER_BUTTON_Y, gamefunc_Third_Person_View },
{ GAMECONTROLLER_BUTTON_BACK, gamefunc_Map },
{ GAMECONTROLLER_BUTTON_LEFTSTICK, gamefunc_Run },
{ GAMECONTROLLER_BUTTON_RIGHTSTICK, gamefunc_Crouch },
{ GAMECONTROLLER_BUTTON_DPAD_UP, gamefunc_Previous_Weapon },
{ GAMECONTROLLER_BUTTON_DPAD_DOWN, gamefunc_Next_Weapon },
};
 
static GameControllerButtonSetting const dukebuttons[] =
{
{ GAMECONTROLLER_BUTTON_X, gamefunc_Inventory },
{ GAMECONTROLLER_BUTTON_LEFTSHOULDER, gamefunc_Previous_Weapon },
{ GAMECONTROLLER_BUTTON_RIGHTSHOULDER, gamefunc_Next_Weapon },
{ GAMECONTROLLER_BUTTON_DPAD_LEFT, gamefunc_Inventory_Left },
{ GAMECONTROLLER_BUTTON_DPAD_RIGHT, gamefunc_Inventory_Right },
};
 
static GameControllerButtonSetting const furybuttons[] =
{
{ GAMECONTROLLER_BUTTON_X, gamefunc_Steroids },
{ GAMECONTROLLER_BUTTON_LEFTSHOULDER, gamefunc_Crouch },
{ GAMECONTROLLER_BUTTON_RIGHTSHOULDER, gamefunc_Alt_Fire },
{ GAMECONTROLLER_BUTTON_DPAD_LEFT, gamefunc_MedKit },
{ GAMECONTROLLER_BUTTON_DPAD_RIGHT, gamefunc_NightVision },
};
 
for (auto const & button : buttons)
button.apply();
 
if (FURY)
{
for (auto const & button : furybuttons)
button.apply();
}
else
{
for (auto const & button : dukebuttons)
button.apply();
}
 
static GameControllerDigitalAxisSetting const digitalAxes[] =
{
{ GAMECONTROLLER_AXIS_TRIGGERLEFT, 1, gamefunc_Jump },
{ GAMECONTROLLER_AXIS_TRIGGERRIGHT, 1, gamefunc_Fire },
};
 
for (auto const & digitalAxis : digitalAxes)
digitalAxis.apply();
}
 
void CONFIG_SetGameControllerDefaultsClear()
{
for (int i=0; i<MAXJOYBUTTONSANDHATS; i++)
{
CONFIG_SetJoystickButtonFunction(i, 0, -1);
CONFIG_SetJoystickButtonFunction(i, 1, -1);
}
 
for (int i=0; i<MAXJOYAXES; i++)
{
CONFIG_SetJoystickAnalogAxisScale(i, DEFAULTJOYSTICKANALOGUESCALE);
CONFIG_SetJoystickAnalogAxisDeadSaturate(i, DEFAULTJOYSTICKANALOGUEDEAD, DEFAULTJOYSTICKANALOGUESATURATE);
 
CONFIG_SetJoystickDigitalAxisFunction(i, 0, -1);
CONFIG_SetJoystickDigitalAxisFunction(i, 1, -1);
 
CONFIG_SetJoystickAnalogAxisFunction(i, -1);
}
}
 
int CONFIG_ReadSetup(void)
{
char tempbuf[1024];
/source/duke3d/src/config.h
32,10 → 32,6
void CONFIG_SetupJoystick(void);
void CONFIG_SetDefaultKeys(const char (*keyptr)[MAXGAMEFUNCLEN], bool lazy=false);
 
void CONFIG_SetGameControllerDefaultsStandard(void);
void CONFIG_SetGameControllerDefaultsPro(void);
void CONFIG_SetGameControllerDefaultsClear(void);
 
int32_t CONFIG_GetMapBestTime(char const *mapname, uint8_t const *mapmd4);
int CONFIG_SetMapBestTime(uint8_t const *mapmd4, int32_t tm);
 
/source/duke3d/src/gamedefs.h
60,7 → 60,7
#define DEFAULTJOYSTICKANALOGUESATURATE 9500
#else
#define DEFAULTJOYSTICKANALOGUESCALE 65536
#define DEFAULTJOYSTICKANALOGUEDEAD 2000
#define DEFAULTJOYSTICKANALOGUEDEAD 1000
#define DEFAULTJOYSTICKANALOGUESATURATE 9500
#endif
 
/source/duke3d/src/input.cpp
32,42 → 32,48
 
int32_t I_CheckAllInput(void)
{
return
KB_KeyWaiting()
|| MOUSE_GetButtons()
|| JOYSTICK_GetButtons()
return (
#if defined EDUKE32_IOS
|| g_mouseClickState == MOUSE_PRESSED
g_mouseClickState == MOUSE_PRESSED ||
#endif
;
KB_KeyWaiting() ||
MOUSE_GetButtons() ||
JOYSTICK_GetButtons()
);
}
void I_ClearAllInput(void)
{
#if defined EDUKE32_IOS
mouseAdvanceClickState();
#endif
KB_FlushKeyboardQueue();
KB_ClearKeysDown();
MOUSE_ClearAllButtons();
JOYSTICK_ClearAllButtons();
CONTROL_ClearAllButtons();
#if defined EDUKE32_IOS
mouseAdvanceClickState();
#endif
}
 
 
int32_t I_AdvanceTrigger(void)
{
return
KB_KeyPressed(sc_Enter)
|| KB_KeyPressed(sc_kpad_Enter)
|| KB_KeyPressed(sc_Space)
return (
KB_KeyPressed(sc_Space) ||
KB_KeyPressed(sc_kpad_Enter) ||
KB_KeyPressed(sc_Enter) ||
#if !defined EDUKE32_TOUCH_DEVICES
|| MOUSEINACTIVECONDITIONAL(MOUSE_GetButtons()&LEFT_MOUSE)
MOUSEINACTIVECONDITIONAL(MOUSE_GetButtons()&LEFT_MOUSE) ||
#endif
|| (JOYSTICK_GetGameControllerButtons()&(1<<SDL_CONTROLLER_BUTTON_A))
#if defined(GEKKO)
|| MOUSEINACTIVECONDITIONAL(JOYSTICK_GetButtons()&WII_A)
MOUSEINACTIVECONDITIONAL(JOYSTICK_GetButtons()&WII_A)
#else
BUTTON(gamefunc_Open) ||
# if !defined EDUKE32_TOUCH_DEVICES
MOUSEINACTIVECONDITIONAL(BUTTON(gamefunc_Fire))
# else
BUTTON(gamefunc_Fire)
# endif
#endif
;
);
}
 
void I_AdvanceTriggerClear(void)
77,22 → 83,24
KB_ClearKeyDown(sc_kpad_Enter);
KB_ClearKeyDown(sc_Enter);
MOUSE_ClearButton(LEFT_MOUSE);
JOYSTICK_ClearGameControllerButton(1<<SDL_CONTROLLER_BUTTON_A);
#if defined(GEKKO)
JOYSTICK_ClearButton(WII_A);
#else
CONTROL_ClearButton(gamefunc_Open);
CONTROL_ClearButton(gamefunc_Fire);
#endif
}
 
int32_t I_ReturnTrigger(void)
{
return
KB_KeyPressed(sc_Escape)
|| (MOUSE_GetButtons()&RIGHT_MOUSE)
|| (JOYSTICK_GetGameControllerButtons()&(1<<SDL_CONTROLLER_BUTTON_B))
return (
KB_KeyPressed(sc_Escape) ||
(MOUSE_GetButtons()&RIGHT_MOUSE) ||
BUTTON(gamefunc_Crouch)
#if defined(GEKKO)
|| (JOYSTICK_GetButtons()&(WII_B|WII_HOME))
|| (JOYSTICK_GetButtons()&(WII_B|WII_HOME))
#endif
;
);
}
 
void I_ReturnTriggerClear(void)
100,7 → 108,7
KB_FlushKeyboardQueue();
KB_ClearKeyDown(sc_Escape);
MOUSE_ClearButton(RIGHT_MOUSE);
JOYSTICK_ClearGameControllerButton(1<<SDL_CONTROLLER_BUTTON_B);
CONTROL_ClearButton(gamefunc_Crouch);
#if defined(GEKKO)
JOYSTICK_ClearButton(WII_B);
JOYSTICK_ClearButton(WII_HOME);
109,20 → 117,7
 
int32_t I_GeneralTrigger(void)
{
return
I_AdvanceTrigger()
|| I_ReturnTrigger()
#if !defined GEKKO
|| BUTTON(gamefunc_Open)
# if !defined EDUKE32_TOUCH_DEVICES
|| MOUSEINACTIVECONDITIONAL(BUTTON(gamefunc_Fire))
# else
|| BUTTON(gamefunc_Fire)
# endif
#endif
|| BUTTON(gamefunc_Crouch)
|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_START))
;
return I_AdvanceTrigger() || I_ReturnTrigger();
}
 
void I_GeneralTriggerClear(void)
129,24 → 124,17
{
I_AdvanceTriggerClear();
I_ReturnTriggerClear();
#if !defined GEKKO
CONTROL_ClearButton(gamefunc_Open);
CONTROL_ClearButton(gamefunc_Fire);
#endif
CONTROL_ClearButton(gamefunc_Crouch);
JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_START);
}
 
 
int32_t I_EscapeTrigger(void)
{
return
KB_KeyPressed(sc_Escape)
|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_START))
return (
KB_KeyPressed(sc_Escape)
#if defined(GEKKO)
|| (JOYSTICK_GetButtons()&WII_HOME)
|| (JOYSTICK_GetButtons()&WII_HOME)
#endif
;
);
}
 
void I_EscapeTriggerClear(void)
153,7 → 141,6
{
KB_FlushKeyboardQueue();
KB_ClearKeyDown(sc_Escape);
JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_START);
#if defined(GEKKO)
JOYSTICK_ClearButton(WII_HOME);
#endif
162,14 → 149,13
 
int32_t I_MenuUp(void)
{
return
KB_KeyPressed(sc_UpArrow)
|| KB_KeyPressed(sc_kpad_8)
|| (MOUSE_GetButtons()&WHEELUP_MOUSE)
|| BUTTON(gamefunc_Move_Forward)
|| (JOYSTICK_GetHat(0)&HAT_UP)
|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_DPAD_UP))
;
return (
KB_KeyPressed(sc_UpArrow) ||
KB_KeyPressed(sc_kpad_8) ||
(MOUSE_GetButtons()&WHEELUP_MOUSE) ||
BUTTON(gamefunc_Move_Forward) ||
(JOYSTICK_GetHat(0)&HAT_UP)
);
}
 
void I_MenuUpClear(void)
179,20 → 165,18
MOUSE_ClearButton(WHEELUP_MOUSE);
CONTROL_ClearButton(gamefunc_Move_Forward);
JOYSTICK_ClearHat(0);
JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_DPAD_UP);
}
 
 
int32_t I_MenuDown(void)
{
return
KB_KeyPressed(sc_DownArrow)
|| KB_KeyPressed(sc_kpad_2)
|| (MOUSE_GetButtons()&WHEELDOWN_MOUSE)
|| BUTTON(gamefunc_Move_Backward)
|| (JOYSTICK_GetHat(0)&HAT_DOWN)
|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_DPAD_DOWN))
;
return (
KB_KeyPressed(sc_DownArrow) ||
KB_KeyPressed(sc_kpad_2) ||
(MOUSE_GetButtons()&WHEELDOWN_MOUSE) ||
BUTTON(gamefunc_Move_Backward) ||
(JOYSTICK_GetHat(0)&HAT_DOWN)
);
}
 
void I_MenuDownClear(void)
203,21 → 187,19
MOUSE_ClearButton(WHEELDOWN_MOUSE);
CONTROL_ClearButton(gamefunc_Move_Backward);
JOYSTICK_ClearHat(0);
JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_DPAD_DOWN);
}
 
 
int32_t I_MenuLeft(void)
{
return
KB_KeyPressed(sc_LeftArrow)
|| KB_KeyPressed(sc_kpad_4)
|| (SHIFTS_IS_PRESSED && KB_KeyPressed(sc_Tab))
|| BUTTON(gamefunc_Turn_Left)
|| BUTTON(gamefunc_Strafe_Left)
|| (JOYSTICK_GetHat(0)&HAT_LEFT)
|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_DPAD_LEFT))
;
return (
KB_KeyPressed(sc_LeftArrow) ||
KB_KeyPressed(sc_kpad_4) ||
(SHIFTS_IS_PRESSED && KB_KeyPressed(sc_Tab)) ||
BUTTON(gamefunc_Turn_Left) ||
BUTTON(gamefunc_Strafe_Left) ||
(JOYSTICK_GetHat(0)&HAT_LEFT)
);
}
 
void I_MenuLeftClear(void)
228,22 → 210,20
CONTROL_ClearButton(gamefunc_Turn_Left);
CONTROL_ClearButton(gamefunc_Strafe_Left);
JOYSTICK_ClearHat(0);
JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_DPAD_LEFT);
}
 
 
int32_t I_MenuRight(void)
{
return
KB_KeyPressed(sc_RightArrow)
|| KB_KeyPressed(sc_kpad_6)
|| (!SHIFTS_IS_PRESSED && KB_KeyPressed(sc_Tab))
|| BUTTON(gamefunc_Turn_Right)
|| BUTTON(gamefunc_Strafe_Right)
|| (MOUSE_GetButtons()&MIDDLE_MOUSE)
|| (JOYSTICK_GetHat(0)&HAT_RIGHT)
|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_DPAD_RIGHT))
;
return (
KB_KeyPressed(sc_RightArrow) ||
KB_KeyPressed(sc_kpad_6) ||
(!SHIFTS_IS_PRESSED && KB_KeyPressed(sc_Tab)) ||
BUTTON(gamefunc_Turn_Right) ||
BUTTON(gamefunc_Strafe_Right) ||
(MOUSE_GetButtons()&MIDDLE_MOUSE) ||
(JOYSTICK_GetHat(0)&HAT_RIGHT)
);
}
 
void I_MenuRightClear(void)
255,42 → 235,41
CONTROL_ClearButton(gamefunc_Strafe_Right);
MOUSE_ClearButton(MIDDLE_MOUSE);
JOYSTICK_ClearHat(0);
JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_DPAD_RIGHT);
}
 
 
int32_t I_PanelUp(void)
{
return
I_MenuUp()
|| I_MenuLeft()
|| KB_KeyPressed(sc_PgUp)
;
return (
KB_KeyPressed(sc_PgUp) ||
I_MenuUp() ||
I_MenuLeft()
);
}
 
void I_PanelUpClear(void)
{
KB_ClearKeyDown(sc_PgUp);
I_MenuUpClear();
I_MenuLeftClear();
KB_ClearKeyDown(sc_PgUp);
}
 
 
int32_t I_PanelDown(void)
{
return
I_MenuDown()
|| I_MenuRight()
|| KB_KeyPressed(sc_PgDn)
|| I_AdvanceTrigger()
;
return (
KB_KeyPressed(sc_PgDn) ||
I_MenuDown() ||
I_MenuRight() ||
I_AdvanceTrigger()
);
}
 
void I_PanelDownClear(void)
{
KB_ClearKeyDown(sc_PgDn);
I_MenuDownClear();
I_MenuRightClear();
KB_ClearKeyDown(sc_PgDn);
I_AdvanceTriggerClear();
}
 
297,12 → 276,12
 
int32_t I_SliderLeft(void)
{
return
I_MenuLeft()
return (
#if !defined EDUKE32_TOUCH_DEVICES
|| MOUSEINACTIVECONDITIONAL((MOUSE_GetButtons()&LEFT_MOUSE) && (MOUSE_GetButtons()&WHEELUP_MOUSE))
MOUSEINACTIVECONDITIONAL((MOUSE_GetButtons()&LEFT_MOUSE) && (MOUSE_GetButtons()&WHEELUP_MOUSE)) ||
#endif
;
I_MenuLeft()
);
}
 
void I_SliderLeftClear(void)
314,12 → 293,12
 
int32_t I_SliderRight(void)
{
return
I_MenuRight()
return (
#if !defined EDUKE32_TOUCH_DEVICES
|| MOUSEINACTIVECONDITIONAL((MOUSE_GetButtons()&LEFT_MOUSE) && (MOUSE_GetButtons()&WHEELDOWN_MOUSE))
MOUSEINACTIVECONDITIONAL((MOUSE_GetButtons()&LEFT_MOUSE) && (MOUSE_GetButtons()&WHEELDOWN_MOUSE)) ||
#endif
;
I_MenuRight()
);
}
 
void I_SliderRightClear(void)
/source/duke3d/src/menus.cpp
238,7 → 238,6
static MenuEntryFormat_t MEF_CenterMenu = { 7<<16, 0, 0 };
static MenuEntryFormat_t MEF_BigOptions_Apply = { 4<<16, 16<<16, -(260<<16) };
static MenuEntryFormat_t MEF_BigOptionsRt = { 4<<16, 0, -(260<<16) };
static MenuEntryFormat_t MEF_BigOptionsRtSections = { 3<<16, 0, -(260<<16) };
#if defined USE_OPENGL || !defined EDUKE32_ANDROID_MENU
static MenuEntryFormat_t MEF_SmallOptions = { 1<<16, 0, -(260<<16) };
#endif
481,12 → 480,12
#ifndef EDUKE32_ANDROID_MENU
MAKE_MENU_TOP_ENTRYLINK( "Control Setup", MEF_OptionsMenu, OPTIONS_CONTROLS, MENU_CONTROLS );
 
MAKE_MENU_TOP_ENTRYLINK( "Keyboard Setup", MEF_BigOptionsRtSections, OPTIONS_KEYBOARDSETUP, MENU_KEYBOARDSETUP );
MAKE_MENU_TOP_ENTRYLINK( "Mouse Setup", MEF_BigOptionsRtSections, OPTIONS_MOUSESETUP, MENU_MOUSESETUP );
MAKE_MENU_TOP_ENTRYLINK( "Keyboard Setup", MEF_BigOptionsRt, OPTIONS_KEYBOARDSETUP, MENU_KEYBOARDSETUP );
MAKE_MENU_TOP_ENTRYLINK( "Mouse Setup", MEF_BigOptionsRt, OPTIONS_MOUSESETUP, MENU_MOUSESETUP );
#endif
MAKE_MENU_TOP_ENTRYLINK( "Joystick Setup", MEF_BigOptionsRtSections, OPTIONS_JOYSTICKSETUP, MENU_JOYSTICKSETUP );
MAKE_MENU_TOP_ENTRYLINK( "Joystick Setup", MEF_BigOptionsRt, OPTIONS_JOYSTICKSETUP, MENU_JOYSTICKSETUP );
#ifdef EDUKE32_ANDROID_MENU
MAKE_MENU_TOP_ENTRYLINK( "Touch Setup", MEF_BigOptionsRtSections, OPTIONS_TOUCHSETUP, MENU_TOUCHSETUP );
MAKE_MENU_TOP_ENTRYLINK( "Touch Setup", MEF_BigOptionsRt, OPTIONS_TOUCHSETUP, MENU_TOUCHSETUP );
#endif
#ifdef EDUKE32_SIMPLE_MENU
MAKE_MENU_TOP_ENTRYLINK("Cheats", MEF_OptionsMenu, OPTIONS_CHEATS, MENU_CHEATS);
716,9 → 715,9
&ME_OPTIONS_MOUSESETUP,
&ME_OPTIONS_JOYSTICKSETUP,
#else
&ME_OPTIONS_TOUCHSETUP,
&ME_OPTIONS_TOUCHSETUP
#endif
&ME_Space6_Redfont,
&ME_Space2_Redfont,
&ME_GAMESETUP_AIM_AUTO,
};
 
945,20 → 944,12
};
#endif
 
MAKE_MENU_TOP_ENTRYLINK( "Edit Buttons", MEF_BigOptionsRtSections, JOYSTICK_EDITBUTTONS, MENU_JOYSTICKBTNS );
MAKE_MENU_TOP_ENTRYLINK( "Edit Axes", MEF_BigOptionsRtSections, JOYSTICK_EDITAXES, MENU_JOYSTICKAXES );
MAKE_MENU_TOP_ENTRYLINK( "Edit Buttons", MEF_CenterMenu, JOYSTICK_EDITBUTTONS, MENU_JOYSTICKBTNS );
MAKE_MENU_TOP_ENTRYLINK( "Edit Axes", MEF_CenterMenu, JOYSTICK_EDITAXES, MENU_JOYSTICKAXES );
 
static MenuEntry_t ME_JOYSTICK_DEFAULTS_STANDARD = MAKE_MENUENTRY( "Use Standard Layout", &MF_Redfont, &MEF_BigOptionsRtSections, &MEO_NULL, Link );
static MenuEntry_t ME_JOYSTICK_DEFAULTS_PRO = MAKE_MENUENTRY( "Use Pro Layout", &MF_Redfont, &MEF_BigOptionsRtSections, &MEO_NULL, Link );
static MenuEntry_t ME_JOYSTICK_DEFAULTS_CLEAR = MAKE_MENUENTRY( "Clear All Settings", &MF_Redfont, &MEF_BigOptionsRtSections, &MEO_NULL, Link );
 
static MenuEntry_t *MEL_JOYSTICKSETUP[] = {
&ME_JOYSTICK_EDITBUTTONS,
&ME_JOYSTICK_EDITAXES,
&ME_Space6_Redfont,
&ME_JOYSTICK_DEFAULTS_STANDARD,
&ME_JOYSTICK_DEFAULTS_PRO,
&ME_JOYSTICK_DEFAULTS_CLEAR,
};
 
#define MAXJOYBUTTONSTRINGLENGTH 32
1403,7 → 1394,7
static MenuMenu_t M_TOUCHSENS = MAKE_MENUMENU( "Sensitivity", &MMF_BigOptions, MEL_TOUCHSENS);
static MenuPanel_t M_TOUCHBUTTONS = { "Button Setup", MENU_TOUCHSETUP, MA_Return, MENU_TOUCHSETUP, MA_Advance, };
#endif
static MenuMenu_t M_JOYSTICKSETUP = MAKE_MENUMENU( "Joystick Setup", &MMF_BigOptions, MEL_JOYSTICKSETUP );
static MenuMenu_t M_JOYSTICKSETUP = MAKE_MENUMENU( "Joystick Setup", &MMF_Top_Joystick_Network, MEL_JOYSTICKSETUP );
static MenuMenu_t M_JOYSTICKBTNS = MAKE_MENUMENU( "Joystick Buttons", &MMF_MouseJoySetupBtns, MEL_JOYSTICKBTNS );
static MenuMenu_t M_JOYSTICKAXES = MAKE_MENUMENU( "Joystick Axes", &MMF_BigSliders, MEL_JOYSTICKAXES );
static MenuMenu_t M_KEYBOARDKEYS = MAKE_MENUMENU( "Key Configuration", &MMF_KeyboardSetupFuncs, MEL_KEYBOARDSETUPFUNCS );
2144,11 → 2135,6
MenuEntry_DisableOnCondition(&ME_SAVESETUP_MAXAUTOSAVES, !ud.autosavedeletion);
break;
 
case MENU_JOYSTICKSETUP:
MenuEntry_DisableOnCondition(&ME_JOYSTICK_DEFAULTS_STANDARD, !joystick.isGameController);
MenuEntry_DisableOnCondition(&ME_JOYSTICK_DEFAULTS_PRO, !joystick.isGameController);
break;
 
#ifndef EDUKE32_SIMPLE_MENU
case MENU_MOUSESETUP:
MenuEntry_DisableOnCondition(&ME_MOUSESETUP_MOUSEAIMING, ud.mouseaiming);
3180,15 → 3166,6
break;
}
 
case MENU_JOYSTICKSETUP:
if (entry == &ME_JOYSTICK_DEFAULTS_STANDARD)
CONFIG_SetGameControllerDefaultsStandard();
else if (entry == &ME_JOYSTICK_DEFAULTS_PRO)
CONFIG_SetGameControllerDefaultsPro();
else if (entry == &ME_JOYSTICK_DEFAULTS_CLEAR)
CONFIG_SetGameControllerDefaultsClear();
break;
 
case MENU_JOYSTICKAXES:
M_JOYSTICKAXIS.title = joyGetName(0, M_JOYSTICKAXES.currentEntry);
MEO_JOYSTICKAXIS_ANALOG.data = &ud.config.JoystickAnalogueAxes[M_JOYSTICKAXES.currentEntry];