xinput tweaks, under advice from primallove.

fix sv_nqplayerphysics+spectators = spectators able to shoot
fix watervis bug, turned out to potentially be more serious.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5194 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2018-01-05 01:45:49 +00:00
parent 56a48000e8
commit 3a85de45f6
9 changed files with 67 additions and 59 deletions

View File

@ -76,11 +76,11 @@ void QDECL joyaxiscallback(cvar_t *var, char *oldvalue)
static cvar_t joy_advaxis[6] =
{
#define ADVAXISDESC (const char *)"Provides a way to remap each joystick/controller axis.\nShould be set to one of: moveforward, moveback, lookup, lookdown, turnleft, turnright, moveleft, moveright, moveup, movedown, rollleft, rollright"
CVARCD("joyadvaxisx", "turnright", joyaxiscallback, ADVAXISDESC),
CVARCD("joyadvaxisy", "lookup", joyaxiscallback, ADVAXISDESC),
CVARCD("joyadvaxisx", "moveright", joyaxiscallback, ADVAXISDESC),
CVARCD("joyadvaxisy", "moveforward", joyaxiscallback, ADVAXISDESC),
CVARCD("joyadvaxisz", "", joyaxiscallback, ADVAXISDESC),
CVARCD("joyadvaxisr", "moveright", joyaxiscallback, ADVAXISDESC),
CVARCD("joyadvaxisu", "moveforward", joyaxiscallback, ADVAXISDESC),
CVARCD("joyadvaxisr", "turnright", joyaxiscallback, ADVAXISDESC),
CVARCD("joyadvaxisu", "lookup", joyaxiscallback, ADVAXISDESC),
CVARCD("joyadvaxisv", "", joyaxiscallback, ADVAXISDESC)
};
static cvar_t joy_advaxisscale[6] =
@ -94,13 +94,13 @@ static cvar_t joy_advaxisscale[6] =
};
static cvar_t joy_anglesens[3] =
{
CVARD("joypitchsensitivity", "1.0", "Scaler value for the controller when it is at its most extreme value"),
CVARD("joypitchsensitivity", "0.5", "Scaler value for the controller when it is at its most extreme value"),
CVAR("joyyawsensitivity", "-1.0"),
CVAR("joyrollsensitivity", "1.0")
};
static cvar_t joy_movesens[3] =
{
CVAR("joyforwardsensitivity", "-1.0"),
CVAR("joyforwardsensitivity", "1.0"),
CVAR("joysidesensitivity", "1.0"),
CVAR("joyupsensitivity", "1.0")
};
@ -118,7 +118,7 @@ static cvar_t joy_movethreshold[3] =
CVAR("joyupthreshold", "0.118"), //30/255 (trigger)
};
static cvar_t joy_exponent = CVARD("joyexponent", "2", "Scales joystick/controller sensitivity non-linearly to increase precision in the center.\nA value of 1 is linear.");
static cvar_t joy_exponent = CVARD("joyexponent", "3", "Scales joystick/controller sensitivity non-linearly to increase precision in the center.\nA value of 1 is linear.");
static cvar_t joy_radialdeadzone = CVARD("joyradialdeadzone", "1", "Treat controller dead zones as a pair, rather than per-axis.");

View File

@ -2709,20 +2709,20 @@ void Key_Event (unsigned int devid, int key, unsigned int unicode, qboolean down
case K_GP_LEFT_TRIGGER: dc = "+jump"; goto defaultedbind; //matches QS's default.cfg
case K_GP_RIGHT_TRIGGER: dc = "+attack"; goto defaultedbind; //matches QS's default.cfg
case K_GP_START: dc = "togglemenu"; goto defaultedbind;
case K_GP_A: dc = "+button4"; goto defaultedbind;
case K_GP_B: dc = "+button3"; goto defaultedbind;
case K_GP_X: dc = "+attack"; goto defaultedbind;
case K_GP_Y: dc = "+jump"; goto defaultedbind;
case K_GP_BACK: dc = "impulse 10"; goto defaultedbind;
case K_GP_A: dc = "+button3"; goto defaultedbind;
case K_GP_B: dc = "+button4"; goto defaultedbind;
case K_GP_X: dc = "+button5"; goto defaultedbind;
case K_GP_Y: dc = "+button6"; goto defaultedbind;
case K_GP_BACK: dc = "+showscores"; goto defaultedbind;
case K_GP_UNKNOWN: dc = "+button8"; goto defaultedbind;
case K_GP_DPAD_UP: dc = "+forward"; goto defaultedbind;
case K_GP_DPAD_DOWN: dc = "+back"; goto defaultedbind;
case K_GP_DPAD_LEFT: dc = "+moveleft"; goto defaultedbind;
case K_GP_DPAD_RIGHT: dc = "+moveright"; goto defaultedbind;
case K_GP_LEFT_THUMB: dc = "toggleconsole"; goto defaultedbind;
case K_GP_UNKNOWN:
case K_GP_RIGHT_THUMB:
case K_GP_GUIDE: dc = "togglemenu"; goto defaultedbind;
case K_GP_LEFT_THUMB: dc = "+movedown"; goto defaultedbind;
case K_GP_RIGHT_THUMB:
default:
break;
}

