*-wgl finally links (who knows if it works?:) and some more conceptual

cleanup
This commit is contained in:
Bill Currie 2001-04-17 15:55:33 +00:00
parent 853fbb4242
commit 527471a7de
21 changed files with 69 additions and 149 deletions

View file

@ -72,5 +72,6 @@ void IN_LL_Init ();
void IN_LL_Shutdown ();
void IN_LL_Commands ();
void IN_LL_SendKeyEvents ();
void IN_LL_ClearStates ();
#endif // _INPUT_H

View file

@ -40,8 +40,6 @@
#ifdef _WIN32
#include "winquake.h"
//#include "in_win.h"
void IN_Accumulate (void);//XXX FIXME
#endif
#include "QF/cmd.h"
@ -870,11 +868,6 @@ GetSoundtime (void)
void
S_ExtraUpdate (void)
{
#ifdef _WIN32
IN_Accumulate ();
#endif
if (snd_noextraupdate->int_val)
return; // don't pollute timings
S_Update_ ();

View file

@ -70,7 +70,7 @@ libQFtdfx.la: $(libQFtdfx_la_OBJECTS) $(libQFtdfx_la_DEPENDENCIES)
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)
$(LINK) -rpath $(libdir) $(libQFwgl_la_LDFLAGS) $(libQFwgl_la_OBJECTS) $(libQFwgl_la_LIBADD) $(LIBS)

View file

@ -161,3 +161,10 @@ void
IN_HandlePause (qboolean paused)
{
}
void
IN_ClearStates (void)
{
IN_LL_ClearStates ();
Key_ClearStates ();
}

View file

@ -612,3 +612,8 @@ void
IN_HandlePause (qboolean pause)
{
}
void
IN_LL_ClearStates (void)
{
}

View file

@ -144,3 +144,8 @@ void
IN_LL_ModeChanged (void)
{
}
void
IN_LL_ClearStates (void)
{
}

View file

@ -62,3 +62,8 @@ void
IN_ModeChanged (void)
{
}
void
IN_LL_ClearStates (void)
{
}

View file

@ -383,3 +383,8 @@ IN_LL_Frame (void)
}
mouse_oldbuttonstate = mouse_buttonstate;
}
void
IN_LL_ClearStates (void)
{
}

View file

@ -269,3 +269,8 @@ void
IN_HandlePause (qboolean pause)
{
}
void
IN_LL_ClearStates (void)
{
}

View file

@ -331,3 +331,8 @@ IN_LL_Commands (void)
mouse_oldbuttonstate = mouse_buttonstate;
}
}
void
IN_LL_ClearStates (void)
{
}

View file

@ -35,12 +35,13 @@
#include "winquake.h"
#include <dinput.h>
#include "QF/keys.h"
#include "QF/cmd.h"
#include "QF/compat.h"
#include "QF/console.h"
#include "QF/qargs.h"
#include "QF/cmd.h"
#include "QF/input.h"
#include "QF/keys.h"
#include "QF/qargs.h"
#include "QF/sys.h"
#define DINPUT_BUFFERSIZE 16
#define iDirectInputCreate(a,b,c,d) pDirectInputCreate(a,b,c,d)
@ -60,7 +61,6 @@ static int mouse_oldbuttonstate;
static POINT current_pos;
static float mx_accum, my_accum;
static qboolean mouseinitialized;
static cvar_t *m_filter;
static qboolean restore_spi;
static int originalmouseparms[3], newmouseparms[3] = { 0, 0, 1 };
static qboolean mouseparmsvalid, mouseactivatetoggle;
@ -395,33 +395,23 @@ IN_StartupMouse (void)
IN_Init
*/
void
IN_Init (void)
IN_LL_Init (void)
{
uiWheelMessage = RegisterWindowMessage ("MSWHEEL_ROLLMSG");
IN_StartupMouse ();
JOY_Init ();
}
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
*/
void
IN_Shutdown (void)
IN_LL_Shutdown (void)
{
IN_DeactivateMouse ();
@ -468,7 +458,7 @@ IN_MouseEvent (int mstate)
IN_MouseMove
*/
void
IN_MouseMove (void)
IN_LL_Commands (void)
{
int mx, my;
@ -568,47 +558,10 @@ IN_MouseMove (void)
/*
IN_Move
IN_LL_ClearStates
*/
void
IN_Move (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 (&current_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)
IN_LL_ClearStates (void)
{
if (in_mouse_avail) {
@ -618,12 +571,15 @@ IN_ClearStates (void)
}
}
/*
IN_Commands
*/
void
IN_Commands (void)
{
// Joystick
JOY_Command();
IN_LL_SendKeyEvents (void)
{
MSG msg;
while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE)) {
if (!GetMessage (&msg, NULL, 0, 0))
Sys_Quit ();
TranslateMessage (&msg);
DispatchMessage (&msg);
}
}

View file

@ -493,3 +493,8 @@ IN_LL_Init_Cvars (void)
"DGA Mouse accelleration multiplier");
}
void
IN_LL_ClearStates (void)
{
}

View file

@ -232,16 +232,12 @@ VID_UpdateWindowStatus (void)
}
extern void CL_ClearStates ();
/*
ClearAllStates
*/
void
ClearAllStates (void)
{
CL_ClearStates ();
Key_ClearStates ();
IN_ClearStates ();
}

View file

@ -140,8 +140,6 @@ glvert_t glv;
HWND WINAPI InitializeWindow (HINSTANCE hInstance, int nCmdShow);
LONG CDAudio_MessageHandler (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
extern void CL_ClearStates ();
extern viddef_t vid; // global video state
unsigned int d_8to24table[256];
@ -171,11 +169,6 @@ RECT window_rect;
// direct draw software compatability stuff
void
VID_HandlePause (qboolean pause)
{
}
void
VID_ForceLockState (int lk)
{
@ -671,8 +664,6 @@ MapKey (int key)
void
ClearAllStates (void)
{
CL_ClearStates ();
Key_ClearStates ();
IN_ClearStates ();
}
@ -1393,6 +1384,7 @@ VID_Init (unsigned char *palette)
#endif
GL_CheckBrightness (palette);
VID_InitGamma (palette);
VID_SetPalette (palette);
VID_SetMode (vid_default, palette);

View file

@ -147,7 +147,7 @@ nq_sgl_DEPENDENCIES= $(client_LIB_DEPS)
# ... SGI/Microsoft WGL (Windows OpenGL)
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)
# Dedicated Server

View file

@ -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);
}
}
/*
==============================================================================

View file

@ -183,7 +183,7 @@ qw_client_sgl_DEPENDENCIES= $(CLIENT_LIB_DEPS)
# ... SGI/Microsoft WGL (Windows OpenGL)
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)
# Stuff that doesn't get linked into an executable NEEDS to be mentioned here,

View file

@ -756,23 +756,3 @@ CL_Input_Init_Cvars (void)
"disable player delta compression. "
"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);
}
}

View file

@ -263,8 +263,3 @@ SDL_main (int c, char **v)
}
}
/* FIXME: evil stub for directsound crap */
IN_Accumulate (void)
{
}

View file

@ -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
*/

View file

@ -909,7 +909,8 @@ Key_ClearStates (void)
int i;
for (i = 0; i < 256; i++) {
keydown[i] = false;
if (keydown[i])
Key_Event (i, 0, false);
key_repeats[i] = false;
}
}