From b892ce637a3378e66a90c7a197bcc993f37fb87d Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 18 Nov 2021 15:33:49 +0900 Subject: [PATCH] [input] Nuke IN_Move from orbit gotta be sure :) On a serious note, it was always a problem in that it had client-specific code and concepts embedded in the libraries. --- include/QF/input.h | 16 +-------- libs/input/in_common.c | 52 +---------------------------- libs/video/targets/in_x11.c | 3 -- nq/source/cl_chase.c | 4 +-- nq/source/cl_main.c | 2 +- qw/source/cl_chase.c | 4 +-- qw/source/cl_main.c | 2 +- ruamoko/qwaq/builtins/qwaq-bi.c | 2 +- ruamoko/qwaq/builtins/qwaq-curses.c | 2 +- 9 files changed, 10 insertions(+), 77 deletions(-) diff --git a/include/QF/input.h b/include/QF/input.h index 7952d82aa..aa7c07a5b 100644 --- a/include/QF/input.h +++ b/include/QF/input.h @@ -49,11 +49,6 @@ typedef struct in_buttoninfo_s { #ifndef __QFCC__ -typedef struct { - vec3_t angles; - vec3_t position; -} viewdelta_t; - struct qf_fd_set; typedef struct in_driver_s { @@ -93,15 +88,13 @@ typedef struct in_device_s { void *event_data; } in_device_t; -extern viewdelta_t viewdelta; - #define freelook (in_mlook.state & 1 || in_freelook->int_val) struct cvar_s; int IN_RegisterDriver (in_driver_t *driver, void *data); void IN_DriverData (int handlle, void *data); -void IN_Init (struct cbuf_s *cbuf); +void IN_Init (void); void IN_Init_Cvars (void); struct plitem_s; void IN_SaveConfig (struct plitem_s *config); @@ -128,9 +121,6 @@ void IN_UpdateGrab (struct cvar_s *); void IN_ClearStates (void); -void IN_Move (void); // FIXME: was cmduser_t? -// add additional movement on top of the keyboard move cmd - extern struct cvar_s *in_grab; extern struct cvar_s *in_amp; extern struct cvar_s *in_pre_amp; @@ -139,10 +129,6 @@ extern struct cvar_s *in_mouse_accel; extern struct cvar_s *in_freelook; extern struct cvar_s *lookstrafe; -extern qboolean in_mouse_avail; -extern float in_mouse_x, in_mouse_y; - - #endif #endif//__QF_input_h diff --git a/libs/input/in_common.c b/libs/input/in_common.c index 4cbb637c5..0d57b4e76 100644 --- a/libs/input/in_common.c +++ b/libs/input/in_common.c @@ -47,7 +47,6 @@ #include #include -#include "QF/cbuf.h" #include "QF/cvar.h" #include "QF/darray.h" #define IMPLEMENT_INPUT_Funcs @@ -71,8 +70,6 @@ typedef struct { static struct DARRAY_TYPE (in_regdriver_t) in_drivers = { .grow = 8 }; static struct DARRAY_TYPE (in_device_t) in_devices = { .grow = 8 }; -VISIBLE viewdelta_t viewdelta; - cvar_t *in_grab; VISIBLE cvar_t *in_amp; VISIBLE cvar_t *in_pre_amp; @@ -84,10 +81,6 @@ cvar_t *lookstrafe; int64_t in_timeout = 10000;//10ms default timeout -qboolean in_mouse_avail; -float in_mouse_x, in_mouse_y; -static float in_old_mouse_x, in_old_mouse_y; - int IN_RegisterDriver (in_driver_t *driver, void *data) { @@ -415,42 +408,6 @@ IN_LoadConfig (plitem_t *config) } } -void -IN_Move (void) -{ - //JOY_Move (); - - if (!in_mouse_avail) - return; - - in_mouse_x *= in_mouse_pre_amp->value * in_pre_amp->value; - in_mouse_y *= in_mouse_pre_amp->value * in_pre_amp->value; - - if (in_mouse_filter->int_val) { - in_mouse_x = (in_mouse_x + in_old_mouse_x) * 0.5; - in_mouse_y = (in_mouse_y + in_old_mouse_y) * 0.5; - - in_old_mouse_x = in_mouse_x; - in_old_mouse_y = in_mouse_y; - } - - in_mouse_x *= in_mouse_amp->value * in_amp->value; - in_mouse_y *= in_mouse_amp->value * in_amp->value; -#if 0 - if ((in_strafe.state & 1) || (lookstrafe->int_val && freelook)) - viewdelta.position[0] += in_mouse_x; - else - viewdelta.angles[YAW] -= in_mouse_x; - - if (freelook && !(in_strafe.state & 1)) { - viewdelta.angles[PITCH] += in_mouse_y; - } else { - viewdelta.position[2] -= in_mouse_y; - } -#endif - in_mouse_x = in_mouse_y = 0.0; -} - /* Called at shutdown */ static void IN_shutdown (void *data) @@ -467,7 +424,7 @@ IN_shutdown (void *data) } void -IN_Init (cbuf_t *cbuf) +IN_Init (void) { Sys_RegisterShutdown (IN_shutdown, 0); IMT_Init (); @@ -477,17 +434,11 @@ IN_Init (cbuf_t *cbuf) in_regdriver_t *rd = &in_drivers.a[i]; rd->driver.init (rd->data); } - //Key_Init (cbuf); - //JOY_Init (); - - in_mouse_x = in_mouse_y = 0.0; } void IN_Init_Cvars (void) { - //Key_Init_Cvars (); - //JOY_Init_Cvars (); in_grab = Cvar_Get ("in_grab", "0", CVAR_ARCHIVE, IN_UpdateGrab, "With this set to 1, quake will grab the mouse, " "preventing loss of input focus."); @@ -516,7 +467,6 @@ IN_ClearStates (void) rd->driver.clear_states (rd->data); } } - //Key_ClearStates (); } #ifdef HAVE_EVDEV diff --git a/libs/video/targets/in_x11.c b/libs/video/targets/in_x11.c index 59308f52c..1898a2482 100644 --- a/libs/video/targets/in_x11.c +++ b/libs/video/targets/in_x11.c @@ -1035,7 +1035,6 @@ static void in_x11_shutdown (void *data) { Sys_MaskPrintf (SYS_vid, "in_x11_shutdown\n"); - in_mouse_avail = 0; if (x_disp) { // XAutoRepeatOn (x_disp); dga_off (); @@ -1129,8 +1128,6 @@ in_x11_init (void *data) X11_AddEvent (MotionNotify, &event_motion); x11_add_device (&x11_mouse_device); - - in_mouse_avail = 1; } Cmd_AddCommand ("in_paste_buffer", in_paste_buffer_f, diff --git a/nq/source/cl_chase.c b/nq/source/cl_chase.c index 151a1d739..1b88e15c8 100644 --- a/nq/source/cl_chase.c +++ b/nq/source/cl_chase.c @@ -211,8 +211,8 @@ Chase_Update (void) // mouse and joystick controllers add to movement VectorSet (0, cl.viewstate.angles[1] - camera_angles[1], 0, dir); AngleVectors (&dir[0], &forward[0], &right[0], &up[0]); //FIXME - forward *= viewdelta.position[2] * m_forward->value; - right *= viewdelta.position[0] * m_side->value; + //forward *= viewdelta.position[2] * m_forward->value; FIXME + //right *= viewdelta.position[0] * m_side->value; FIXME dir = forward + right; cmd.forwardmove += dir[0]; cmd.sidemove -= dir[1]; diff --git a/nq/source/cl_main.c b/nq/source/cl_main.c index 865da8507..488c86b5a 100644 --- a/nq/source/cl_main.c +++ b/nq/source/cl_main.c @@ -585,7 +585,7 @@ CL_Init (cbuf_t *cbuf) W_LoadWadFile ("gfx.wad"); VID_Init (basepal, colormap); - IN_Init (cbuf); + IN_Init (); R_Init (); r_data->lightstyle = cl.lightstyle; diff --git a/qw/source/cl_chase.c b/qw/source/cl_chase.c index 481002354..6c747f6f9 100644 --- a/qw/source/cl_chase.c +++ b/qw/source/cl_chase.c @@ -211,8 +211,8 @@ Chase_Update (void) // mouse and joystick controllers add to movement VectorSet (0, cl.viewstate.angles[1] - camera_angles[1], 0, dir); AngleVectors (&dir[0], &forward[0], &right[0], &up[0]); //FIXME - forward *= viewdelta.position[2] * m_forward->value; - right *= viewdelta.position[0] * m_side->value; + //forward *= viewdelta.position[2] * m_forward->value; FIXME + //right *= viewdelta.position[0] * m_side->value; FIXME dir = forward + right; cmd.forwardmove += dir[0]; cmd.sidemove -= dir[1]; diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index a4a72ed45..f3eab261e 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -1183,7 +1183,7 @@ CL_Init (void) W_LoadWadFile ("gfx.wad"); VID_Init (basepal, colormap); - IN_Init (cl_cbuf); + IN_Init (); Mod_Init (); R_Init (); r_data->lightstyle = cl.lightstyle; diff --git a/ruamoko/qwaq/builtins/qwaq-bi.c b/ruamoko/qwaq/builtins/qwaq-bi.c index ee29dbc5b..1468380fa 100644 --- a/ruamoko/qwaq/builtins/qwaq-bi.c +++ b/ruamoko/qwaq/builtins/qwaq-bi.c @@ -191,7 +191,7 @@ BI_Init (progs_t *pr) W_LoadWadFile ("gfx.wad"); VID_Init (basepal, colormap); - IN_Init (qwaq_cbuf); + IN_Init (); Mod_Init (); R_Init (); R_Progs_Init (pr); diff --git a/ruamoko/qwaq/builtins/qwaq-curses.c b/ruamoko/qwaq/builtins/qwaq-curses.c index 4f80e4683..b2aab8f94 100644 --- a/ruamoko/qwaq/builtins/qwaq-curses.c +++ b/ruamoko/qwaq/builtins/qwaq-curses.c @@ -89,7 +89,7 @@ qwaq_init_threads (qwaq_thread_set_t *thread_data) Sys_SetStdPrintf (qwaq_print); IN_Init_Cvars (); - IN_Init (qwaq_cbuf); + IN_Init (); for (size_t i = 1, thread_ind = 0; i < thread_data->size; i++) { qwaq_thread_t *thread = thread_data->a[i];