mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-22 11:51:17 +00:00
quakefs.c - added #include "config.h" so unistd.h would be included properly
vid_sunx.c - do not define x_disp and x_win as static, removed unneeded variables, took on IN_* functions
This commit is contained in:
parent
e0dc6fa673
commit
8668430a36
2 changed files with 5 additions and 70 deletions
|
@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <ctype.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
|
|
|
@ -58,16 +58,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <client.h>
|
||||
#include <input.h>
|
||||
|
||||
cvar_t _windowed_mouse = {"_windowed_mouse","0", CVAR_ARCHIVE};
|
||||
cvar_t m_filter = {"m_filter","0", CVAR_ARCHIVE};
|
||||
|
||||
static qboolean mouse_avail;
|
||||
static float mouse_x, mouse_y;
|
||||
static float old_mouse_x, old_mouse_y;
|
||||
static int p_mouse_x, p_mouse_y;
|
||||
static qboolean mouse_in_window = false;
|
||||
static qboolean mouse_grabbed = false; // we grab it when console is up
|
||||
|
||||
/* Also in vid_x11.c - referenced by in_x11.c */
|
||||
Display *x_disp = NULL;
|
||||
Window x_win;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int input;
|
||||
|
@ -77,8 +77,6 @@ typedef struct
|
|||
viddef_t vid; // global video state
|
||||
unsigned short d_8to16table[256];
|
||||
|
||||
static Display *x_disp = NULL;
|
||||
static Window x_win;
|
||||
static Colormap x_cmap;
|
||||
static GC x_gc;
|
||||
static Visual *x_vis;
|
||||
|
@ -1145,70 +1143,6 @@ Sys_SendKeyEvents(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IN_Init(void)
|
||||
{
|
||||
Cvar_RegisterVariable(&m_filter);
|
||||
if (COM_CheckParm("-nomouse")) return;
|
||||
mouse_x = mouse_y = 0.0;
|
||||
mouse_avail = 1;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IN_Shutdown(void)
|
||||
{
|
||||
mouse_avail = 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IN_Frame(void)
|
||||
{
|
||||
/* Nothing to do here */
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IN_Move(usercmd_t *cmd)
|
||||
{
|
||||
if (!mouse_avail)
|
||||
return;
|
||||
|
||||
if (m_filter.value) {
|
||||
mouse_x = (mouse_x + old_mouse_x) * 0.5;
|
||||
mouse_y = (mouse_y + old_mouse_y) * 0.5;
|
||||
}
|
||||
|
||||
old_mouse_x = mouse_x;
|
||||
old_mouse_y = mouse_y;
|
||||
|
||||
mouse_x *= sensitivity.value;
|
||||
mouse_y *= sensitivity.value;
|
||||
|
||||
if ( (in_strafe.state & 1) || (lookstrafe.value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side.value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
if ( (in_mlook.state & 1) && !(in_strafe.state & 1)) {
|
||||
cl.viewangles[PITCH] += m_pitch.value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70)
|
||||
cl.viewangles[PITCH] = -70;
|
||||
} else {
|
||||
if ((in_strafe.state & 1) && noclip_anglehack)
|
||||
cmd->upmove -= m_forward.value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
}
|
||||
mouse_x = mouse_y = 0.0;
|
||||
}
|
||||
|
||||
void VID_ExtraOptionDraw(unsigned int options_draw_cursor)
|
||||
{
|
||||
// Windowed Mouse
|
||||
|
|
Loading…
Reference in a new issue