mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
Input changes from JonoF
git-svn-id: https://svn.eduke32.com/eduke32@171 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
85452ab0d5
commit
c6e003ee9b
7 changed files with 142 additions and 201 deletions
|
@ -59,7 +59,7 @@ int32 MixRate;
|
|||
//int32 MidiPort;
|
||||
int32 ReverseStereo;
|
||||
|
||||
int32 ControllerType;
|
||||
int32 UseJoystick = 0, UseMouse = 1;
|
||||
int32 RunMode;
|
||||
int32 AutoAim; // JBF 20031125
|
||||
int32 ShowOpponentWeapons;
|
||||
|
@ -200,7 +200,6 @@ void CONFIG_SetDefaults( void )
|
|||
|
||||
AmbienceToggle = 1;
|
||||
AutoAim = 1;
|
||||
ControllerType = 1;
|
||||
FXDevice = 0;
|
||||
FXVolume = 220;
|
||||
MixRate = 44100;
|
||||
|
@ -241,6 +240,8 @@ void CONFIG_SetDefaults( void )
|
|||
ud.statusbarmode = 0;
|
||||
ud.statusbarscale = 100;
|
||||
ud.weaponswitch = 3; // new+empty
|
||||
UseJoystick = 0;
|
||||
UseMouse = 1;
|
||||
VoiceToggle = 2;
|
||||
|
||||
Bstrcpy(ud.rtsname, "DUKE.RTS");
|
||||
|
@ -670,13 +671,13 @@ void CONFIG_ReadSetup( void )
|
|||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "MixRate",&MixRate);
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "ReverseStereo",&ReverseStereo);
|
||||
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","ControllerType",&ControllerType);
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","MouseAimingFlipped",&ud.mouseflip); // mouse aiming inverted
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","MouseAiming",&ud.mouseaiming); // 1=momentary/0=toggle
|
||||
ps[0].aim_mode = ud.mouseaiming;
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","MouseFilter",&MouseFilter);
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","SmoothInput",&SmoothInput);
|
||||
//SCRIPT_GetNumber( scripthandle, "Controls","GameMouseAiming",(int32 *)&ps[0].aim_mode); // dupe of below (?)
|
||||
ps[0].aim_mode = ud.mouseaiming;
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","UseJoystick",&UseJoystick);
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","UseMouse",&UseMouse);
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","AimingFlag",(int32 *)&myaimmode); // (if toggle mode) gives state
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","RunKeyBehaviour",&ud.runkey_mode); // JBF 20031125
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","AutoAim",&AutoAim); // JBF 20031125
|
||||
|
@ -713,12 +714,13 @@ void CONFIG_WriteSetup( void )
|
|||
|
||||
SCRIPT_PutNumber( scripthandle, "Controls","AimingFlag",(long) myaimmode,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Controls","AutoAim",AutoAim,false,false);
|
||||
// SCRIPT_PutNumber( scripthandle, "Controls","GameMouseAiming",(int32) ps[myconnectindex].aim_mode,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Controls", "MouseAimingFlipped",ud.mouseflip,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Controls","MouseAimingFlipped",ud.mouseflip,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Controls","MouseAiming",ud.mouseaiming,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Controls","MouseFilter",MouseFilter,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Controls","SmoothInput",SmoothInput,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Controls","RunKeyBehaviour",ud.runkey_mode,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Controls","UseJoystick",UseJoystick,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Controls","UseMouse",UseMouse,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Controls","WeaponSwitchMode",ud.weaponswitch,false,false);
|
||||
|
||||
SCRIPT_PutNumber( scripthandle, "Misc", "AutoMsg",ud.automsg,false,false);
|
||||
|
|
|
@ -42,7 +42,7 @@ extern int32 MixRate;
|
|||
//extern int32 MidiPort;
|
||||
extern int32 ReverseStereo;
|
||||
|
||||
extern int32 ControllerType;
|
||||
extern int32 UseJoystick, UseMouse;
|
||||
extern int32 RunMode;
|
||||
extern int32 AutoAim;
|
||||
extern int32 MouseFilter;
|
||||
|
|
|
@ -7645,6 +7645,7 @@ static int parse_rancid_net(scriptfile *script)
|
|||
Bsprintf(tempbuf,"%s",strtok(NULL,":"));
|
||||
if(atoi(tempbuf) > 1024)
|
||||
Bsprintf(rancid_local_port_string,"-p %s",tempbuf);
|
||||
Bfree(ip);
|
||||
}
|
||||
break;
|
||||
case T_MODE:
|
||||
|
@ -7652,6 +7653,7 @@ static int parse_rancid_net(scriptfile *script)
|
|||
char *mode;
|
||||
|
||||
if (scriptfile_getstring(script,&mode)) break;
|
||||
Bfree(mode);
|
||||
}
|
||||
break;
|
||||
case T_ALLOW:
|
||||
|
@ -7660,6 +7662,7 @@ static int parse_rancid_net(scriptfile *script)
|
|||
|
||||
if (scriptfile_getstring(script,&ip)) break;
|
||||
Bstrcpy(rancid_ip_strings[rancid_players++],ip);
|
||||
Bfree(ip);
|
||||
}
|
||||
break;
|
||||
case T_EOF:
|
||||
|
@ -7751,7 +7754,7 @@ void checkcommandline(int argc,char **argv)
|
|||
{
|
||||
if(load_rancid_net(CommandNet) != -1)
|
||||
{
|
||||
char tmp[16];
|
||||
char tmp[32];
|
||||
|
||||
CommandNet = 0;
|
||||
|
||||
|
@ -7827,10 +7830,10 @@ void checkcommandline(int argc,char **argv)
|
|||
{
|
||||
if(Bstrcmp(rancid_ip_strings[j],rancid_ip_strings[MAXPLAYERS]) == 0)
|
||||
Bsprintf(rancid_ip_strings[j],"/n1");
|
||||
netparam[j] = rancid_ip_strings[j];
|
||||
netparam[j] = (char *)&rancid_ip_strings[j];
|
||||
}
|
||||
if(j != netparamcount)
|
||||
netparam[j] = rancid_local_port_string;
|
||||
netparam[j] = (char *)&rancid_local_port_string;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
|
@ -8533,21 +8536,22 @@ void Startup(void)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
if (CONTROL_Startup( ControllerType, &GetTime, TICRATE )) {
|
||||
if (CONTROL_Startup( 1, &GetTime, TICRATE )) {
|
||||
uninitengine();
|
||||
exit(1);
|
||||
}
|
||||
SetupGameButtons();
|
||||
CONFIG_SetupMouse();
|
||||
CONFIG_SetupJoystick();
|
||||
CONFIG_SetupMouse();
|
||||
CONFIG_SetupJoystick();
|
||||
|
||||
CONTROL_JoystickEnabled = (UseJoystick && CONTROL_JoyPresent);
|
||||
CONTROL_MouseEnabled = (UseMouse && CONTROL_MousePresent);
|
||||
|
||||
// JBF 20040215: evil and nasty place to do this, but joysticks are evil and nasty too
|
||||
if (ControllerType == controltype_keyboardandjoystick) {
|
||||
for (i=0;i<joynumaxes;i++)
|
||||
setjoydeadzone(i,JoystickAnalogueDead[i],JoystickAnalogueSaturate[i]);
|
||||
}
|
||||
|
||||
inittimer(TICRATE);
|
||||
// JBF 20040215: evil and nasty place to do this, but joysticks are evil and nasty too
|
||||
for (i=0;i<joynumaxes;i++)
|
||||
setjoydeadzone(i,JoystickAnalogueDead[i],JoystickAnalogueSaturate[i]);
|
||||
|
||||
inittimer(TICRATE);
|
||||
|
||||
//initprintf("* Hold Esc to Abort. *\n");
|
||||
initprintf("Loading art header...\n");
|
||||
|
@ -8564,7 +8568,10 @@ void Startup(void)
|
|||
for(i=0;i<MAXPLAYERS;i++) playerreadyflag[i] = 0;
|
||||
|
||||
if(Bstrlen(rancid_ip_strings[MAXPLAYERS]))
|
||||
initprintf("net: Using %s as sort IP\n",rancid_ip_strings[MAXPLAYERS]);
|
||||
{
|
||||
initprintf("rmnet: Using %s as sort IP\n",rancid_ip_strings[MAXPLAYERS]);
|
||||
initprintf("rmnet: %d players\n",rancid_players);
|
||||
}
|
||||
|
||||
//initmultiplayers(netparamcount,netparam, 0,0,0);
|
||||
if (initmultiplayersparms(netparamcount,netparam)) {
|
||||
|
@ -8894,16 +8901,6 @@ void app_main(int argc,char **argv)
|
|||
RTS_Init(ud.rtsname);
|
||||
if(numlumps) initprintf("Using .RTS file: %s\n",ud.rtsname);
|
||||
|
||||
if (CONTROL_JoystickEnabled)
|
||||
CONTROL_CenterJoystick
|
||||
(
|
||||
CenterCenter,
|
||||
UpperLeft,
|
||||
LowerRight,
|
||||
CenterThrottle,
|
||||
CenterRudder
|
||||
);
|
||||
|
||||
if( setgamemode(ScreenMode,ScreenWidth,ScreenHeight,ScreenBPP) < 0 )
|
||||
{
|
||||
int i = 0;
|
||||
|
|
|
@ -824,84 +824,10 @@ void CONTROL_GetInput( ControlInfo *info )
|
|||
|
||||
void CONTROL_WaitRelease( void )
|
||||
{
|
||||
/*
|
||||
155C CONTROL_WaitRelease_:
|
||||
155C 83 EC 0C sub esp,0x0000000c
|
||||
155F L$170:
|
||||
155F 89 E0 mov eax,esp
|
||||
1561 E8 00 00 00 00 call CONTROL_GetUserInput_
|
||||
1566 80 7C 24 08 08 cmp byte ptr 0x8[esp],0x08
|
||||
156B 75 F2 jne L$170
|
||||
156D 83 3C 24 00 cmp dword ptr [esp],0x00000000
|
||||
1571 75 EC jne L$170
|
||||
1573 83 7C 24 04 00 cmp dword ptr 0x4[esp],0x00000000
|
||||
1578 75 E5 jne L$170
|
||||
157A 83 C4 0C add esp,0x0000000c
|
||||
157D C3 ret
|
||||
157E 8B C0 mov eax,eax
|
||||
*/
|
||||
}
|
||||
|
||||
void CONTROL_Ack( void )
|
||||
{
|
||||
/*
|
||||
1580 CONTROL_Ack_:
|
||||
1580 53 push ebx
|
||||
1581 51 push ecx
|
||||
1582 52 push edx
|
||||
1583 56 push esi
|
||||
1584 55 push ebp
|
||||
1585 83 EC 18 sub esp,0x00000018
|
||||
1588 8D 44 24 0C lea eax,0xc[esp]
|
||||
158C E8 00 00 00 00 call CONTROL_GetUserInput_
|
||||
1591 31 DB xor ebx,ebx
|
||||
1593 L$171:
|
||||
1593 89 E0 mov eax,esp
|
||||
1595 E8 00 00 00 00 call CONTROL_GetUserInput_
|
||||
159A 8B 14 24 mov edx,[esp]
|
||||
159D 39 D3 cmp ebx,edx
|
||||
159F 75 04 jne L$172
|
||||
15A1 89 54 24 0C mov 0xc[esp],edx
|
||||
15A5 L$172:
|
||||
15A5 8B 4C 24 04 mov ecx,0x4[esp]
|
||||
15A9 39 CB cmp ebx,ecx
|
||||
15AB 75 04 jne L$173
|
||||
15AD 89 4C 24 10 mov 0x10[esp],ecx
|
||||
15B1 L$173:
|
||||
15B1 8B 74 24 0C mov esi,0xc[esp]
|
||||
15B5 39 F3 cmp ebx,esi
|
||||
15B7 75 0C jne L$174
|
||||
15B9 3B 34 24 cmp esi,[esp]
|
||||
15BC 74 07 je L$174
|
||||
15BE B8 01 00 00 00 mov eax,0x00000001
|
||||
15C3 EB 02 jmp L$175
|
||||
15C5 L$174:
|
||||
15C5 89 D8 mov eax,ebx
|
||||
15C7 L$175:
|
||||
15C7 8B 6C 24 10 mov ebp,0x10[esp]
|
||||
15CB 89 C2 mov edx,eax
|
||||
15CD 39 EB cmp ebx,ebp
|
||||
15CF 75 0D jne L$176
|
||||
15D1 3B 6C 24 04 cmp ebp,0x4[esp]
|
||||
15D5 74 07 je L$176
|
||||
15D7 B8 01 00 00 00 mov eax,0x00000001
|
||||
15DC EB 02 jmp L$177
|
||||
15DE L$176:
|
||||
15DE 89 D8 mov eax,ebx
|
||||
15E0 L$177:
|
||||
15E0 85 D2 test edx,edx
|
||||
15E2 75 04 jne L$178
|
||||
15E4 85 C0 test eax,eax
|
||||
15E6 74 AB je L$171
|
||||
15E8 L$178:
|
||||
15E8 83 C4 18 add esp,0x00000018
|
||||
15EB 5D pop ebp
|
||||
15EC 5E pop esi
|
||||
15ED 5A pop edx
|
||||
15EE 59 pop ecx
|
||||
15EF 5B pop ebx
|
||||
15F0 C3 ret
|
||||
*/
|
||||
}
|
||||
|
||||
boolean CONTROL_Startup(controltype which, int32 ( *TimeFunction )( void ), int32 ticspersecond)
|
||||
|
@ -925,27 +851,28 @@ boolean CONTROL_Startup(controltype which, int32 ( *TimeFunction )( void ), int3
|
|||
CONTROL_JoyPresent = CONTROL_JoystickEnabled = false;
|
||||
CONTROL_NumMouseButtons = CONTROL_NumJoyButtons = 0;
|
||||
CONTROL_NumMouseAxes = CONTROL_NumJoyAxes = 0;
|
||||
KB_Startup();
|
||||
switch (which) {
|
||||
case controltype_keyboard:
|
||||
break;
|
||||
KB_Startup();
|
||||
|
||||
//switch (which) {
|
||||
// case controltype_keyboard:
|
||||
// break;
|
||||
|
||||
case controltype_keyboardandmouse:
|
||||
CONTROL_NumMouseAxes = MAXMOUSEAXES;
|
||||
CONTROL_NumMouseButtons = MAXMOUSEBUTTONS;
|
||||
CONTROL_MousePresent = MOUSE_Init();
|
||||
CONTROL_MouseEnabled = CONTROL_MousePresent;
|
||||
break;
|
||||
|
||||
case controltype_keyboardandjoystick:
|
||||
CONTROL_NumJoyAxes = min(MAXJOYAXES,joynumaxes);
|
||||
CONTROL_NumJoyButtons = min(MAXJOYBUTTONS,joynumbuttons + 4*(joynumhats>0));
|
||||
CONTROL_JoyPresent = ((inputdevices & 3) == 3);
|
||||
CONTROL_JoystickEnabled = CONTROL_JoyPresent;
|
||||
break;
|
||||
}
|
||||
|
||||
if (CONTROL_MousePresent)
|
||||
// case controltype_keyboardandmouse:
|
||||
CONTROL_NumMouseAxes = MAXMOUSEAXES;
|
||||
CONTROL_NumMouseButtons = MAXMOUSEBUTTONS;
|
||||
CONTROL_MousePresent = MOUSE_Init();
|
||||
CONTROL_MouseEnabled = CONTROL_MousePresent;
|
||||
// break;
|
||||
|
||||
// case controltype_keyboardandjoystick:
|
||||
CONTROL_NumJoyAxes = min(MAXJOYAXES,joynumaxes);
|
||||
CONTROL_NumJoyButtons = min(MAXJOYBUTTONS,joynumbuttons + 4*(joynumhats>0));
|
||||
CONTROL_JoyPresent = ((inputdevices & 4) == 4);
|
||||
CONTROL_JoystickEnabled = CONTROL_JoyPresent;
|
||||
// break;
|
||||
//}
|
||||
|
||||
if (CONTROL_MousePresent)
|
||||
initprintf("CONTROL_Startup: Mouse Present\n");
|
||||
if (CONTROL_JoyPresent)
|
||||
initprintf("CONTROL_Startup: Joystick Present\n");
|
||||
|
|
|
@ -113,14 +113,11 @@ static int probe_(int type,int x,int y,int i,int n)
|
|||
|
||||
s = 1+(CONTROL_GetMouseSensitivity()>>4);
|
||||
|
||||
if( ControllerType == 1 && CONTROL_MousePresent )
|
||||
{
|
||||
CONTROL_GetInput( &minfo );
|
||||
mi += minfo.dz;
|
||||
}
|
||||
|
||||
else minfo.dz = minfo.dyaw = 0;
|
||||
|
||||
if( x == (320>>1) )
|
||||
centre = 320>>2;
|
||||
else centre = 0;
|
||||
|
@ -561,7 +558,6 @@ void menus(void)
|
|||
|
||||
getpackets();
|
||||
|
||||
if(ControllerType == 1 && CONTROL_MousePresent)
|
||||
{
|
||||
if(buttonstat != 0 && !onbar)
|
||||
{
|
||||
|
@ -572,7 +568,6 @@ void menus(void)
|
|||
else
|
||||
buttonstat = MOUSE_GetButtons();
|
||||
}
|
||||
else buttonstat = 0;
|
||||
|
||||
if( (ps[myconnectindex].gm&MODE_MENU) == 0 )
|
||||
{
|
||||
|
@ -2447,7 +2442,7 @@ cheat_for_port_credits:
|
|||
currentlist = 0;
|
||||
case 5:
|
||||
case 6:
|
||||
if (x==6 && (!CONTROL_JoystickEnabled || !CONTROL_JoyPresent)) break;
|
||||
if (x==6 && !CONTROL_JoyPresent) break;
|
||||
cmenu(204+x-4);
|
||||
break;
|
||||
}
|
||||
|
@ -2458,7 +2453,7 @@ cheat_for_port_credits:
|
|||
menutext(160,c+18+18+18, MENUHIGHLIGHT(3),ud.recstat == 1,"PLAYER SETUP");
|
||||
menutext(160,c+18+18+18+18, MENUHIGHLIGHT(4),0,"KEYBOARD SETUP");
|
||||
menutext(160,c+18+18+18+18+18, MENUHIGHLIGHT(5),0,"MOUSE SETUP");
|
||||
menutext(160,c+18+18+18+18+18+18,MENUHIGHLIGHT(6),CONTROL_JoyPresent==0 || CONTROL_JoystickEnabled==0,"JOYSTICK SETUP");
|
||||
menutext(160,c+18+18+18+18+18+18,MENUHIGHLIGHT(6),CONTROL_JoyPresent==0,"JOYSTICK SETUP");
|
||||
break;
|
||||
|
||||
// JBF 20031206: Video settings menu
|
||||
|
@ -3300,6 +3295,10 @@ cheat_for_port_credits:
|
|||
else l = analog_turning;
|
||||
JoystickAnalogueAxes[thispage*2+(x==7)] = l;
|
||||
CONTROL_MapAnalogAxis(thispage*2+(x==7),l,controldevice_joystick);
|
||||
{
|
||||
extern int32 mouseyaxismode; // player.c
|
||||
mouseyaxismode = -1;
|
||||
}
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
|
|
|
@ -599,6 +599,28 @@ void onvideomodechange(int newmode)
|
|||
restorepalette = 1;
|
||||
}
|
||||
|
||||
int osdcmd_usemousejoy(const osdfuncparm_t *parm)
|
||||
{
|
||||
int showval = (parm->numparms < 1);
|
||||
if (!Bstrcasecmp(parm->name, "usemouse")) {
|
||||
if (showval) { OSD_Printf("usemouse is %d\n", UseMouse); }
|
||||
else {
|
||||
UseMouse = (atoi(parm->parms[0]) != 0);
|
||||
CONTROL_MouseEnabled = (UseMouse && CONTROL_MousePresent);
|
||||
}
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
else if (!Bstrcasecmp(parm->name, "usejoystick")) {
|
||||
if (showval) { OSD_Printf("usejoystick is %d\n", UseJoystick); }
|
||||
else {
|
||||
UseJoystick = (atoi(parm->parms[0]) != 0);
|
||||
CONTROL_JoystickEnabled = (UseJoystick && CONTROL_JoyPresent);
|
||||
}
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
return OSDCMD_SHOWHELP;
|
||||
}
|
||||
|
||||
int osdcmd_mpmap(const osdfuncparm_t *parm)
|
||||
{
|
||||
int i;
|
||||
|
@ -686,6 +708,9 @@ int registerosdcommands(void)
|
|||
OSD_RegisterFunction("restartvid","restartvid: reinitialised the video mode",osdcmd_restartvid);
|
||||
OSD_RegisterFunction("vidmode","vidmode [xdim ydim] [bpp] [fullscreen]: immediately change the video mode",osdcmd_vidmode);
|
||||
|
||||
OSD_RegisterFunction("usemouse","usemouse: enables input from the mouse if it is present",osdcmd_usemousejoy);
|
||||
OSD_RegisterFunction("usejoystick","usejoystick: enables input from the joystick if it is present",osdcmd_usemousejoy);
|
||||
|
||||
//baselayer_onvideomodechange = onvideomodechange;
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -2684,6 +2684,7 @@ void displayweapon(short snum)
|
|||
|
||||
long myaimmode = 0, myaimstat = 0, omyaimstat = 0;
|
||||
|
||||
int32 mouseyaxismode = -1;
|
||||
static ControlInfo lastinfo = { 0,0,0,0,0,0 };
|
||||
|
||||
static int jump_input = 0;
|
||||
|
@ -2691,7 +2692,6 @@ static int jump_input = 0;
|
|||
void getinput(short snum)
|
||||
{
|
||||
short j, daang;
|
||||
// MED
|
||||
ControlInfo info;
|
||||
int32 tics;
|
||||
boolean running;
|
||||
|
@ -2703,19 +2703,54 @@ void getinput(short snum)
|
|||
momx = momy = 0;
|
||||
p = &ps[snum];
|
||||
|
||||
if( (p->gm&MODE_MENU) || (p->gm&MODE_TYPE) || (ud.pause_on && !KB_KeyPressed(sc_Pause)) )
|
||||
{
|
||||
CONTROL_GetInput( &info );
|
||||
memset(&lastinfo, 0, sizeof(lastinfo));
|
||||
loc.fvel = vel = 0;
|
||||
loc.svel = svel = 0;
|
||||
loc.avel = angvel = 0;
|
||||
loc.horz = horiz = 0;
|
||||
loc.bits = (((long)gamequit)<<26);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ud.mouseaiming)
|
||||
myaimmode = BUTTON(gamefunc_Mouse_Aiming);
|
||||
else
|
||||
{
|
||||
omyaimstat = myaimstat; myaimstat = BUTTON(gamefunc_Mouse_Aiming);
|
||||
if (myaimstat > omyaimstat)
|
||||
{
|
||||
myaimmode ^= 1;
|
||||
FTA(44+myaimmode,p);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
int32 i;
|
||||
if (myaimmode) i = analog_lookingupanddown;
|
||||
else i = MouseAnalogueAxes[1];
|
||||
|
||||
if (i != mouseyaxismode) {
|
||||
CONTROL_MapAnalogAxis(1, i, controldevice_mouse);
|
||||
mouseyaxismode = i;
|
||||
}
|
||||
}
|
||||
|
||||
CONTROL_GetInput( &info );
|
||||
|
||||
if(MouseFilter)
|
||||
{
|
||||
if(info.dz > 0)
|
||||
if(info.dpitch > 0)
|
||||
{
|
||||
info.dz -= MouseFilter;
|
||||
if(info.dz < 0) info.dz = 0;
|
||||
info.dpitch -= MouseFilter;
|
||||
if(info.dpitch < 0) info.dpitch = 0;
|
||||
}
|
||||
else if(info.dz < 0)
|
||||
else if(info.dpitch < 0)
|
||||
{
|
||||
info.dz += MouseFilter;
|
||||
if(info.dz > 0) info.dz = 0;
|
||||
info.dpitch += MouseFilter;
|
||||
if(info.dpitch > 0) info.dpitch = 0;
|
||||
}
|
||||
if(info.dyaw > 0)
|
||||
{
|
||||
|
@ -2729,32 +2764,9 @@ void getinput(short snum)
|
|||
}
|
||||
}
|
||||
|
||||
if( (p->gm&MODE_MENU) || (p->gm&MODE_TYPE) || (ud.pause_on && !KB_KeyPressed(sc_Pause)) )
|
||||
{
|
||||
loc.fvel = vel = 0;
|
||||
loc.svel = svel = 0;
|
||||
loc.avel = angvel = 0;
|
||||
loc.horz = horiz = 0;
|
||||
loc.bits = (((long)gamequit)<<26);
|
||||
info.dz = info.dyaw = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
tics = totalclock-lastcontroltime;
|
||||
lastcontroltime = totalclock;
|
||||
|
||||
if (ud.mouseaiming)
|
||||
myaimmode = BUTTON(gamefunc_Mouse_Aiming);
|
||||
else
|
||||
{
|
||||
omyaimstat = myaimstat; myaimstat = BUTTON(gamefunc_Mouse_Aiming);
|
||||
if (myaimstat > omyaimstat)
|
||||
{
|
||||
myaimmode ^= 1;
|
||||
FTA(44+myaimmode,p);
|
||||
}
|
||||
}
|
||||
|
||||
if(multiflag == 1)
|
||||
{
|
||||
loc.bits = 1<<17;
|
||||
|
@ -2840,9 +2852,6 @@ void getinput(short snum)
|
|||
|
||||
svel = vel = angvel = horiz = 0;
|
||||
|
||||
if( CONTROL_JoystickEnabled )
|
||||
if ( running ) info.dz *= 2;
|
||||
|
||||
if(SmoothInput)
|
||||
{
|
||||
if( BUTTON(gamefunc_Strafe) ) {
|
||||
|
@ -2853,17 +2862,11 @@ void getinput(short snum)
|
|||
lastinfo.dyaw = (lastinfo.dyaw+info.dyaw) % 64;
|
||||
}
|
||||
|
||||
if( myaimmode )
|
||||
{
|
||||
if(ud.mouseflip)
|
||||
horiz = -(info.dz+lastinfo.dz)/(314-128);
|
||||
else horiz = (info.dz+lastinfo.dz)/(314-128);
|
||||
if(ud.mouseflip)
|
||||
horiz = -(info.dpitch+lastinfo.dpitch)/(314-128);
|
||||
else horiz = (info.dpitch+lastinfo.dpitch)/(314-128);
|
||||
|
||||
lastinfo.dz = (lastinfo.dz+info.dz) % (314-128);
|
||||
info.dz = 0;
|
||||
} else {
|
||||
lastinfo.dz = info.dz % (1<<6);
|
||||
}
|
||||
lastinfo.dpitch = (lastinfo.dpitch+info.dpitch) % (314-128);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2873,16 +2876,13 @@ void getinput(short snum)
|
|||
angvel = info.dyaw/64;
|
||||
}
|
||||
|
||||
if( myaimmode )
|
||||
{
|
||||
if(ud.mouseflip)
|
||||
horiz -= info.dz/(314-128);
|
||||
else horiz += info.dz/(314-128);
|
||||
info.dz = 0;
|
||||
}
|
||||
if(ud.mouseflip)
|
||||
horiz -= info.dpitch/(314-128);
|
||||
else horiz += info.dpitch/(314-128);
|
||||
}
|
||||
|
||||
svel -= info.dx;
|
||||
lastinfo.dz = info.dz % (1<<6);
|
||||
vel = -info.dz>>6;
|
||||
|
||||
if (running)
|
||||
|
@ -2899,13 +2899,9 @@ void getinput(short snum)
|
|||
if (BUTTON(gamefunc_Strafe))
|
||||
{
|
||||
if ( BUTTON(gamefunc_Turn_Left) && (ps[snum].movement_lock[3] == 0))
|
||||
{
|
||||
svel -= -keymove;
|
||||
}
|
||||
if ( BUTTON(gamefunc_Turn_Right) && (ps[snum].movement_lock[4] == 0))
|
||||
{
|
||||
svel -= keymove;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2913,30 +2909,20 @@ void getinput(short snum)
|
|||
{
|
||||
turnheldtime += tics;
|
||||
if (turnheldtime>=TURBOTURNTIME)
|
||||
{
|
||||
angvel -= turnamount;
|
||||
}
|
||||
else
|
||||
{
|
||||
angvel -= PREAMBLETURN;
|
||||
}
|
||||
}
|
||||
else if ( BUTTON(gamefunc_Turn_Right))
|
||||
{
|
||||
turnheldtime += tics;
|
||||
if (turnheldtime>=TURBOTURNTIME)
|
||||
{
|
||||
angvel += turnamount;
|
||||
}
|
||||
else
|
||||
{
|
||||
angvel += PREAMBLETURN;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
turnheldtime=0;
|
||||
}
|
||||
}
|
||||
|
||||
if ( BUTTON(gamefunc_Strafe_Left) && (ps[snum].movement_lock[3] == 0))
|
||||
|
@ -4405,6 +4391,7 @@ HORIZONLY:
|
|||
}
|
||||
|
||||
// center_view
|
||||
i = 0;
|
||||
if( sb_snum&(1<<18) || p->hard_landing)
|
||||
{
|
||||
SetGameVarID(g_iReturnVarID,0,pi,snum);
|
||||
|
@ -4425,6 +4412,7 @@ HORIZONLY:
|
|||
p->return_to_center = 9;
|
||||
if( sb_snum&(1<<5) ) p->horiz += 12; // running
|
||||
p->horiz += 12;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4438,6 +4426,7 @@ HORIZONLY:
|
|||
p->return_to_center = 9;
|
||||
if( sb_snum&(1<<5) ) p->horiz -= 12;
|
||||
p->horiz -= 12;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4450,6 +4439,7 @@ HORIZONLY:
|
|||
// running
|
||||
if( sb_snum&(1<<5) ) p->horiz += 6;
|
||||
p->horiz += 6;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4462,6 +4452,7 @@ HORIZONLY:
|
|||
// running
|
||||
if( sb_snum&(1<<5) ) p->horiz -= 6;
|
||||
p->horiz -= 6;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if(p->return_to_center > 0)
|
||||
|
@ -4469,6 +4460,7 @@ HORIZONLY:
|
|||
{
|
||||
p->return_to_center--;
|
||||
p->horiz += 33-(p->horiz/3);
|
||||
i++;
|
||||
}
|
||||
|
||||
if(p->hard_landing > 0)
|
||||
|
@ -4477,13 +4469,12 @@ HORIZONLY:
|
|||
p->horiz -= (p->hard_landing<<4);
|
||||
}
|
||||
|
||||
if(p->aim_mode)
|
||||
p->horiz += sync[snum].horz;
|
||||
else
|
||||
if(i)
|
||||
{
|
||||
if( p->horiz > 95 && p->horiz < 105) p->horiz = 100;
|
||||
if( p->horizoff > -5 && p->horizoff < 5) p->horizoff = 0;
|
||||
}
|
||||
p->horiz += sync[snum].horz;
|
||||
|
||||
if(p->horiz > 299) p->horiz = 299;
|
||||
else if(p->horiz < -99) p->horiz = -99;
|
||||
|
@ -4915,7 +4906,7 @@ SHOOTINCODE:
|
|||
if(*kb == aplWeaponSpawnTime[p->curr_weapon][snum])
|
||||
DoSpawn(p);
|
||||
|
||||
if ((*kb) >= aplWeaponTotalTime[p->curr_weapon][snum])
|
||||
if ((*kb) >= aplWeaponTotalTime[p->curr_weapon][snum])
|
||||
{
|
||||
if(/*!(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_CHECKATRELOAD) && */ p->reloading == 1 ||
|
||||
(aplWeaponReload[p->curr_weapon][snum] > aplWeaponTotalTime[p->curr_weapon][snum] && p->ammo_amount[p->curr_weapon] > 0
|
||||
|
|
Loading…
Reference in a new issue