mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 00:24:12 +00:00
*-wgl finally links (who knows if it works?:) and some more conceptual
cleanup
This commit is contained in:
parent
853fbb4242
commit
527471a7de
21 changed files with 69 additions and 149 deletions
|
@ -72,5 +72,6 @@ void IN_LL_Init ();
|
||||||
void IN_LL_Shutdown ();
|
void IN_LL_Shutdown ();
|
||||||
void IN_LL_Commands ();
|
void IN_LL_Commands ();
|
||||||
void IN_LL_SendKeyEvents ();
|
void IN_LL_SendKeyEvents ();
|
||||||
|
void IN_LL_ClearStates ();
|
||||||
|
|
||||||
#endif // _INPUT_H
|
#endif // _INPUT_H
|
||||||
|
|
|
@ -40,8 +40,6 @@
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "winquake.h"
|
#include "winquake.h"
|
||||||
//#include "in_win.h"
|
|
||||||
void IN_Accumulate (void);//XXX FIXME
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "QF/cmd.h"
|
#include "QF/cmd.h"
|
||||||
|
@ -870,11 +868,6 @@ GetSoundtime (void)
|
||||||
void
|
void
|
||||||
S_ExtraUpdate (void)
|
S_ExtraUpdate (void)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
IN_Accumulate ();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (snd_noextraupdate->int_val)
|
if (snd_noextraupdate->int_val)
|
||||||
return; // don't pollute timings
|
return; // don't pollute timings
|
||||||
S_Update_ ();
|
S_Update_ ();
|
||||||
|
|
|
@ -70,7 +70,7 @@ libQFtdfx.la: $(libQFtdfx_la_OBJECTS) $(libQFtdfx_la_DEPENDENCIES)
|
||||||
|
|
||||||
|
|
||||||
libQFwgl_la_LDFLAGS= -version-info 1:0:0
|
libQFwgl_la_LDFLAGS= -version-info 1:0:0
|
||||||
libQFwgl_la_SOURCES= in_common.c in_win.c qfgl_ext.c vid.c vid_wgl.c
|
libQFwgl_la_SOURCES= in_common.c in_win.c qfgl_ext.c vid.c vid_common_gl.c vid_wgl.c
|
||||||
libQFwgl.la: $(libQFwgl_la_OBJECTS) $(libQFwgl_la_DEPENDENCIES)
|
libQFwgl.la: $(libQFwgl_la_OBJECTS) $(libQFwgl_la_DEPENDENCIES)
|
||||||
$(LINK) -rpath $(libdir) $(libQFwgl_la_LDFLAGS) $(libQFwgl_la_OBJECTS) $(libQFwgl_la_LIBADD) $(LIBS)
|
$(LINK) -rpath $(libdir) $(libQFwgl_la_LDFLAGS) $(libQFwgl_la_OBJECTS) $(libQFwgl_la_LIBADD) $(LIBS)
|
||||||
|
|
||||||
|
|
|
@ -161,3 +161,10 @@ void
|
||||||
IN_HandlePause (qboolean paused)
|
IN_HandlePause (qboolean paused)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
IN_ClearStates (void)
|
||||||
|
{
|
||||||
|
IN_LL_ClearStates ();
|
||||||
|
Key_ClearStates ();
|
||||||
|
}
|
||||||
|
|
|
@ -612,3 +612,8 @@ void
|
||||||
IN_HandlePause (qboolean pause)
|
IN_HandlePause (qboolean pause)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
IN_LL_ClearStates (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -144,3 +144,8 @@ void
|
||||||
IN_LL_ModeChanged (void)
|
IN_LL_ModeChanged (void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
IN_LL_ClearStates (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -62,3 +62,8 @@ void
|
||||||
IN_ModeChanged (void)
|
IN_ModeChanged (void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
IN_LL_ClearStates (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -383,3 +383,8 @@ IN_LL_Frame (void)
|
||||||
}
|
}
|
||||||
mouse_oldbuttonstate = mouse_buttonstate;
|
mouse_oldbuttonstate = mouse_buttonstate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
IN_LL_ClearStates (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -269,3 +269,8 @@ void
|
||||||
IN_HandlePause (qboolean pause)
|
IN_HandlePause (qboolean pause)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
IN_LL_ClearStates (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -331,3 +331,8 @@ IN_LL_Commands (void)
|
||||||
mouse_oldbuttonstate = mouse_buttonstate;
|
mouse_oldbuttonstate = mouse_buttonstate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
IN_LL_ClearStates (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -35,12 +35,13 @@
|
||||||
#include "winquake.h"
|
#include "winquake.h"
|
||||||
#include <dinput.h>
|
#include <dinput.h>
|
||||||
|
|
||||||
#include "QF/keys.h"
|
#include "QF/cmd.h"
|
||||||
#include "QF/compat.h"
|
#include "QF/compat.h"
|
||||||
#include "QF/console.h"
|
#include "QF/console.h"
|
||||||
#include "QF/qargs.h"
|
|
||||||
#include "QF/cmd.h"
|
|
||||||
#include "QF/input.h"
|
#include "QF/input.h"
|
||||||
|
#include "QF/keys.h"
|
||||||
|
#include "QF/qargs.h"
|
||||||
|
#include "QF/sys.h"
|
||||||
|
|
||||||
#define DINPUT_BUFFERSIZE 16
|
#define DINPUT_BUFFERSIZE 16
|
||||||
#define iDirectInputCreate(a,b,c,d) pDirectInputCreate(a,b,c,d)
|
#define iDirectInputCreate(a,b,c,d) pDirectInputCreate(a,b,c,d)
|
||||||
|
@ -60,7 +61,6 @@ static int mouse_oldbuttonstate;
|
||||||
static POINT current_pos;
|
static POINT current_pos;
|
||||||
static float mx_accum, my_accum;
|
static float mx_accum, my_accum;
|
||||||
static qboolean mouseinitialized;
|
static qboolean mouseinitialized;
|
||||||
static cvar_t *m_filter;
|
|
||||||
static qboolean restore_spi;
|
static qboolean restore_spi;
|
||||||
static int originalmouseparms[3], newmouseparms[3] = { 0, 0, 1 };
|
static int originalmouseparms[3], newmouseparms[3] = { 0, 0, 1 };
|
||||||
static qboolean mouseparmsvalid, mouseactivatetoggle;
|
static qboolean mouseparmsvalid, mouseactivatetoggle;
|
||||||
|
@ -395,33 +395,23 @@ IN_StartupMouse (void)
|
||||||
IN_Init
|
IN_Init
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
IN_Init (void)
|
IN_LL_Init (void)
|
||||||
{
|
{
|
||||||
uiWheelMessage = RegisterWindowMessage ("MSWHEEL_ROLLMSG");
|
uiWheelMessage = RegisterWindowMessage ("MSWHEEL_ROLLMSG");
|
||||||
|
|
||||||
|
|
||||||
IN_StartupMouse ();
|
IN_StartupMouse ();
|
||||||
|
|
||||||
JOY_Init ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
IN_Init_Cvars (void)
|
IN_LL_Init_Cvars (void)
|
||||||
{
|
{
|
||||||
// mouse variables
|
|
||||||
m_filter = Cvar_Get ("m_filter", "0", CVAR_ARCHIVE, NULL,
|
|
||||||
"Toggle mouse input filtering.");
|
|
||||||
_windowed_mouse = Cvar_Get ("_windowed_mouse", "0", CVAR_ARCHIVE, NULL,
|
|
||||||
"Grab the mouse from X while playing quake");
|
|
||||||
|
|
||||||
JOY_Init_Cvars();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
IN_Shutdown
|
IN_Shutdown
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
IN_Shutdown (void)
|
IN_LL_Shutdown (void)
|
||||||
{
|
{
|
||||||
|
|
||||||
IN_DeactivateMouse ();
|
IN_DeactivateMouse ();
|
||||||
|
@ -468,7 +458,7 @@ IN_MouseEvent (int mstate)
|
||||||
IN_MouseMove
|
IN_MouseMove
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
IN_MouseMove (void)
|
IN_LL_Commands (void)
|
||||||
{
|
{
|
||||||
int mx, my;
|
int mx, my;
|
||||||
|
|
||||||
|
@ -568,47 +558,10 @@ IN_MouseMove (void)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
IN_Move
|
IN_LL_ClearStates
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
IN_Move (void)
|
IN_LL_ClearStates (void)
|
||||||
{
|
|
||||||
|
|
||||||
if (ActiveApp && !Minimized) {
|
|
||||||
IN_MouseMove ();
|
|
||||||
JOY_Move ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
IN_Accumulate
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
IN_Accumulate (void)
|
|
||||||
{
|
|
||||||
// int mx, my;
|
|
||||||
// HDC hdc;
|
|
||||||
|
|
||||||
// if (dinput) return; // If using dinput we don't probably need this
|
|
||||||
|
|
||||||
if (in_mouse_avail) {
|
|
||||||
GetCursorPos (¤t_pos);
|
|
||||||
|
|
||||||
mx_accum += current_pos.x - window_center_x;
|
|
||||||
my_accum += current_pos.y - window_center_y;
|
|
||||||
|
|
||||||
// force the mouse to the center, so there's room to move
|
|
||||||
SetCursorPos (window_center_x, window_center_y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
IN_ClearStates
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
IN_ClearStates (void)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (in_mouse_avail) {
|
if (in_mouse_avail) {
|
||||||
|
@ -618,12 +571,15 @@ IN_ClearStates (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
IN_Commands
|
|
||||||
*/
|
|
||||||
void
|
void
|
||||||
IN_Commands (void)
|
IN_LL_SendKeyEvents (void)
|
||||||
{
|
{
|
||||||
// Joystick
|
MSG msg;
|
||||||
JOY_Command();
|
|
||||||
|
while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE)) {
|
||||||
|
if (!GetMessage (&msg, NULL, 0, 0))
|
||||||
|
Sys_Quit ();
|
||||||
|
TranslateMessage (&msg);
|
||||||
|
DispatchMessage (&msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -493,3 +493,8 @@ IN_LL_Init_Cvars (void)
|
||||||
"DGA Mouse accelleration multiplier");
|
"DGA Mouse accelleration multiplier");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
IN_LL_ClearStates (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -232,16 +232,12 @@ VID_UpdateWindowStatus (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern void CL_ClearStates ();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ClearAllStates
|
ClearAllStates
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ClearAllStates (void)
|
ClearAllStates (void)
|
||||||
{
|
{
|
||||||
CL_ClearStates ();
|
|
||||||
Key_ClearStates ();
|
|
||||||
IN_ClearStates ();
|
IN_ClearStates ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,8 +140,6 @@ glvert_t glv;
|
||||||
HWND WINAPI InitializeWindow (HINSTANCE hInstance, int nCmdShow);
|
HWND WINAPI InitializeWindow (HINSTANCE hInstance, int nCmdShow);
|
||||||
LONG CDAudio_MessageHandler (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
LONG CDAudio_MessageHandler (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
extern void CL_ClearStates ();
|
|
||||||
|
|
||||||
extern viddef_t vid; // global video state
|
extern viddef_t vid; // global video state
|
||||||
|
|
||||||
unsigned int d_8to24table[256];
|
unsigned int d_8to24table[256];
|
||||||
|
@ -171,11 +169,6 @@ RECT window_rect;
|
||||||
|
|
||||||
// direct draw software compatability stuff
|
// direct draw software compatability stuff
|
||||||
|
|
||||||
void
|
|
||||||
VID_HandlePause (qboolean pause)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
VID_ForceLockState (int lk)
|
VID_ForceLockState (int lk)
|
||||||
{
|
{
|
||||||
|
@ -671,8 +664,6 @@ MapKey (int key)
|
||||||
void
|
void
|
||||||
ClearAllStates (void)
|
ClearAllStates (void)
|
||||||
{
|
{
|
||||||
CL_ClearStates ();
|
|
||||||
Key_ClearStates ();
|
|
||||||
IN_ClearStates ();
|
IN_ClearStates ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1393,6 +1384,7 @@ VID_Init (unsigned char *palette)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GL_CheckBrightness (palette);
|
GL_CheckBrightness (palette);
|
||||||
|
VID_InitGamma (palette);
|
||||||
VID_SetPalette (palette);
|
VID_SetPalette (palette);
|
||||||
|
|
||||||
VID_SetMode (vid_default, palette);
|
VID_SetMode (vid_default, palette);
|
||||||
|
|
|
@ -147,7 +147,7 @@ nq_sgl_DEPENDENCIES= $(client_LIB_DEPS)
|
||||||
|
|
||||||
# ... SGI/Microsoft WGL (Windows OpenGL)
|
# ... SGI/Microsoft WGL (Windows OpenGL)
|
||||||
nq_wgl_SOURCES= $(combined_SOURCES) $(ogl_SOURCES) conproc.c
|
nq_wgl_SOURCES= $(combined_SOURCES) $(ogl_SOURCES) conproc.c
|
||||||
nq_wgl_LDADD= $(client_LIBS) $(GLX_LIBS) ../../libs/video/targets/libQFwgl.la -lgdi32 -lcomctl32 $(client_POST_LIBS)
|
nq_wgl_LDADD= $(client_LIBS) ../../libs/video/targets/libQFwgl.la $(client_POST_LIBS) $(GLX_LIBS) -lgdi32 -lcomctl32 -lwinmm
|
||||||
nq_wgl_DEPENDENCIES= $(client_LIB_DEPS)
|
nq_wgl_DEPENDENCIES= $(client_LIB_DEPS)
|
||||||
|
|
||||||
# Dedicated Server
|
# Dedicated Server
|
||||||
|
|
|
@ -443,24 +443,6 @@ Sys_Sleep (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
IN_SendKeyEvents (void)
|
|
||||||
{
|
|
||||||
MSG msg;
|
|
||||||
|
|
||||||
while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE)) {
|
|
||||||
// we always update if there are any event, even if we're paused
|
|
||||||
scr_skipupdate = 0;
|
|
||||||
|
|
||||||
if (!GetMessage (&msg, NULL, 0, 0))
|
|
||||||
Sys_Quit ();
|
|
||||||
|
|
||||||
TranslateMessage (&msg);
|
|
||||||
DispatchMessage (&msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ qw_client_sgl_DEPENDENCIES= $(CLIENT_LIB_DEPS)
|
||||||
|
|
||||||
# ... SGI/Microsoft WGL (Windows OpenGL)
|
# ... SGI/Microsoft WGL (Windows OpenGL)
|
||||||
qw_client_wgl_SOURCES= $(common_SOURCES) $(client_SOURCES) $(ogl_SOURCES)
|
qw_client_wgl_SOURCES= $(common_SOURCES) $(client_SOURCES) $(ogl_SOURCES)
|
||||||
qw_client_wgl_LDADD= $(CLIENT_LIBS) $(GLX_LIBS) ../../libs/video/targets/libQFwgl.la -lgdi32 $(CLIENT_POST_LIBS)
|
qw_client_wgl_LDADD= $(CLIENT_LIBS) ../../libs/video/targets/libQFwgl.la $(CLIENT_POST_LIBS) $(GLX_LIBS) -lgdi32 -lwinmm
|
||||||
qw_client_wgl_DEPENDENCIES= $(CLIENT_LIB_DEPS)
|
qw_client_wgl_DEPENDENCIES= $(CLIENT_LIB_DEPS)
|
||||||
|
|
||||||
# Stuff that doesn't get linked into an executable NEEDS to be mentioned here,
|
# Stuff that doesn't get linked into an executable NEEDS to be mentioned here,
|
||||||
|
|
|
@ -756,23 +756,3 @@ CL_Input_Init_Cvars (void)
|
||||||
"disable player delta compression. "
|
"disable player delta compression. "
|
||||||
"set to 1 if you have a poor ISP and get a lot of U_REMOVE warnings.");
|
"set to 1 if you have a poor ISP and get a lot of U_REMOVE warnings.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern qboolean keydown[256];
|
|
||||||
|
|
||||||
/*
|
|
||||||
CL_ClearStates
|
|
||||||
|
|
||||||
Generate key up event for each key that is down
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
CL_ClearStates (void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
// send an up event for each key, to make sure the server clears them all
|
|
||||||
for (i = 0; i < 256; i++) {
|
|
||||||
if (keydown[i])
|
|
||||||
Key_Event (i, 0, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -263,8 +263,3 @@ SDL_main (int c, char **v)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: evil stub for directsound crap */
|
|
||||||
IN_Accumulate (void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
|
@ -352,24 +352,6 @@ Sys_Sleep (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
IN_SendKeyEvents (void)
|
|
||||||
{
|
|
||||||
MSG msg;
|
|
||||||
|
|
||||||
while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE)) {
|
|
||||||
// we always update if there are any event, even if we're paused
|
|
||||||
scr_skipupdate = 0;
|
|
||||||
|
|
||||||
if (!GetMessage (&msg, NULL, 0, 0))
|
|
||||||
Sys_Quit ();
|
|
||||||
TranslateMessage (&msg);
|
|
||||||
DispatchMessage (&msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
WINDOWS CRAP
|
WINDOWS CRAP
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -909,7 +909,8 @@ Key_ClearStates (void)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < 256; i++) {
|
for (i = 0; i < 256; i++) {
|
||||||
keydown[i] = false;
|
if (keydown[i])
|
||||||
|
Key_Event (i, 0, false);
|
||||||
key_repeats[i] = false;
|
key_repeats[i] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue