mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-22 10:52:23 +00:00
Branch G_Controldefault into FPS and PLATFORM
This commit is contained in:
parent
896de73c60
commit
727ca143b5
3 changed files with 66 additions and 38 deletions
|
@ -611,42 +611,66 @@ INT32 G_KeyStringtoNum(const char *keystr)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void G_Controldefault(void)
|
||||
void G_Controldefault(INT32 scheme, boolean setcommon)
|
||||
{
|
||||
gamecontrol[gc_forward ][0] = 'w';
|
||||
gamecontrol[gc_backward ][0] = 's';
|
||||
gamecontrol[gc_strafeleft ][0] = 'a';
|
||||
gamecontrol[gc_straferight][0] = 'd';
|
||||
gamecontrol[gc_turnleft ][0] = KEY_LEFTARROW;
|
||||
gamecontrol[gc_turnright ][0] = KEY_RIGHTARROW;
|
||||
gamecontrol[gc_weaponnext ][0] = 'e';
|
||||
gamecontrol[gc_weaponprev ][0] = 'q';
|
||||
gamecontrol[gc_wepslot1 ][0] = '1';
|
||||
gamecontrol[gc_wepslot2 ][0] = '2';
|
||||
gamecontrol[gc_wepslot3 ][0] = '3';
|
||||
gamecontrol[gc_wepslot4 ][0] = '4';
|
||||
gamecontrol[gc_wepslot5 ][0] = '5';
|
||||
gamecontrol[gc_wepslot6 ][0] = '6';
|
||||
gamecontrol[gc_wepslot7 ][0] = '7';
|
||||
gamecontrol[gc_wepslot8 ][0] = '8';
|
||||
gamecontrol[gc_wepslot9 ][0] = '9';
|
||||
gamecontrol[gc_wepslot10 ][0] = '0';
|
||||
gamecontrol[gc_fire ][0] = KEY_RCTRL;
|
||||
gamecontrol[gc_fire ][1] = KEY_MOUSE1+0;
|
||||
gamecontrol[gc_firenormal ][0] = 'c';
|
||||
gamecontrol[gc_tossflag ][0] = '\'';
|
||||
gamecontrol[gc_use ][0] = KEY_LSHIFT;
|
||||
gamecontrol[gc_camtoggle ][0] = 'v';
|
||||
gamecontrol[gc_camreset ][0] = 'r';
|
||||
gamecontrol[gc_lookup ][0] = KEY_UPARROW;
|
||||
gamecontrol[gc_lookdown ][0] = KEY_DOWNARROW;
|
||||
gamecontrol[gc_centerview ][0] = KEY_END;
|
||||
gamecontrol[gc_talkkey ][0] = 't';
|
||||
gamecontrol[gc_teamkey ][0] = 'y';
|
||||
gamecontrol[gc_scores ][0] = KEY_TAB;
|
||||
gamecontrol[gc_jump ][0] = KEY_SPACE;
|
||||
gamecontrol[gc_console ][0] = KEY_CONSOLE;
|
||||
gamecontrol[gc_pause ][0] = KEY_PAUSE;
|
||||
if (scheme == CONTROL_DEFAULT_PLATFORM)
|
||||
{
|
||||
gamecontrol[gc_forward ][0] = KEY_UPARROW;
|
||||
gamecontrol[gc_backward ][0] = KEY_DOWNARROW;
|
||||
gamecontrol[gc_strafeleft ][0] = 'a';
|
||||
gamecontrol[gc_straferight][0] = 'd';
|
||||
gamecontrol[gc_lookup ][0] = KEY_PGUP;
|
||||
gamecontrol[gc_lookdown ][0] = KEY_PGDN;
|
||||
gamecontrol[gc_turnleft ][0] = KEY_LEFTARROW;
|
||||
gamecontrol[gc_turnright ][0] = KEY_RIGHTARROW;
|
||||
gamecontrol[gc_centerview ][0] = KEY_END;
|
||||
gamecontrol[gc_jump ][0] = KEY_SPACE;
|
||||
gamecontrol[gc_use ][0] = KEY_LSHIFT;
|
||||
gamecontrol[gc_fire ][0] = 's';
|
||||
gamecontrol[gc_fire ][1] = KEY_MOUSE1+0;
|
||||
gamecontrol[gc_firenormal ][0] = 'w';
|
||||
}
|
||||
else // if (scheme == CONTROL_DEFAULT_FPS)
|
||||
{
|
||||
gamecontrol[gc_forward ][0] = 'w';
|
||||
gamecontrol[gc_backward ][0] = 's';
|
||||
gamecontrol[gc_strafeleft ][0] = 'a';
|
||||
gamecontrol[gc_straferight][0] = 'd';
|
||||
gamecontrol[gc_lookup ][0] = KEY_UPARROW;
|
||||
gamecontrol[gc_lookdown ][0] = KEY_DOWNARROW;
|
||||
gamecontrol[gc_turnleft ][0] = KEY_LEFTARROW;
|
||||
gamecontrol[gc_turnright ][0] = KEY_RIGHTARROW;
|
||||
gamecontrol[gc_centerview ][0] = KEY_END;
|
||||
gamecontrol[gc_jump ][0] = KEY_SPACE;
|
||||
gamecontrol[gc_use ][0] = KEY_LSHIFT;
|
||||
gamecontrol[gc_fire ][0] = KEY_RCTRL;
|
||||
gamecontrol[gc_fire ][1] = KEY_MOUSE1+0;
|
||||
gamecontrol[gc_firenormal ][0] = 'c';
|
||||
}
|
||||
|
||||
if (setcommon)
|
||||
{
|
||||
gamecontrol[gc_weaponnext ][0] = 'e';
|
||||
gamecontrol[gc_weaponprev ][0] = 'q';
|
||||
gamecontrol[gc_wepslot1 ][0] = '1';
|
||||
gamecontrol[gc_wepslot2 ][0] = '2';
|
||||
gamecontrol[gc_wepslot3 ][0] = '3';
|
||||
gamecontrol[gc_wepslot4 ][0] = '4';
|
||||
gamecontrol[gc_wepslot5 ][0] = '5';
|
||||
gamecontrol[gc_wepslot6 ][0] = '6';
|
||||
gamecontrol[gc_wepslot7 ][0] = '7';
|
||||
gamecontrol[gc_wepslot8 ][0] = '8';
|
||||
gamecontrol[gc_wepslot9 ][0] = '9';
|
||||
gamecontrol[gc_wepslot10 ][0] = '0';
|
||||
gamecontrol[gc_tossflag ][0] = '\'';
|
||||
gamecontrol[gc_camtoggle ][0] = 'v';
|
||||
gamecontrol[gc_camreset ][0] = 'r';
|
||||
gamecontrol[gc_talkkey ][0] = 't';
|
||||
gamecontrol[gc_teamkey ][0] = 'y';
|
||||
gamecontrol[gc_scores ][0] = KEY_TAB;
|
||||
gamecontrol[gc_console ][0] = KEY_CONSOLE;
|
||||
gamecontrol[gc_pause ][0] = KEY_PAUSE;
|
||||
}
|
||||
}
|
||||
|
||||
void G_SaveKeySetting(FILE *f)
|
||||
|
|
|
@ -27,6 +27,10 @@
|
|||
#define JOYHATS 4 // 4 hats
|
||||
#define JOYAXISSET 4 // 4 Sets of 2 axises
|
||||
|
||||
#define CONTROL_DEFAULT_FPS 0
|
||||
#define CONTROL_DEFAULT_PLATFORM 1
|
||||
#define CONTROL_DEFAULT_CUSTOM 2
|
||||
|
||||
//
|
||||
// mouse and joystick buttons are handled as 'virtual' keys
|
||||
//
|
||||
|
@ -133,7 +137,7 @@ INT32 G_KeyStringtoNum(const char *keystr);
|
|||
void G_ClearControlKeys(INT32 (*setupcontrols)[2], INT32 control);
|
||||
void Command_Setcontrol_f(void);
|
||||
void Command_Setcontrol2_f(void);
|
||||
void G_Controldefault(void);
|
||||
void G_Controldefault(INT32 scheme);
|
||||
void G_SaveKeySetting(FILE *f);
|
||||
void G_CheckDoubleUsage(INT32 keynum);
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ typedef off_t off64_t;
|
|||
|
||||
#if defined(__MINGW32__) && ((__GNUC__ > 7) || (__GNUC__ == 6 && __GNUC_MINOR__ >= 3))
|
||||
#define PRIdS "u"
|
||||
#elif defined (_WIN32)
|
||||
#elif defined (_WIN32)
|
||||
#define PRIdS "Iu"
|
||||
#elif defined (DJGPP)
|
||||
#define PRIdS "u"
|
||||
|
@ -475,7 +475,7 @@ void M_FirstLoadConfig(void)
|
|||
}
|
||||
|
||||
// load default control
|
||||
G_Controldefault();
|
||||
G_Controldefault(CONTROL_DEFAULT_FPS, true);
|
||||
|
||||
// load config, make sure those commands doesnt require the screen...
|
||||
COM_BufInsertText(va("exec \"%s\"\n", configfile));
|
||||
|
|
Loading…
Reference in a new issue