View File

@ -1366,7 +1366,7 @@ void MC_Slider_Key(menuslider_t *option, int key)
else
delta = 0.1;
if (key == K_LEFTARROW || key == K_KP_LEFTARROW || key == K_GP_DPAD_LEFT || key == K_MWHEELDOWN)
if (key == K_LEFTARROW || key == K_KP_LEFTARROW || key == K_GP_DPAD_LEFT || key == K_GP_A || key == K_MWHEELDOWN)
{
range -= delta;
if (option->min > option->max)
@ -1375,7 +1375,7 @@ void MC_Slider_Key(menuslider_t *option, int key)
range = bound(option->min, range, option->max);
option->current = range;
}
else if (key == K_RIGHTARROW || key == K_KP_RIGHTARROW || key == K_GP_DPAD_RIGHT || key == K_MWHEELUP)
else if (key == K_RIGHTARROW || key == K_KP_RIGHTARROW || key == K_GP_DPAD_RIGHT || key == K_GP_B || key == K_MWHEELUP)
{
range += delta;
if (option->min > option->max)
@ -1422,7 +1422,7 @@ void MC_Slider_Key(menuslider_t *option, int key)
void MC_CheckBox_Key(menucheck_t *option, menu_t *menu, int key)
{
if (key != K_ENTER && key != K_KP_ENTER && key != K_GP_START && key != K_LEFTARROW && key != K_KP_LEFTARROW && key != K_GP_DPAD_LEFT && key != K_RIGHTARROW && key != K_KP_LEFTARROW && key != K_GP_DPAD_RIGHT && key != K_MWHEELUP && key != K_MWHEELDOWN && key != K_MOUSE1)
if (key != K_ENTER && key != K_KP_ENTER && key != K_GP_START && key != K_GP_A && key != K_GP_B && key != K_LEFTARROW && key != K_KP_LEFTARROW && key != K_GP_DPAD_LEFT && key != K_RIGHTARROW && key != K_KP_LEFTARROW && key != K_GP_DPAD_RIGHT && key != K_MWHEELUP && key != K_MWHEELDOWN && key != K_MOUSE1)
return;
if (option->func)
option->func(option, menu, CHK_TOGGLE);
@ -1488,7 +1488,7 @@ void MC_EditBox_Key(menuedit_t *edit, int key, unsigned int unicode)
void MC_Combo_Key(menucombo_t *combo, int key)
{
if (key == K_ENTER || key == K_KP_ENTER || key == K_GP_START || key == K_RIGHTARROW || key == K_KP_RIGHTARROW || key == K_GP_DPAD_RIGHT || key == K_MWHEELDOWN || key == K_MOUSE1)
if (key == K_ENTER || key == K_KP_ENTER || key == K_GP_START || key == K_RIGHTARROW || key == K_KP_RIGHTARROW || key == K_GP_DPAD_RIGHT || key == K_GP_B || key == K_MWHEELDOWN || key == K_MOUSE1)
{
combo->selectedoption++;
if (combo->selectedoption >= combo->numoptions)
@ -1499,7 +1499,7 @@ changed:
Cvar_Set(combo->cvar, (char *)combo->values[combo->selectedoption]);
S_LocalSound ("misc/menu2.wav");
}
else if (key == K_LEFTARROW || key == K_KP_LEFTARROW || key == K_GP_DPAD_LEFT || key == K_MWHEELUP)
else if (key == K_LEFTARROW || key == K_KP_LEFTARROW || key == K_GP_DPAD_LEFT || key == K_GP_A || key == K_MWHEELUP)
{
combo->selectedoption--;
if (combo->selectedoption < 0)
@ -1738,7 +1738,7 @@ void M_Complex_Key(int key, int unicode)
if (currentmenu->key(key, currentmenu))
return;
if (currentmenu->selecteditem && currentmenu->selecteditem->common.type == mt_custom && (key == K_DOWNARROW || key == K_KP_DOWNARROW || key == K_GP_DPAD_DOWN || key == K_UPARROW || key == K_KP_UPARROW || key == K_GP_DPAD_UP || key == K_TAB))
if (currentmenu->selecteditem && currentmenu->selecteditem->common.type == mt_custom && (key == K_DOWNARROW || key == K_KP_DOWNARROW || key == K_GP_DPAD_DOWN || key == K_GP_A || key == K_GP_B || key == K_UPARROW || key == K_KP_UPARROW || key == K_GP_DPAD_UP || key == K_TAB))
if (currentmenu->selecteditem->custom.key)
if (currentmenu->selecteditem->custom.key(&currentmenu->selecteditem->custom, currentmenu, key, unicode))
return;
@ -1881,7 +1881,7 @@ void M_Complex_Key(int key, int unicode)
case mt_qbuttonbigfont:
if (!currentmenu->selecteditem->button.command)
currentmenu->selecteditem->button.key(currentmenu->selecteditem, currentmenu, key);
else if (key == K_ENTER || key == K_KP_ENTER || key == K_GP_START || key == K_MOUSE1)
else if (key == K_ENTER || key == K_KP_ENTER || key == K_GP_START || key == K_GP_A || key == K_GP_B || key == K_MOUSE1)
{
Cbuf_AddText(currentmenu->selecteditem->button.command, RESTRICT_LOCAL);
#ifdef HEXEN2
@ -1903,7 +1903,7 @@ void M_Complex_Key(int key, int unicode)
MC_Combo_Key(&currentmenu->selecteditem->combo, key);
break;
case mt_bind:
if (key == K_ENTER || key == K_KP_ENTER || key == K_GP_START || key == K_MOUSE1)
if (key == K_ENTER || key == K_KP_ENTER || key == K_GP_START || key == K_GP_A || key == K_GP_B || key == K_MOUSE1)
bindingactive = true;
else if (key == K_BACKSPACE || key == K_DEL)
M_UnbindCommand (currentmenu->selecteditem->bind.command);

View File

@ -726,7 +726,7 @@ static void Classic_RunParticleEffect (vec3_t org, vec3_t dir, int color, int co
scale = (count > 130) ? 3 : (count > 20) ? 2 : 1;
count *= r_part_density.value;
count = ceil(count*r_part_density.value); //round-to-0 was resulting in blood being far too hard to see, especially when blood is often spawned with multiple points all rounded down
for (i = 0; i < count; i++)
{

View File

@ -49,11 +49,11 @@ void PF_Common_RegisterCvars(void)
{
if (COM_CheckParm("-nodaz"))
{
Con_Printf("Disabling DAZ. This may have performance implications.\n");
Con_DPrintf("Disabling DAZ. This may have performance implications.\n");
_mm_setcsr(mxcsr & ~(0x8040));
}
else
Con_Printf(CON_WARNING "denormalised floats are disabled. Use -nodaz to re-enable if mods malfunction\n");
Con_DPrintf(CON_WARNING "denormalised floats are disabled. Use -nodaz to re-enable if mods malfunction\n");
}
#else
volatile union

View File

@ -2615,7 +2615,8 @@ static void GLSlang_ProgAutoFields(program_t *prog, const char *progname, cvar_t
if (!cvars[i])
continue;
uniformloc = qglGetUniformLocationARB(pp->h.glsl.handle, va("cvar_%s", cvarnames[i]));
Q_snprintfz(tmpname, sizeof(tmpname), "cvar_%s", cvarnames[i]);
uniformloc = qglGetUniformLocationARB(pp->h.glsl.handle, tmpname);
if (uniformloc >= 0)
{
if (pp->numparms >= maxparms)

View File

@ -11559,7 +11559,7 @@ void PR_DumpPlatform_f(void)
{"CSQC_Ent_Remove", "void()", CS},
{"CSQC_Event_Sound", "float(float entnum, float channel, string soundname, float vol, float attenuation, vector pos, float pitchmod, float flags"/*", float timeofs*/")", CS},
// {"CSQC_ServerSound", "//void()", CS},
{"CSQC_LoadResource", "float(string resname, string restype)", CS, "Called each time some resource is being loaded. CSQC can invoke various draw calls to provide a loading screen, until WorldLoaded is called."},
// {"CSQC_LoadResource", "float(string resname, string restype)", CS, "Called each time some resource is being loaded. CSQC can invoke various draw calls to provide a loading screen, until WorldLoaded is called."},
{"CSQC_Parse_TempEntity", "float()", CS, "Please don't use this. Use CSQC_Parse_Event and multicasts instead.\nThe use of serverside protocol translation to handle QW vs NQ protocols mean that you're likely to end up reading slightly different data. Which is bad.\nReturn true to say that you fully handled the tempentity. Return false to have the client attempt to rewind the network stream and parse the message itself."},
{"GameCommand", "void(string cmdtext)", CS|MENU},

View File

@ -2108,28 +2108,31 @@ void WPhys_RunEntity (world_t *w, wedict_t *ent)
host_client = &svs.clients[ent->entnum-1];
SV_ClientThink();
if (progstype == PROG_QW) //detect if the mod should do a jump
if (svent->v->button2)
if ((int)svent->v->flags & FL_JUMPRELEASED)
readyforjump = true;
//
// call standard client pre-think
//
pr_global_struct->time = sv.world.physicstime;
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, ent);
#ifdef VM_Q1
if (svs.gametype == GT_Q1QVM)
Q1QVM_PlayerPreThink();
else
#endif
if (pr_global_ptrs->PlayerPreThink)
PR_ExecuteProgram (svprogfuncs, *pr_global_ptrs->PlayerPreThink);
if (readyforjump) //qw progs can't jump for themselves...
if (!host_client->spectator)
{
if (!svent->v->button2 && !((int)ent->v->flags & FL_JUMPRELEASED) && ent->v->velocity[2] <= 0)
svent->v->velocity[2] += 270;
if (progstype == PROG_QW) //detect if the mod should do a jump
if (svent->v->button2)
if ((int)svent->v->flags & FL_JUMPRELEASED)
readyforjump = true;
//
// call standard client pre-think
//
pr_global_struct->time = sv.world.physicstime;
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, ent);
#ifdef VM_Q1
if (svs.gametype == GT_Q1QVM)
Q1QVM_PlayerPreThink();
else
#endif
if (pr_global_ptrs->PlayerPreThink)
PR_ExecuteProgram (svprogfuncs, *pr_global_ptrs->PlayerPreThink);
if (readyforjump) //qw progs can't jump for themselves...
{
if (!svent->v->button2 && !((int)ent->v->flags & FL_JUMPRELEASED) && ent->v->velocity[2] <= 0)
svent->v->velocity[2] += 270;
}
}
}
else
@ -2252,16 +2255,19 @@ void WPhys_RunEntity (world_t *w, wedict_t *ent)
{
World_LinkEdict (w, (wedict_t*)svent, true);
pr_global_struct->time = w->physicstime;
pr_global_struct->self = EDICT_TO_PROG(w->progs, ent);
#ifdef VM_Q1
if (svs.gametype == GT_Q1QVM)
Q1QVM_PostThink();
else
#endif
if (!host_client->spectator)
{
if (pr_global_ptrs->PlayerPostThink)
PR_ExecuteProgram (w->progs, *pr_global_ptrs->PlayerPostThink);
pr_global_struct->time = w->physicstime;
pr_global_struct->self = EDICT_TO_PROG(w->progs, ent);
#ifdef VM_Q1
if (svs.gametype == GT_Q1QVM)
Q1QVM_PostThink();
else
#endif
{
if (pr_global_ptrs->PlayerPostThink)
PR_ExecuteProgram (w->progs, *pr_global_ptrs->PlayerPostThink);
}
}
}
#endif

View File

@ -34,7 +34,8 @@ nonstatic void(mitem_desktop desktop) M_Options =
//and show the options.
fr.add(spawn(mitem_text, item_text:"Graphical Presets", item_command:"m_pop;m_preset", item_scale:16, item_flags:IF_CENTERALIGN), fl, [0, pos], [0, 16]); pos += 16;
if (assumefalsecheckcommand("fps_preset"))
{fr.add(spawn(mitem_text, item_text:"Graphical Presets", item_command:"m_pop;m_preset", item_scale:16, item_flags:IF_CENTERALIGN), fl, [0, pos], [0, 16]); pos += 16;}
fr.add(spawn(mitem_text, item_text:"Game Configs", item_command:"m_pop;m_configs", item_scale:16, item_flags:IF_CENTERALIGN), fl, [0, pos], [0, 16]); pos += 16;
fr.add(spawn(mitem_text, item_text:"Basic Setup", item_command:"m_pop;m_basicopts", item_scale:16, item_flags:IF_CENTERALIGN), fl, [0, pos], [0, 16]); pos += 16;
fr.add(spawn(mitem_text, item_text:"Audio", item_command:"m_pop;m_audio", item_scale:16, item_flags:IF_CENTERALIGN), fl, [0, pos], [0, 16]); pos += 16;