mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-21 11:11:37 +00:00
Whitespace.
This commit is contained in:
parent
b1666defb9
commit
793efd6976
32 changed files with 667 additions and 916 deletions
|
@ -46,7 +46,6 @@ CDAudio_Pause (void)
|
|||
cdmodule->functions->cd->pCDAudio_Pause ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CDAudio_Play (byte track, qboolean looping)
|
||||
{
|
||||
|
@ -54,7 +53,6 @@ CDAudio_Play (byte track, qboolean looping)
|
|||
cdmodule->functions->cd->pCDAudio_Play (track, looping);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CDAudio_Resume (void)
|
||||
{
|
||||
|
@ -62,7 +60,6 @@ CDAudio_Resume (void)
|
|||
cdmodule->functions->cd->pCDAudio_Resume ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CDAudio_Shutdown (void)
|
||||
{
|
||||
|
@ -70,7 +67,6 @@ CDAudio_Shutdown (void)
|
|||
cdmodule->functions->general->p_Shutdown ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CDAudio_Update (void)
|
||||
{
|
||||
|
@ -78,7 +74,6 @@ CDAudio_Update (void)
|
|||
cdmodule->functions->cd->pCDAudio_Update ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
CD_f (void)
|
||||
{
|
||||
|
@ -86,7 +81,6 @@ CD_f (void)
|
|||
cdmodule->functions->cd->pCD_f ();
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
CDAudio_Init (void)
|
||||
{
|
||||
|
@ -100,7 +94,8 @@ CDAudio_Init (void)
|
|||
cdmodule->functions->general->p_Init ();
|
||||
return 0; // FIXME: Assumes success
|
||||
}
|
||||
Cmd_AddCommand ("cd", CD_f, "Control the CD player.\n"
|
||||
Cmd_AddCommand (
|
||||
"cd", CD_f, "Control the CD player.\n"
|
||||
"Commands:\n"
|
||||
"eject - Eject the CD.\n"
|
||||
"info - Reports information on the CD.\n"
|
||||
|
|
|
@ -29,15 +29,15 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
|
@ -90,7 +90,6 @@ I_CDAudio_CloseDoor (void)
|
|||
Con_DPrintf ("CDAudio: ioctl cdromclosetray failed\n");
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
I_CDAudio_Eject (void)
|
||||
{
|
||||
|
@ -101,7 +100,6 @@ I_CDAudio_Eject (void)
|
|||
Con_DPrintf ("CDAudio: ioctl cdromeject failed\n");
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
I_CDAudio_GetAudioDiskInfo (void)
|
||||
{
|
||||
|
@ -125,7 +123,6 @@ I_CDAudio_GetAudioDiskInfo (void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Pause (void)
|
||||
{
|
||||
|
@ -142,7 +139,6 @@ I_CDAudio_Pause (void)
|
|||
playing = false;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Stop (void)
|
||||
{
|
||||
|
@ -159,7 +155,6 @@ I_CDAudio_Stop (void)
|
|||
playing = false;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Play (byte track, qboolean looping)
|
||||
{
|
||||
|
@ -239,7 +234,6 @@ I_CDAudio_Play (byte track, qboolean looping)
|
|||
CDAudio_Pause ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Resume (void)
|
||||
{
|
||||
|
@ -257,7 +251,6 @@ I_CDAudio_Resume (void)
|
|||
playing = true;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Shutdown (void)
|
||||
{
|
||||
|
@ -270,7 +263,6 @@ I_CDAudio_Shutdown (void)
|
|||
mus_enabled = false;
|
||||
}
|
||||
|
||||
|
||||
void // FIXME: was static
|
||||
I_CD_f (void)
|
||||
{
|
||||
|
@ -377,7 +369,6 @@ I_CD_f (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Update (void)
|
||||
{
|
||||
|
@ -416,7 +407,6 @@ I_CDAudio_Update (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Mus_CDChange (cvar_t *mus_cdaudio)
|
||||
{
|
||||
|
@ -448,7 +438,6 @@ Mus_CDChange (cvar_t *mus_cdaudio)
|
|||
mus_enabled = true;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Init (void)
|
||||
{
|
||||
|
@ -456,7 +445,6 @@ I_CDAudio_Init (void)
|
|||
Mus_CDChange, "device to use for CD music");
|
||||
}
|
||||
|
||||
|
||||
plugin_t *
|
||||
PluginInfo (void)
|
||||
{
|
||||
|
|
|
@ -47,43 +47,36 @@ I_CDAudio_Pause (void)
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Play (byte track, qboolean looping)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Resume (void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Shutdown (void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Update (void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Init (void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CD_f (void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
plugin_t *
|
||||
PluginInfo (void)
|
||||
{
|
||||
|
|
|
@ -78,7 +78,6 @@ I_CDAudio_Eject (void)
|
|||
Con_DPrintf ("Unable to eject CD-ROM tray.\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Pause (void)
|
||||
{
|
||||
|
@ -91,7 +90,6 @@ I_CDAudio_Pause (void)
|
|||
Con_DPrintf ("CDAudio_Pause: Failed to pause track.\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Stop (void)
|
||||
{
|
||||
|
@ -107,7 +105,6 @@ I_CDAudio_Stop (void)
|
|||
Con_DPrintf ("CDAudio_Stop: Failed to stop track.\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Play (byte track, qboolean looping)
|
||||
{
|
||||
|
@ -119,7 +116,8 @@ I_CDAudio_Play (byte track, qboolean looping)
|
|||
return;
|
||||
|
||||
if (!cdValid) {
|
||||
if (!CD_INDRIVE (cd_stat = SDL_CDStatus (cd_id)) || (!cd_id->numtracks))
|
||||
if (!CD_INDRIVE (cd_stat = SDL_CDStatus (cd_id)) ||
|
||||
(!cd_id->numtracks))
|
||||
return;
|
||||
cdValid = true;
|
||||
}
|
||||
|
@ -143,7 +141,6 @@ I_CDAudio_Play (byte track, qboolean looping)
|
|||
playLooping = looping;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Resume (void)
|
||||
{
|
||||
|
@ -156,7 +153,6 @@ I_CDAudio_Resume (void)
|
|||
Con_DPrintf ("CDAudio_Resume: Failed tp resume track.\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Shutdown (void)
|
||||
{
|
||||
|
@ -167,7 +163,6 @@ I_CDAudio_Shutdown (void)
|
|||
cd_id = NULL;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Update (void)
|
||||
{
|
||||
|
@ -189,7 +184,6 @@ I_CDAudio_Update (void)
|
|||
CDAudio_Play (cd_id->cur_track + 1, true);
|
||||
}
|
||||
|
||||
|
||||
#define CD_f_DEFINED
|
||||
|
||||
void // FIXME: was static void
|
||||
|
@ -255,7 +249,6 @@ I_CD_f (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Init (void)
|
||||
{
|
||||
|
@ -286,7 +279,6 @@ I_CDAudio_Init (void)
|
|||
Con_Printf ("CD Audio Initialized.\n");
|
||||
}
|
||||
|
||||
|
||||
plugin_t *
|
||||
PluginInfo (void)
|
||||
{
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <dmedia/cdaudio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "QF/cdaudio.h"
|
||||
#include "QF/cmd.h"
|
||||
|
@ -63,7 +63,6 @@ pCDAudio_Eject (void)
|
|||
Con_DPrintf ("CDAudio_Eject: CDeject failed\n");
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
pCDAudio_GetState (void)
|
||||
{
|
||||
|
@ -80,7 +79,6 @@ pCDAudio_GetState (void)
|
|||
return cds.state;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
pCDAudio_MaxTrack (void)
|
||||
{
|
||||
|
@ -97,7 +95,6 @@ pCDAudio_MaxTrack (void)
|
|||
return cds.last;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
pCDAudio_Pause (void)
|
||||
{
|
||||
|
@ -108,7 +105,6 @@ pCDAudio_Pause (void)
|
|||
Con_DPrintf ("CDAudio_PAUSE: CDtogglepause failed (%d)\n", errno);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
pCDAudio_Play (byte track, qboolean looping)
|
||||
{
|
||||
|
@ -166,7 +162,6 @@ pCDAudio_Play (byte track, qboolean looping)
|
|||
playTrack = track;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
pCDAudio_Resume (void)
|
||||
{
|
||||
|
@ -177,7 +172,6 @@ pCDAudio_Resume (void)
|
|||
Con_DPrintf ("CDAudio_Resume: CDtogglepause failed (%d)\n", errno);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
pCDAudio_Shutdown (void)
|
||||
{
|
||||
|
@ -190,7 +184,6 @@ pCDAudio_Shutdown (void)
|
|||
initialized = false;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
pCDAudio_Stop (void)
|
||||
{
|
||||
|
@ -201,7 +194,6 @@ pCDAudio_Stop (void)
|
|||
Con_DPrintf ("CDAudio_Stop: CDStop failed (%d)\n", errno);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
pCDAudio_Update (void)
|
||||
{
|
||||
|
@ -225,7 +217,6 @@ pCDAudio_Update (void)
|
|||
CDAudio_Play (playTrack, true);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
pCD_f (void)
|
||||
{
|
||||
|
@ -320,7 +311,6 @@ pCD_f (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
pCDAudio_Init (void)
|
||||
{
|
||||
|
|
|
@ -68,6 +68,7 @@ UINT wDeviceID;
|
|||
void I_CDAudio_Play (byte track, qboolean looping);
|
||||
void I_CDAudio_Stop (void);
|
||||
|
||||
|
||||
static void
|
||||
I_CDAudio_CloseDoor (void)
|
||||
{
|
||||
|
@ -80,7 +81,6 @@ I_CDAudio_CloseDoor (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
I_CDAudio_Eject (void)
|
||||
{
|
||||
|
@ -93,14 +93,12 @@ I_CDAudio_Eject (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
I_CDAudio_GetAudioDiskInfo (void)
|
||||
{
|
||||
DWORD dwReturn;
|
||||
MCI_STATUS_PARMS mciStatusParms;
|
||||
|
||||
|
||||
cdValid = false;
|
||||
|
||||
mciStatusParms.dwItem = MCI_STATUS_READY;
|
||||
|
@ -135,7 +133,6 @@ I_CDAudio_GetAudioDiskInfo (void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
LONG
|
||||
I_CDAudio_MessageHandler (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -169,7 +166,6 @@ I_CDAudio_MessageHandler (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Pause (void)
|
||||
{
|
||||
|
@ -194,7 +190,6 @@ I_CDAudio_Pause (void)
|
|||
playing = false;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Play (byte track, qboolean looping)
|
||||
{
|
||||
|
@ -269,7 +264,6 @@ I_CDAudio_Play (byte track, qboolean looping)
|
|||
I_CDAudio_Pause ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Resume (void)
|
||||
{
|
||||
|
@ -298,7 +292,6 @@ I_CDAudio_Resume (void)
|
|||
playing = true;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Shutdown (void)
|
||||
{
|
||||
|
@ -309,7 +302,6 @@ I_CDAudio_Shutdown (void)
|
|||
Con_DPrintf ("CDAudio_Shutdown: MCI_CLOSE failed\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Stop (void)
|
||||
{
|
||||
|
@ -330,7 +322,6 @@ I_CDAudio_Stop (void)
|
|||
playing = false;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Update (void)
|
||||
{
|
||||
|
@ -350,14 +341,11 @@ I_CDAudio_Update (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
I_CD_f (void)
|
||||
{
|
||||
const char *command;
|
||||
int ret;
|
||||
int n;
|
||||
|
||||
int n, ret;
|
||||
// int startAddress;
|
||||
|
||||
if (Cmd_Argc () < 2)
|
||||
|
@ -459,7 +447,6 @@ I_CD_f (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
I_CDAudio_Init (void)
|
||||
{
|
||||
|
@ -501,7 +488,6 @@ I_CDAudio_Init (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
plugin_t *
|
||||
PluginInfo (void)
|
||||
{
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "winquake.h"
|
||||
# include "winquake.h"
|
||||
#endif
|
||||
|
||||
#include "QF/cmd.h"
|
||||
|
@ -54,9 +54,9 @@
|
|||
void SND_Play (void);
|
||||
void SND_PlayVol (void);
|
||||
void SND_SoundList (void);
|
||||
void SND_Update_ (void);
|
||||
void SND_StopAllSounds (qboolean clear);
|
||||
void SND_StopAllSoundsC (void);
|
||||
void SND_Update_ (void);
|
||||
|
||||
sfx_t *SND_PrecacheSound (const char *name);
|
||||
sfxcache_t *SND_LoadSound (sfx_t *s);
|
||||
|
@ -65,9 +65,6 @@ void SND_PaintChannels (int endtime);
|
|||
|
||||
void SND_Init_Cvars ();
|
||||
|
||||
// QuakeWorld hack...
|
||||
//#define viewentity playernum+1
|
||||
|
||||
// Internal sound data & structures ===========================================
|
||||
|
||||
extern channel_t channels[MAX_CHANNELS];
|
||||
|
@ -113,7 +110,6 @@ cvar_t *snd_phasesep;
|
|||
cvar_t *snd_show;
|
||||
cvar_t *snd_volumesep;
|
||||
|
||||
|
||||
plugin_t plugin_info;
|
||||
plugin_data_t plugin_info_data;
|
||||
plugin_funcs_t plugin_info_funcs;
|
||||
|
@ -132,6 +128,7 @@ snd_render_funcs_t plugin_info_snd_render_funcs;
|
|||
qboolean fakedma = false;
|
||||
int fakedma_updates = 15;
|
||||
|
||||
|
||||
void
|
||||
SND_AmbientOff (void)
|
||||
{
|
||||
|
@ -652,7 +649,8 @@ SND_UpdateAmbientSounds (void)
|
|||
if (!**plugin_info_snd_render_data.worldmodel) // FIXME: eww
|
||||
return;
|
||||
|
||||
l = Mod_PointInLeaf (listener_origin, **plugin_info_snd_render_data.worldmodel);
|
||||
l = Mod_PointInLeaf (listener_origin,
|
||||
**plugin_info_snd_render_data.worldmodel);
|
||||
if (!l || !ambient_level->value) {
|
||||
for (ambient_channel = 0; ambient_channel < NUM_AMBIENTS;
|
||||
ambient_channel++)
|
||||
|
@ -837,13 +835,10 @@ SND_Update_ (void)
|
|||
#endif
|
||||
|
||||
SND_PaintChannels (endtime);
|
||||
|
||||
S_O_Submit ();
|
||||
}
|
||||
|
||||
/*
|
||||
console functions
|
||||
*/
|
||||
/* console functions */
|
||||
|
||||
void
|
||||
SND_Play (void)
|
||||
|
@ -928,8 +923,8 @@ SND_LocalSound (const char *sound)
|
|||
Con_Printf ("S_LocalSound: can't cache %s\n", sound);
|
||||
return;
|
||||
}
|
||||
SND_StartSound (*plugin_info_snd_render_data.viewentity, -1, sfx, vec3_origin,
|
||||
1, 1);
|
||||
SND_StartSound (*plugin_info_snd_render_data.viewentity, -1, sfx,
|
||||
vec3_origin, 1, 1);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -970,7 +965,8 @@ PluginInfo (void) {
|
|||
plugin_info.plugin_version = "0.1";
|
||||
plugin_info.description = "Sound Renderer";
|
||||
plugin_info.copyright = "Copyright (C) 1996-1997 id Software, Inc.\n"
|
||||
"Copyright (C) 1999,2000,2001 contributors of the QuakeForge project\n"
|
||||
"Copyright (C) 1999,2000,2001 contributors of the QuakeForge "
|
||||
"project\n"
|
||||
"Please see the file \"AUTHORS\" for a list of contributors";
|
||||
plugin_info.functions = &plugin_info_funcs;
|
||||
plugin_info.data = &plugin_info_data;
|
||||
|
|
|
@ -218,9 +218,7 @@ SND_LoadSound (sfx_t *s)
|
|||
return sc;
|
||||
}
|
||||
|
||||
/*
|
||||
WAV loading
|
||||
*/
|
||||
/* WAV loading */
|
||||
|
||||
byte *data_p;
|
||||
byte *iff_end;
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
#define PAINTBUFFER_SIZE 512
|
||||
portable_samplepair_t paintbuffer[PAINTBUFFER_SIZE * 2];
|
||||
int max_overpaint; // number of extra samples painted
|
||||
|
||||
// due to phase shift
|
||||
int snd_scaletable[32][256];
|
||||
int *snd_p, snd_linear_count, snd_vol;
|
||||
|
@ -208,9 +207,7 @@ SND_TransferPaintBuffer (int endtime)
|
|||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
CHANNEL MIXING
|
||||
*/
|
||||
/* CHANNEL MIXING */
|
||||
|
||||
void SND_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int endtime);
|
||||
void SND_PaintChannelFrom16 (channel_t *ch, sfxcache_t *sc, int endtime);
|
||||
|
@ -231,8 +228,8 @@ SND_PaintChannels (int endtime)
|
|||
end = paintedtime + PAINTBUFFER_SIZE;
|
||||
|
||||
// clear the paint buffer
|
||||
// memset (paintbuffer, 0,
|
||||
// (end - paintedtime) * sizeof (portable_samplepair_t));
|
||||
// memset (paintbuffer, 0, (end - paintedtime) *
|
||||
// sizeof (portable_samplepair_t));
|
||||
max_overpaint = 0;
|
||||
|
||||
// paint in the channels.
|
||||
|
|
|
@ -110,8 +110,8 @@ SND_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation)
|
|||
}
|
||||
|
||||
void
|
||||
SND_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol,
|
||||
float attenuation)
|
||||
SND_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin,
|
||||
float fvol, float attenuation)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,8 @@ SND_UnblockSound (void)
|
|||
}
|
||||
|
||||
plugin_t *
|
||||
PluginInfo (void) {
|
||||
PluginInfo (void)
|
||||
{
|
||||
plugin_info.type = qfp_sound;
|
||||
plugin_info.api_version = QFPLUGIN_VERSION;
|
||||
plugin_info.plugin_version = "0.1";
|
||||
|
|
|
@ -28,11 +28,11 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#include "QF/console.h"
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/sound.h"
|
||||
#include "QF/plugin.h"
|
||||
#include "QF/console.h"
|
||||
#include "QF/model.h"
|
||||
#include "QF/plugin.h"
|
||||
|
||||
// =======================================================================
|
||||
// Various variables also defined in snd_dma.c
|
||||
|
@ -60,6 +60,7 @@ extern double host_frametime; // From host.h
|
|||
extern struct model_s **snd_worldmodel;
|
||||
extern int snd_viewentity;
|
||||
|
||||
|
||||
void
|
||||
S_Init (void)
|
||||
{
|
||||
|
@ -78,7 +79,8 @@ S_Init (void)
|
|||
} else {
|
||||
snd_render_module->data->snd_render->worldmodel = &snd_worldmodel;
|
||||
snd_render_module->data->snd_render->viewentity = &snd_viewentity;
|
||||
snd_render_module->data->snd_render->host_frametime = &host_frametime;
|
||||
snd_render_module->data->snd_render->host_frametime =
|
||||
&host_frametime;
|
||||
|
||||
snd_output_module->data->snd_output->soundtime
|
||||
= snd_render_module->data->snd_render->soundtime;
|
||||
|
@ -157,25 +159,28 @@ S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation)
|
|||
}
|
||||
|
||||
void
|
||||
S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol,
|
||||
float attenuation)
|
||||
S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin,
|
||||
float fvol, float attenuation)
|
||||
{
|
||||
if (snd_render_module)
|
||||
snd_render_module->functions->snd_render->pS_StartSound (entnum, entchannel, sfx, origin, fvol, attenuation);
|
||||
snd_render_module->functions->snd_render->pS_StartSound
|
||||
(entnum, entchannel, sfx, origin, fvol, attenuation);
|
||||
}
|
||||
|
||||
void
|
||||
S_StopSound (int entnum, int entchannel)
|
||||
{
|
||||
if (snd_render_module)
|
||||
snd_render_module->functions->snd_render->pS_StopSound (entnum, entchannel);
|
||||
snd_render_module->functions->snd_render->pS_StopSound
|
||||
(entnum, entchannel);
|
||||
}
|
||||
|
||||
sfx_t *
|
||||
S_PrecacheSound (const char *sample)
|
||||
{
|
||||
if (snd_render_module)
|
||||
return snd_render_module->functions->snd_render->pS_PrecacheSound (sample);
|
||||
return snd_render_module->functions->snd_render->pS_PrecacheSound
|
||||
(sample);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
@ -191,7 +196,8 @@ void
|
|||
S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up)
|
||||
{
|
||||
if (snd_render_module)
|
||||
snd_render_module->functions->snd_render->pS_Update (origin, v_forward, v_right, v_up);
|
||||
snd_render_module->functions->snd_render->pS_Update (origin, v_forward,
|
||||
v_right, v_up);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -289,4 +295,3 @@ S_O_UnblockSound (void)
|
|||
if (snd_output_module)
|
||||
snd_output_module->functions->snd_output->pS_O_UnblockSound ();
|
||||
}
|
||||
|
||||
|
|
|
@ -1059,7 +1059,7 @@ R_Mirror (void)
|
|||
R_DrawWaterSurfaces ();
|
||||
|
||||
gldepthmin = 0;
|
||||
gldepthmax = 1;//XXX 0.5;
|
||||
gldepthmax = 1; // XXX 0.5;
|
||||
qfglDepthRange (gldepthmin, gldepthmax);
|
||||
qfglDepthFunc (GL_LEQUAL);
|
||||
|
||||
|
|
|
@ -73,10 +73,10 @@ void
|
|||
R_RecursiveMarkLights (vec3_t lightorigin, dlight_t *light, int bit,
|
||||
mnode_t *node)
|
||||
{
|
||||
mplane_t *splitplane;
|
||||
float ndist, maxdist;
|
||||
msurface_t *surf;
|
||||
int i;
|
||||
float ndist, maxdist;
|
||||
mplane_t *splitplane;
|
||||
msurface_t *surf;
|
||||
|
||||
maxdist = light->radius * light->radius;
|
||||
|
||||
|
@ -160,8 +160,7 @@ loc0:
|
|||
}
|
||||
|
||||
static void
|
||||
mark_surfaces (msurface_t *surf, vec3_t lightorigin, dlight_t *light,
|
||||
int bit)
|
||||
mark_surfaces (msurface_t *surf, vec3_t lightorigin, dlight_t *light, int bit)
|
||||
{
|
||||
float dist;
|
||||
#if 1
|
||||
|
@ -301,24 +300,19 @@ vec3_t lightspot;
|
|||
int
|
||||
RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
||||
{
|
||||
int r;
|
||||
float front, back, frac;
|
||||
int side;
|
||||
mplane_t *plane;
|
||||
vec3_t mid;
|
||||
msurface_t *surf;
|
||||
int s, t, ds, dt;
|
||||
int i;
|
||||
mtexinfo_t *tex;
|
||||
byte *lightmap;
|
||||
int i, r, s, t, ds, dt, maps, side;
|
||||
unsigned int scale;
|
||||
int maps;
|
||||
byte *lightmap;
|
||||
float front, back, frac;
|
||||
mplane_t *plane;
|
||||
msurface_t *surf;
|
||||
mtexinfo_t *tex;
|
||||
vec3_t mid;
|
||||
|
||||
if (node->contents < 0)
|
||||
return -1; // didn't hit anything
|
||||
|
||||
// calculate mid point
|
||||
|
||||
// calculate mid point
|
||||
// FIXME: optimize for axial
|
||||
plane = node->plane;
|
||||
front = DotProduct (start, plane->normal) - plane->dist;
|
||||
|
@ -333,7 +327,7 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
mid[1] = start[1] + (end[1] - start[1]) * frac;
|
||||
mid[2] = start[2] + (end[2] - start[2]) * frac;
|
||||
|
||||
// go down front side
|
||||
// go down front side
|
||||
r = RecursiveLightPoint (node->children[side], start, mid);
|
||||
if (r >= 0)
|
||||
return r; // hit something
|
||||
|
@ -341,7 +335,7 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
if ((back < 0) == side)
|
||||
return -1; // didn't hit anything
|
||||
|
||||
// check for impact on this node
|
||||
// check for impact on this node
|
||||
VectorCopy (mid, lightspot);
|
||||
lightplane = plane;
|
||||
|
||||
|
@ -390,7 +384,7 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
return r;
|
||||
}
|
||||
|
||||
// go down back side
|
||||
// go down back side
|
||||
return RecursiveLightPoint (node->children[!side], mid, end);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,19 +31,16 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "QF/qargs.h"
|
||||
#include "QF/console.h"
|
||||
#include "QF/qargs.h"
|
||||
#include "QF/render.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "r_local.h"
|
||||
|
||||
particle_t *active_particles, *free_particles;
|
||||
|
||||
particle_t *particles;
|
||||
int r_numparticles;
|
||||
|
||||
particle_t *active_particles, *free_particles, *particles;
|
||||
vec3_t r_pright, r_pup, r_ppn;
|
||||
int r_numparticles;
|
||||
|
||||
|
||||
#ifdef QUAKE2
|
||||
|
@ -51,10 +48,9 @@ void
|
|||
R_DarkFieldParticles (entity_t *ent)
|
||||
{
|
||||
int i, j, k;
|
||||
particle_t *p;
|
||||
float vel;
|
||||
vec3_t dir;
|
||||
vec3_t org;
|
||||
particle_t *p;
|
||||
vec3_t dir, org;
|
||||
|
||||
org[0] = ent->origin[0];
|
||||
org[1] = ent->origin[1];
|
||||
|
@ -89,20 +85,17 @@ R_DarkFieldParticles (entity_t *ent)
|
|||
#endif
|
||||
|
||||
#define NUMVERTEXNORMALS 162
|
||||
extern float r_avertexnormals[NUMVERTEXNORMALS][3];
|
||||
static vec3_t avelocities[NUMVERTEXNORMALS];
|
||||
static float beamlength = 16;
|
||||
extern float r_avertexnormals[NUMVERTEXNORMALS][3];
|
||||
static float beamlength = 16;
|
||||
static vec3_t avelocities[NUMVERTEXNORMALS];
|
||||
|
||||
void
|
||||
R_EntityParticles (entity_t *ent)
|
||||
{
|
||||
int count;
|
||||
int i;
|
||||
int count, i;
|
||||
float angle, dist, sr, sp, sy, cr, cp, cy;
|
||||
particle_t *p;
|
||||
float angle;
|
||||
float sr, sp, sy, cr, cp, cy;
|
||||
vec3_t forward;
|
||||
float dist;
|
||||
|
||||
dist = 64;
|
||||
count = 50;
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#endif
|
||||
|
||||
#include "QF/console.h"
|
||||
|
||||
#include "dga_check.h"
|
||||
|
||||
|
||||
|
@ -86,7 +87,8 @@ VID_CheckDGA (Display * dpy, int *maj_ver, int *min_ver, int *hasvideo)
|
|||
}
|
||||
|
||||
if ((!maj_ver) || (*maj_ver != XDGA_MAJOR_VERSION)) {
|
||||
Con_Printf ("VID: Incorrect DGA version: %d.%d, \n", *maj_ver, *min_ver);
|
||||
Con_Printf ("VID: Incorrect DGA version: %d.%d, \n", *maj_ver,
|
||||
*min_ver);
|
||||
return false;
|
||||
}
|
||||
Con_Printf ("VID: DGA version: %d.%d\n", *maj_ver, *min_ver);
|
||||
|
@ -120,8 +122,7 @@ qboolean
|
|||
VID_CheckVMode (Display * dpy, int *maj_ver, int *min_ver)
|
||||
{
|
||||
#ifdef HAVE_VIDMODE
|
||||
int event_base, error_base;
|
||||
int dummy, dummy_major, dummy_minor;
|
||||
int dummy, dummy_major, dummy_minor, event_base, error_base;
|
||||
|
||||
if (!XQueryExtension (dpy, XF86VIDMODENAME, &dummy, &dummy, &dummy)) {
|
||||
return false;
|
||||
|
@ -140,7 +141,8 @@ VID_CheckVMode (Display * dpy, int *maj_ver, int *min_ver)
|
|||
return false;
|
||||
|
||||
if ((!maj_ver) || (*maj_ver != XF86VIDMODE_MAJOR_VERSION)) {
|
||||
Con_Printf ("VID: Incorrect VidMode version: %d.%d\n", *maj_ver, *min_ver);
|
||||
Con_Printf ("VID: Incorrect VidMode version: %d.%d\n", *maj_ver,
|
||||
*min_ver);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -43,10 +43,10 @@
|
|||
#endif
|
||||
|
||||
#define _BSD
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "QF/console.h"
|
||||
#include "QF/cvar.h"
|
||||
|
@ -124,9 +124,7 @@ IN_Move (void)
|
|||
in_mouse_x = in_mouse_y = 0.0;
|
||||
}
|
||||
|
||||
/*
|
||||
Called at shutdown
|
||||
*/
|
||||
/* Called at shutdown */
|
||||
void
|
||||
IN_Shutdown (void)
|
||||
{
|
||||
|
|
|
@ -32,9 +32,6 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
@ -42,6 +39,8 @@
|
|||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "QF/sys.h"
|
||||
#include "QF/in_event.h"
|
||||
|
||||
|
@ -49,6 +48,7 @@
|
|||
|
||||
float ie_time;
|
||||
|
||||
|
||||
void
|
||||
IE_Threshold_Event (ie_event_t *event, float value)
|
||||
{
|
||||
|
@ -94,7 +94,7 @@ IE_Translation_Event (ie_event_t *event, float value)
|
|||
}
|
||||
|
||||
ie_translation_table_t *
|
||||
IE_Translation_Table_Create ()
|
||||
IE_Translation_Table_Create (void)
|
||||
{
|
||||
ie_translation_table_t *table;
|
||||
|
||||
|
@ -108,16 +108,19 @@ IE_Translation_Table_Create ()
|
|||
}
|
||||
|
||||
void
|
||||
IE_Translation_Table_Modify (ie_translation_table_t *table, int offset, ie_event_t *event)
|
||||
IE_Translation_Table_Modify (ie_translation_table_t *table, int offset,
|
||||
ie_event_t *event)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (offset >= table->maxevents) {
|
||||
i = table->maxevents;
|
||||
table->maxevents++;
|
||||
table->events = realloc (table->events, sizeof (ie_translation_table_t *) * table->maxevents);
|
||||
table->events = realloc (table->events, sizeof (ie_translation_table_t
|
||||
*) * table->maxevents);
|
||||
if (!table->events)
|
||||
Sys_Error ("IE_Translation_Table_Modify: memory allocation failure");
|
||||
Sys_Error ("IE_Translation_Table_Modify: memory allocation "
|
||||
"failure");
|
||||
for (; i < table->maxevents; i++)
|
||||
table->events[i] = 0;
|
||||
}
|
||||
|
@ -125,7 +128,7 @@ IE_Translation_Table_Modify (ie_translation_table_t *table, int offset, ie_event
|
|||
}
|
||||
|
||||
ie_translation_index_t *
|
||||
IE_Translation_Index_Create ()
|
||||
IE_Translation_Index_Create (void)
|
||||
{
|
||||
ie_translation_index_t *index;
|
||||
|
||||
|
@ -138,8 +141,6 @@ IE_Translation_Index_Create ()
|
|||
return index;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
IE_Multiplier_Event (ie_event_t *event, float value)
|
||||
{
|
||||
|
@ -160,8 +161,6 @@ IE_CallHandler (ie_handler handler, ie_event_t *event, float value)
|
|||
depth--;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
static int (**event_handler_list)(const IE_event_t*);
|
||||
static int eh_list_size;
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <termios.h>
|
||||
#include <fcntl.h>
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include "QF/cvar.h"
|
||||
|
@ -48,11 +48,11 @@ fd_blocking (int fd, int on)
|
|||
int x;
|
||||
|
||||
#if defined(_POSIX_SOURCE) || !defined(FIONBIO)
|
||||
#if !defined(O_NONBLOCK)
|
||||
# if defined(O_NDELAY)
|
||||
# define O_NONBLOCK O_NDELAY
|
||||
# if !defined(O_NONBLOCK)
|
||||
# if defined(O_NDELAY)
|
||||
# define O_NONBLOCK O_NDELAY
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
if ((x = fcntl(fd, F_GETFL, 0)) == -1)
|
||||
return -1;
|
||||
if (on)
|
||||
|
@ -137,9 +137,6 @@ IN_LL_Commands (void)
|
|||
{
|
||||
}
|
||||
|
||||
/*
|
||||
IN_ModeChanged
|
||||
*/
|
||||
void
|
||||
IN_LL_ModeChanged (void)
|
||||
{
|
||||
|
|
|
@ -55,9 +55,6 @@ IN_Move (usercmd_t *cmd)
|
|||
{
|
||||
}
|
||||
|
||||
/*
|
||||
IN_ModeChanged
|
||||
*/
|
||||
void
|
||||
IN_ModeChanged (void)
|
||||
{
|
||||
|
|
|
@ -31,18 +31,19 @@
|
|||
|
||||
#include <SDL.h>
|
||||
|
||||
#include "compat.h"
|
||||
#include "QF/console.h"
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/input.h"
|
||||
#include "QF/joystick.h"
|
||||
#include "QF/keys.h"
|
||||
#include "QF/mathlib.h"
|
||||
#include "QF/sys.h"
|
||||
#include "QF/qargs.h"
|
||||
#include "QF/qendian.h"
|
||||
#include "QF/sys.h"
|
||||
#include "QF/vid.h"
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
#ifdef WIN32
|
||||
// FIXME: this is evil...
|
||||
# include <windows.h>
|
||||
|
@ -51,13 +52,10 @@ HWND mainwindow;
|
|||
|
||||
cvar_t *m_filter;
|
||||
cvar_t *_windowed_mouse;
|
||||
int old_windowed_mouse;
|
||||
|
||||
int old_windowed_mouse;
|
||||
int modestate; // FIXME: just to avoid cross-comp errors - remove later
|
||||
|
||||
/*
|
||||
IN_SendKeyEvents
|
||||
*/
|
||||
|
||||
void
|
||||
IN_LL_SendKeyEvents (void)
|
||||
|
@ -821,7 +819,6 @@ IN_LL_SendKeyEvents (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IN_LL_Commands (void)
|
||||
{
|
||||
|
|
|
@ -32,15 +32,15 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -49,7 +49,6 @@
|
|||
#include <vgamouse.h>
|
||||
|
||||
#include "QF/cmd.h"
|
||||
#include "compat.h"
|
||||
#include "QF/console.h"
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/input.h"
|
||||
|
@ -59,6 +58,8 @@
|
|||
#include "QF/qargs.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
static int UseKeyboard = 1;
|
||||
static int UseMouse = 1;
|
||||
static int in_svgalib_inited = 0;
|
||||
|
@ -73,12 +74,11 @@ static void IN_InitMouse (void);
|
|||
|
||||
#define ROTL(x,n) (((x)<<(n))|(x)>>(32-n))
|
||||
|
||||
|
||||
static void
|
||||
keyhandler (int scancode, int state)
|
||||
{
|
||||
int sc;
|
||||
int key;
|
||||
int ascii;
|
||||
int sc, ascii, key;
|
||||
int press = state == KEY_EVENTPRESS;
|
||||
unsigned long mask = ~1;
|
||||
static unsigned long shifts;
|
||||
|
@ -117,9 +117,9 @@ keyhandler (int scancode, int state)
|
|||
Key_Event (key, ascii, press);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mousehandler (int buttonstate, int dx, int dy, int dz, int drx, int dry, int drz)
|
||||
mousehandler (int buttonstate, int dx, int dy, int dz, int drx, int dry,
|
||||
int drz)
|
||||
{
|
||||
mouse_buttonstate = buttonstate;
|
||||
in_mouse_x += dx;
|
||||
|
@ -133,7 +133,6 @@ mousehandler (int buttonstate, int dx, int dy, int dz, int drx, int dry, int drz
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IN_LL_Init (void)
|
||||
{
|
||||
|
@ -364,8 +363,8 @@ static void
|
|||
IN_InitMouse (void)
|
||||
{
|
||||
int mtype;
|
||||
char *mousedev;
|
||||
int mouserate = MOUSE_DEFAULTSAMPLERATE;
|
||||
char *mousedev;
|
||||
|
||||
mouse_buttons = 3;
|
||||
|
||||
|
@ -420,7 +419,6 @@ IN_LL_SendKeyEvents (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IN_LL_Commands (void)
|
||||
{
|
||||
|
|
|
@ -32,17 +32,18 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include "winquake.h"
|
||||
#include <dinput.h>
|
||||
|
||||
#include "QF/cmd.h"
|
||||
#include "compat.h"
|
||||
#include "QF/console.h"
|
||||
#include "QF/input.h"
|
||||
#include "QF/keys.h"
|
||||
#include "QF/qargs.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "winquake.h"
|
||||
|
||||
#define DINPUT_BUFFERSIZE 16
|
||||
#define iDirectInputCreate(a,b,c,d) pDirectInputCreate(a,b,c,d)
|
||||
|
||||
|
@ -51,11 +52,9 @@ HRESULT (WINAPI * pDirectInputCreate) (HINSTANCE hinst, DWORD dwVersion,
|
|||
LPUNKNOWN punkOuter);
|
||||
|
||||
// mouse public variables
|
||||
|
||||
unsigned int uiWheelMessage;
|
||||
|
||||
// mouse local variables
|
||||
|
||||
static int mouse_buttons;
|
||||
static int mouse_oldbuttonstate;
|
||||
static POINT current_pos;
|
||||
|
@ -69,7 +68,6 @@ static qboolean dinput_acquired;
|
|||
static unsigned int mstate_di;
|
||||
|
||||
// misc locals
|
||||
|
||||
static LPDIRECTINPUT g_pdi;
|
||||
static LPDIRECTINPUTDEVICE g_pMouse;
|
||||
|
||||
|
@ -88,15 +86,15 @@ typedef struct MYDATA {
|
|||
} MYDATA;
|
||||
|
||||
static DIOBJECTDATAFORMAT rgodf[] = {
|
||||
{&GUID_XAxis, FIELD_OFFSET (MYDATA, lX), DIDFT_AXIS | DIDFT_ANYINSTANCE, 0,},
|
||||
{&GUID_YAxis, FIELD_OFFSET (MYDATA, lY), DIDFT_AXIS | DIDFT_ANYINSTANCE, 0,},
|
||||
|
||||
{&GUID_ZAxis, FIELD_OFFSET (MYDATA, lZ),
|
||||
{&GUID_XAxis, FIELD_OFFSET (MYDATA, lX), DIDFT_AXIS | DIDFT_ANYINSTANCE,
|
||||
0,},
|
||||
{&GUID_YAxis, FIELD_OFFSET (MYDATA, lY), DIDFT_AXIS | DIDFT_ANYINSTANCE,
|
||||
0,},
|
||||
{&GUID_ZAxis, FIELD_OFFSET (MYDATA, lZ),
|
||||
0x80000000 | DIDFT_AXIS | DIDFT_ANYINSTANCE, 0,},
|
||||
{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),
|
||||
{0, FIELD_OFFSET (MYDATA, bButtonC),
|
||||
0x80000000 | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0,},
|
||||
{0, FIELD_OFFSET (MYDATA, bButtonD),
|
||||
0x80000000 | DIDFT_BUTTON | DIDFT_ANYINSTANCE, 0,},
|
||||
|
@ -114,7 +112,6 @@ static DIDATAFORMAT df = {
|
|||
};
|
||||
|
||||
// forward-referenced functions, joy
|
||||
|
||||
extern void JOY_Command(void);
|
||||
extern void JOY_Init_Cvars(void);
|
||||
extern void JOY_Init (void);
|
||||
|
@ -122,9 +119,6 @@ extern void JOY_AdvancedUpdate_f (void);
|
|||
extern void JOY_Move (void);
|
||||
|
||||
|
||||
/*
|
||||
IN_UpdateClipCursor
|
||||
*/
|
||||
void
|
||||
IN_UpdateClipCursor (void)
|
||||
{
|
||||
|
@ -134,10 +128,6 @@ IN_UpdateClipCursor (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
IN_ShowMouse
|
||||
*/
|
||||
void
|
||||
IN_ShowMouse (void)
|
||||
{
|
||||
|
@ -148,10 +138,6 @@ IN_ShowMouse (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
IN_HideMouse
|
||||
*/
|
||||
void
|
||||
IN_HideMouse (void)
|
||||
{
|
||||
|
@ -162,10 +148,6 @@ IN_HideMouse (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
IN_ActivateMouse
|
||||
*/
|
||||
void
|
||||
IN_ActivateMouse (void)
|
||||
{
|
||||
|
@ -196,10 +178,6 @@ IN_ActivateMouse (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
IN_SetQuakeMouseState
|
||||
*/
|
||||
void
|
||||
IN_SetQuakeMouseState (void)
|
||||
{
|
||||
|
@ -207,10 +185,6 @@ IN_SetQuakeMouseState (void)
|
|||
IN_ActivateMouse ();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
IN_DeactivateMouse
|
||||
*/
|
||||
void
|
||||
IN_DeactivateMouse (void)
|
||||
{
|
||||
|
@ -237,10 +211,6 @@ IN_DeactivateMouse (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
IN_RestoreOriginalMouseState
|
||||
*/
|
||||
void
|
||||
IN_RestoreOriginalMouseState (void)
|
||||
{
|
||||
|
@ -248,28 +218,23 @@ IN_RestoreOriginalMouseState (void)
|
|||
IN_DeactivateMouse ();
|
||||
mouseactivatetoggle = true;
|
||||
}
|
||||
// try to redraw the cursor so it gets reinitialized, because sometimes it
|
||||
// has garbage after the mode switch
|
||||
// try to redraw the cursor so it gets reinitialized, because sometimes it
|
||||
// has garbage after the mode switch
|
||||
ShowCursor (TRUE);
|
||||
ShowCursor (FALSE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
IN_InitDInput
|
||||
*/
|
||||
static qboolean
|
||||
IN_InitDInput (void)
|
||||
{
|
||||
HRESULT hr;
|
||||
DIPROPDWORD dipdw = {
|
||||
{
|
||||
sizeof (DIPROPDWORD), // diph.dwSize
|
||||
sizeof (DIPROPHEADER), // diph.dwHeaderSize
|
||||
0, // diph.dwObj
|
||||
DIPH_DEVICE, // diph.dwHow
|
||||
}
|
||||
,
|
||||
sizeof (DIPROPDWORD), // diph.dwSize
|
||||
sizeof (DIPROPHEADER), // diph.dwHeaderSize
|
||||
0, // diph.dwObj
|
||||
DIPH_DEVICE, // diph.dwHow
|
||||
},
|
||||
DINPUT_BUFFERSIZE, // dwData
|
||||
};
|
||||
|
||||
|
@ -291,29 +256,27 @@ IN_InitDInput (void)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
// register with DirectInput and get an IDirectInput to play with.
|
||||
hr =
|
||||
iDirectInputCreate (global_hInstance, DIRECTINPUT_VERSION, &g_pdi,
|
||||
NULL);
|
||||
// register with DirectInput and get an IDirectInput to play with.
|
||||
hr = iDirectInputCreate (global_hInstance, DIRECTINPUT_VERSION, &g_pdi,
|
||||
NULL);
|
||||
|
||||
if (FAILED (hr)) {
|
||||
if (FAILED (hr))
|
||||
return false;
|
||||
}
|
||||
// obtain an interface to the system mouse device.
|
||||
// obtain an interface to the system mouse device.
|
||||
hr = IDirectInput_CreateDevice (g_pdi, &GUID_SysMouse, &g_pMouse, NULL);
|
||||
|
||||
if (FAILED (hr)) {
|
||||
Con_Printf ("Couldn't open DI mouse device\n");
|
||||
return false;
|
||||
}
|
||||
// set the data format to "mouse format".
|
||||
// set the data format to "mouse format".
|
||||
hr = IDirectInputDevice_SetDataFormat (g_pMouse, &df);
|
||||
|
||||
if (FAILED (hr)) {
|
||||
Con_Printf ("Couldn't set DI mouse format\n");
|
||||
return false;
|
||||
}
|
||||
// set the cooperativity level.
|
||||
// set the cooperativity level.
|
||||
hr = IDirectInputDevice_SetCooperativeLevel (g_pMouse, mainwindow,
|
||||
DISCL_EXCLUSIVE |
|
||||
DISCL_FOREGROUND);
|
||||
|
@ -323,11 +286,10 @@ IN_InitDInput (void)
|
|||
return false;
|
||||
}
|
||||
|
||||
// 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);
|
||||
// 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)) {
|
||||
Con_Printf ("Couldn't set DI buffersize\n");
|
||||
|
@ -337,10 +299,6 @@ IN_InitDInput (void)
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
IN_StartupMouse
|
||||
*/
|
||||
static void
|
||||
IN_StartupMouse (void)
|
||||
{
|
||||
|
@ -362,8 +320,8 @@ IN_StartupMouse (void)
|
|||
}
|
||||
|
||||
if (!dinput) {
|
||||
mouseparmsvalid =
|
||||
SystemParametersInfo (SPI_GETMOUSE, 0, originalmouseparms, 0);
|
||||
mouseparmsvalid = SystemParametersInfo (SPI_GETMOUSE, 0,
|
||||
originalmouseparms, 0);
|
||||
|
||||
if (mouseparmsvalid) {
|
||||
if (COM_CheckParm ("-noforcemspd"))
|
||||
|
@ -384,16 +342,12 @@ IN_StartupMouse (void)
|
|||
|
||||
mouse_buttons = 3;
|
||||
|
||||
// if a fullscreen video mode was set before the mouse was initialized,
|
||||
// set the mouse state appropriately
|
||||
// if a fullscreen video mode was set before the mouse was initialized,
|
||||
// set the mouse state appropriately
|
||||
if (mouseactivatetoggle)
|
||||
IN_ActivateMouse ();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
IN_Init
|
||||
*/
|
||||
void
|
||||
IN_LL_Init (void)
|
||||
{
|
||||
|
@ -407,9 +361,6 @@ IN_LL_Init_Cvars (void)
|
|||
{
|
||||
}
|
||||
|
||||
/*
|
||||
IN_Shutdown
|
||||
*/
|
||||
void
|
||||
IN_LL_Shutdown (void)
|
||||
{
|
||||
|
@ -428,10 +379,6 @@ IN_LL_Shutdown (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
IN_MouseEvent
|
||||
*/
|
||||
void
|
||||
IN_MouseEvent (int mstate)
|
||||
{
|
||||
|
@ -453,10 +400,6 @@ IN_MouseEvent (int mstate)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
IN_MouseMove
|
||||
*/
|
||||
void
|
||||
IN_LL_Commands (void)
|
||||
{
|
||||
|
@ -494,7 +437,6 @@ IN_LL_Commands (void)
|
|||
}
|
||||
|
||||
/* Look at the element to see what happened */
|
||||
|
||||
switch (od.dwOfs) {
|
||||
case DIMOFS_X:
|
||||
mx += od.dwData;
|
||||
|
@ -550,16 +492,12 @@ IN_LL_Commands (void)
|
|||
in_mouse_x = mx;
|
||||
in_mouse_y = my;
|
||||
|
||||
// if the mouse has moved, force it to the center, so there's room to move
|
||||
// if the mouse has moved, force it to the center, so there's room to move
|
||||
if (mx || my) {
|
||||
SetCursorPos (window_center_x, window_center_y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
IN_LL_ClearStates
|
||||
*/
|
||||
void
|
||||
IN_LL_ClearStates (void)
|
||||
{
|
||||
|
|
|
@ -43,10 +43,10 @@
|
|||
#endif
|
||||
|
||||
#define _BSD
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/keysym.h>
|
||||
|
||||
|
@ -87,6 +87,7 @@ static int p_mouse_x, p_mouse_y;
|
|||
#define FOCUS_MASK (FocusChangeMask)
|
||||
#define INPUT_MASK (KEY_MASK | MOUSE_MASK | FOCUS_MASK)
|
||||
|
||||
|
||||
static void
|
||||
XLateKey (XKeyEvent * ev, int *k, int *u)
|
||||
{
|
||||
|
@ -98,7 +99,8 @@ XLateKey (XKeyEvent * ev, int *k, int *u)
|
|||
int unicode;
|
||||
|
||||
keysym = XLookupKeysym (ev, 0);
|
||||
bytes = XLookupString (ev, buffer, sizeof(buffer), &shifted_keysym, &compose);
|
||||
bytes = XLookupString (ev, buffer, sizeof(buffer), &shifted_keysym,
|
||||
&compose);
|
||||
unicode = buffer[0];
|
||||
|
||||
switch (keysym) {
|
||||
|
@ -289,7 +291,7 @@ XLateKey (XKeyEvent * ev, int *k, int *u)
|
|||
key = K_KP_DIVIDE;
|
||||
break;
|
||||
|
||||
/* For Sun keyboards */
|
||||
/* For Sun keyboards */
|
||||
case XK_F27:
|
||||
key = K_HOME;
|
||||
break;
|
||||
|
@ -337,7 +339,6 @@ XLateKey (XKeyEvent * ev, int *k, int *u)
|
|||
*u = unicode;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
event_key (XEvent * event)
|
||||
{
|
||||
|
@ -354,7 +355,6 @@ event_key (XEvent * event)
|
|||
Key_Event (key, unicode, event->type == KeyPress);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
event_button (XEvent * event)
|
||||
{
|
||||
|
@ -414,7 +414,6 @@ center_pointer (void)
|
|||
vid.width / 2, vid.height / 2);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
event_motion (XEvent * event)
|
||||
{
|
||||
|
@ -426,8 +425,8 @@ event_motion (XEvent * event)
|
|||
if (!event->xmotion.send_event) {
|
||||
in_mouse_x += (event->xmotion.x - p_mouse_x);
|
||||
in_mouse_y += (event->xmotion.y - p_mouse_y);
|
||||
if (abs (vid.width / 2 - event->xmotion.x) > vid.width / 4
|
||||
|| abs (vid.height / 2 - event->xmotion.y) > vid.height / 4) {
|
||||
if (abs (vid.width / 2 - event->xmotion.x) > vid.width / 4 ||
|
||||
abs (vid.height / 2 - event->xmotion.y) > vid.height / 4) {
|
||||
center_pointer ();
|
||||
}
|
||||
}
|
||||
|
@ -440,7 +439,6 @@ event_motion (XEvent * event)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IN_LL_Commands (void)
|
||||
{
|
||||
|
@ -474,7 +472,6 @@ IN_LL_Commands (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IN_LL_SendKeyEvents (void)
|
||||
{
|
||||
|
@ -482,9 +479,7 @@ IN_LL_SendKeyEvents (void)
|
|||
X11_ProcessEvents ();
|
||||
}
|
||||
|
||||
/*
|
||||
Called at shutdown
|
||||
*/
|
||||
/* Called at shutdown */
|
||||
void
|
||||
IN_LL_Shutdown (void)
|
||||
{
|
||||
|
|
|
@ -71,6 +71,7 @@ ocvar_t joy_axes_cvar_init[JOY_MAX_AXES] = {
|
|||
struct joy_axis joy_axes[JOY_MAX_AXES];
|
||||
struct joy_button joy_buttons[JOY_MAX_BUTTONS];
|
||||
|
||||
|
||||
void
|
||||
JOY_Command (void)
|
||||
{
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <linux/joystick.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <linux/joystick.h>
|
||||
|
||||
#include "QF/console.h"
|
||||
#include "QF/cvar.h"
|
||||
|
@ -44,6 +44,7 @@
|
|||
// Variables and structures for this driver
|
||||
int joy_handle;
|
||||
|
||||
|
||||
void
|
||||
JOY_Read (void)
|
||||
{
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#undef byte
|
||||
|
||||
#include "QF/cmd.h"
|
||||
#include "compat.h"
|
||||
#include "QF/console.h"
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/input.h"
|
||||
|
@ -50,6 +49,8 @@
|
|||
#include "QF/keys.h"
|
||||
#include "QF/qargs.h"
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
// Joystick variables and structures
|
||||
cvar_t *joy_device; // Joystick device name
|
||||
cvar_t *joy_enable; // Joystick enabling flag
|
||||
|
@ -74,7 +75,8 @@ enum _ControlList {
|
|||
};
|
||||
|
||||
DWORD dwAxisFlags[JOY_MAX_AXES] = {
|
||||
JOY_RETURNX, JOY_RETURNY, JOY_RETURNZ, JOY_RETURNR, JOY_RETURNU, JOY_RETURNV
|
||||
JOY_RETURNX, JOY_RETURNY, JOY_RETURNZ, JOY_RETURNR, JOY_RETURNU,
|
||||
JOY_RETURNV
|
||||
};
|
||||
|
||||
DWORD dwAxisMap[JOY_MAX_AXES];
|
||||
|
@ -85,8 +87,8 @@ JOYINFOEX ji;
|
|||
|
||||
// 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
|
||||
// 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.
|
||||
|
||||
cvar_t *in_joystick;
|
||||
|
@ -117,14 +119,11 @@ int joy_id;
|
|||
DWORD joy_flags;
|
||||
DWORD joy_numbuttons;
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
void JOY_AdvancedUpdate_f (void);
|
||||
int JOY_StartupJoystick (void);
|
||||
|
||||
PDWORD RawValuePointer (int axis);
|
||||
|
||||
|
||||
qboolean
|
||||
_JOY_Read (void)
|
||||
{
|
||||
|
@ -213,7 +212,8 @@ int
|
|||
JOY_Open (void)
|
||||
{
|
||||
return JOY_StartupJoystick();
|
||||
// Cmd_AddCommand ("joyadvancedupdate", JOY_AdvancedUpdate_f, "FIXME: This appears to update the joystick poll? No Description");
|
||||
// Cmd_AddCommand ("joyadvancedupdate", JOY_AdvancedUpdate_f, "FIXME: This "
|
||||
"appears to update the joystick poll? No Description");
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -221,9 +221,6 @@ JOY_Close (void)
|
|||
{
|
||||
}
|
||||
|
||||
/*
|
||||
Joy_AdvancedUpdate_f
|
||||
*/
|
||||
void
|
||||
JOY_AdvancedUpdate_f (void)
|
||||
{
|
||||
|
@ -283,10 +280,6 @@ JOY_AdvancedUpdate_f (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
IN_StartupJoystick
|
||||
*/
|
||||
int
|
||||
JOY_StartupJoystick (void)
|
||||
{
|
||||
|
@ -318,7 +311,8 @@ JOY_StartupJoystick (void)
|
|||
|
||||
// abort startup if we didn't find a valid joystick
|
||||
if (mmr != JOYERR_NOERROR) {
|
||||
Con_Printf ("\njoystick not found -- no valid joysticks (%x)\n\n", mmr);
|
||||
Con_Printf ("\njoystick not found -- no valid joysticks (%x)\n\n",
|
||||
mmr);
|
||||
return -1;
|
||||
}
|
||||
// get the capabilities of the selected joystick
|
||||
|
@ -349,9 +343,6 @@ JOY_StartupJoystick (void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
RawValuePointer
|
||||
*/
|
||||
PDWORD
|
||||
RawValuePointer (int axis)
|
||||
{
|
||||
|
@ -376,56 +367,54 @@ RawValuePointer (int axis)
|
|||
void
|
||||
JOY_Init_Cvars(void)
|
||||
{
|
||||
joy_device =
|
||||
Cvar_Get ("joy_device", "none", CVAR_NONE | CVAR_ROM, 0,
|
||||
"Joystick device");
|
||||
joy_enable =
|
||||
Cvar_Get ("joy_enable", "1", CVAR_NONE | CVAR_ARCHIVE, 0,
|
||||
"Joystick enable flag");
|
||||
joy_sensitivity =
|
||||
Cvar_Get ("joy_sensitivity", "1", CVAR_NONE | CVAR_ARCHIVE, 0,
|
||||
"Joystick sensitivity");
|
||||
|
||||
// joystick variables
|
||||
joy_device = Cvar_Get ("joy_device", "none", CVAR_NONE | CVAR_ROM, 0,
|
||||
"Joystick device");
|
||||
joy_enable = Cvar_Get ("joy_enable", "1", CVAR_NONE | CVAR_ARCHIVE, 0,
|
||||
"Joystick enable flag");
|
||||
joy_sensitivity = Cvar_Get ("joy_sensitivity", "1", CVAR_NONE |
|
||||
CVAR_ARCHIVE, 0, "Joystick sensitivity");
|
||||
in_joystick = Cvar_Get ("joystick", "0", CVAR_ARCHIVE, 0, "FIXME: No "
|
||||
"Description");
|
||||
joy_name = Cvar_Get ("joyname", "joystick", CVAR_NONE, 0, "FIXME: No "
|
||||
"Description");
|
||||
joy_advanced = Cvar_Get ("joyadvanced", "0", CVAR_NONE, 0, "FIXME: No "
|
||||
"Description");
|
||||
joy_advaxisx = Cvar_Get ("joyadvaxisx", "0", CVAR_NONE, 0, "FIXME: No "
|
||||
"Description");
|
||||
joy_advaxisy = Cvar_Get ("joyadvaxisy", "0", CVAR_NONE, 0, "FIXME: No "
|
||||
"Description");
|
||||
joy_advaxisz = Cvar_Get ("joyadvaxisz", "0", CVAR_NONE, 0, "FIXME: No "
|
||||
"Description");
|
||||
joy_advaxisr = Cvar_Get ("joyadvaxisr", "0", CVAR_NONE, 0, "FIXME: No "
|
||||
"Description");
|
||||
joy_advaxisu = Cvar_Get ("joyadvaxisu", "0", CVAR_NONE, 0, "FIXME: No "
|
||||
"Description");
|
||||
joy_advaxisv = Cvar_Get ("joyadvaxisv", "0", CVAR_NONE, 0, "FIXME: No "
|
||||
"Description");
|
||||
joy_forwardthreshold = Cvar_Get ("joyforwardthreshold", "0.15", CVAR_NONE,
|
||||
0, "FIXME: No Description");
|
||||
joy_sidethreshold = Cvar_Get ("joysidethreshold", "0.15", CVAR_NONE, 0,
|
||||
"FIXME: No Description");
|
||||
joy_pitchthreshold = Cvar_Get ("joypitchthreshold", "0.15", CVAR_NONE, 0,
|
||||
"FIXME: No Description");
|
||||
joy_yawthreshold = Cvar_Get ("joyyawthreshold", "0.15", CVAR_NONE, 0,
|
||||
"FIXME: No Description");
|
||||
joy_forwardsensitivity = Cvar_Get ("joyforwardsensitivity", "-1.0",
|
||||
CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_sidesensitivity = Cvar_Get ("joysidesensitivity", "-1.0", CVAR_NONE,
|
||||
0, "FIXME: No Description");
|
||||
joy_pitchsensitivity = Cvar_Get ("joypitchsensitivity", "1.0", CVAR_NONE,
|
||||
0, "FIXME: No Description");
|
||||
joy_yawsensitivity = Cvar_Get ("joyyawsensitivity", "-1.0", CVAR_NONE, 0,
|
||||
"FIXME: No Description");
|
||||
joy_wwhack1 = Cvar_Get ("joywwhack1", "0.0", CVAR_NONE, 0, "FIXME: No "
|
||||
"Description");
|
||||
joy_wwhack2 = Cvar_Get ("joywwhack2", "0.0", CVAR_NONE, 0, "FIXME: No "
|
||||
"Description");
|
||||
|
||||
in_joystick =
|
||||
Cvar_Get ("joystick", "0", CVAR_ARCHIVE, 0, "FIXME: No Description");
|
||||
joy_name =
|
||||
Cvar_Get ("joyname", "joystick", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_advanced =
|
||||
Cvar_Get ("joyadvanced", "0", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_advaxisx =
|
||||
Cvar_Get ("joyadvaxisx", "0", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_advaxisy =
|
||||
Cvar_Get ("joyadvaxisy", "0", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_advaxisz =
|
||||
Cvar_Get ("joyadvaxisz", "0", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_advaxisr =
|
||||
Cvar_Get ("joyadvaxisr", "0", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_advaxisu =
|
||||
Cvar_Get ("joyadvaxisu", "0", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_advaxisv =
|
||||
Cvar_Get ("joyadvaxisv", "0", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_forwardthreshold =
|
||||
Cvar_Get ("joyforwardthreshold", "0.15", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_sidethreshold =
|
||||
Cvar_Get ("joysidethreshold", "0.15", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_pitchthreshold =
|
||||
Cvar_Get ("joypitchthreshold", "0.15", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_yawthreshold = Cvar_Get ("joyyawthreshold", "0.15", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_forwardsensitivity =
|
||||
Cvar_Get ("joyforwardsensitivity", "-1.0", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_sidesensitivity =
|
||||
Cvar_Get ("joysidesensitivity", "-1.0", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_pitchsensitivity =
|
||||
Cvar_Get ("joypitchsensitivity", "1.0", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_yawsensitivity =
|
||||
Cvar_Get ("joyyawsensitivity", "-1.0", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_wwhack1 = Cvar_Get ("joywwhack1", "0.0", CVAR_NONE, 0, "FIXME: No Description");
|
||||
joy_wwhack2 = Cvar_Get ("joywwhack2", "0.0", CVAR_NONE, 0, "FIXME: No Description");
|
||||
|
||||
joy_debug = Cvar_Get ("joy_debug", "0.0", CVAR_NONE, 0, "FIXME: No Description");
|
||||
|
||||
joy_debug = Cvar_Get ("joy_debug", "0.0", CVAR_NONE, 0, "FIXME: No "
|
||||
"Description");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -39,9 +39,9 @@
|
|||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "QF/cmd.h"
|
||||
#include "QF/console.h"
|
||||
|
@ -54,9 +54,7 @@
|
|||
#include "compat.h"
|
||||
#include "old_keys.h"
|
||||
|
||||
/*
|
||||
key up events are sent even if in console mode
|
||||
*/
|
||||
/* key up events are sent even if in console mode */
|
||||
|
||||
cvar_t *cl_chatmode;
|
||||
cvar_t *in_bind_imt;
|
||||
|
@ -385,13 +383,12 @@ keyname_t keynames[] = {
|
|||
{ "J_BUTTON31", J_BUTTON31 },
|
||||
{ "J_BUTTON32", J_BUTTON32 },
|
||||
|
||||
|
||||
{NULL, 0}
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
LINE TYPING INTO THE CONSOLE
|
||||
LINE TYPING INTO THE CONSOLE
|
||||
*/
|
||||
|
||||
qboolean
|
||||
|
@ -473,7 +470,8 @@ Key_Console (knum_t key, short unicode)
|
|||
if (Key_Game (key, unicode))
|
||||
return;
|
||||
|
||||
if (unicode == '\x0D' || key == K_RETURN) { // backslash text are commands, else
|
||||
if (unicode == '\x0D' || key == K_RETURN) {
|
||||
// backslash text are commands, else
|
||||
if (!strncmp(key_lines[edit_line], "//", 2))
|
||||
goto no_lf;
|
||||
else if (key_lines[edit_line][1] == '\\' ||
|
||||
|
@ -532,7 +530,6 @@ no_lf:
|
|||
key_linepos--;
|
||||
return;
|
||||
}
|
||||
|
||||
if (key == K_UP) {
|
||||
do {
|
||||
history_line = (history_line - 1) & 31;
|
||||
|
@ -543,7 +540,6 @@ no_lf:
|
|||
key_linepos = strlen (key_lines[edit_line]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (key == K_DOWN) {
|
||||
if (history_line == edit_line)
|
||||
return;
|
||||
|
@ -565,7 +561,6 @@ no_lf:
|
|||
con->display -= 2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (key == K_PAGEDOWN || key == M_WHEEL_DOWN) {
|
||||
con->display += 2;
|
||||
if (con->display > con->current)
|
||||
|
@ -577,7 +572,6 @@ no_lf:
|
|||
key_linepos = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (key == K_END) {
|
||||
key_linepos = strlen (key_lines[edit_line]);
|
||||
return;
|
||||
|
@ -689,13 +683,11 @@ Key_IMTnumToString (const int imtnum)
|
|||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
Key_StringToKeynum
|
||||
Key_StringToKeynum
|
||||
|
||||
Returns a key number to be used to index keybindings[] by looking at
|
||||
the given string. Single ascii characters return themselves, while
|
||||
the K_* names are matched up.
|
||||
===================
|
||||
Returns a key number to be used to index keybindings[] by looking at
|
||||
the given string. Single ascii characters return themselves, while
|
||||
the K_* names are matched up.
|
||||
*/
|
||||
int
|
||||
Key_StringToKeynum (const char *str)
|
||||
|
@ -713,13 +705,10 @@ Key_StringToKeynum (const char *str)
|
|||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
Key_KeynumToString
|
||||
Key_KeynumToString
|
||||
|
||||
Returns a string (a K_* name) for the
|
||||
given keynum.
|
||||
FIXME: handle quote special (general escape sequence?)
|
||||
===================
|
||||
Returns a string (a K_* name) for the given keynum.
|
||||
FIXME: handle quote special (general escape sequence?)
|
||||
*/
|
||||
const char *
|
||||
Key_KeynumToString (knum_t keynum)
|
||||
|
@ -814,7 +803,8 @@ Key_In_Bind_f (void)
|
|||
c = Cmd_Argc ();
|
||||
|
||||
if (c < 3) {
|
||||
Con_Printf ("in_bind <imt> <key> [command] : attach a command to a key\n");
|
||||
Con_Printf ("in_bind <imt> <key> [command] : attach a command to a "
|
||||
"key\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -826,7 +816,8 @@ Key_In_Bind_f (void)
|
|||
cmd = cmd_buf;
|
||||
cmd_buf[0] = 0;
|
||||
for (i = 3; i < c; i++) {
|
||||
strncat (cmd_buf, Cmd_Argv (i), sizeof (cmd_buf) - strlen (cmd_buf));
|
||||
strncat (cmd_buf, Cmd_Argv (i), sizeof (cmd_buf) -
|
||||
strlen (cmd_buf));
|
||||
if (i != (c - 1))
|
||||
strncat (cmd_buf, " ", sizeof (cmd_buf) - strlen (cmd_buf));
|
||||
}
|
||||
|
@ -870,7 +861,8 @@ Key_Bind_f (void)
|
|||
cmd = cmd_buf;
|
||||
cmd_buf[0] = 0;
|
||||
for (i = 2; i < c; i++) {
|
||||
strncat (cmd_buf, Cmd_Argv (i), sizeof (cmd_buf) - strlen (cmd_buf));
|
||||
strncat (cmd_buf, Cmd_Argv (i), sizeof (cmd_buf) -
|
||||
strlen (cmd_buf));
|
||||
if (i != (c - 1))
|
||||
strncat (cmd_buf, " ", sizeof (cmd_buf) - strlen (cmd_buf));
|
||||
}
|
||||
|
@ -946,9 +938,8 @@ Key_Event (knum_t key, short unicode, qboolean down)
|
|||
keydown[key] = 0;
|
||||
|
||||
key_lastpress = key;
|
||||
//
|
||||
// handle escape specialy, so the user can never unbind it
|
||||
//
|
||||
|
||||
// handle escape specially, so the user can never unbind it
|
||||
if (unicode == '\x1b' || key == K_ESCAPE) {
|
||||
if (!down || (keydown[key] > 1))
|
||||
return;
|
||||
|
@ -969,9 +960,7 @@ Key_Event (knum_t key, short unicode, qboolean down)
|
|||
if (!down && Key_Game (key, unicode))
|
||||
return;
|
||||
|
||||
//
|
||||
// if not a consolekey, send to the interpreter no matter what mode is
|
||||
//
|
||||
// if not a consolekey, send to the interpreter no matter what mode is
|
||||
switch (key_dest) {
|
||||
case key_message:
|
||||
Key_Message (key, unicode);
|
||||
|
@ -1013,8 +1002,8 @@ Key_Init (void)
|
|||
key_linepos = 1;
|
||||
|
||||
// register our functions
|
||||
Cmd_AddCommand ("in_bind", Key_In_Bind_f,
|
||||
"Assign a command or a set of commands to a key.\n"
|
||||
Cmd_AddCommand ("in_bind", Key_In_Bind_f, "Assign a command or a set of "
|
||||
"commands to a key.\n"
|
||||
"Note: To bind multiple commands to a key, enclose the "
|
||||
"commands in quotes and separate with semi-colons.");
|
||||
Cmd_AddCommand ("in_unbind", Key_In_Unbind_f,
|
||||
|
@ -1022,9 +1011,8 @@ Key_Init (void)
|
|||
Cmd_AddCommand ("unbindall", Key_Unbindall_f,
|
||||
"Remove all binds (USE CAUTIOUSLY!!!)");
|
||||
Cmd_AddCommand ("imt", Key_InputMappingTable_f, "");
|
||||
Cmd_AddCommand ("bind", Key_Bind_f,
|
||||
"wrapper for in_bind that uses in_bind_imt for the imt "
|
||||
"parameter");
|
||||
Cmd_AddCommand ("bind", Key_Bind_f, "wrapper for in_bind that uses "
|
||||
"in_bind_imt for the imt parameter");
|
||||
Cmd_AddCommand ("unbind", Key_Unbind_f,
|
||||
"wrapper for in_unbind that uses in_bind_imt for the imt "
|
||||
"parameter");
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "QF/console.h"
|
||||
#include "QF/hash.h"
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
// must be BEFORE include gl/gl.h
|
||||
# include "winquake.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
@ -56,20 +55,20 @@
|
|||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/qtypes.h"
|
||||
|
||||
#include "QF/sys.h"
|
||||
#include "QF/GL/extensions.h"
|
||||
#include "QF/GL/funcs.h"
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "r_cvar.h"
|
||||
|
||||
/*
|
||||
ParseExtensionList
|
||||
|
||||
It takes a bit of care to be fool-proof about parsing an OpenGL extensions
|
||||
string. Don't be fooled by sub-strings, etc.
|
||||
/*
|
||||
ParseExtensionList
|
||||
|
||||
It takes a bit of care to be fool-proof about parsing an OpenGL extensions
|
||||
string. Don't be fooled by sub-strings, etc.
|
||||
*/
|
||||
qboolean
|
||||
QFGL_ParseExtensionList (const GLubyte * list, const char *name)
|
||||
|
@ -108,7 +107,6 @@ QFGL_ExtensionPresent (const char *name)
|
|||
return QFGL_ParseExtensionList (gl_extensions, name);
|
||||
}
|
||||
|
||||
|
||||
void *
|
||||
QFGL_ExtensionAddress (const char *name)
|
||||
{
|
||||
|
@ -122,7 +120,8 @@ QFGL_ExtensionAddress (const char *name)
|
|||
|
||||
#if defined(HAVE_DLOPEN)
|
||||
if (!(handle = dlopen (gl_libgl->string, RTLD_NOW))) {
|
||||
Sys_Error ("Couldn't load OpenGL library %s: %s\n", gl_libgl->string, dlerror ());
|
||||
Sys_Error ("Couldn't load OpenGL library %s: %s\n", gl_libgl->string,
|
||||
dlerror ());
|
||||
return 0;
|
||||
}
|
||||
#elif defined(_WIN32)
|
||||
|
@ -137,9 +136,11 @@ QFGL_ExtensionAddress (const char *name)
|
|||
if (glProcAddress_present && !glGetProcAddress) {
|
||||
if (QFGL_ExtensionPresent ("GLX_ARB_get_proc_address")) {
|
||||
#if defined(HAVE_GLX)
|
||||
glGetProcAddress = QFGL_ProcAddress (handle, "glXGetProcAddressARB", false);
|
||||
glGetProcAddress =
|
||||
QFGL_ProcAddress (handle, "glXGetProcAddressARB", false);
|
||||
#elif defined (_WIN32)
|
||||
glGetProcAddress = QFGL_ProcAddress (handle, "wglGetProcAddress", false);
|
||||
glGetProcAddress =
|
||||
QFGL_ProcAddress (handle, "wglGetProcAddress", false);
|
||||
#endif
|
||||
if (!glGetProcAddress)
|
||||
glProcAddress_present = false;
|
||||
|
|
|
@ -29,34 +29,33 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "compat.h"
|
||||
#include "QF/console.h"
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/qargs.h"
|
||||
#include "QF/sys.h"
|
||||
#include "QF/va.h"
|
||||
#include "QF/vid.h"
|
||||
|
||||
#include "compat.h"
|
||||
#include "view.h"
|
||||
|
||||
extern viddef_t vid; // global video state
|
||||
|
||||
/*
|
||||
Software and hardware gamma support
|
||||
*/
|
||||
/* Software and hardware gamma support */
|
||||
byte gammatable[256];
|
||||
cvar_t *vid_gamma;
|
||||
cvar_t *vid_system_gamma;
|
||||
qboolean vid_gamma_avail; // hardware gamma availability
|
||||
|
||||
/*
|
||||
Screen size
|
||||
*/
|
||||
/* Screen size */
|
||||
int scr_width, scr_height;
|
||||
cvar_t *vid_width;
|
||||
cvar_t *vid_height;
|
||||
|
||||
|
||||
void
|
||||
VID_GetWindowSize (int def_w, int def_h)
|
||||
{
|
||||
|
@ -105,9 +104,7 @@ VID_GetWindowSize (int def_w, int def_h)
|
|||
scr_height = vid.height = vid_height->int_val;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* GAMMA FUNCTIONS *
|
||||
****************************************************************************/
|
||||
/* GAMMA FUNCTIONS */
|
||||
|
||||
void
|
||||
VID_BuildGammaTable (double gamma)
|
||||
|
|
|
@ -205,7 +205,6 @@ VID_MakeColormaps (int fullbrights, byte *pal)
|
|||
VID_MakeColormap32(vid.colormap32, pal);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
VID_InitBuffers (void)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue