Honor _windowed_mouse in addition to LibGGI's native Ctrl-Alt-m method.

Requires current LibGII.
This commit is contained in:
Marcus Sundberg 2000-03-19 19:30:39 +00:00
parent c1fb651c0d
commit 64683cdc75

View file

@ -54,8 +54,8 @@ cvar_t *m_filter;
static qboolean mouse_avail; static qboolean mouse_avail;
static float mouse_x, mouse_y; static float mouse_x, mouse_y;
static float old_mouse_x, old_mouse_y; static float old_mouse_x, old_mouse_y;
static int p_mouse_x; static int p_mouse_x, p_mouse_y;
static int p_mouse_y; static float old_windowed_mouse;
static ggi_visual_t ggivis = NULL; static ggi_visual_t ggivis = NULL;
static ggi_mode mode; static ggi_mode mode;
@ -880,13 +880,31 @@ void IN_SendKeyEvents(void)
void IN_Frame(void) void IN_Frame(void)
{ {
/* Only supported by LibGII 0.7 or later. */
#ifdef GII_CMDCODE_PREFER_RELPTR
if (old_windowed_mouse != _windowed_mouse->value) {
gii_event ev;
old_windowed_mouse = _windowed_mouse->value;
ev.cmd.size = sizeof(gii_cmd_nodata_event);
ev.cmd.type = evCommand;
ev.cmd.target = GII_EV_TARGET_ALL;
ev.cmd.code = (int)_windowed_mouse->value ? GII_CMDCODE_PREFER_RELPTR
: GII_CMDCODE_PREFER_ABSPTR;
ggiEventSend(ggivis, &ev);
}
#endif
} }
void void
IN_Init(void) IN_Init(void)
{ {
m_filter = Cvar_Get ("m_filter","0",CVAR_ARCHIVE, "None"); _windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_ARCHIVE, "None");
old_windowed_mouse = -1; /* Force update */
m_filter = Cvar_Get("m_filter","0",CVAR_ARCHIVE, "None");
if (COM_CheckParm ("-nomouse")) return; if (COM_CheckParm ("-nomouse")) return;
mouse_x = mouse_y = 0.0; mouse_x = mouse_y = 0.0;