Sensitivity and crosshair fixes

This commit is contained in:
Ian 2023-10-16 14:03:42 -04:00
parent 644257eab2
commit 6e2353e79d
3 changed files with 30 additions and 10 deletions

View file

@ -35,7 +35,7 @@ cvar_t cl_nolerp = {"cl_nolerp","0"};
cvar_t lookspring = {"lookspring","0", true}; cvar_t lookspring = {"lookspring","0", true};
cvar_t lookstrafe = {"lookstrafe","0", true}; cvar_t lookstrafe = {"lookstrafe","0", true};
cvar_t sensitivity = {"sensitivity","3", true}; cvar_t sensitivity = {"sensitivity","8", true};
cvar_t in_tolerance = {"tolerance","0.25", true}; cvar_t in_tolerance = {"tolerance","0.25", true};
cvar_t in_acceleration = {"acceleration","1.0", true}; cvar_t in_acceleration = {"acceleration","1.0", true};
cvar_t in_analog_strafe = {"in_analog_strafe", "0", true}; cvar_t in_analog_strafe = {"in_analog_strafe", "0", true};

View file

@ -1143,19 +1143,19 @@ void Draw_Crosshair (void)
x_value = (vid.width - 3)/2 - crosshair_offset_step; x_value = (vid.width - 3)/2 - crosshair_offset_step;
y_value = (vid.height - 1)/2; y_value = (vid.height - 1)/2;
Draw_FillByColor(x_value, y_value, 3, 1, 255, (int)col, (int)col, 255); Draw_FillByColor(x_value, y_value, 3, 1, 255, (int)col, (int)col, crosshair_opacity);
x_value = (vid.width - 3)/2 + crosshair_offset_step; x_value = (vid.width - 3)/2 + crosshair_offset_step;
y_value = (vid.height - 1)/2; y_value = (vid.height - 1)/2;
Draw_FillByColor(x_value, y_value, 3, 1, 255, (int)col, (int)col, 255); Draw_FillByColor(x_value, y_value, 3, 1, 255, (int)col, (int)col, crosshair_opacity);
x_value = (vid.width - 1)/2; x_value = (vid.width - 1)/2;
y_value = (vid.height - 3)/2 - crosshair_offset_step; y_value = (vid.height - 3)/2 - crosshair_offset_step;
Draw_FillByColor(x_value, y_value, 1, 3, 255, (int)col, (int)col, 255); Draw_FillByColor(x_value, y_value, 1, 3, 255, (int)col, (int)col, crosshair_opacity);
x_value = (vid.width - 1)/2; x_value = (vid.width - 1)/2;
y_value = (vid.height - 3)/2 + crosshair_offset_step; y_value = (vid.height - 3)/2 + crosshair_offset_step;
Draw_FillByColor(x_value, y_value, 1, 3, 255, (int)col, (int)col, 255); Draw_FillByColor(x_value, y_value, 1, 3, 255, (int)col, (int)col, crosshair_opacity);
} }
// Area of Effect (o) // Area of Effect (o)
else if (crosshair.value == 2) { else if (crosshair.value == 2) {

View file

@ -25,6 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern int bind_grab; extern int bind_grab;
extern bool new3ds_flag; extern bool new3ds_flag;
extern bool croshhairmoving;
extern float crosshair_opacity;
extern cvar_t in_analog_strafe; extern cvar_t in_analog_strafe;
extern cvar_t in_x_axis_adjust; extern cvar_t in_x_axis_adjust;
@ -137,18 +139,36 @@ void IN_Move (usercmd_t *cmd)
if (new3ds_flag) { if (new3ds_flag) {
float move_x, move_y; float move_x, move_y;
cl_backspeed = cl_forwardspeed = cl_sidespeed = sv_player->v.maxspeed*1.2; cl_backspeed = cl_forwardspeed = cl_sidespeed = sv_player->v.maxspeed;
cl_sidespeed *= 0.8; cl_sidespeed *= 0.8;
cl_backspeed *= 0.7; cl_backspeed *= 0.7;
if (left.dx > 0) move_x = IN_CalcInput(left.dx, cl_sidespeed, deadZone, acceleration);
move_x = IN_CalcInput(left.dx, cl_forwardspeed, deadZone, acceleration);
if (left.dy > 0)
move_y = IN_CalcInput(left.dy, cl_forwardspeed, deadZone, acceleration);
else else
move_x = IN_CalcInput(left.dx, cl_backspeed, deadZone, acceleration); move_y = IN_CalcInput(left.dy, cl_backspeed, deadZone, acceleration);
move_y = IN_CalcInput(left.dy, cl_sidespeed, deadZone, acceleration);
cmd->sidemove += move_x; cmd->sidemove += move_x;
cmd->forwardmove += move_y; cmd->forwardmove += move_y;
Con_Printf("%d\n", left.dx);
// crosshair stuff
if (left.dx < 50 && left.dx > -50 && left.dy < 50 && left.dy > -50) {
croshhairmoving = false;
crosshair_opacity += 22;
if (crosshair_opacity >= 255)
crosshair_opacity = 255;
} else {
croshhairmoving = true;
crosshair_opacity -= 8;
if (crosshair_opacity <= 128)
crosshair_opacity = 128;
}
} }
} }