2004-08-23 00:15:46 +00:00
/*
Copyright ( C ) 1996 - 1997 Id Software , Inc .
This program is free software ; you can redistribute it and / or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
2011-05-19 13:34:07 +00:00
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE .
2004-08-23 00:15:46 +00:00
See the GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*/
// in_win.c -- windows 95 mouse and joystick code
// 02/21/97 JCB Added extended DirectInput code to support external controllers.
# include "quakedef.h"
# include "winquake.h"
//#include "dosisms.h"
2014-03-30 08:55:06 +00:00
# ifndef WINRT
2005-06-29 21:20:34 +00:00
# define USINGRAWINPUT
# ifdef USINGRAWINPUT
# include "in_raw.h"
# endif
2012-10-14 09:00:49 +00:00
void INS_Accumulate ( void ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
# define AVAIL_XINPUT
# ifdef AVAIL_XINPUT
//#define AVAIL_XINPUT_DLL "xinput9_1_0.dll"
# define AVAIL_XINPUT_DLL "xinput1_3.dll"
typedef struct _XINPUT_GAMEPAD {
WORD wButtons ;
BYTE bLeftTrigger ;
BYTE bRightTrigger ;
SHORT sThumbLX ;
SHORT sThumbLY ;
SHORT sThumbRX ;
SHORT sThumbRY ;
} XINPUT_GAMEPAD , * PXINPUT_GAMEPAD ;
typedef struct _XINPUT_STATE {
DWORD dwPacketNumber ;
XINPUT_GAMEPAD Gamepad ;
} XINPUT_STATE , * PXINPUT_STATE ;
typedef struct _XINPUT_VIBRATION {
WORD wLeftMotorSpeed ;
WORD wRightMotorSpeed ;
} XINPUT_VIBRATION , * PXINPUT_VIBRATION ;
DWORD ( WINAPI * pXInputGetState ) ( DWORD dwUserIndex , XINPUT_STATE * pState ) ;
DWORD ( WINAPI * pXInputSetState ) ( DWORD dwUserIndex , XINPUT_VIBRATION * pState ) ;
2016-02-10 23:23:43 +00:00
DWORD ( WINAPI * pXInputGetDSoundAudioDeviceGuids ) ( DWORD dwUserIndex , GUID * pDSoundRenderGuid , GUID * pDSoundCaptureGuid ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
enum
{
XINPUT_GAMEPAD_DPAD_UP = 0x0001 ,
XINPUT_GAMEPAD_DPAD_DOWN = 0x0002 ,
XINPUT_GAMEPAD_DPAD_LEFT = 0x0004 ,
XINPUT_GAMEPAD_DPAD_RIGHT = 0x0008 ,
XINPUT_GAMEPAD_START = 0x0010 ,
XINPUT_GAMEPAD_BACK = 0x0020 ,
XINPUT_GAMEPAD_LEFT_THUMB = 0x0040 ,
XINPUT_GAMEPAD_RIGHT_THUMB = 0x0080 ,
XINPUT_GAMEPAD_LEFT_SHOULDER = 0x0100 ,
XINPUT_GAMEPAD_RIGHT_SHOULDER = 0x0200 ,
XINPUT_GAMEPAD_A = 0x1000 ,
XINPUT_GAMEPAD_B = 0x2000 ,
XINPUT_GAMEPAD_X = 0x4000 ,
XINPUT_GAMEPAD_Y = 0x8000
} ;
2016-02-10 23:23:43 +00:00
static qboolean xinput_useaudio ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
# endif
2009-03-07 04:37:24 +00:00
# ifdef AVAIL_DINPUT
2004-08-23 00:15:46 +00:00
2017-08-14 16:38:44 +00:00
# ifndef DIRECTINPUT_VERSION
2015-08-20 03:58:15 +00:00
# define DIRECTINPUT_VERSION 0x0700
2004-08-23 00:15:46 +00:00
# endif
2005-10-21 16:29:08 +00:00
# include <dinput.h>
2004-08-23 00:15:46 +00:00
# define DINPUT_BUFFERSIZE 16
# define iDirectInputCreate(a,b,c,d) pDirectInputCreate(a,b,c,d)
HRESULT ( WINAPI * pDirectInputCreate ) ( HINSTANCE hinst , DWORD dwVersion ,
LPDIRECTINPUT * lplpDirectInput , LPUNKNOWN punkOuter ) ;
# endif
2005-06-18 22:30:57 +00:00
# define DINPUT_VERSION_DX3 0x0300
# define DINPUT_VERSION_DX7 0x0700
2004-08-23 00:15:46 +00:00
// mouse variables
2017-02-19 00:15:42 +00:00
static cvar_t in_dinput = CVARFD ( " in_dinput " , " 0 " , CVAR_ARCHIVE , " Enables the use of dinput for mouse movements " ) ;
2017-08-16 02:14:07 +00:00
static cvar_t in_xinput = CVARFD ( " in_xinput " , " 1 " , CVAR_ARCHIVE , " Enables the use of xinput for controllers. \n Note that if you have a headset plugged in, that headset will be used for audio playback if no specific audio device is configured. " ) ;
2012-10-14 09:00:49 +00:00
static cvar_t in_builtinkeymap = CVARF ( " in_builtinkeymap " , " 0 " , CVAR_ARCHIVE ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
static cvar_t in_simulatemultitouch = CVAR ( " in_simulatemultitouch " , " 0 " ) ;
2014-04-24 01:53:01 +00:00
static cvar_t in_nonstandarddeadkeys = CVARD ( " in_nonstandarddeadkeys " , " 1 " , " Discard input events that result in multiple keys. Only the last key will be used. This results in behaviour that differs from eg notepad. To use a dead key, press it twice instead of the dead key followed by space. " ) ;
2004-08-23 00:15:46 +00:00
2020-08-13 08:39:48 +00:00
static cvar_t xinput_leftvibrator = CVARF ( " xinput_leftvibrator " , " 0 " , CVAR_ARCHIVE ) ;
static cvar_t xinput_rightvibrator = CVARF ( " xinput_rightvibrator " , " 0 " , CVAR_ARCHIVE ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
2012-10-14 09:00:49 +00:00
static cvar_t m_accel_noforce = CVAR ( " m_accel_noforce " , " 0 " ) ;
static cvar_t m_threshold_noforce = CVAR ( " m_threshold_noforce " , " 0 " ) ;
2005-08-06 22:39:28 +00:00
2013-04-13 08:15:18 +00:00
static cvar_t cl_keypad = CVAR ( " cl_keypad " , " 1 " ) ;
2004-08-23 00:15:46 +00:00
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
extern float multicursor_x [ 8 ] , multicursor_y [ 8 ] ;
extern qboolean multicursor_active [ 8 ] ;
2015-04-14 23:12:17 +00:00
POINT current_mouse_pos ;
2020-08-13 08:39:48 +00:00
HWND mainwindow ;
int window_center_x , window_center_y ;
RECT window_rect ;
2010-08-23 04:53:20 +00:00
typedef struct {
union {
HANDLE rawinputhandle ;
} handles ;
2016-01-18 05:22:07 +00:00
char sysname [ MAX_OSPATH ] ;
2010-08-23 04:53:20 +00:00
2012-02-12 05:18:31 +00:00
int qdeviceid ;
2010-08-23 04:53:20 +00:00
} keyboard_t ;
2004-08-23 00:15:46 +00:00
typedef struct {
2005-06-29 21:20:34 +00:00
union {
HANDLE rawinputhandle ; // raw input
2006-02-17 02:51:59 +00:00
} handles ;
2016-01-18 05:22:07 +00:00
char sysname [ MAX_OSPATH ] ;
2004-08-23 00:15:46 +00:00
int numbuttons ;
2012-10-14 09:00:49 +00:00
int oldbuttons ;
2012-02-12 05:18:31 +00:00
int qdeviceid ; /*the device id controls which player slot it controls, if splitscreen splits it that way*/
2004-08-23 00:15:46 +00:00
} mouse_t ;
2012-10-14 09:00:49 +00:00
static mouse_t sysmouse ;
2004-08-23 00:15:46 +00:00
static qboolean restore_spi ;
2005-08-06 22:39:28 +00:00
static int originalmouseparms [ 3 ] , newmouseparms [ 3 ] = { 0 , 0 , 0 } ;
2004-08-23 00:15:46 +00:00
qboolean mouseinitialized ;
static qboolean mouseparmsvalid , mouseactivatetoggle ;
2015-05-03 19:57:46 +00:00
qboolean mouseshowtoggle = 1 ;
2004-08-23 00:15:46 +00:00
unsigned int uiWheelMessage ;
qboolean mouseactive ;
// joystick defines and variables
// where should defines be moved?
# define JOY_ABSOLUTE_AXIS 0x00000000 // control like a joystick
# define JOY_RELATIVE_AXIS 0x00000010 // control like a mouse, spinner, trackball
# define JOY_MAX_AXES 6 // X, Y, Z, R, U, V
// none of these cvars are saved over a session
// this means that advanced controller configuration needs to be executed
// each time. this avoids any problems with getting back to a default usage
// or when changing from one controller to another. this way at least something
// works.
2017-02-19 00:15:42 +00:00
static cvar_t in_joystick = CVARAF ( " joystick " , " 0 " , " in_joystick " , CVAR_ARCHIVE ) ;
2014-07-12 06:56:17 +00:00
static qboolean joy_advancedinit ;
2012-10-14 09:00:49 +00:00
2018-10-23 07:09:06 +00:00
static DWORD joy_flags = JOY_RETURNALL | JOY_RETURNCENTERED ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
# define MAX_JOYSTICKS 8
2014-07-12 06:56:17 +00:00
static struct wjoy_s {
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
qboolean isxinput ; //xinput device
2017-08-14 16:38:44 +00:00
enum
{
DS_UNKNOWN ,
DS_PRESENT ,
DS_NOTPRESENT
} devstate ;
2014-07-12 06:56:17 +00:00
unsigned int id ; //windows id. device id is the index.
unsigned int devid ; //quake id (generally player index)
DWORD numbuttons ;
qboolean haspov ;
DWORD povstate ;
DWORD oldpovstate ;
DWORD buttonstate ;
DWORD oldbuttonstate ;
2016-02-10 23:23:43 +00:00
soundcardinfo_t * audiodev ;
2014-07-12 06:56:17 +00:00
} wjoy [ MAX_JOYSTICKS ] ;
static int joy_count ;
2004-08-23 00:15:46 +00:00
2009-03-07 04:37:24 +00:00
# ifdef AVAIL_DINPUT
2009-11-04 21:16:50 +00:00
static const GUID fGUID_XAxis = { 0xA36D02E0 , 0xC9F3 , 0x11CF , { 0xBF , 0xC7 , 0x44 , 0x45 , 0x53 , 0x54 , 0x00 , 0x00 } } ;
static const GUID fGUID_YAxis = { 0xA36D02E1 , 0xC9F3 , 0x11CF , { 0xBF , 0xC7 , 0x44 , 0x45 , 0x53 , 0x54 , 0x00 , 0x00 } } ;
static const GUID fGUID_ZAxis = { 0xA36D02E2 , 0xC9F3 , 0x11CF , { 0xBF , 0xC7 , 0x44 , 0x45 , 0x53 , 0x54 , 0x00 , 0x00 } } ;
static const GUID fGUID_SysMouse = { 0x6F1D2B60 , 0xD5A0 , 0x11CF , { 0xBF , 0xC7 , 0x44 , 0x45 , 0x53 , 0x54 , 0x00 , 0x00 } } ;
static const GUID fIID_IDirectInputDevice7A = { 0x57d7c6bc , 0x2356 , 0x11d3 , { 0x8e , 0x9d , 0x00 , 0xC0 , 0x4f , 0x68 , 0x44 , 0xae } } ;
static const GUID fIID_IDirectInput7A = { 0x9a4cb684 , 0x236d , 0x11d3 , { 0x8e , 0x9d , 0x00 , 0xc0 , 0x4f , 0x68 , 0x44 , 0xae } } ;
2005-06-18 22:30:57 +00:00
// devices
2012-10-14 09:00:49 +00:00
static LPDIRECTINPUT g_pdi ;
static LPDIRECTINPUTDEVICE g_pMouse ;
2017-02-19 00:15:42 +00:00
static qboolean dinput_acquired ;
2004-08-23 00:15:46 +00:00
static HINSTANCE hInstDI ;
2005-06-18 22:30:57 +00:00
// current DirectInput version in use, 0 means using no DirectInput
2011-05-19 13:34:07 +00:00
static int dinput ;
2004-08-23 00:15:46 +00:00
typedef struct MYDATA {
LONG lX ; // X axis goes here
LONG lY ; // Y axis goes here
LONG lZ ; // Z axis goes here
BYTE bButtonA ; // One button goes here
BYTE bButtonB ; // Another button goes here
BYTE bButtonC ; // Another button goes here
BYTE bButtonD ; // Another button goes here
2005-06-18 22:30:57 +00:00
# if (DIRECTINPUT_VERSION >= DINPUT_VERSION_DX7)
BYTE bButtonE ; // DX7 buttons
2011-05-19 13:34:07 +00:00
BYTE bButtonF ;
BYTE bButtonG ;
2005-06-18 22:30:57 +00:00
BYTE bButtonH ;
# endif
2004-08-23 00:15:46 +00:00
} MYDATA ;
static DIOBJECTDATAFORMAT rgodf [ ] = {
2009-11-04 21:16:50 +00:00
{ & fGUID_XAxis , FIELD_OFFSET ( MYDATA , lX ) , DIDFT_AXIS | DIDFT_ANYINSTANCE , 0 , } ,
{ & fGUID_YAxis , FIELD_OFFSET ( MYDATA , lY ) , DIDFT_AXIS | DIDFT_ANYINSTANCE , 0 , } ,
{ & fGUID_ZAxis , FIELD_OFFSET ( MYDATA , lZ ) , 0x80000000 | DIDFT_AXIS | DIDFT_ANYINSTANCE , 0 , } ,
2004-08-23 00:15:46 +00:00
{ 0 , FIELD_OFFSET ( MYDATA , bButtonA ) , DIDFT_BUTTON | DIDFT_ANYINSTANCE , 0 , } ,
{ 0 , FIELD_OFFSET ( MYDATA , bButtonB ) , DIDFT_BUTTON | DIDFT_ANYINSTANCE , 0 , } ,
{ 0 , FIELD_OFFSET ( MYDATA , bButtonC ) , 0x80000000 | DIDFT_BUTTON | DIDFT_ANYINSTANCE , 0 , } ,
{ 0 , FIELD_OFFSET ( MYDATA , bButtonD ) , 0x80000000 | DIDFT_BUTTON | DIDFT_ANYINSTANCE , 0 , } ,
2005-06-18 22:30:57 +00:00
# if (DIRECTINPUT_VERSION >= DINPUT_VERSION_DX7)
{ 0 , FIELD_OFFSET ( MYDATA , bButtonE ) , 0x80000000 | DIDFT_BUTTON | DIDFT_ANYINSTANCE , 0 , } ,
{ 0 , FIELD_OFFSET ( MYDATA , bButtonF ) , 0x80000000 | DIDFT_BUTTON | DIDFT_ANYINSTANCE , 0 , } ,
{ 0 , FIELD_OFFSET ( MYDATA , bButtonG ) , 0x80000000 | DIDFT_BUTTON | DIDFT_ANYINSTANCE , 0 , } ,
{ 0 , FIELD_OFFSET ( MYDATA , bButtonH ) , 0x80000000 | DIDFT_BUTTON | DIDFT_ANYINSTANCE , 0 , } ,
# endif
2004-08-23 00:15:46 +00:00
} ;
# define NUM_OBJECTS (sizeof(rgodf) / sizeof(rgodf[0]))
static DIDATAFORMAT df = {
sizeof ( DIDATAFORMAT ) , // this structure
sizeof ( DIOBJECTDATAFORMAT ) , // size of object data format
DIDF_RELAXIS , // absolute axis coordinates
sizeof ( MYDATA ) , // device data size
NUM_OBJECTS , // number of objects
rgodf , // and here they are
} ;
2005-06-18 22:30:57 +00:00
# if (DIRECTINPUT_VERSION >= DINPUT_VERSION_DX7)
// DX7 devices
2012-10-14 09:00:49 +00:00
static LPDIRECTINPUT7 g_pdi7 ;
static LPDIRECTINPUTDEVICE7 g_pMouse7 ;
2005-06-18 22:30:57 +00:00
// DX7 specific calls
# define iDirectInputCreateEx(a,b,c,d,e) pDirectInputCreateEx(a,b,c,d,e)
static HRESULT ( WINAPI * pDirectInputCreateEx ) ( HINSTANCE hinst ,
DWORD dwVersion , REFIID riidltf , LPVOID * ppvOut , LPUNKNOWN punkOuter ) ;
# endif
2004-08-23 00:15:46 +00:00
# else
# define dinput 0
# endif
static JOYINFOEX ji ;
2005-06-29 21:20:34 +00:00
// raw input specific defines
# ifdef USINGRAWINPUT
// defines
# define MAX_RI_DEVICE_SIZE 128
# define INIT_RIBUFFER_SIZE (sizeof(RAWINPUTHEADER)+sizeof(RAWMOUSE))
# define RI_RAWBUTTON_MASK 0x000003E0
# define RI_INVALID_POS 0x80000000
// raw input dynamic functions
2005-08-03 23:14:59 +00:00
typedef INT ( WINAPI * pGetRawInputDeviceList ) ( OUT PRAWINPUTDEVICELIST pRawInputDeviceList , IN OUT PINT puiNumDevices , IN UINT cbSize ) ;
typedef INT ( WINAPI * pGetRawInputData ) ( IN HRAWINPUT hRawInput , IN UINT uiCommand , OUT LPVOID pData , IN OUT PINT pcbSize , IN UINT cbSizeHeader ) ;
typedef INT ( WINAPI * pGetRawInputDeviceInfoA ) ( IN HANDLE hDevice , IN UINT uiCommand , OUT LPVOID pData , IN OUT PINT pcbSize ) ;
typedef BOOL ( WINAPI * pRegisterRawInputDevices ) ( IN PCRAWINPUTDEVICE pRawInputDevices , IN UINT uiNumDevices , IN UINT cbSize ) ;
2005-06-29 21:20:34 +00:00
2012-10-14 09:00:49 +00:00
static pGetRawInputDeviceList _GRIDL ;
static pGetRawInputData _GRID ;
static pGetRawInputDeviceInfoA _GRIDIA ;
static pRegisterRawInputDevices _RRID ;
2005-06-29 21:20:34 +00:00
2012-10-14 09:00:49 +00:00
static keyboard_t * rawkbd ;
static mouse_t * rawmice ;
static int rawmicecount ;
static int rawkbdcount ;
static RAWINPUT * raw ;
static int ribuffersize ;
2005-06-29 21:20:34 +00:00
2016-01-18 05:22:07 +00:00
static cvar_t in_rawinput_mice = CVARD ( " in_rawinput " , " 0 " , " Enables rawinput support for mice in XP onwards. Rawinput permits independant device identification (ie: splitscreen clients can each have their own mouse) " ) ;
static cvar_t in_rawinput_keyboard = CVARD ( " in_rawinput_keyboard " , " 0 " , " Enables rawinput support for keyboards in XP onwards as well as just mice. " ) ;
2012-10-14 09:00:49 +00:00
static cvar_t in_rawinput_rdp = CVARD ( " in_rawinput_rdp " , " 0 " , " Activate Remote Desktop Protocol devices too. " ) ;
2005-12-11 03:22:43 +00:00
2012-10-14 09:00:49 +00:00
void INS_RawInput_MouseDeRegister ( void ) ;
int INS_RawInput_MouseRegister ( void ) ;
void INS_RawInput_KeyboardDeRegister ( void ) ;
int INS_RawInput_KeyboardRegister ( void ) ;
void INS_RawInput_DeInit ( void ) ;
2005-12-11 03:22:43 +00:00
2005-06-29 21:20:34 +00:00
# endif
2019-07-03 17:41:30 +00:00
# ifdef AVAIL_XINPUT
static const int xinputjbuttons [ ] =
{ //xinput->fte button mapping table
K_GP_DPAD_UP ,
K_GP_DPAD_DOWN ,
K_GP_DPAD_LEFT ,
K_GP_DPAD_RIGHT ,
K_GP_START ,
K_GP_BACK ,
K_GP_LEFT_THUMB ,
K_GP_RIGHT_THUMB ,
K_GP_LEFT_SHOULDER ,
K_GP_RIGHT_SHOULDER ,
K_GP_GUIDE , //officially, this is 'reserved'
K_GP_UNKNOWN , //reserved
K_GP_A ,
K_GP_B ,
K_GP_X ,
K_GP_Y ,
//not part of xinput specs, but used to treat the various axis as buttons.
K_GP_LEFT_THUMB_UP ,
K_GP_LEFT_THUMB_DOWN ,
K_GP_LEFT_THUMB_LEFT ,
K_GP_LEFT_THUMB_RIGHT ,
K_GP_RIGHT_THUMB_UP ,
K_GP_RIGHT_THUMB_DOWN ,
K_GP_RIGHT_THUMB_LEFT ,
K_GP_RIGHT_THUMB_RIGHT ,
K_GP_LEFT_TRIGGER ,
K_GP_RIGHT_TRIGGER ,
} ;
# endif
static const int mmjbuttons [ 32 ] =
{ //winmm->fte joystick button mapping table
K_JOY1 ,
K_JOY2 ,
K_JOY3 ,
K_JOY4 ,
//yes, aux1-4 skipped for compat with other quake engines.
2021-07-23 13:36:18 +00:00
K_JOY9 ,
K_JOY10 ,
K_JOY11 ,
K_JOY12 ,
K_JOY13 ,
K_JOY14 ,
K_JOY15 ,
K_JOY16 ,
K_JOY17 ,
K_JOY18 ,
K_JOY19 ,
K_JOY20 ,
K_JOY21 ,
K_JOY22 ,
K_JOY23 ,
K_JOY24 ,
K_JOY25 ,
K_JOY26 ,
K_JOY27 ,
K_JOY28 ,
K_JOY29 ,
K_JOY30 ,
K_JOY31 ,
K_JOY32 ,
2019-07-03 17:41:30 +00:00
//29-32 used for the pov stuff, so lets switch back to aux1-4 to avoid wastage
2021-07-23 13:36:18 +00:00
K_JOY5 ,
K_JOY6 ,
K_JOY7 ,
K_JOY8
2019-07-03 17:41:30 +00:00
} ;
2004-08-23 00:15:46 +00:00
// forward-referenced functions
2012-10-14 09:00:49 +00:00
void INS_StartupJoystick ( void ) ;
2018-03-04 14:41:16 +00:00
void INS_JoyMove ( void ) ;
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = =
Force_CenterView_f
= = = = = = = = = = =
*/
void Force_CenterView_f ( void )
{
2012-07-05 19:42:36 +00:00
cl . playerview [ 0 ] . viewangles [ PITCH ] = 0 ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_UpdateClipCursor
2004-08-23 00:15:46 +00:00
= = = = = = = = = = =
*/
2012-10-14 09:00:49 +00:00
void INS_UpdateClipCursor ( void )
2004-08-23 00:15:46 +00:00
{
if ( mouseinitialized & & mouseactive & & ! dinput )
{
ClipCursor ( & window_rect ) ;
}
}
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_ShowMouse
2004-08-23 00:15:46 +00:00
= = = = = = = = = = =
*/
2012-10-14 09:00:49 +00:00
static void INS_ShowMouse ( void )
2004-08-23 00:15:46 +00:00
{
if ( ! mouseshowtoggle )
2018-01-22 19:18:04 +00:00
{ //FIXME: we should be sending this via the window thread.
2004-08-23 00:15:46 +00:00
ShowCursor ( TRUE ) ;
mouseshowtoggle = 1 ;
}
}
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_HideMouse
2004-08-23 00:15:46 +00:00
= = = = = = = = = = =
*/
2012-10-14 09:00:49 +00:00
static void INS_HideMouse ( void )
2004-08-23 00:15:46 +00:00
{
if ( mouseshowtoggle )
2018-01-22 19:18:04 +00:00
{ //I'm told that nvidia's null-named 'Geforce Experience' (which is malware in my book) fucks with cursor visibility.
//So lets try to ensure that it gets hidden properly in case we've got race conditions and code getting injected into our process.
//in modern windows, this is per-thread, so blame code injection if this ever prints.
//FIXME: we should be sending this via the window thread.
while ( ShowCursor ( FALSE ) > = 0 )
Con_Printf ( CON_WARNING " Force-hiding mouse cursor... \n " ) ;
2004-08-23 00:15:46 +00:00
mouseshowtoggle = 0 ;
}
}
2016-02-10 23:23:43 +00:00
//scan for an unused device id for joysticks (now that something was pressed).
static int Joy_AllocateDevID ( void )
{
2017-05-18 10:24:09 +00:00
extern cvar_t cl_splitscreen ;
2016-02-10 23:23:43 +00:00
int id = 0 , j ;
for ( id = 0 ; ; id + + )
{
for ( j = 0 ; j < joy_count ; j + + )
{
if ( wjoy [ j ] . devid = = id )
break ;
}
if ( j = = joy_count )
2017-05-18 10:24:09 +00:00
{
if ( id > cl_splitscreen . ival & & ! * cl_splitscreen . string )
cl_splitscreen . ival = id ;
2016-02-10 23:23:43 +00:00
return id ;
2017-05-18 10:24:09 +00:00
}
2016-02-10 23:23:43 +00:00
}
}
# ifdef USINGRAWINPUT
static int Mouse_AllocateDevID ( void )
{
2017-05-18 10:24:09 +00:00
extern cvar_t cl_splitscreen ;
2016-02-10 23:23:43 +00:00
int id = 0 , j ;
for ( id = 0 ; ; id + + )
{
for ( j = 0 ; j < rawmicecount ; j + + )
{
if ( rawmice [ j ] . qdeviceid = = id )
break ;
}
if ( j = = rawmicecount )
2017-05-18 10:24:09 +00:00
{
if ( id > cl_splitscreen . ival & & ! * cl_splitscreen . string )
cl_splitscreen . ival = id ;
2016-02-10 23:23:43 +00:00
return id ;
2017-05-18 10:24:09 +00:00
}
2016-02-10 23:23:43 +00:00
}
}
static int Keyboard_AllocateDevID ( void )
{
2017-05-18 10:24:09 +00:00
extern cvar_t cl_splitscreen ;
2016-02-10 23:23:43 +00:00
int id = 0 , j ;
for ( id = 0 ; ; id + + )
{
for ( j = 0 ; j < rawkbdcount ; j + + )
{
if ( rawkbd [ j ] . qdeviceid = = id )
break ;
}
if ( j = = rawkbdcount )
2017-05-18 10:24:09 +00:00
{
if ( id > cl_splitscreen . ival & & ! * cl_splitscreen . string )
cl_splitscreen . ival = id ;
2016-02-10 23:23:43 +00:00
return id ;
2017-05-18 10:24:09 +00:00
}
2016-02-10 23:23:43 +00:00
}
}
# endif
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_ActivateMouse
2004-08-23 00:15:46 +00:00
= = = = = = = = = = =
*/
2012-10-14 09:00:49 +00:00
static void INS_ActivateMouse ( void )
2004-08-23 00:15:46 +00:00
{
mouseactivatetoggle = true ;
2009-04-01 22:03:56 +00:00
if ( mouseinitialized & & ! mouseactive )
2004-08-23 00:15:46 +00:00
{
2009-03-07 04:37:24 +00:00
# ifdef AVAIL_DINPUT
2005-06-18 22:30:57 +00:00
# if (DIRECTINPUT_VERSION >= DINPUT_VERSION_DX7)
if ( dinput > = DINPUT_VERSION_DX7 )
{
if ( g_pMouse7 )
{
if ( ! dinput_acquired )
{
IDirectInputDevice7_Acquire ( g_pMouse7 ) ;
dinput_acquired = true ;
}
}
else
{
return ;
}
}
else
# endif
2004-08-23 00:15:46 +00:00
if ( dinput )
{
if ( g_pMouse )
{
if ( ! dinput_acquired )
{
IDirectInputDevice_Acquire ( g_pMouse ) ;
dinput_acquired = true ;
}
}
else
{
return ;
}
}
else
# endif
{
2005-12-11 03:22:43 +00:00
# ifdef USINGRAWINPUT
2010-08-24 02:18:42 +00:00
if ( rawkbdcount > 0 )
{
2012-10-14 09:00:49 +00:00
if ( INS_RawInput_KeyboardRegister ( ) )
2010-08-24 02:18:42 +00:00
{
Con_SafePrintf ( " Raw input: unable to register raw input for keyboard, deinitializing \n " ) ;
2012-10-14 09:00:49 +00:00
INS_RawInput_KeyboardDeRegister ( ) ;
2010-08-24 02:18:42 +00:00
}
}
2005-12-11 03:22:43 +00:00
# endif
2004-08-23 00:15:46 +00:00
if ( mouseparmsvalid )
2013-09-22 06:26:40 +00:00
{
SystemParametersInfo ( SPI_SETMOUSE , 0 , newmouseparms , 0 ) ;
restore_spi = true ;
}
2004-08-23 00:15:46 +00:00
SetCursorPos ( window_center_x , window_center_y ) ;
SetCapture ( mainwindow ) ;
ClipCursor ( & window_rect ) ;
}
mouseactive = true ;
}
}
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_DeactivateMouse
2004-08-23 00:15:46 +00:00
= = = = = = = = = = =
*/
2012-10-14 09:00:49 +00:00
static void INS_DeactivateMouse ( void )
2004-08-23 00:15:46 +00:00
{
mouseactivatetoggle = false ;
2009-04-01 22:03:56 +00:00
if ( mouseinitialized & & mouseactive )
2004-08-23 00:15:46 +00:00
{
2009-03-07 04:37:24 +00:00
# ifdef AVAIL_DINPUT
2005-06-18 22:30:57 +00:00
# if (DIRECTINPUT_VERSION >= DINPUT_VERSION_DX7)
if ( dinput > = DINPUT_VERSION_DX7 )
{
if ( g_pMouse7 )
{
if ( dinput_acquired )
{
IDirectInputDevice_Unacquire ( g_pMouse7 ) ;
dinput_acquired = false ;
}
}
else
{
return ;
}
}
else
# endif
2004-08-23 00:15:46 +00:00
if ( dinput )
{
if ( g_pMouse )
{
if ( dinput_acquired )
{
IDirectInputDevice_Unacquire ( g_pMouse ) ;
dinput_acquired = false ;
}
}
}
else
# endif
{
2005-12-11 03:22:43 +00:00
# ifdef USINGRAWINPUT
2017-11-23 07:46:39 +00:00
// if (rawmicecount > 0)
// INS_RawInput_MouseDeRegister();
2005-12-11 03:22:43 +00:00
# endif
2004-08-23 00:15:46 +00:00
if ( restore_spi )
SystemParametersInfo ( SPI_SETMOUSE , 0 , originalmouseparms , 0 ) ;
ClipCursor ( NULL ) ;
ReleaseCapture ( ) ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( ! vid . forcecursor )
{
vid . forcecursor = true ;
vid . forcecursorpos [ 0 ] = mousecursor_x ;
vid . forcecursorpos [ 1 ] = mousecursor_y ;
}
2004-08-23 00:15:46 +00:00
}
mouseactive = false ;
}
}
2009-04-01 22:03:56 +00:00
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_SetQuakeMouseState
2009-04-01 22:03:56 +00:00
= = = = = = = = = = =
*/
2012-10-14 09:00:49 +00:00
void INS_SetQuakeMouseState ( void )
2009-04-01 22:03:56 +00:00
{
if ( mouseactivatetoggle )
2012-10-14 09:00:49 +00:00
INS_ActivateMouse ( ) ;
2009-04-01 22:03:56 +00:00
else
2012-10-14 09:00:49 +00:00
INS_DeactivateMouse ( ) ;
2009-04-01 22:03:56 +00:00
}
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_RestoreOriginalMouseState
2004-08-23 00:15:46 +00:00
= = = = = = = = = = =
*/
2012-10-14 09:00:49 +00:00
void INS_RestoreOriginalMouseState ( void )
2004-08-23 00:15:46 +00:00
{
if ( mouseactivatetoggle )
{
2012-10-14 09:00:49 +00:00
INS_DeactivateMouse ( ) ;
2004-08-23 00:15:46 +00:00
mouseactivatetoggle = true ;
}
// try to redraw the cursor so it gets reinitialized, because sometimes it
// has garbage after the mode switch
ShowCursor ( TRUE ) ;
ShowCursor ( FALSE ) ;
}
2009-04-01 22:03:56 +00:00
2012-10-14 09:00:49 +00:00
void INS_UpdateGrabs ( int fullscreen , int activeapp )
2009-04-01 22:03:56 +00:00
{
int grabmouse ;
2009-07-17 15:34:16 +00:00
if ( ! activeapp )
grabmouse = false ;
2019-04-15 18:43:42 +00:00
else if ( fullscreen | | in_simulatemultitouch . ival | | in_windowed_mouse . value )
2009-04-01 22:03:56 +00:00
{
if ( ! Key_MouseShouldBeFree ( ) )
grabmouse = true ;
else
grabmouse = false ;
}
else
grabmouse = false ;
2015-04-14 23:12:17 +00:00
if ( activeapp )
{
2016-07-12 00:40:13 +00:00
if (
# ifdef TEXTEDITOR
! editormodal & &
# endif
2019-04-15 18:43:42 +00:00
! SCR_HardwareCursorIsActive ( ) & & ( fullscreen | | in_simulatemultitouch . ival | | in_windowed_mouse . value ) & & ( fullscreen | | ( current_mouse_pos . x > = window_rect . left & & current_mouse_pos . y > = window_rect . top & & current_mouse_pos . x < = window_rect . right & & current_mouse_pos . y < = window_rect . bottom ) ) )
2015-04-14 23:12:17 +00:00
{
INS_HideMouse ( ) ;
}
else
{
INS_ShowMouse ( ) ;
grabmouse = false ;
}
}
2009-04-01 22:03:56 +00:00
else
2014-09-02 02:44:43 +00:00
{
2012-10-14 09:00:49 +00:00
INS_ShowMouse ( ) ;
2014-09-02 02:44:43 +00:00
grabmouse = false ;
}
2009-04-01 22:03:56 +00:00
# ifdef HLCLIENT
//halflife gamecode does its own mouse control... yes this is vile.
if ( grabmouse )
{
if ( CLHL_GamecodeDoesMouse ( ) )
grabmouse = 2 ;
}
if ( grabmouse = = 2 )
{
2012-10-14 09:00:49 +00:00
INS_DeactivateMouse ( ) ;
2009-04-01 22:03:56 +00:00
CLHL_SetMouseActive ( true ) ;
return ;
}
CLHL_SetMouseActive ( false ) ;
# endif
if ( grabmouse )
2012-10-14 09:00:49 +00:00
INS_ActivateMouse ( ) ;
2009-04-01 22:03:56 +00:00
else
2012-10-14 09:00:49 +00:00
INS_DeactivateMouse ( ) ;
Too many changes, sorry.
Change revision displays, use the SVN commit date instead of using __DATE__ (when there's no local changes). This should allow reproducible builds.
Added s_al_disable cvar, to block openal and all the various problems people have had with it, without having to name an explicit fallback (which would vary by system).
Add mastervolume cvar (for ss).
Add r_shadows 2 (aka fake shadows - for ss).
Add scr_loadingscreen_aspect -1 setting, to disable levelshots entirely, also disables the progress bar (for ss).
Better support for some effectinfo hacks (for ss).
Added dpcompat_nocsqcwarnings (because of lazy+buggy mods like ss).
Rework the dpcsqc versions of project+unproject builtins for better compat (for ss).
Added dpcompat_csqcinputeventtypes to block unexpected csqc input events (for ss).
Better compat with DP's loadfont console command (for ss).
Added dpcompat_smallerfonts cvar to replicate a DP bug (for ss).
Detect dp's m_draw extension, to work around it (for ss).
Cvar dpcompat_ignoremodificationtimes added. A value of 0 favour the most recently modified file, 1 will use DP-like alphabetically sorted preferences (for ss).
loadfont builtin can now accept outline=1 in the sizes arg for slightly more readable fonts.
Fix bbox calcs for rotated entities, fix needed for r_ignorenetpvs 0.
Hackily parse emoji.json to provide :poop: etc suggestions.
Skip prediction entirely when there's no local entity info. This fixes stair-smoothing in xonotic.
screenshot_cubemap will now capture half-float images when saving to ktx or dds files.
Fix support for xcf files larger than 4gb, mostly to avoid compiler warnings.
Fixed size of gfx/loading.lmp when replacement textures are used.
Added mipmap support for rg8 and l8a8 textures.
r_hdr_framebuffer cvar updated to support format names instead of random negative numbers. Description updated to name some interesting ones.
Perform autoupdate _checks_ ONLY with explicit user confirmation (actual updating already needed user confirmation, but this extra step should reduce the chances of us getting wrongly accused of exfiltrating user data if we're run in a sandbox - we ONLY ever included the updating engine's version in the checks, though there's nothing we can do to avoid sending the user's router's IP).
Removed the 'summon satan all over your harddrive' quit message, in case paranoid security researchers are idiots and don't bother doing actual research.
Removed the triptohell.info and fte.triptohell.info certificates, they really need to stop being self-signed. The updates domain is still self-signed for autoupdates.
Video drivers are now able to report supported video resolutions, visible to menuqc. Currently only works with SDL2 builds.
Added setmousepos builtin. Should work with glx+win32 build.
VF_SKYROOM_CAMERA can now accept an extra two args, setviewprop(VF_SKYROOM_CAMERA, org, axis, degrees).
Removed v_skyroom_origin+v_skyroom_orientation cvars in favour just v_skyroom, which should make it behave more like the 'fog' command (used when csqc isn't overriding).
Added R_EndPolygonRibbon builtin to make it faster+easier to generate textured ribbon/cable/etc wide lines (for TW).
sdl: Fix up sys_sdl.c's file enumeration to support wildcards in directories.
edit command now displays end1.bin/end2.bin correctly, because we can.
Finally add support for f_modified - though ruleset_allow_larger_models and ruleset_allow_overlong_sounds generally make it redundant.
Fix threading race condition in sha1 lookups.
Updated f_ruleset to include the same extra flags reported by ezquake.
A mod's default.fmf file can now contain an eg 'mainconfig config.cfg' line (to explicitly set the main config saved with cfg_save_auto 1 etc).
fmf: basegame steam:GameName/GameDir can be used to try to load a mod directory from an installed steam game. The resulting gamedir will be read-only.
HOMEDIR CHANGE: use homedirs only if the basedir cannot be written or a homedir already exists, which should further reduce the probability of microsoft randomly uploading our data to their cloud (but mostly because its annoying to never know where your data is written).
Fixed buf_cvarlist, should work in xonotic now, and without segfaults.
Added an extra arg to URI_Get_Callback calls - the response size, also changed the tempstring to contain all bytes of the response, you need to be careful about nulls though.
Try to work around nvidia's forced-panning bug on x11 when changing video modes. This might screw with other programs.
sdl: support custom icons.
sdl: support choosing a specific display.
Added some documentation to menuqc builtins.
menusys: use outlines for slightly more readable fonts.
menusys: switch vid_width and vid_height combos into a single video mode combo to set both according to reported video modes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5581 fc73d0e0-1445-4013-8a0c-d673dee63da5
2019-11-20 03:09:50 +00:00
if ( vid . forcecursor & & ! mouseactive )
{
vid . forcecursor = false ;
if ( activeapp )
SetCursorPos ( window_rect . left + vid . forcecursorpos [ 0 ] , window_rect . top + vid . forcecursorpos [ 1 ] ) ;
}
2009-04-01 22:03:56 +00:00
}
2009-03-07 04:37:24 +00:00
# ifdef AVAIL_DINPUT
2015-04-14 23:12:17 +00:00
BOOL CALLBACK INS_EnumerateDI7Devices ( LPCDIDEVICEINSTANCE inst , LPVOID parm )
2004-08-23 00:15:46 +00:00
{
2006-01-28 23:22:17 +00:00
Con_DPrintf ( " EnumerateDevices found: %s \n " , inst - > tszProductName ) ;
2005-06-29 21:20:34 +00:00
return DIENUM_CONTINUE ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_InitDInput
2004-08-23 00:15:46 +00:00
= = = = = = = = = = =
*/
2012-10-14 09:00:49 +00:00
int INS_InitDInput ( void )
2004-08-23 00:15:46 +00:00
{
2017-02-19 00:15:42 +00:00
HRESULT hr ;
2004-08-23 00:15:46 +00:00
DIPROPDWORD dipdw = {
{
sizeof ( DIPROPDWORD ) , // diph.dwSize
sizeof ( DIPROPHEADER ) , // diph.dwHeaderSize
0 , // diph.dwObj
DIPH_DEVICE , // diph.dwHow
} ,
DINPUT_BUFFERSIZE , // dwData
} ;
if ( ! hInstDI )
{
2015-05-14 03:06:58 +00:00
hInstDI = Sys_LoadLibrary ( " dinput.dll " , NULL ) ;
2011-05-19 13:34:07 +00:00
2004-08-23 00:15:46 +00:00
if ( hInstDI = = NULL )
{
Con_SafePrintf ( " Couldn't load dinput.dll \n " ) ;
2005-06-18 22:30:57 +00:00
return 0 ;
}
}
# if (DIRECTINPUT_VERSION >= DINPUT_VERSION_DX7)
if ( ! pDirectInputCreateEx )
pDirectInputCreateEx = ( void * ) GetProcAddress ( hInstDI , " DirectInputCreateEx " ) ;
if ( pDirectInputCreateEx ) // use DirectInput 7
{
// register with DirectInput and get an IDirectInput to play with.
2016-07-12 00:40:13 +00:00
hr = iDirectInputCreateEx ( global_hInstance , DINPUT_VERSION_DX7 , & fIID_IDirectInput7A , ( void * * ) & g_pdi7 , NULL ) ;
2005-06-18 22:30:57 +00:00
if ( FAILED ( hr ) )
return 0 ;
2015-04-14 23:12:17 +00:00
IDirectInput7_EnumDevices ( g_pdi7 , 0 , & INS_EnumerateDI7Devices , NULL , DIEDFL_ATTACHEDONLY ) ;
2005-06-18 22:30:57 +00:00
// obtain an interface to the system mouse device.
2016-07-12 00:40:13 +00:00
hr = IDirectInput7_CreateDeviceEx ( g_pdi7 , & fGUID_SysMouse , & fIID_IDirectInputDevice7A , ( void * * ) & g_pMouse7 , NULL ) ;
2005-06-18 22:30:57 +00:00
if ( FAILED ( hr ) ) {
Con_SafePrintf ( " Couldn't open DI7 mouse device \n " ) ;
return 0 ;
2004-08-23 00:15:46 +00:00
}
2005-06-18 22:30:57 +00:00
// set the data format to "mouse format".
hr = IDirectInputDevice7_SetDataFormat ( g_pMouse7 , & df ) ;
if ( FAILED ( hr ) ) {
Con_SafePrintf ( " Couldn't set DI7 mouse format \n " ) ;
return 0 ;
}
// set the cooperativity level.
hr = IDirectInputDevice7_SetCooperativeLevel ( g_pMouse7 , mainwindow ,
DISCL_EXCLUSIVE | DISCL_FOREGROUND ) ;
if ( FAILED ( hr ) ) {
Con_SafePrintf ( " Couldn't set DI7 coop level \n " ) ;
return 0 ;
}
// set the buffer size to DINPUT_BUFFERSIZE elements.
// the buffer size is a DWORD property associated with the device
hr = IDirectInputDevice7_SetProperty ( g_pMouse7 , DIPROP_BUFFERSIZE , & dipdw . diph ) ;
if ( FAILED ( hr ) ) {
Con_SafePrintf ( " Couldn't set DI7 buffersize \n " ) ;
return 0 ;
}
return DINPUT_VERSION_DX7 ;
2004-08-23 00:15:46 +00:00
}
2005-06-18 22:30:57 +00:00
# endif
2004-08-23 00:15:46 +00:00
if ( ! pDirectInputCreate )
{
pDirectInputCreate = ( void * ) GetProcAddress ( hInstDI , " DirectInputCreateA " ) ;
if ( ! pDirectInputCreate )
{
2005-06-18 22:30:57 +00:00
Con_SafePrintf ( " Couldn't get DI3 proc addr \n " ) ;
return 0 ;
2004-08-23 00:15:46 +00:00
}
}
// register with DirectInput and get an IDirectInput to play with.
2005-06-18 22:30:57 +00:00
hr = iDirectInputCreate ( global_hInstance , DINPUT_VERSION_DX3 , & g_pdi , NULL ) ;
2004-08-23 00:15:46 +00:00
if ( FAILED ( hr ) )
{
2005-06-18 22:30:57 +00:00
return 0 ;
2004-08-23 00:15:46 +00:00
}
2015-04-14 23:12:17 +00:00
IDirectInput_EnumDevices ( g_pdi , 0 , & INS_EnumerateDI7Devices , NULL , DIEDFL_ATTACHEDONLY ) ;
2004-08-23 00:15:46 +00:00
// obtain an interface to the system mouse device.
2009-11-04 21:16:50 +00:00
hr = IDirectInput_CreateDevice ( g_pdi , & fGUID_SysMouse , & g_pMouse , NULL ) ;
2004-08-23 00:15:46 +00:00
if ( FAILED ( hr ) )
{
2005-06-18 22:30:57 +00:00
Con_SafePrintf ( " Couldn't open DI3 mouse device \n " ) ;
return 0 ;
2004-08-23 00:15:46 +00:00
}
// set the data format to "mouse format".
hr = IDirectInputDevice_SetDataFormat ( g_pMouse , & df ) ;
if ( FAILED ( hr ) )
{
2005-06-18 22:30:57 +00:00
Con_SafePrintf ( " Couldn't set DI3 mouse format \n " ) ;
return 0 ;
2004-08-23 00:15:46 +00:00
}
// set the cooperativity level.
hr = IDirectInputDevice_SetCooperativeLevel ( g_pMouse , mainwindow ,
DISCL_EXCLUSIVE | DISCL_FOREGROUND ) ;
if ( FAILED ( hr ) )
{
2005-06-18 22:30:57 +00:00
Con_SafePrintf ( " Couldn't set DI3 coop level \n " ) ;
return 0 ;
2004-08-23 00:15:46 +00:00
}
// set the buffer size to DINPUT_BUFFERSIZE elements.
// the buffer size is a DWORD property associated with the device
hr = IDirectInputDevice_SetProperty ( g_pMouse , DIPROP_BUFFERSIZE , & dipdw . diph ) ;
if ( FAILED ( hr ) )
{
2005-06-18 22:30:57 +00:00
Con_SafePrintf ( " Couldn't set DI3 buffersize \n " ) ;
return 0 ;
2004-08-23 00:15:46 +00:00
}
2005-06-18 22:30:57 +00:00
return DINPUT_VERSION_DX3 ;
2004-08-23 00:15:46 +00:00
}
2012-10-14 09:00:49 +00:00
void INS_CloseDInput ( void )
2004-08-23 00:15:46 +00:00
{
2005-06-18 22:30:57 +00:00
# if (DIRECTINPUT_VERSION >= DINPUT_VERSION_DX7)
if ( g_pMouse7 )
{
IDirectInputDevice7_Release ( g_pMouse7 ) ;
g_pMouse7 = NULL ;
}
if ( g_pdi7 )
{
IDirectInput7_Release ( g_pdi7 ) ;
g_pdi7 = NULL ;
}
2015-08-20 03:58:15 +00:00
pDirectInputCreateEx = NULL ;
2005-06-18 22:30:57 +00:00
# endif
2004-08-23 00:15:46 +00:00
if ( g_pMouse )
{
IDirectInputDevice_Release ( g_pMouse ) ;
g_pMouse = NULL ;
}
if ( g_pdi )
{
IDirectInput_Release ( g_pdi ) ;
g_pdi = NULL ;
}
if ( hInstDI )
{
FreeLibrary ( hInstDI ) ;
hInstDI = NULL ;
pDirectInputCreate = NULL ;
}
}
# endif
2005-06-29 21:20:34 +00:00
# ifdef USINGRAWINPUT
2012-10-14 09:00:49 +00:00
void INS_RawInput_MouseDeRegister ( void )
2005-06-29 21:20:34 +00:00
{
RAWINPUTDEVICE Rid ;
// deregister raw input
2011-05-19 13:34:07 +00:00
Rid . usUsagePage = 0x01 ;
Rid . usUsage = 0x02 ;
2005-06-29 21:20:34 +00:00
Rid . dwFlags = RIDEV_REMOVE ;
Rid . hwndTarget = NULL ;
( * _RRID ) ( & Rid , 1 , sizeof ( Rid ) ) ;
2005-12-11 03:22:43 +00:00
}
2012-10-14 09:00:49 +00:00
void INS_RawInput_KeyboardDeRegister ( void )
2005-12-11 03:22:43 +00:00
{
2010-08-23 04:53:20 +00:00
RAWINPUTDEVICE Rid ;
2005-12-11 03:22:43 +00:00
2010-08-23 04:53:20 +00:00
// deregister raw input
2011-05-19 13:34:07 +00:00
Rid . usUsagePage = 0x01 ;
2015-01-21 18:18:37 +00:00
Rid . usUsage = 0x06 ;
2010-08-23 04:53:20 +00:00
Rid . dwFlags = RIDEV_REMOVE ;
Rid . hwndTarget = NULL ;
2005-06-29 21:20:34 +00:00
2010-08-23 04:53:20 +00:00
( * _RRID ) ( & Rid , 1 , sizeof ( Rid ) ) ;
}
2005-06-29 21:20:34 +00:00
2012-10-14 09:00:49 +00:00
void INS_RawInput_DeInit ( void )
2010-08-23 04:53:20 +00:00
{
if ( rawmicecount > 0 )
2012-10-14 09:00:49 +00:00
INS_RawInput_MouseDeRegister ( ) ;
2010-08-23 04:53:20 +00:00
if ( rawkbdcount > 0 )
2012-10-14 09:00:49 +00:00
INS_RawInput_KeyboardDeRegister ( ) ;
2015-01-21 18:18:37 +00:00
rawmicecount = 0 ;
rawkbdcount = 0 ;
Z_Free ( rawmice ) ;
rawmice = NULL ;
Z_Free ( rawkbd ) ;
rawkbd = NULL ;
Z_Free ( raw ) ;
raw = NULL ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
memset ( multicursor_active , 0 , sizeof ( multicursor_active ) ) ;
2005-06-29 21:20:34 +00:00
}
# endif
# ifdef USINGRAWINPUT
// raw input registration functions
2012-10-14 09:00:49 +00:00
int INS_RawInput_MouseRegister ( void )
2005-06-29 21:20:34 +00:00
{
// This function registers to receive the WM_INPUT messages
2011-05-19 13:34:07 +00:00
RAWINPUTDEVICE Rid ; // Register only for mouse messages from wm_input.
2005-06-29 21:20:34 +00:00
//register to get wm_input messages
2011-05-19 13:34:07 +00:00
Rid . usUsagePage = 0x01 ;
Rid . usUsage = 0x02 ;
2017-11-23 07:46:39 +00:00
//note: we don't exclude legacy events any more. while we don't really want them, we also don't want to get confused about click states. this way we can track the states properly without breaking.
Rid . dwFlags = 0 ; //RIDEV_NOLEGACY; // adds HID mouse and also ignores legacy mouse messages
2005-06-29 21:20:34 +00:00
Rid . hwndTarget = NULL ;
// Register to receive the WM_INPUT message for any change in mouse (buttons, wheel, and movement will all generate the same message)
if ( ! ( * _RRID ) ( & Rid , 1 , sizeof ( Rid ) ) )
2005-12-11 03:22:43 +00:00
return 1 ;
2005-06-29 21:20:34 +00:00
2005-12-11 03:22:43 +00:00
return 0 ;
2005-06-29 21:20:34 +00:00
}
2012-10-14 09:00:49 +00:00
int INS_RawInput_KeyboardRegister ( void )
2005-06-29 21:20:34 +00:00
{
2010-08-23 04:53:20 +00:00
RAWINPUTDEVICE Rid ;
2011-05-19 13:34:07 +00:00
Rid . usUsagePage = 0x01 ;
Rid . usUsage = 0x06 ;
2010-08-23 04:53:20 +00:00
Rid . dwFlags = RIDEV_NOLEGACY | RIDEV_APPKEYS | RIDEV_NOHOTKEYS ; // fetch everything, disable hotkey behavior (should cvar?)
Rid . hwndTarget = NULL ;
if ( ! ( * _RRID ) ( & Rid , 1 , sizeof ( Rid ) ) )
return 1 ;
return 0 ;
}
2012-10-14 09:00:49 +00:00
int INS_RawInput_Register ( void )
2010-08-23 04:53:20 +00:00
{
2012-10-14 09:00:49 +00:00
if ( INS_RawInput_MouseRegister ( ) )
return ! in_rawinput_keyboard . ival | | INS_RawInput_KeyboardRegister ( ) ;
2010-08-23 04:53:20 +00:00
return 0 ;
}
2012-10-14 09:00:49 +00:00
int INS_RawInput_IsRDPDevice ( char * cDeviceString )
2010-08-23 04:53:20 +00:00
{
// mouse is \\?\Root#RDP_MOU#, keyboard is \\?\Root#RDP_KBD#"
char cRDPString [ ] = " \\ \\ ? \\ Root#RDP_ " ;
2005-06-29 21:20:34 +00:00
int i ;
if ( strlen ( cDeviceString ) < strlen ( cRDPString ) ) {
return 0 ;
}
for ( i = strlen ( cRDPString ) - 1 ; i > = 0 ; i - - )
{
if ( cDeviceString [ i ] ! = cRDPString [ i ] )
return 0 ;
}
2010-08-23 04:53:20 +00:00
return 1 ;
2005-06-29 21:20:34 +00:00
}
2012-10-14 09:00:49 +00:00
void INS_RawInput_Init ( void )
2005-06-29 21:20:34 +00:00
{
// "0" to exclude, "1" to include
PRAWINPUTDEVICELIST pRawInputDeviceList ;
2010-08-23 04:53:20 +00:00
int inputdevices , i , j , mtemp , ktemp ;
2005-06-29 21:20:34 +00:00
char dname [ MAX_RI_DEVICE_SIZE ] ;
// Return 0 if rawinput is not available
HMODULE user32 = LoadLibrary ( " user32.dll " ) ;
if ( ! user32 )
{
Con_SafePrintf ( " Raw input: unable to load user32.dll \n " ) ;
return ;
}
_RRID = ( pRegisterRawInputDevices ) GetProcAddress ( user32 , " RegisterRawInputDevices " ) ;
if ( ! _RRID )
{
2016-01-18 05:22:07 +00:00
Con_SafePrintf ( " Raw input: function RegisterRawInputDevices is not available \n " ) ;
2005-06-29 21:20:34 +00:00
return ;
}
_GRIDL = ( pGetRawInputDeviceList ) GetProcAddress ( user32 , " GetRawInputDeviceList " ) ;
if ( ! _GRIDL )
{
2016-01-18 05:22:07 +00:00
Con_SafePrintf ( " Raw input: function GetRawInputDeviceList is not available \n " ) ;
2005-06-29 21:20:34 +00:00
return ;
}
_GRIDIA = ( pGetRawInputDeviceInfoA ) GetProcAddress ( user32 , " GetRawInputDeviceInfoA " ) ;
if ( ! _GRIDIA )
{
2016-01-18 05:22:07 +00:00
Con_SafePrintf ( " Raw input: function GetRawInputDeviceInfoA is not available \n " ) ;
2005-06-29 21:20:34 +00:00
return ;
}
_GRID = ( pGetRawInputData ) GetProcAddress ( user32 , " GetRawInputData " ) ;
if ( ! _GRID )
{
2016-01-18 05:22:07 +00:00
Con_SafePrintf ( " Raw input: function GetRawInputData is not available \n " ) ;
2005-06-29 21:20:34 +00:00
return ;
}
rawmicecount = 0 ;
rawmice = NULL ;
raw = NULL ;
ribuffersize = 0 ;
// 1st call to GetRawInputDeviceList: Pass NULL to get the number of devices.
if ( ( * _GRIDL ) ( NULL , & inputdevices , sizeof ( RAWINPUTDEVICELIST ) ) ! = 0 )
{
Con_SafePrintf ( " Raw input: unable to count raw input devices \n " ) ;
return ;
}
// Allocate the array to hold the DeviceList
pRawInputDeviceList = Z_Malloc ( sizeof ( RAWINPUTDEVICELIST ) * inputdevices ) ;
// 2nd call to GetRawInputDeviceList: Pass the pointer to our DeviceList and GetRawInputDeviceList() will fill the array
if ( ( * _GRIDL ) ( pRawInputDeviceList , & inputdevices , sizeof ( RAWINPUTDEVICELIST ) ) = = - 1 )
{
Con_SafePrintf ( " Raw input: unable to get raw input device list \n " ) ;
return ;
}
// Loop through all devices and count the mice
2010-08-23 04:53:20 +00:00
for ( i = 0 , mtemp = 0 , ktemp = 0 ; i < inputdevices ; i + + )
2005-06-29 21:20:34 +00:00
{
2010-08-23 04:53:20 +00:00
j = MAX_RI_DEVICE_SIZE ;
2005-06-29 21:20:34 +00:00
2010-08-23 04:53:20 +00:00
// Get the device name and use it to determine if it's the RDP Terminal Services virtual device.
if ( ( * _GRIDIA ) ( pRawInputDeviceList [ i ] . hDevice , RIDI_DEVICENAME , dname , & j ) < 0 )
dname [ 0 ] = 0 ;
2005-06-29 21:20:34 +00:00
2012-10-14 09:00:49 +00:00
if ( ! ( in_rawinput_rdp . value ) & & INS_RawInput_IsRDPDevice ( dname ) ) // use rdp (cvar)
2010-08-23 04:53:20 +00:00
continue ;
2005-06-29 21:20:34 +00:00
2010-08-23 04:53:20 +00:00
switch ( pRawInputDeviceList [ i ] . dwType )
{
case RIM_TYPEMOUSE :
2016-01-18 05:22:07 +00:00
if ( ! in_rawinput_mice . ival )
continue ;
2005-06-29 21:20:34 +00:00
mtemp + + ;
2010-08-23 04:53:20 +00:00
break ;
case RIM_TYPEKEYBOARD :
if ( ! in_rawinput_keyboard . ival )
continue ;
ktemp + + ;
break ;
default : // (RIM_TYPEHID) support joysticks?
break ;
2005-06-29 21:20:34 +00:00
}
}
// exit out if no devices found
2010-08-23 04:53:20 +00:00
if ( ! mtemp & & ! ktemp )
2005-06-29 21:20:34 +00:00
{
Con_SafePrintf ( " Raw input: no usable device found \n " ) ;
return ;
}
// Loop again and bind devices
2010-08-23 04:53:20 +00:00
rawmice = ( mouse_t * ) Z_Malloc ( sizeof ( mouse_t ) * mtemp ) ;
rawkbd = ( keyboard_t * ) Z_Malloc ( sizeof ( keyboard_t ) * ktemp ) ;
2005-06-29 21:20:34 +00:00
for ( i = 0 ; i < inputdevices ; i + + )
{
2010-08-23 04:53:20 +00:00
j = MAX_RI_DEVICE_SIZE ;
2005-06-29 21:20:34 +00:00
2010-08-23 04:53:20 +00:00
// Get the device name and use it to determine if it's the RDP Terminal Services virtual device.
if ( ( * _GRIDIA ) ( pRawInputDeviceList [ i ] . hDevice , RIDI_DEVICENAME , dname , & j ) < 0 )
dname [ 0 ] = 0 ;
2005-06-29 21:20:34 +00:00
2012-10-14 09:00:49 +00:00
if ( ! ( in_rawinput_rdp . value ) & & INS_RawInput_IsRDPDevice ( dname ) ) // use rdp (cvar)
2010-08-23 04:53:20 +00:00
continue ;
2005-06-29 21:20:34 +00:00
2010-08-23 04:53:20 +00:00
switch ( pRawInputDeviceList [ i ] . dwType )
2011-05-19 13:34:07 +00:00
{
2010-08-23 04:53:20 +00:00
case RIM_TYPEMOUSE :
2016-01-18 05:22:07 +00:00
if ( ! in_rawinput_mice . ival )
continue ;
2005-06-29 21:20:34 +00:00
// set handle
2006-02-17 02:51:59 +00:00
rawmice [ rawmicecount ] . handles . rawinputhandle = pRawInputDeviceList [ i ] . hDevice ;
2016-01-18 05:22:07 +00:00
Q_strncpyz ( rawmice [ rawmicecount ] . sysname , dname , sizeof ( rawmice [ rawmicecount ] . sysname ) ) ;
rawmice [ rawmicecount ] . numbuttons = 16 ;
rawmice [ rawmicecount ] . oldbuttons = 0 ;
2016-02-10 23:23:43 +00:00
rawmice [ rawmicecount ] . qdeviceid = DEVID_UNSET ;
2005-06-29 21:20:34 +00:00
rawmicecount + + ;
2010-08-23 04:53:20 +00:00
break ;
case RIM_TYPEKEYBOARD :
if ( ! in_rawinput_keyboard . ival )
continue ;
rawkbd [ rawkbdcount ] . handles . rawinputhandle = pRawInputDeviceList [ i ] . hDevice ;
2016-01-18 05:22:07 +00:00
Q_strncpyz ( rawkbd [ rawkbdcount ] . sysname , dname , sizeof ( rawkbd [ rawkbdcount ] . sysname ) ) ;
2016-02-10 23:23:43 +00:00
rawkbd [ rawkbdcount ] . qdeviceid = DEVID_UNSET ;
2010-08-23 04:53:20 +00:00
rawkbdcount + + ;
break ;
default :
continue ;
}
// print pretty message about device
dname [ MAX_RI_DEVICE_SIZE - 1 ] = 0 ;
for ( mtemp = strlen ( dname ) ; mtemp > = 0 ; mtemp - - )
{
if ( dname [ mtemp ] = = ' # ' )
{
dname [ mtemp + 1 ] = 0 ;
break ;
}
2005-06-29 21:20:34 +00:00
}
2016-01-18 05:22:07 +00:00
Con_DPrintf ( " Raw input type %i: [%i] %s \n " , ( int ) pRawInputDeviceList [ i ] . dwType , i , dname ) ;
2005-06-29 21:20:34 +00:00
}
2011-05-19 13:34:07 +00:00
2005-06-29 21:20:34 +00:00
// free the RAWINPUTDEVICELIST
Z_Free ( pRawInputDeviceList ) ;
// alloc raw input buffer
raw = BZ_Malloc ( INIT_RIBUFFER_SIZE ) ;
ribuffersize = INIT_RIBUFFER_SIZE ;
2018-12-04 08:59:22 +00:00
Con_DPrintf ( " Raw input: initialized with %i mice and %i keyboards \n " , rawmicecount , rawkbdcount ) ;
2005-06-29 21:20:34 +00:00
return ; // success
}
# endif
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_StartupMouse
2004-08-23 00:15:46 +00:00
= = = = = = = = = = =
*/
2012-10-14 09:00:49 +00:00
void INS_StartupMouse ( void )
2004-08-23 00:15:46 +00:00
{
2011-05-19 13:34:07 +00:00
if ( COM_CheckParm ( " -nomouse " ) )
return ;
2004-08-23 00:15:46 +00:00
mouseinitialized = true ;
2009-08-04 23:56:43 +00:00
//make sure it can't get stuck
2012-10-14 09:00:49 +00:00
INS_DeactivateMouse ( ) ;
2009-08-04 23:56:43 +00:00
2009-03-07 04:37:24 +00:00
# ifdef AVAIL_DINPUT
2004-08-23 00:15:46 +00:00
if ( in_dinput . value )
{
2012-10-14 09:00:49 +00:00
dinput = INS_InitDInput ( ) ;
2004-08-23 00:15:46 +00:00
if ( dinput )
{
2005-06-18 22:30:57 +00:00
Con_SafePrintf ( " DirectInput initialized, version %i \n " , ( dinput > > 8 & 0xFF ) ) ;
2004-08-23 00:15:46 +00:00
}
else
{
Con_SafePrintf ( " DirectInput not initialized \n " ) ;
}
}
2005-01-04 12:01:48 +00:00
else
2005-06-18 22:30:57 +00:00
dinput = 0 ;
2004-08-23 00:15:46 +00:00
if ( ! dinput )
# endif
{
if ( ! mouseparmsvalid )
mouseparmsvalid = SystemParametersInfo ( SPI_GETMOUSE , 0 , originalmouseparms , 0 ) ;
if ( mouseparmsvalid )
{
2011-05-19 13:34:07 +00:00
if ( m_accel_noforce . value )
2004-08-23 00:15:46 +00:00
newmouseparms [ 2 ] = originalmouseparms [ 2 ] ;
2011-05-19 13:34:07 +00:00
if ( m_threshold_noforce . value )
2004-08-23 00:15:46 +00:00
{
newmouseparms [ 0 ] = originalmouseparms [ 0 ] ;
newmouseparms [ 1 ] = originalmouseparms [ 1 ] ;
}
}
}
sysmouse . numbuttons = 10 ;
// if a fullscreen video mode was set before the mouse was initialized,
// set the mouse state appropriately
if ( mouseactivatetoggle )
2012-10-14 09:00:49 +00:00
INS_ActivateMouse ( ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_Init
2004-08-23 00:15:46 +00:00
= = = = = = = = = = =
*/
2012-10-14 09:00:49 +00:00
void INS_ReInit ( void )
2006-05-10 22:12:20 +00:00
{
2010-08-23 04:53:20 +00:00
# ifdef USINGRAWINPUT
2016-01-18 05:22:07 +00:00
if ( in_rawinput_mice . ival | | in_rawinput_keyboard . ival )
2010-08-23 04:53:20 +00:00
{
2012-10-14 09:00:49 +00:00
INS_RawInput_Init ( ) ;
2010-08-23 04:53:20 +00:00
}
# endif
2012-10-14 09:00:49 +00:00
INS_StartupMouse ( ) ;
INS_StartupJoystick ( ) ;
// INS_ActivateMouse();
2017-11-23 07:46:39 +00:00
# ifdef USINGRAWINPUT
//mouse rawinput is always enabled, because its too messy otherwise.
if ( rawmicecount > 0 )
{
if ( INS_RawInput_MouseRegister ( ) )
{
Con_SafePrintf ( " Raw input: unable to register raw input for mice, deinitializing \n " ) ;
INS_RawInput_MouseDeRegister ( ) ;
}
}
# endif
2006-05-10 22:12:20 +00:00
}
2012-10-14 09:00:49 +00:00
void INS_Init ( void )
2004-08-23 00:15:46 +00:00
{
2006-05-10 22:12:20 +00:00
//keyboard variables
Cvar_Register ( & cl_keypad , " Input Controls " ) ;
2004-08-23 00:15:46 +00:00
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
# ifdef AVAIL_DINPUT
2006-05-10 22:12:20 +00:00
Cvar_Register ( & in_dinput , " Input Controls " ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
# endif
# ifdef AVAIL_XINPUT
Cvar_Register ( & in_xinput , " Input Controls " ) ;
Cvar_Register ( & xinput_leftvibrator , " Input Controls " ) ;
Cvar_Register ( & xinput_rightvibrator , " Input Controls " ) ;
# endif
2009-07-05 18:45:53 +00:00
Cvar_Register ( & in_builtinkeymap , " Input Controls " ) ;
2014-04-24 01:53:01 +00:00
Cvar_Register ( & in_nonstandarddeadkeys , " Input Controls " ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
Cvar_Register ( & in_simulatemultitouch , " Input Controls " ) ;
2004-08-23 00:15:46 +00:00
2006-05-10 22:12:20 +00:00
Cvar_Register ( & m_accel_noforce , " Input Controls " ) ;
Cvar_Register ( & m_threshold_noforce , " Input Controls " ) ;
2005-08-06 22:39:28 +00:00
2006-05-10 22:12:20 +00:00
// this looks strange but quake cmdline definitions
// and MS documentation don't agree with each other
if ( COM_CheckParm ( " -noforcemspd " ) )
Cvar_Set ( & m_accel_noforce , " 1 " ) ;
2005-08-06 22:39:28 +00:00
2006-05-10 22:12:20 +00:00
if ( COM_CheckParm ( " -noforcemaccel " ) )
Cvar_Set ( & m_threshold_noforce , " 1 " ) ;
2005-08-06 22:39:28 +00:00
2006-05-10 22:12:20 +00:00
if ( COM_CheckParm ( " -noforcemparms " ) )
{
Cvar_Set ( & m_accel_noforce , " 1 " ) ;
Cvar_Set ( & m_threshold_noforce , " 1 " ) ;
}
2005-08-06 22:39:28 +00:00
2006-05-10 22:12:20 +00:00
if ( COM_CheckParm ( " -dinput " ) )
Cvar_Set ( & in_dinput , " 1 " ) ;
2004-08-23 00:15:46 +00:00
2011-05-19 13:34:07 +00:00
// joystick variables
2006-05-10 22:12:20 +00:00
Cvar_Register ( & in_joystick , " Joystick variables " ) ;
Cmd_AddCommand ( " force_centerview " , Force_CenterView_f ) ;
2013-11-21 23:02:28 +00:00
uiWheelMessage = RegisterWindowMessageA ( " MSWHEEL_ROLLMSG " ) ;
2005-06-29 21:20:34 +00:00
# ifdef USINGRAWINPUT
2016-01-18 05:22:07 +00:00
Cvar_Register ( & in_rawinput_mice , " Input Controls " ) ;
2010-08-23 04:53:20 +00:00
Cvar_Register ( & in_rawinput_keyboard , " Input Controls " ) ;
2006-05-10 22:12:20 +00:00
Cvar_Register ( & in_rawinput_rdp , " Input Controls " ) ;
2005-06-29 21:20:34 +00:00
# endif
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_Shutdown
2004-08-23 00:15:46 +00:00
= = = = = = = = = = =
*/
2012-10-14 09:00:49 +00:00
void INS_Shutdown ( void )
2004-08-23 00:15:46 +00:00
{
2012-10-14 09:00:49 +00:00
INS_DeactivateMouse ( ) ;
INS_ShowMouse ( ) ;
2004-08-23 00:15:46 +00:00
2013-09-22 06:26:40 +00:00
mouseinitialized = false ;
2004-08-23 00:15:46 +00:00
mouseparmsvalid = false ;
2009-03-07 04:37:24 +00:00
# ifdef AVAIL_DINPUT
2012-10-14 09:00:49 +00:00
INS_CloseDInput ( ) ;
2004-08-23 00:15:46 +00:00
# endif
2005-06-29 21:20:34 +00:00
# ifdef USINGRAWINPUT
2012-10-14 09:00:49 +00:00
INS_RawInput_DeInit ( ) ;
2005-06-29 21:20:34 +00:00
# endif
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_MouseEvent
2004-08-23 00:15:46 +00:00
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
a mouse button was pressed / released , mstate is the current set of buttons pressed .
2004-08-23 00:15:46 +00:00
*/
2012-10-14 09:00:49 +00:00
void INS_MouseEvent ( int mstate )
2004-08-23 00:15:46 +00:00
{
int i ;
2009-07-25 11:05:06 +00:00
if ( dinput & & mouseactive )
2009-04-01 22:03:56 +00:00
return ;
# ifdef HLCLIENT
if ( CLHL_MouseEvent ( mstate ) )
return ;
# endif
2009-07-25 11:05:06 +00:00
if ( 1 ) //mouseactive || (key_dest != key_game))
2004-08-23 00:15:46 +00:00
{
// perform button actions
for ( i = 0 ; i < sysmouse . numbuttons ; i + + )
{
if ( ( mstate & ( 1 < < i ) ) & &
! ( sysmouse . oldbuttons & ( 1 < < i ) ) )
{
2017-11-23 07:46:39 +00:00
if ( ! rawmicecount )
IN_KeyEvent ( sysmouse . qdeviceid , true , K_MOUSE1 + i , 0 ) ;
else
mstate & = ~ ( 1 < < i ) ;
2004-08-23 00:15:46 +00:00
}
if ( ! ( mstate & ( 1 < < i ) ) & &
( sysmouse . oldbuttons & ( 1 < < i ) ) )
{
2016-02-10 23:23:43 +00:00
IN_KeyEvent ( sysmouse . qdeviceid , false , K_MOUSE1 + i , 0 ) ;
2004-08-23 00:15:46 +00:00
}
2011-05-19 13:34:07 +00:00
}
2004-08-23 00:15:46 +00:00
sysmouse . oldbuttons = mstate ;
}
}
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_MouseMove
2004-08-23 00:15:46 +00:00
= = = = = = = = = = =
*/
2018-03-04 14:41:16 +00:00
void INS_MouseMove ( void )
2004-08-23 00:15:46 +00:00
{
2009-03-07 04:37:24 +00:00
# ifdef AVAIL_DINPUT
2012-11-27 03:23:19 +00:00
if ( dinput & & mouseactive )
2004-08-23 00:15:46 +00:00
{
DIDEVICEOBJECTDATA od ;
DWORD dwElements ;
HRESULT hr ;
2012-10-14 09:00:49 +00:00
int xd = 0 , yd = 0 , zd = 0 ;
2004-08-23 00:15:46 +00:00
for ( ; ; )
{
dwElements = 1 ;
2005-06-18 22:30:57 +00:00
# if (DIRECTINPUT_VERSION >= DINPUT_VERSION_DX7)
if ( dinput > = DINPUT_VERSION_DX7 )
{
hr = IDirectInputDevice7_GetDeviceData ( g_pMouse7 ,
sizeof ( DIDEVICEOBJECTDATA ) , & od , & dwElements , 0 ) ;
2004-08-23 00:15:46 +00:00
2005-06-18 22:30:57 +00:00
if ( ( hr = = DIERR_INPUTLOST ) | | ( hr = = DIERR_NOTACQUIRED ) )
{
dinput_acquired = true ;
IDirectInputDevice7_Acquire ( g_pMouse7 ) ;
break ;
}
}
else
# endif
2004-08-23 00:15:46 +00:00
{
2005-06-18 22:30:57 +00:00
hr = IDirectInputDevice_GetDeviceData ( g_pMouse ,
sizeof ( DIDEVICEOBJECTDATA ) , & od , & dwElements , 0 ) ;
if ( ( hr = = DIERR_INPUTLOST ) | | ( hr = = DIERR_NOTACQUIRED ) )
{
dinput_acquired = true ;
IDirectInputDevice_Acquire ( g_pMouse ) ;
break ;
}
2004-08-23 00:15:46 +00:00
}
/* Unable to read data or no data available */
if ( FAILED ( hr ) | | dwElements = = 0 )
{
break ;
}
/* Look at the element to see what happened */
switch ( od . dwOfs )
{
case DIMOFS_X :
2012-10-14 09:00:49 +00:00
xd + = od . dwData ;
2004-08-23 00:15:46 +00:00
break ;
case DIMOFS_Y :
2012-10-14 09:00:49 +00:00
yd + = od . dwData ;
2004-08-23 00:15:46 +00:00
break ;
2004-09-20 23:25:38 +00:00
case DIMOFS_Z :
2012-10-14 09:00:49 +00:00
zd + = od . dwData ;
2004-09-20 23:25:38 +00:00
break ;
2004-08-23 00:15:46 +00:00
case DIMOFS_BUTTON0 :
case DIMOFS_BUTTON1 :
case DIMOFS_BUTTON2 :
2004-09-20 23:25:38 +00:00
case DIMOFS_BUTTON3 :
2005-06-18 22:30:57 +00:00
# if (DIRECTINPUT_VERSION >= DINPUT_VERSION_DX7)
2004-09-20 23:25:38 +00:00
case DIMOFS_BUTTON4 :
case DIMOFS_BUTTON5 :
case DIMOFS_BUTTON6 :
case DIMOFS_BUTTON7 :
# endif
2012-10-14 09:00:49 +00:00
IN_KeyEvent ( sysmouse . qdeviceid , ( od . dwData & 0x80 ) ? true : false , K_MOUSE1 + ( ( od . dwOfs - DIMOFS_BUTTON0 ) / ( DIMOFS_BUTTON1 - DIMOFS_BUTTON0 ) ) , 0 ) ;
break ;
2004-08-23 00:15:46 +00:00
}
}
2012-10-14 09:00:49 +00:00
if ( xd | | yd | | zd )
IN_MouseMove ( sysmouse . qdeviceid , false , xd , yd , zd , 0 ) ;
2004-08-23 00:15:46 +00:00
}
else
# endif
{
2012-10-14 09:00:49 +00:00
INS_Accumulate ( ) ;
2005-06-29 21:20:34 +00:00
}
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_Move
2004-08-23 00:15:46 +00:00
= = = = = = = = = = =
*/
2018-03-04 14:41:16 +00:00
void INS_Move ( void )
2004-08-23 00:15:46 +00:00
{
2016-02-10 23:23:43 +00:00
if ( vid . activeapp & & ! Minimized )
2004-08-23 00:15:46 +00:00
{
2018-03-04 14:41:16 +00:00
INS_MouseMove ( ) ;
INS_JoyMove ( ) ;
2004-08-23 00:15:46 +00:00
}
2015-04-14 23:12:17 +00:00
else
INS_Accumulate ( ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_Accumulate
2004-08-23 00:15:46 +00:00
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
potentially called multiple times per frame .
2004-08-23 00:15:46 +00:00
*/
2012-10-14 09:00:49 +00:00
void INS_Accumulate ( void )
2004-08-23 00:15:46 +00:00
{
if ( mouseactive & & ! dinput )
{
2016-08-25 00:12:14 +00:00
//if you have two programs side by side that both think that they own the mouse cursor then there are certain race conditions when switching between them
//when alt+tabbing, windows won't wait for a response, so we may have already lost focus by the time we get here, and none of our internal state will know about it.
//fte won't grab the mouse until its actually inside the window, but other programs don't have similar delays.
//so when switching to other quake ports, expect fte to detect the oter engine's setcursorpos as a really big mouse move.
RECT cliprect ;
if ( GetClipCursor ( & cliprect ) & & ! (
cliprect . left > = window_rect . left & &
cliprect . right < = window_rect . right & &
cliprect . top > = window_rect . top & &
cliprect . bottom < = window_rect . bottom
) )
; //cliprect now covers some area outside of where we asked for.
else
2005-06-29 21:20:34 +00:00
# ifdef USINGRAWINPUT
2012-10-14 09:00:49 +00:00
//raw input disables the system mouse, to avoid dupes
if ( ! rawmicecount )
2005-06-29 21:20:34 +00:00
# endif
{
2015-04-14 23:12:17 +00:00
GetCursorPos ( & current_mouse_pos ) ;
2015-04-21 04:12:00 +00:00
SetCursorPos ( window_center_x , window_center_y ) ;
2004-08-23 00:15:46 +00:00
2016-07-12 00:40:13 +00:00
if ( current_mouse_pos . x - window_center_x | | current_mouse_pos . y - window_center_y )
IN_MouseMove ( sysmouse . qdeviceid , false , current_mouse_pos . x - window_center_x , current_mouse_pos . y - window_center_y , 0 , 0 ) ;
2005-06-29 21:20:34 +00:00
}
2015-04-21 04:12:00 +00:00
else
{
// force the mouse to the center, so there's room to move (rawinput ignore this apparently)
SetCursorPos ( window_center_x , window_center_y ) ;
}
2004-08-23 00:15:46 +00:00
}
2012-10-14 09:00:49 +00:00
if ( ! mouseactive )
{
2015-04-14 23:12:17 +00:00
GetCursorPos ( & current_mouse_pos ) ;
2012-10-14 09:00:49 +00:00
2020-08-13 08:39:48 +00:00
IN_MouseMove ( sysmouse . qdeviceid , true , current_mouse_pos . x - window_rect . left , current_mouse_pos . y - window_rect . top , 0 , 0 ) ;
2012-10-14 09:00:49 +00:00
return ;
}
2004-08-23 00:15:46 +00:00
}
2005-06-29 21:20:34 +00:00
# ifdef USINGRAWINPUT
2012-10-14 09:00:49 +00:00
void INS_RawInput_MouseRead ( void )
2005-06-29 21:20:34 +00:00
{
2010-08-23 04:53:20 +00:00
int i , tbuttons , j ;
2012-02-12 05:18:31 +00:00
mouse_t * mouse ;
2005-06-29 21:20:34 +00:00
// find mouse in our mouse list
2010-08-23 04:53:20 +00:00
for ( i = 0 ; i < rawmicecount ; i + + )
2005-06-29 21:20:34 +00:00
{
2006-02-17 02:51:59 +00:00
if ( rawmice [ i ] . handles . rawinputhandle = = raw - > header . hDevice )
2005-06-29 21:20:34 +00:00
break ;
}
2010-08-23 04:53:20 +00:00
if ( i = = rawmicecount ) // we're not tracking this device
2005-06-29 21:20:34 +00:00
return ;
2012-02-12 05:18:31 +00:00
mouse = & rawmice [ i ] ;
2010-08-14 00:15:07 +00:00
2016-02-10 23:23:43 +00:00
if ( mouse - > qdeviceid = = DEVID_UNSET )
{
if ( ( raw - > data . mouse . usButtonFlags & ( RI_MOUSE_BUTTON_1_DOWN | RI_MOUSE_BUTTON_2_DOWN | RI_MOUSE_BUTTON_3_DOWN | RI_MOUSE_BUTTON_4_DOWN | RI_MOUSE_BUTTON_5_DOWN | RI_MOUSE_WHEEL ) )
| | ( raw - > data . mouse . ulRawButtons & RI_RAWBUTTON_MASK ) | | raw - > data . mouse . lLastX | | raw - > data . mouse . lLastY )
{
mouse - > qdeviceid = Mouse_AllocateDevID ( ) ;
}
else
return ;
}
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
multicursor_active [ mouse - > qdeviceid & 7 ] = 0 ;
2017-11-23 07:46:39 +00:00
if ( vid . activeapp )
2005-06-29 21:20:34 +00:00
{
2017-11-23 07:46:39 +00:00
// movement
if ( raw - > data . mouse . usFlags & MOUSE_MOVE_ABSOLUTE )
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
{
2017-11-23 07:46:39 +00:00
if ( in_simulatemultitouch . ival )
{
multicursor_active [ mouse - > qdeviceid & 7 ] = true ;
multicursor_x [ mouse - > qdeviceid & 7 ] = raw - > data . mouse . lLastX ;
multicursor_y [ mouse - > qdeviceid & 7 ] = raw - > data . mouse . lLastY ;
}
IN_MouseMove ( mouse - > qdeviceid , true , raw - > data . mouse . lLastX , raw - > data . mouse . lLastY , 0 , 0 ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
}
2017-11-23 07:46:39 +00:00
else if ( mouseactive ) // RELATIVE
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
{
2017-11-23 07:46:39 +00:00
if ( in_simulatemultitouch . ival )
{
multicursor_active [ mouse - > qdeviceid & 7 ] = true ;
multicursor_x [ mouse - > qdeviceid & 7 ] + = raw - > data . mouse . lLastX ;
multicursor_y [ mouse - > qdeviceid & 7 ] + = raw - > data . mouse . lLastY ;
multicursor_x [ mouse - > qdeviceid & 7 ] = bound ( 0 , multicursor_x [ mouse - > qdeviceid & 7 ] , vid . pixelwidth ) ;
multicursor_y [ mouse - > qdeviceid & 7 ] = bound ( 0 , multicursor_y [ mouse - > qdeviceid & 7 ] , vid . pixelheight ) ;
IN_MouseMove ( mouse - > qdeviceid , true , multicursor_x [ mouse - > qdeviceid & 7 ] , multicursor_y [ mouse - > qdeviceid & 7 ] , 0 , 0 ) ;
}
else
IN_MouseMove ( mouse - > qdeviceid , false , raw - > data . mouse . lLastX , raw - > data . mouse . lLastY , 0 , 0 ) ;
------------------------------------------------------------------------
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines
removed MAX_VISEDICTS limit.
PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default.
TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW.
added android multitouch emulation for windows/rawinput (in_simulatemultitouch).
split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature.
now using utf-8 for windows consoles.
qcc warnings/errors now give clickable console links for quick+easy editing.
disabled menutint when the currently active item changes contrast or gamma (for OneManClan).
Added support for drawfont/drawfontscale.
tweaked the qcvm a little to reduce the number of pointers.
.doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up.
windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings.
fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen.
editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts.
Added support for .framegroups files for psk(psa) and iqm formats.
True support for ezquake's colour codes. Mutually exclusive with background colours.
path command output slightly more readable.
added support for digest_hex (MD4, SHA1, CRC16).
skingroups now colourmap correctly.
Fix terrain colour hints, and litdata from the wrong bsp.
fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported).
remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother.
fix v *= v.x and similar opcodes.
fteqcc: fixed support for áéÃóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported.
fteqcc: fixed '#if 1 == 3 && 4' parsing.
fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable.
fteqcc: copyright message now includes compile date instead.
fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile.
fteqccgui: the output window is now focused and scrolls down as compilation progresses.
pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue.
rewrote prespawn/modelist/soundlist code. server tracks progress now.
------------------------------------------------------------------------
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
}
2005-06-29 21:20:34 +00:00
2017-11-23 07:46:39 +00:00
// button presses
if ( raw - > data . mouse . usButtonFlags & RI_MOUSE_BUTTON_1_DOWN )
IN_KeyEvent ( mouse - > qdeviceid , true , K_MOUSE1 , 0 ) ;
if ( raw - > data . mouse . usButtonFlags & RI_MOUSE_BUTTON_2_DOWN )
IN_KeyEvent ( mouse - > qdeviceid , true , K_MOUSE2 , 0 ) ;
if ( raw - > data . mouse . usButtonFlags & RI_MOUSE_BUTTON_3_DOWN )
IN_KeyEvent ( mouse - > qdeviceid , true , K_MOUSE3 , 0 ) ;
if ( raw - > data . mouse . usButtonFlags & RI_MOUSE_BUTTON_4_DOWN )
IN_KeyEvent ( mouse - > qdeviceid , true , K_MOUSE4 , 0 ) ;
if ( raw - > data . mouse . usButtonFlags & RI_MOUSE_BUTTON_5_DOWN )
IN_KeyEvent ( mouse - > qdeviceid , true , K_MOUSE5 , 0 ) ;
// mouse wheel
if ( raw - > data . mouse . usButtonFlags & RI_MOUSE_WHEEL )
{ // If the current message has a mouse_wheel message
if ( ( SHORT ) raw - > data . mouse . usButtonData > 0 )
{
IN_KeyEvent ( mouse - > qdeviceid , true , K_MWHEELUP , 0 ) ;
IN_KeyEvent ( mouse - > qdeviceid , false , K_MWHEELUP , 0 ) ;
}
if ( ( SHORT ) raw - > data . mouse . usButtonData < 0 )
{
IN_KeyEvent ( mouse - > qdeviceid , true , K_MWHEELDOWN , 0 ) ;
IN_KeyEvent ( mouse - > qdeviceid , false , K_MWHEELDOWN , 0 ) ;
}
}
}
//button releass
2011-05-19 13:34:07 +00:00
if ( raw - > data . mouse . usButtonFlags & RI_MOUSE_BUTTON_1_UP )
2012-10-14 09:00:49 +00:00
IN_KeyEvent ( mouse - > qdeviceid , false , K_MOUSE1 , 0 ) ;
2011-05-19 13:34:07 +00:00
if ( raw - > data . mouse . usButtonFlags & RI_MOUSE_BUTTON_2_UP )
2012-10-14 09:00:49 +00:00
IN_KeyEvent ( mouse - > qdeviceid , false , K_MOUSE2 , 0 ) ;
2011-05-19 13:34:07 +00:00
if ( raw - > data . mouse . usButtonFlags & RI_MOUSE_BUTTON_3_UP )
2012-10-14 09:00:49 +00:00
IN_KeyEvent ( mouse - > qdeviceid , false , K_MOUSE3 , 0 ) ;
2011-05-19 13:34:07 +00:00
if ( raw - > data . mouse . usButtonFlags & RI_MOUSE_BUTTON_4_UP )
2012-10-14 09:00:49 +00:00
IN_KeyEvent ( mouse - > qdeviceid , false , K_MOUSE4 , 0 ) ;
2011-05-19 13:34:07 +00:00
if ( raw - > data . mouse . usButtonFlags & RI_MOUSE_BUTTON_5_UP )
2012-10-14 09:00:49 +00:00
IN_KeyEvent ( mouse - > qdeviceid , false , K_MOUSE5 , 0 ) ;
2005-06-29 21:20:34 +00:00
// extra buttons
tbuttons = raw - > data . mouse . ulRawButtons & RI_RAWBUTTON_MASK ;
for ( j = 6 ; j < rawmice [ i ] . numbuttons ; j + + )
{
2012-10-14 09:00:49 +00:00
if ( ( tbuttons & ( 1 < < j ) ) & & ! ( rawmice [ i ] . oldbuttons & ( 1 < < j ) ) )
2005-06-29 21:20:34 +00:00
{
2017-11-23 07:46:39 +00:00
if ( vid . activeapp )
IN_KeyEvent ( mouse - > qdeviceid , true , K_MOUSE1 + j , 0 ) ;
2005-06-29 21:20:34 +00:00
}
2012-10-14 09:00:49 +00:00
if ( ! ( tbuttons & ( 1 < < j ) ) & & ( rawmice [ i ] . oldbuttons & ( 1 < < j ) ) )
2005-06-29 21:20:34 +00:00
{
2012-10-14 09:00:49 +00:00
IN_KeyEvent ( mouse - > qdeviceid , false , K_MOUSE1 + j , 0 ) ;
2005-06-29 21:20:34 +00:00
}
}
2012-10-14 09:00:49 +00:00
rawmice [ i ] . oldbuttons & = ~ RI_RAWBUTTON_MASK ;
rawmice [ i ] . oldbuttons | = tbuttons ;
2005-06-29 21:20:34 +00:00
}
2010-08-23 04:53:20 +00:00
2012-10-14 09:00:49 +00:00
void INS_RawInput_KeyboardRead ( void )
2010-08-23 04:53:20 +00:00
{
int i ;
qboolean down ;
WPARAM wParam ;
LPARAM lParam ;
for ( i = 0 ; i < rawkbdcount ; i + + )
{
if ( rawkbd [ i ] . handles . rawinputhandle = = raw - > header . hDevice )
break ;
}
if ( i = = rawkbdcount ) // not tracking this device
return ;
2016-02-10 23:23:43 +00:00
if ( rawkbd [ i ] . qdeviceid = = DEVID_UNSET )
rawkbd [ i ] . qdeviceid = Keyboard_AllocateDevID ( ) ;
2010-08-23 04:53:20 +00:00
down = ! ( raw - > data . keyboard . Flags & RI_KEY_BREAK ) ;
2015-01-21 18:18:37 +00:00
wParam = raw - > data . keyboard . VKey ; //(-down) & 0xC0000000;
lParam = ( MapVirtualKey ( raw - > data . keyboard . VKey , 0 ) < < 16 ) | ( ( ! ! ( raw - > data . keyboard . Flags & RI_KEY_E0 ) ) < < 24 ) ;
2010-08-23 04:53:20 +00:00
2015-01-21 18:18:37 +00:00
INS_TranslateKeyEvent ( wParam , lParam , down , rawkbd [ i ] . qdeviceid , true ) ;
2010-08-23 04:53:20 +00:00
}
2012-10-14 09:00:49 +00:00
void INS_RawInput_Read ( HANDLE in_device_handle )
2010-08-23 04:53:20 +00:00
{
int dwSize ;
// get raw input
2011-05-19 13:34:07 +00:00
if ( ( * _GRID ) ( ( HRAWINPUT ) in_device_handle , RID_INPUT , NULL , & dwSize , sizeof ( RAWINPUTHEADER ) ) = = - 1 )
2010-08-23 04:53:20 +00:00
{
Con_Printf ( " Raw input: unable to add to get size of raw input header. \n " ) ;
return ;
}
if ( dwSize > ribuffersize )
{
ribuffersize = dwSize ;
raw = ( RAWINPUT * ) BZ_Realloc ( raw , dwSize ) ;
}
2011-05-19 13:34:07 +00:00
2010-08-23 04:53:20 +00:00
if ( ( * _GRID ) ( ( HRAWINPUT ) in_device_handle , RID_INPUT , raw , & dwSize , sizeof ( RAWINPUTHEADER ) ) ! = dwSize ) {
Con_Printf ( " Raw input: unable to add to get raw input header. \n " ) ;
return ;
}
2012-10-14 09:00:49 +00:00
INS_RawInput_MouseRead ( ) ;
INS_RawInput_KeyboardRead ( ) ;
2010-08-23 04:53:20 +00:00
}
2005-06-29 21:20:34 +00:00
# else
2012-10-14 09:00:49 +00:00
void INS_RawInput_Read ( HANDLE in_device_handle )
2005-06-29 21:20:34 +00:00
{
}
# endif
2004-08-23 00:15:46 +00:00
/*
= = = = = = = = = = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_ClearStates
2004-08-23 00:15:46 +00:00
= = = = = = = = = = = = = = = = = = =
*/
2012-10-14 09:00:49 +00:00
void INS_ClearStates ( void )
2004-08-23 00:15:46 +00:00
{
if ( mouseactive )
{
memset ( & sysmouse , 0 , sizeof ( sysmouse ) ) ;
sysmouse . numbuttons = 10 ;
}
}
2011-05-19 13:34:07 +00:00
/*
= = = = = = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_StartupJoystick
2011-05-19 13:34:07 +00:00
= = = = = = = = = = = = = = =
*/
2014-07-12 06:56:17 +00:00
static void INS_StartupJoystickId ( unsigned int id )
2011-05-19 13:34:07 +00:00
{
2004-08-23 00:15:46 +00:00
JOYCAPS jc ;
MMRESULT mmr ;
2014-07-12 06:56:17 +00:00
struct wjoy_s * joy ;
if ( joy_count = = MAX_JOYSTICKS )
return ;
joy = & wjoy [ joy_count ] ;
memset ( joy , 0 , sizeof ( * joy ) ) ;
joy - > id = id ;
2016-02-10 23:23:43 +00:00
joy - > devid = DEVID_UNSET ; //1+joy_count; //FIXME: this is a hack. make joysticks 1-based. this means mouse0 controls 1st player, joy0 controls 2nd player (controls wrap so joy1 controls 1st player too.
2014-07-12 06:56:17 +00:00
// get the capabilities of the selected joystick
// abort startup if command fails
memset ( & jc , 0 , sizeof ( jc ) ) ;
if ( ( mmr = joyGetDevCaps ( joy - > id , & jc , sizeof ( jc ) ) ) ! = JOYERR_NOERROR )
{
Con_Printf ( " joystick %03x not found -- invalid joystick capabilities (%x) \n " , id , mmr ) ;
return ;
}
// save the joystick's number of buttons and POV status
2019-07-03 17:41:30 +00:00
joy - > numbuttons = min ( countof ( mmjbuttons ) , jc . wNumButtons ) ;
2014-07-12 06:56:17 +00:00
joy - > haspov = jc . wCaps & JOYCAPS_HASPOV ;
// mark the joystick as available and advanced initialization not completed
// this is needed as cvars are not available during initialization
joy_advancedinit = false ;
joy_count + + ;
}
2016-02-10 23:23:43 +00:00
static void IN_XInput_SetupAudio ( struct wjoy_s * joy )
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
{
# ifdef AVAIL_XINPUT
2016-02-10 23:23:43 +00:00
char audiodevicename [ MAX_QPATH ] ;
wchar_t mssuck [ MAX_QPATH ] ;
static GUID GUID_NULL ;
GUID gplayback = GUID_NULL ;
GUID gcapture = GUID_NULL ;
if ( joy - > audiodev )
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
{
2016-02-10 23:23:43 +00:00
S_ShutdownCard ( joy - > audiodev ) ;
joy - > audiodev = NULL ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
}
2016-02-10 23:23:43 +00:00
if ( ! xinput_useaudio )
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
return ;
2016-02-10 23:23:43 +00:00
if ( ! joy - > isxinput )
return ;
if ( joy - > devid = = DEVID_UNSET )
return ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
2016-02-10 23:23:43 +00:00
if ( pXInputGetDSoundAudioDeviceGuids ( joy - > id , & gplayback , & gcapture ) ! = ERROR_SUCCESS )
return ; //probably not plugged in
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
2016-02-10 23:23:43 +00:00
if ( ! memcmp ( & gplayback , & GUID_NULL , sizeof ( gplayback ) ) )
return ; //we have a controller, but no headset.
StringFromGUID2 ( & gplayback , mssuck , sizeof ( mssuck ) / sizeof ( mssuck [ 0 ] ) ) ;
narrowen ( audiodevicename , sizeof ( audiodevicename ) , mssuck ) ;
Con_Printf ( " Controller %i uses audio device %s \n " , joy - > id , audiodevicename ) ;
joy - > audiodev = S_SetupDeviceSeat ( " DirectSound " , audiodevicename , joy - > devid ) ;
# endif
}
void INS_SetupControllerAudioDevices ( qboolean enabled )
{
# ifdef AVAIL_XINPUT
int i ;
if ( ! pXInputGetDSoundAudioDeviceGuids )
return ;
xinput_useaudio = enabled ;
for ( i = 0 ; i < joy_count ; i + + )
IN_XInput_SetupAudio ( & wjoy [ i ] ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
# endif
}
2014-07-12 06:56:17 +00:00
void INS_StartupJoystick ( void )
{
unsigned int id , numdevs ;
MMRESULT mmr ;
2011-05-19 13:34:07 +00:00
2014-07-12 06:56:17 +00:00
// assume no joysticks
joy_count = 0 ;
2004-08-23 00:15:46 +00:00
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
# ifdef AVAIL_XINPUT
if ( in_xinput . ival )
{
static dllhandle_t * xinput ;
if ( ! xinput )
{
dllfunction_t funcs [ ] =
{
{ ( void * * ) & pXInputGetState , " XInputGetState " } ,
{ ( void * * ) & pXInputSetState , " XInputSetState " } ,
{ NULL }
} ;
xinput = Sys_LoadLibrary ( AVAIL_XINPUT_DLL , funcs ) ;
2016-02-10 23:23:43 +00:00
if ( xinput )
pXInputGetDSoundAudioDeviceGuids = Sys_GetAddressForName ( xinput , " XInputGetDSoundAudioDeviceGuids " ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
}
if ( pXInputGetState )
{
2018-01-24 12:13:32 +00:00
XINPUT_STATE xistate ;
numdevs = 0 ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
for ( id = 0 ; id < 4 ; id + + )
{
if ( joy_count = = countof ( wjoy ) )
break ;
memset ( & wjoy [ id ] , 0 , sizeof ( wjoy [ id ] ) ) ;
wjoy [ joy_count ] . isxinput = true ;
wjoy [ joy_count ] . id = id ;
2016-02-10 23:23:43 +00:00
wjoy [ joy_count ] . devid = DEVID_UNSET ; //id;
2019-07-03 17:41:30 +00:00
wjoy [ joy_count ] . numbuttons = countof ( xinputjbuttons ) ; //xinput supports 16 buttons, we emulate two more with the two triggers.
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
joy_count + + ;
2018-01-24 12:13:32 +00:00
if ( ERROR_DEVICE_NOT_AVAILABLE ! = pXInputGetState ( id , & xistate ) )
numdevs + + ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
}
2018-01-24 12:13:32 +00:00
Con_DPrintf ( " XInput is enabled (%i controllers found) \n " , numdevs ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
}
else
Con_Printf ( " XInput not installed \n " ) ;
}
# endif
2004-08-23 00:15:46 +00:00
// abort startup if user requests no joystick
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( ! in_joystick . ival )
2011-05-19 13:34:07 +00:00
return ;
2004-08-23 00:15:46 +00:00
// verify joystick driver is present
if ( ( numdevs = joyGetNumDevs ( ) ) = = 0 )
{
2009-07-05 18:45:53 +00:00
Con_Printf ( " joystick not found -- driver not present \n " ) ;
2004-08-23 00:15:46 +00:00
return ;
}
mmr = JOYERR_UNPLUGGED ;
// cycle through the joystick ids for the first valid one
2014-07-12 06:56:17 +00:00
for ( id = 0 ; id < numdevs ; id + + )
2004-08-23 00:15:46 +00:00
{
memset ( & ji , 0 , sizeof ( ji ) ) ;
ji . dwSize = sizeof ( ji ) ;
ji . dwFlags = JOY_RETURNCENTERED ;
2014-07-12 06:56:17 +00:00
if ( ( mmr = joyGetPosEx ( id , & ji ) ) = = JOYERR_NOERROR )
{
INS_StartupJoystickId ( id ) ;
}
2004-08-23 00:15:46 +00:00
}
2014-10-05 20:04:11 +00:00
if ( joy_count )
Con_Printf ( " found %i joysticks \n " , joy_count ) ;
else
Con_DPrintf ( " found no joysticks \n " ) ;
2004-08-23 00:15:46 +00:00
}
/*
= = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_Commands
2004-08-23 00:15:46 +00:00
= = = = = = = = = = =
*/
2012-10-14 09:00:49 +00:00
void INS_Commands ( void )
2004-08-23 00:15:46 +00:00
{
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
int i ;
2004-08-23 00:15:46 +00:00
DWORD buttonstate , povstate ;
2014-07-12 06:56:17 +00:00
unsigned int idx ;
struct wjoy_s * joy ;
2004-08-23 00:15:46 +00:00
2014-07-12 06:56:17 +00:00
for ( idx = 0 ; idx < joy_count ; idx + + )
2004-08-23 00:15:46 +00:00
{
2014-07-12 06:56:17 +00:00
joy = & wjoy [ idx ] ;
2011-05-19 13:34:07 +00:00
2014-07-12 06:56:17 +00:00
// loop through the joystick buttons
// key a joystick event or auxillary event for higher number buttons for each state change
buttonstate = joy - > buttonstate ;
2016-02-10 23:23:43 +00:00
if ( buttonstate ! = joy - > oldbuttonstate )
2004-08-23 00:15:46 +00:00
{
2016-02-10 23:23:43 +00:00
if ( joy - > devid = = DEVID_UNSET )
{
joy - > devid = Joy_AllocateDevID ( ) ;
IN_XInput_SetupAudio ( joy ) ;
}
if ( joy - > isxinput )
2014-07-12 06:56:17 +00:00
{
2016-02-10 23:23:43 +00:00
for ( i = 0 ; i < joy - > numbuttons ; i + + )
{
if ( ( buttonstate & ( 1 < < i ) ) & & ! ( joy - > oldbuttonstate & ( 1 < < i ) ) )
Key_Event ( joy - > devid , xinputjbuttons [ i ] , 0 , true ) ;
2004-08-23 00:15:46 +00:00
2016-02-10 23:23:43 +00:00
if ( ! ( buttonstate & ( 1 < < i ) ) & & ( joy - > oldbuttonstate & ( 1 < < i ) ) )
Key_Event ( joy - > devid , xinputjbuttons [ i ] , 0 , false ) ;
}
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
}
2016-02-10 23:23:43 +00:00
else
2014-07-12 06:56:17 +00:00
{
2016-02-10 23:23:43 +00:00
for ( i = 0 ; i < joy - > numbuttons ; i + + )
{
if ( ( buttonstate & ( 1 < < i ) ) & & ! ( joy - > oldbuttonstate & ( 1 < < i ) ) )
2017-03-30 18:37:16 +00:00
Key_Event ( joy - > devid , mmjbuttons [ i ] , 0 , true ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
2016-02-10 23:23:43 +00:00
if ( ! ( buttonstate & ( 1 < < i ) ) & & ( joy - > oldbuttonstate & ( 1 < < i ) ) )
2017-03-30 18:37:16 +00:00
Key_Event ( joy - > devid , mmjbuttons [ i ] , 0 , false ) ;
2016-02-10 23:23:43 +00:00
}
2014-07-12 06:56:17 +00:00
}
2016-02-10 23:23:43 +00:00
joy - > oldbuttonstate = buttonstate ;
2004-08-23 00:15:46 +00:00
}
2014-07-12 06:56:17 +00:00
if ( joy - > haspov )
2004-08-23 00:15:46 +00:00
{
2014-07-12 06:56:17 +00:00
// convert POV information into 4 bits of state information
// this avoids any potential problems related to moving from one
// direction to another without going through the center position
povstate = 0 ;
if ( joy - > povstate ! = JOY_POVCENTERED )
2004-08-23 00:15:46 +00:00
{
2014-07-12 06:56:17 +00:00
if ( joy - > povstate = = JOY_POVFORWARD )
povstate | = 0x01 ;
if ( joy - > povstate = = JOY_POVRIGHT )
povstate | = 0x02 ;
if ( joy - > povstate = = JOY_POVBACKWARD )
povstate | = 0x04 ;
if ( joy - > povstate = = JOY_POVLEFT )
povstate | = 0x08 ;
2004-08-23 00:15:46 +00:00
}
2016-02-10 23:23:43 +00:00
if ( joy - > oldpovstate ! = povstate )
2004-08-23 00:15:46 +00:00
{
2016-02-10 23:23:43 +00:00
if ( joy - > devid = = DEVID_UNSET )
joy - > devid = Joy_AllocateDevID ( ) ;
2014-07-12 06:56:17 +00:00
2016-02-10 23:23:43 +00:00
// determine which bits have changed and key an auxillary event for each change
for ( i = 0 ; i < 4 ; i + + )
2014-07-12 06:56:17 +00:00
{
2016-02-10 23:23:43 +00:00
if ( ( povstate & ( 1 < < i ) ) & & ! ( joy - > oldpovstate & ( 1 < < i ) ) )
{
2021-07-23 13:36:18 +00:00
Key_Event ( joy - > devid , K_AUX13 + i , 0 , true ) ;
2016-02-10 23:23:43 +00:00
}
if ( ! ( povstate & ( 1 < < i ) ) & & ( joy - > oldpovstate & ( 1 < < i ) ) )
{
2021-07-23 13:36:18 +00:00
Key_Event ( joy - > devid , K_AUX13 + i , 0 , false ) ;
2016-02-10 23:23:43 +00:00
}
2014-07-12 06:56:17 +00:00
}
2016-02-10 23:23:43 +00:00
joy - > oldpovstate = povstate ;
2004-08-23 00:15:46 +00:00
}
}
}
}
2017-08-14 16:38:44 +00:00
void INS_DeviceChanged ( void * ctx , void * data , size_t a , size_t b )
{ //called on WM_DEVICECHANGE
unsigned int idx ;
for ( idx = 0 ; idx < joy_count ; idx + + )
{
wjoy [ idx ] . devstate = DS_UNKNOWN ;
}
}
2011-05-19 13:34:07 +00:00
/*
= = = = = = = = = = = = = = =
2012-10-14 09:00:49 +00:00
INS_ReadJoystick
2011-05-19 13:34:07 +00:00
= = = = = = = = = = = = = = =
*/
2017-08-14 16:38:44 +00:00
static qboolean INS_ReadJoystick ( struct wjoy_s * joy )
2004-08-23 00:15:46 +00:00
{
2017-08-14 16:38:44 +00:00
if ( joy - > devstate ! = DS_NOTPRESENT )
{ //xinput samples all basically say to poll, but that gives really shit performance.
//instead we wait until our window thread gets a WM_DEVICECHANGE before we restart polling an inactive device.
//this can safe us a couple ms each frame.
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
2017-08-14 16:38:44 +00:00
# ifdef AVAIL_XINPUT
if ( joy - > isxinput )
2004-08-23 00:15:46 +00:00
{
2017-08-14 16:38:44 +00:00
XINPUT_STATE xistate ;
XINPUT_VIBRATION vibrator ;
HRESULT hr ;
memset ( & xistate , 0 , sizeof ( xistate ) ) ;
hr = pXInputGetState ( joy - > id , & xistate ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
2017-08-14 16:38:44 +00:00
if ( in_xinput . ival = = 2 )
{
Con_Printf ( " xi%i %s, b:%#x r:%u,%u l:%u,%u t:%u,%u \n " , joy - > id , ( hr = = ERROR_SUCCESS ) ? " success " : va ( " %lx " , hr ) , xistate . Gamepad . wButtons ,
xistate . Gamepad . sThumbRX , xistate . Gamepad . sThumbRY ,
xistate . Gamepad . sThumbLX , xistate . Gamepad . sThumbLY ,
xistate . Gamepad . bLeftTrigger , xistate . Gamepad . bRightTrigger ) ;
}
else if ( in_xinput . ival = = 3 & & joy - > id = = 0 )
{
//I don't have a controller to test this with, so we fake stuff.
POINT p ;
GetCursorPos ( & p ) ;
hr = ERROR_SUCCESS ;
xistate . Gamepad . wButtons = rand ( ) & 0xfff0 ;
xistate . Gamepad . sThumbRX = 0 ; //(p.x/1920.0)*0xffff - 0x8000;
xistate . Gamepad . sThumbRY = 0 ; //(p.y/1080.0)*0xffff - 0x8000;
xistate . Gamepad . sThumbLX = ( p . x / 1920.0 ) * 0xffff - 0x8000 ;
xistate . Gamepad . sThumbLY = ( p . y / 1080.0 ) * 0xffff - 0x8000 ;
xistate . Gamepad . bLeftTrigger = 0 ;
xistate . Gamepad . bRightTrigger = 0 ;
}
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
2017-08-14 16:38:44 +00:00
if ( hr = = ERROR_SUCCESS )
{ //ERROR_SUCCESS
//do we care about the dwPacketNumber?
joy - > devstate = DS_PRESENT ;
joy - > buttonstate = xistate . Gamepad . wButtons & 0xffff ;
2016-07-12 00:40:13 +00:00
2018-04-27 16:40:50 +00:00
if ( xistate . Gamepad . sThumbLY < - 16364 )
joy - > buttonstate | = 0x00010000 ;
if ( xistate . Gamepad . sThumbLY > 16364 )
joy - > buttonstate | = 0x00020000 ;
if ( xistate . Gamepad . sThumbLX < - 16364 )
joy - > buttonstate | = 0x00040000 ;
if ( xistate . Gamepad . sThumbLX > 16364 )
joy - > buttonstate | = 0x00080000 ;
if ( xistate . Gamepad . sThumbRY < - 16364 )
joy - > buttonstate | = 0x00100000 ;
if ( xistate . Gamepad . sThumbRY > 16364 )
joy - > buttonstate | = 0x00200000 ;
if ( xistate . Gamepad . sThumbRX < - 16364 )
joy - > buttonstate | = 0x00400000 ;
if ( xistate . Gamepad . sThumbRX > 16364 )
joy - > buttonstate | = 0x00800000 ;
2017-08-14 16:38:44 +00:00
if ( xistate . Gamepad . bLeftTrigger > = 128 )
2018-04-27 16:40:50 +00:00
joy - > buttonstate | = 0x01000000 ;
2017-08-14 16:38:44 +00:00
if ( xistate . Gamepad . bRightTrigger > = 128 )
2018-04-27 16:40:50 +00:00
joy - > buttonstate | = 0x02000000 ;
2017-08-14 16:38:44 +00:00
if ( joy - > devid ! = DEVID_UNSET )
{
IN_JoystickAxisEvent ( joy - > devid , GPAXIS_LT_RIGHT , xistate . Gamepad . sThumbLX / 32768.0 ) ;
IN_JoystickAxisEvent ( joy - > devid , GPAXIS_LT_DOWN , xistate . Gamepad . sThumbLY / 32768.0 ) ;
IN_JoystickAxisEvent ( joy - > devid , GPAXIS_LT_TRIGGER , xistate . Gamepad . bLeftTrigger / 255.0 ) ;
IN_JoystickAxisEvent ( joy - > devid , GPAXIS_RT_RIGHT , xistate . Gamepad . sThumbRX / 32768.0 ) ;
IN_JoystickAxisEvent ( joy - > devid , GPAXIS_RT_DOWN , xistate . Gamepad . sThumbRY / 32768.0 ) ;
IN_JoystickAxisEvent ( joy - > devid , GPAXIS_RT_TRIGGER , xistate . Gamepad . bRightTrigger / 255.0 ) ;
vibrator . wLeftMotorSpeed = xinput_leftvibrator . value * 0xffff ;
vibrator . wRightMotorSpeed = xinput_rightvibrator . value * 0xffff ;
pXInputSetState ( joy - > id , & vibrator ) ;
}
return true ;
2016-02-10 23:23:43 +00:00
}
2017-08-14 16:38:44 +00:00
else if ( hr = = ERROR_DEVICE_NOT_CONNECTED )
joy - > devstate = DS_NOTPRESENT ;
2004-08-23 00:15:46 +00:00
}
2017-08-14 16:38:44 +00:00
else
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
# endif
{
2017-08-14 16:38:44 +00:00
memset ( & ji , 0 , sizeof ( ji ) ) ;
ji . dwSize = sizeof ( ji ) ;
ji . dwFlags = joy_flags ;
if ( joyGetPosEx ( joy - > id , & ji ) = = JOYERR_NOERROR )
2016-02-10 23:23:43 +00:00
{
2017-08-14 16:38:44 +00:00
joy - > devstate = DS_PRESENT ;
joy - > povstate = ji . dwPOV ;
joy - > buttonstate = ji . dwButtons ;
if ( joy - > devid ! = DEVID_UNSET )
{
IN_JoystickAxisEvent ( joy - > devid , GPAXIS_LT_RIGHT , ( ji . dwXpos - 32768.0 ) / 32768 ) ;
IN_JoystickAxisEvent ( joy - > devid , GPAXIS_LT_DOWN , ( ji . dwYpos - 32768.0 ) / 32768 ) ;
IN_JoystickAxisEvent ( joy - > devid , GPAXIS_LT_AUX , ( ji . dwZpos - 32768.0 ) / 32768 ) ;
IN_JoystickAxisEvent ( joy - > devid , GPAXIS_RT_RIGHT , ( ji . dwRpos - 32768.0 ) / 32768 ) ;
IN_JoystickAxisEvent ( joy - > devid , GPAXIS_RT_DOWN , ( ji . dwUpos - 32768.0 ) / 32768 ) ;
IN_JoystickAxisEvent ( joy - > devid , GPAXIS_RT_AUX , ( ji . dwVpos - 32768.0 ) / 32768 ) ;
}
return true ;
2016-02-10 23:23:43 +00:00
}
2017-08-14 16:38:44 +00:00
else
joy - > devstate = DS_NOTPRESENT ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
}
2004-08-23 00:15:46 +00:00
}
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
joy - > povstate = 0 ;
joy - > buttonstate = 0 ;
2016-02-10 23:23:43 +00:00
if ( joy - > devid ! = DEVID_UNSET )
{
IN_JoystickAxisEvent ( joy - > devid , 0 , 0 ) ;
IN_JoystickAxisEvent ( joy - > devid , 1 , 0 ) ;
IN_JoystickAxisEvent ( joy - > devid , 2 , 0 ) ;
IN_JoystickAxisEvent ( joy - > devid , 3 , 0 ) ;
IN_JoystickAxisEvent ( joy - > devid , 4 , 0 ) ;
IN_JoystickAxisEvent ( joy - > devid , 5 , 0 ) ;
}
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
// read error occurred
// turning off the joystick seems too harsh for 1 read error,
// but what should be done?
// Con_Printf ("INS_ReadJoystick: no response\n");
// joy_avail = false;
return false ;
2004-08-23 00:15:46 +00:00
}
2014-07-12 06:56:17 +00:00
/*
= = = = = = = = = = =
INS_JoyMove
= = = = = = = = = = =
*/
2018-03-04 14:41:16 +00:00
void INS_JoyMove ( void )
2014-07-12 06:56:17 +00:00
{
unsigned int idx ;
for ( idx = 0 ; idx < joy_count ; idx + + )
{
2018-03-04 14:41:16 +00:00
INS_ReadJoystick ( & wjoy [ idx ] ) ;
2014-07-12 06:56:17 +00:00
}
}
2004-08-23 00:15:46 +00:00
2016-07-21 19:27:59 +00:00
void INS_EnumerateDevices ( void * ctx , void ( * callback ) ( void * ctx , const char * type , const char * devicename , unsigned int * qdevid ) )
2015-04-14 23:12:17 +00:00
{
int idx ;
for ( idx = 0 ; idx < rawkbdcount ; idx + + )
2016-01-18 05:22:07 +00:00
callback ( ctx , " keyboard " , rawkbd [ idx ] . sysname ? rawkbd [ idx ] . sysname : va ( " rawk%i " , idx ) , & rawkbd [ idx ] . qdeviceid ) ;
2016-02-10 23:23:43 +00:00
callback ( ctx , " keyboard " , " system " , NULL ) ;
for ( idx = 0 ; idx < rawmicecount ; idx + + )
callback ( ctx , " mouse " , rawmice [ idx ] . sysname ? rawmice [ idx ] . sysname : va ( " raw%i " , idx ) , & rawmice [ idx ] . qdeviceid ) ;
2015-04-14 23:12:17 +00:00
2017-02-19 00:15:42 +00:00
# ifdef AVAIL_DINPUT
2015-04-21 23:11:26 +00:00
# if (DIRECTINPUT_VERSION >= DINPUT_VERSION_DX7)
2015-04-14 23:12:17 +00:00
if ( dinput > = DINPUT_VERSION_DX7 & & g_pMouse7 )
callback ( ctx , " mouse " , " di7 " , NULL ) ;
2015-04-21 23:11:26 +00:00
else
# endif
if ( dinput & & g_pMouse )
2015-04-14 23:12:17 +00:00
callback ( ctx , " mouse " , " di " , NULL ) ;
2017-02-19 00:15:42 +00:00
# endif
2015-04-14 23:12:17 +00:00
callback ( ctx , " mouse " , " system " , NULL ) ;
for ( idx = 0 ; idx < joy_count ; idx + + )
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
{
2016-02-10 23:23:43 +00:00
int odevid = wjoy [ idx ] . devid ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
if ( wjoy [ idx ] . isxinput )
callback ( ctx , " joy " , va ( " xi%i " , wjoy [ idx ] . id ) , & wjoy [ idx ] . devid ) ;
else
callback ( ctx , " joy " , va ( " mmj%i " , wjoy [ idx ] . id ) , & wjoy [ idx ] . devid ) ;
2016-02-10 23:23:43 +00:00
if ( odevid ! = wjoy [ idx ] . devid )
IN_XInput_SetupAudio ( & wjoy [ idx ] ) ;
Reworked client support for DPP5+. less code now, its much more graceful.
added waterfog command. waterfog overrides regular fog only when the view is in water.
fixed 64bit printf format specifiers. should work better on winxp64.
fixed some spec angle weirdness.
fixed viewsize 99.99 weirdness with ezhud.
fixed extra offset on the console (exhibited in 64bit builds, but not limited to).
fixed .avi playback, can now actually display frames again.
reimplemented line sparks.
fixed r_editlights_save flipping the light's pitch.
fixed issue with oggs failing to load.
fixed condump to cope with unicode properly.
made sv_bigcoords default except in quake. hexen2 kinda needs it for bsp angle precision.
fixed nq server to not stall weirdly on map changes.
fixed qwprogs svc_cdtrack not bugging out with nq clients on the server.
fixed restart command to load the last map run by the server, instead of start.bsp (when idle)
optimised d3d9 renderer a little. now uses less draw calls, especially with complex scenes. seems to get higher framerates than opengl now.
fixed d3d9 renderer to not bug out quite so much when run fullscreen (shader subsystem is now correctly initialised).
fixed a couple of bugs from font change. also now supports utf-8 in a few more places.
r_editlights_reload no longer generates rtlights inside the void. this resolves a few glitches (but should also help framerates a little).
fixed so corona-only lights won't generate shadowmaps and waste lots of time.
removed lots of #defines from qclib. I should never have made them in the first place, but I was lazy. obviously there's more left that I cba to remove yet.
fixed nested calls with variant-vectors. this fixes csaddon's light editor.
fixed qcc hc calling conventions using redundant stores.
disabled keywords can still be used by using __keyword instead.
fixed ftegccgui grep feature.
fixed motionless-dog qcc bug.
tweaked qcc warnings a little. -Wall is now a viable setting. you should be able to fix all those warnings.
fixed qw svc_intermission + dpp5+ clients bug.
fixed annoying spam about disconnecting in hexen2.
rewrote status command a little to cope with ipv6 addresses more gracefully
fixed significant stall when hibernating/debugging a server with a player sitting on it.
fixed truelightning.
fixed rocketlight overriding pflags.
fixed torches vanishing on vid_restart.
fixed issue with decal scaling.
fixed findentityfield builtin.
fixed fteqcc issue with ptr+1
fixed use of arrays inside class functions.
fixed/implemented fteqcc emulation of pointer opcodes.
added __inout keyword to fteqcc, so that it doesn't feel so horrendous.
fixed sizeof(*foo)
fixed *struct = struct;
fixed recursive structs.
fixed fteqcc warning report.
fixed sdl2 controller support, hopefully.
attempted to implement xinput, including per-player audio playback.
slightly fixed relaxed attitude to mouse focus when running fullscreen.
fixed weird warnings/errors with 'ent.arrayhead' terms. now generates sane errors.
implemented bindmaps (for csqc).
fixed crashing bug with eprint builtin.
implemented subset of music_playlist_* functionality. significant changes to music playback.
fixed some more dpcsqc compat.
fixed binds menu. now displays and accepts modifiers.
fixed issues with huge lightmaps.
fixed protocol determinism with dp clients connecting to fte servers. the initial getchallenge request now inhibits vanilla nq connection requests.
implemented support for 'dupe' userinfo key, allowing clients to request client->server packet duplication. should probably queue them tbh.
implemented sv_saveentfile command.
fixed resume after breaking inside a stepped-over function.
fixed erroneous footer after debugging.
(I wonder just how many things I broke with these fixes)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4946 fc73d0e0-1445-4013-8a0c-d673dee63da5
2015-07-26 10:56:18 +00:00
}
2015-04-14 23:12:17 +00:00
}
2017-06-21 01:24:25 +00:00
static unsigned short scantokey [ ] =
2013-05-11 14:02:55 +00:00
{
2017-02-19 00:15:42 +00:00
// 0 1 2 3 4 5 6 7
// 8 9 A B C D E F
2013-05-11 14:02:55 +00:00
0 , 27 , ' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' , // 0
' 7 ' , ' 8 ' , ' 9 ' , ' 0 ' , ' - ' , ' = ' , K_BACKSPACE , 9 , // 0
' q ' , ' w ' , ' e ' , ' r ' , ' t ' , ' y ' , ' u ' , ' i ' , // 1
' o ' , ' p ' , ' [ ' , ' ] ' , K_ENTER , K_LCTRL , ' a ' , ' s ' , // 1
' d ' , ' f ' , ' g ' , ' h ' , ' j ' , ' k ' , ' l ' , ' ; ' , // 2
' \' ' , ' ` ' , K_LSHIFT , ' \\ ' , ' z ' , ' x ' , ' c ' , ' v ' , // 2
' b ' , ' n ' , ' m ' , ' , ' , ' . ' , ' / ' , K_RSHIFT , K_KP_STAR , // 3
K_LALT , ' ' , K_CAPSLOCK , K_F1 , K_F2 , K_F3 , K_F4 , K_F5 , // 3
K_F6 , K_F7 , K_F8 , K_F9 , K_F10 , K_PAUSE , K_SCRLCK , K_KP_HOME , // 4
K_KP_UPARROW , K_KP_PGUP , K_KP_MINUS , K_KP_LEFTARROW , K_KP_5 , K_KP_RIGHTARROW , K_KP_PLUS , K_KP_END , // 4
K_KP_DOWNARROW , K_KP_PGDN , K_KP_INS , K_KP_DEL , 0 , 0 , 0 , K_F11 , // 5
K_F12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 5
0 , 0 , 0 , 0 , 0 , ' \\ ' , 0 , 0 , // 6
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 6
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 7
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 7
2017-02-19 00:15:42 +00:00
// 0 1 2 3 4 5 6 7
// 8 9 A B C D E F
2013-05-11 14:02:55 +00:00
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 8
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 8
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 9
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 9
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // a
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // a
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // b
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // b
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // c
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // c
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // d
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // d
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // e
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // e
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // f
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // f
2017-02-19 00:15:42 +00:00
// 0 1 2 3 4 5 6 7
// 8 9 A B C D E F
2013-05-11 14:02:55 +00:00
0 , 27 , ' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' , // 0
' 7 ' , ' 8 ' , ' 9 ' , ' 0 ' , ' - ' , ' = ' , K_BACKSPACE , 9 , // 0
' q ' , ' w ' , ' e ' , ' r ' , ' t ' , ' y ' , ' u ' , ' i ' , // 1
' o ' , ' p ' , ' [ ' , ' ] ' , K_KP_ENTER , K_RCTRL , ' a ' , ' s ' , // 1
' d ' , ' f ' , ' g ' , ' h ' , ' j ' , ' k ' , ' l ' , ' ; ' , // 2
' \' ' , ' ` ' , K_SHIFT , ' \\ ' , ' z ' , ' x ' , ' c ' , ' v ' , // 2
' b ' , ' n ' , ' m ' , ' , ' , ' . ' , K_KP_SLASH , K_SHIFT , K_PRINTSCREEN , // 3
K_RALT , ' ' , K_CAPSLOCK , K_F1 , K_F2 , K_F3 , K_F4 , K_F5 , // 3
K_F6 , K_F7 , K_F8 , K_F9 , K_F10 , K_KP_NUMLOCK , K_SCRLCK , K_HOME , // 4
K_UPARROW , K_PGUP , ' - ' , K_LEFTARROW , 0 , K_RIGHTARROW , ' + ' , K_END , // 4
K_DOWNARROW , K_PGDN , K_INS , K_DEL , 0 , 0 , 0 , K_F11 , // 5
K_F12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 5
0 , 0 , 0 , 0 , 0 , ' \\ ' , 0 , 0 , // 6
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 6
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 7
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 // 7
2017-02-19 00:15:42 +00:00
// 0 1 2 3 4 5 6 7
// 8 9 A B C D E F
2013-05-11 14:02:55 +00:00
} ;
2004-08-23 00:15:46 +00:00
/*
= = = = = = =
MapKey
Map from windows to quake keynums
= = = = = = =
*/
2009-07-05 18:45:53 +00:00
static int MapKey ( int vkey )
2004-08-23 00:15:46 +00:00
{
int key ;
2013-05-11 14:02:55 +00:00
key = ( vkey > > 16 ) & 511 ;
2004-08-23 00:15:46 +00:00
2013-05-11 14:02:55 +00:00
if ( key < sizeof ( scantokey ) / sizeof ( scantokey [ 0 ] ) )
key = scantokey [ key ] ;
else
key = 0 ;
if ( ! cl_keypad . ival )
2004-08-23 00:15:46 +00:00
{
2013-05-20 02:18:50 +00:00
switch ( key )
2004-08-23 00:15:46 +00:00
{
2013-05-11 14:02:55 +00:00
case K_KP_HOME : return ' 7 ' ;
case K_KP_UPARROW : return ' 8 ' ;
case K_KP_PGUP : return ' 9 ' ;
case K_KP_LEFTARROW : return ' 4 ' ;
case K_KP_5 : return ' 5 ' ;
case K_KP_RIGHTARROW : return ' 6 ' ;
case K_KP_END : return ' 1 ' ;
case K_KP_DOWNARROW : return ' 2 ' ;
case K_KP_PGDN : return ' 3 ' ;
case K_KP_ENTER : return K_ENTER ;
case K_KP_INS : return ' 0 ' ;
case K_KP_DEL : return ' . ' ;
case K_KP_SLASH : return ' / ' ;
case K_KP_MINUS : return ' - ' ;
case K_KP_PLUS : return ' + ' ;
case K_KP_STAR : return ' * ' ;
case K_KP_EQUALS : return ' = ' ;
2004-08-23 00:15:46 +00:00
}
}
2013-05-11 14:02:55 +00:00
if ( key = = 0 )
2004-08-23 00:15:46 +00:00
Con_DPrintf ( " key 0x%02x has no translation \n " , key ) ;
2017-08-16 02:14:07 +00:00
2013-05-11 14:02:55 +00:00
return key ;
2004-08-23 00:15:46 +00:00
}
2009-07-05 18:45:53 +00:00
2015-01-21 18:18:37 +00:00
void INS_TranslateKeyEvent ( WPARAM wParam , LPARAM lParam , qboolean down , int qdeviceid , qboolean genkeystate )
2009-07-05 18:45:53 +00:00
{
extern cvar_t in_builtinkeymap ;
int qcode ;
int unicode ;
2014-04-24 01:53:01 +00:00
int chars ;
2017-06-21 01:24:25 +00:00
extern int keyshift [ K_MAX ] ;
2012-02-27 12:23:15 +00:00
extern int shift_down ;
2009-07-05 18:45:53 +00:00
qcode = MapKey ( lParam ) ;
if ( WinNT & & ! in_builtinkeymap . value )
{
BYTE keystate [ 256 ] ;
WCHAR wchars [ 2 ] ;
2015-01-21 18:18:37 +00:00
if ( genkeystate )
{
extern qboolean keydown [ K_MAX ] ;
memset ( keystate , 0 , sizeof ( keystate ) ) ;
//128 for held.
//1 for toggled (ie: caps / num)
keystate [ VK_LSHIFT ] = 128 * ! ! keydown [ K_LSHIFT ] ;
keystate [ VK_RSHIFT ] = 128 * ! ! keydown [ K_RSHIFT ] ;
keystate [ VK_LCONTROL ] = 128 * ! ! keydown [ K_LCTRL ] ;
keystate [ VK_RCONTROL ] = 128 * ! ! keydown [ K_RCTRL ] ;
keystate [ VK_LMENU ] = 128 * ! ! keydown [ K_LALT ] ;
keystate [ VK_RMENU ] = 128 * ! ! keydown [ K_RALT ] ;
//seems to matter
keystate [ VK_SHIFT ] = keystate [ VK_LSHIFT ] | keystate [ VK_RSHIFT ] ;
keystate [ VK_CONTROL ] = keystate [ VK_LCONTROL ] | keystate [ VK_RCONTROL ] ;
keystate [ VK_MENU ] = keystate [ VK_LMENU ] | keystate [ VK_RMENU ] ;
keystate [ VK_NUMLOCK ] = 1 ; //doesn't seem to matter?
}
else
GetKeyboardState ( keystate ) ;
2014-04-24 01:53:01 +00:00
chars = ToUnicode ( wParam , HIWORD ( lParam ) , keystate , wchars , sizeof ( wchars ) / sizeof ( wchars [ 0 ] ) , 0 ) ;
if ( chars > 0 )
2009-07-05 18:45:53 +00:00
{
2014-04-24 01:53:01 +00:00
if ( ! in_nonstandarddeadkeys . ival )
{
for ( unicode = 0 ; unicode < chars - 1 ; unicode + + )
2015-05-03 19:57:46 +00:00
IN_KeyEvent ( qdeviceid , down , 0 , wchars [ unicode ] ) ;
2014-04-24 01:53:01 +00:00
}
unicode = wchars [ chars - 1 ] ;
2009-07-05 18:45:53 +00:00
}
2012-02-27 12:23:15 +00:00
else unicode = 0 ;
}
else
{
unicode = ( qcode < 128 ) ? qcode : 0 ;
if ( shift_down & & unicode < K_MAX & & keyshift [ unicode ] )
unicode = keyshift [ unicode ] ;
2009-07-05 18:45:53 +00:00
}
2015-05-03 19:57:46 +00:00
IN_KeyEvent ( qdeviceid , down , qcode , unicode ) ;
2009-07-05 18:45:53 +00:00
}
2017-06-21 01:24:25 +00:00
# ifndef APPCOMMAND_BROWSER_BACKWARD //added in win2k (but was probably used before that too)
# define APPCOMMAND_BROWSER_BACKWARD 1
# define APPCOMMAND_BROWSER_FORWARD 2
# define APPCOMMAND_BROWSER_REFRESH 3
# define APPCOMMAND_BROWSER_STOP 4
# define APPCOMMAND_BROWSER_SEARCH 5
# define APPCOMMAND_BROWSER_FAVORITES 6
# define APPCOMMAND_BROWSER_HOME 7
# define APPCOMMAND_VOLUME_MUTE 8
# define APPCOMMAND_VOLUME_DOWN 9
# define APPCOMMAND_VOLUME_UP 10
# define APPCOMMAND_MEDIA_NEXTTRACK 11
# define APPCOMMAND_MEDIA_PREVIOUSTRACK 12
# define APPCOMMAND_MEDIA_STOP 13
# define APPCOMMAND_MEDIA_PLAY_PAUSE 14
# define APPCOMMAND_LAUNCH_MAIL 15
# define APPCOMMAND_LAUNCH_MEDIA_SELECT 16
# define APPCOMMAND_LAUNCH_APP1 17
# define APPCOMMAND_LAUNCH_APP2 18
# define APPCOMMAND_BASS_DOWN 19
# define APPCOMMAND_BASS_BOOST 20
# define APPCOMMAND_BASS_UP 21
# define APPCOMMAND_TREBLE_DOWN 22
# define APPCOMMAND_TREBLE_UP 23
# endif
# ifndef APPCOMMAND_MICROPHONE_VOLUME_MUTE //added in winxp
# define APPCOMMAND_MICROPHONE_VOLUME_MUTE 24
# define APPCOMMAND_MICROPHONE_VOLUME_DOWN 25
# define APPCOMMAND_MICROPHONE_VOLUME_UP 26
# define APPCOMMAND_HELP 27
# define APPCOMMAND_FIND 28
# define APPCOMMAND_NEW 29
# define APPCOMMAND_OPEN 30
# define APPCOMMAND_CLOSE 31
# define APPCOMMAND_SAVE 32
# define APPCOMMAND_PRINT 33
# define APPCOMMAND_UNDO 34
# define APPCOMMAND_REDO 35
# define APPCOMMAND_COPY 36
# define APPCOMMAND_CUT 37
# define APPCOMMAND_PASTE 38
# define APPCOMMAND_REPLY_TO_MAIL 39
# define APPCOMMAND_FORWARD_MAIL 40
# define APPCOMMAND_SEND_MAIL 41
# define APPCOMMAND_SPELL_CHECK 42
# define APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE 43
# define APPCOMMAND_MIC_ON_OFF_TOGGLE 44
# define APPCOMMAND_CORRECTION_LIST 45
# define APPCOMMAND_MEDIA_PLAY 46
# define APPCOMMAND_MEDIA_PAUSE 47
# define APPCOMMAND_MEDIA_RECORD 48
# define APPCOMMAND_MEDIA_FAST_FORWARD 49
# define APPCOMMAND_MEDIA_REWIND 50
# define APPCOMMAND_MEDIA_CHANNEL_UP 51
# define APPCOMMAND_MEDIA_CHANNEL_DOWN 52
# endif
int INS_AppCommand ( LPARAM lParam )
{
2018-04-06 17:21:15 +00:00
const char * b ;
2017-06-21 01:24:25 +00:00
int qkey = 0 ;
switch ( HIWORD ( lParam ) & 0xfff )
{
2018-04-06 17:21:15 +00:00
case APPCOMMAND_BROWSER_BACKWARD : qkey = K_MM_BROWSER_BACK ; break ;
case APPCOMMAND_BROWSER_FAVORITES : qkey = K_MM_BROWSER_FAVORITES ; break ;
case APPCOMMAND_BROWSER_FORWARD : qkey = K_MM_BROWSER_FORWARD ; break ;
case APPCOMMAND_BROWSER_HOME : qkey = K_MM_BROWSER_HOME ; break ;
case APPCOMMAND_BROWSER_REFRESH : qkey = K_MM_BROWSER_REFRESH ; break ;
case APPCOMMAND_BROWSER_SEARCH : qkey = K_SEARCH ; break ;
case APPCOMMAND_BROWSER_STOP : qkey = K_MM_BROWSER_STOP ; break ;
case APPCOMMAND_VOLUME_MUTE : qkey = K_MM_VOLUME_MUTE ; break ;
case APPCOMMAND_VOLUME_UP : qkey = K_VOLUP ; break ;
case APPCOMMAND_VOLUME_DOWN : qkey = K_VOLDOWN ; break ;
case APPCOMMAND_MEDIA_NEXTTRACK : qkey = K_MM_TRACK_NEXT ; break ;
case APPCOMMAND_MEDIA_PREVIOUSTRACK : qkey = K_MM_TRACK_PREV ; break ;
case APPCOMMAND_MEDIA_STOP : qkey = K_MM_TRACK_STOP ; break ;
case APPCOMMAND_MEDIA_PLAY_PAUSE : qkey = K_MM_TRACK_PLAYPAUSE ; break ;
2017-06-21 01:24:25 +00:00
default :
return false ;
}
2018-04-06 17:21:15 +00:00
b = Key_GetBinding ( qkey , 0 , 0 ) ;
if ( b & & * b )
{ //only take the key if its actually bound to something, otherwise let the system handle it normally.
IN_KeyEvent ( 0 , true , qkey , 0 ) ;
IN_KeyEvent ( 0 , false , qkey , 0 ) ;
return true ;
}
2017-06-21 01:24:25 +00:00
return false ;
}
2014-03-30 08:55:06 +00:00
# endif