mirror of
https://git.code.sf.net/p/quake/nuq
synced 2025-03-26 04:30:45 +00:00
New cvar system. -svga and -x11 still compile, link and run!! :)
This commit is contained in:
parent
a6415d5601
commit
b39fa5ac8a
90 changed files with 1893 additions and 1561 deletions
|
@ -34,3 +34,5 @@ void CDAudio_Pause(void);
|
|||
void CDAudio_Resume(void);
|
||||
void CDAudio_Shutdown(void);
|
||||
void CDAudio_Update(void);
|
||||
|
||||
extern cvar_t *bgmvolume;
|
||||
|
|
|
@ -246,35 +246,35 @@ typedef struct
|
|||
//
|
||||
// cvars
|
||||
//
|
||||
extern cvar_t cl_name;
|
||||
extern cvar_t cl_color;
|
||||
extern cvar_t *cl_name;
|
||||
extern cvar_t *cl_color;
|
||||
|
||||
extern cvar_t cl_upspeed;
|
||||
extern cvar_t cl_forwardspeed;
|
||||
extern cvar_t cl_backspeed;
|
||||
extern cvar_t cl_sidespeed;
|
||||
extern cvar_t *cl_upspeed;
|
||||
extern cvar_t *cl_forwardspeed;
|
||||
extern cvar_t *cl_backspeed;
|
||||
extern cvar_t *cl_sidespeed;
|
||||
|
||||
extern cvar_t cl_movespeedkey;
|
||||
extern cvar_t *cl_movespeedkey;
|
||||
|
||||
extern cvar_t cl_yawspeed;
|
||||
extern cvar_t cl_pitchspeed;
|
||||
extern cvar_t *cl_yawspeed;
|
||||
extern cvar_t *cl_pitchspeed;
|
||||
|
||||
extern cvar_t cl_anglespeedkey;
|
||||
extern cvar_t *cl_anglespeedkey;
|
||||
|
||||
extern cvar_t cl_autofire;
|
||||
extern cvar_t *cl_autofire;
|
||||
|
||||
extern cvar_t cl_shownet;
|
||||
extern cvar_t cl_nolerp;
|
||||
extern cvar_t *cl_shownet;
|
||||
extern cvar_t *cl_nolerp;
|
||||
|
||||
extern cvar_t cl_pitchdriftspeed;
|
||||
extern cvar_t lookspring;
|
||||
extern cvar_t lookstrafe;
|
||||
extern cvar_t sensitivity;
|
||||
extern cvar_t *cl_pitchdriftspeed;
|
||||
extern cvar_t *lookspring;
|
||||
extern cvar_t *lookstrafe;
|
||||
extern cvar_t *sensitivity;
|
||||
|
||||
extern cvar_t m_pitch;
|
||||
extern cvar_t m_yaw;
|
||||
extern cvar_t m_forward;
|
||||
extern cvar_t m_side;
|
||||
extern cvar_t *m_pitch;
|
||||
extern cvar_t *m_yaw;
|
||||
extern cvar_t *m_forward;
|
||||
extern cvar_t *m_side;
|
||||
|
||||
|
||||
#define MAX_TEMP_ENTITIES 64 // lightning bolts, etc
|
||||
|
@ -300,6 +300,7 @@ dlight_t *CL_AllocDlight (int key);
|
|||
void CL_DecayLights (void);
|
||||
|
||||
void CL_Init (void);
|
||||
void CL_InitCvars (void);
|
||||
|
||||
void CL_EstablishConnection (char *host);
|
||||
void CL_Signon1 (void);
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef __cmd_h
|
||||
#define __cmd_h
|
||||
|
||||
//===========================================================================
|
||||
|
||||
|
@ -126,3 +128,4 @@ void Cmd_Print (char *text);
|
|||
// used by command functions to send output to either the graphics console or
|
||||
// passed as a print message to the client
|
||||
|
||||
#endif __cmd_h
|
||||
|
|
|
@ -186,6 +186,6 @@ byte *COM_LoadHunkFile (char *path);
|
|||
void COM_LoadCacheFile (char *path, struct cache_user_s *cu);
|
||||
|
||||
|
||||
extern struct cvar_s registered;
|
||||
extern struct cvar_s *registered;
|
||||
|
||||
extern qboolean standard_quake, rogue, hipnotic;
|
||||
|
|
122
include/cvar.h
122
include/cvar.h
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
cvar.h
|
||||
|
||||
@description@
|
||||
Configuration variable definitions and prototypes
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
|
@ -26,80 +26,102 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef _CVAR_H
|
||||
#define _CVAR_H
|
||||
|
||||
/*
|
||||
|
||||
cvar_t variables are used to hold scalar or string variables that can be changed or displayed at the console or prog code as well as accessed directly
|
||||
in C code.
|
||||
|
||||
it is sufficient to initialize a cvar_t with just the first two fields, or
|
||||
you can add a ,true flag for variables that you want saved to the configuration
|
||||
file when the game is quit:
|
||||
|
||||
cvar_t r_draworder = {"r_draworder","1"};
|
||||
cvar_t scr_screensize = {"screensize","1",true};
|
||||
|
||||
Cvars must be registered before use, or they will have a 0 value instead of the float interpretation of the string. Generally, all cvar_t declarations should be registered in the apropriate init function before any console commands are executed:
|
||||
Cvar_RegisterVariable (&host_framerate);
|
||||
|
||||
|
||||
C code usually just references a cvar in place:
|
||||
if ( r_draworder.value )
|
||||
|
||||
It could optionally ask for the value to be looked up for a string name:
|
||||
if (Cvar_VariableValue ("r_draworder"))
|
||||
|
||||
Interpreted prog code can access cvars with the cvar(name) or
|
||||
cvar_set (name, value) internal functions:
|
||||
teamplay = cvar("teamplay");
|
||||
cvar_set ("registered", "1");
|
||||
|
||||
The user can access cvars from the console in two ways:
|
||||
r_draworder prints the current value
|
||||
r_draworder 0 sets the current value to 0
|
||||
Cvars are restricted from having the same names as commands to keep this
|
||||
interface from being ambiguous.
|
||||
*/
|
||||
//#include "qtypes.h"
|
||||
//#include "quakeio.h"
|
||||
#include "cmd.h"
|
||||
|
||||
typedef struct cvar_s
|
||||
{
|
||||
char *name;
|
||||
char *string;
|
||||
qboolean archive; // set to true to cause it to be saved to vars.rc
|
||||
qboolean server; // notifies players when changed
|
||||
char *name;
|
||||
char *string;
|
||||
int flags;
|
||||
char *description; // for "help" command
|
||||
float value;
|
||||
struct cvar_s *next;
|
||||
} cvar_t;
|
||||
|
||||
void Cvar_RegisterVariable (cvar_t *variable);
|
||||
// registers a cvar that allready has the name, string, and optionally the
|
||||
// archive elements set.
|
||||
typedef struct cvar_alias_s
|
||||
{
|
||||
char *name;
|
||||
cvar_t *cvar;
|
||||
struct cvar_alias_s *next;
|
||||
} cvar_alias_t;
|
||||
|
||||
void Cvar_Set (char *var_name, char *value);
|
||||
// equivelant to "<name> <variable>" typed at the console
|
||||
#define CVAR_NONE 0
|
||||
#define CVAR_ARCHIVE 1 // set to cause it to be saved to vars.rc
|
||||
// used for system variables, not for player
|
||||
// specific configurations
|
||||
#define CVAR_USERINFO 2 // sent to server on connect or change
|
||||
#define CVAR_SERVERINFO 4 // sent in response to front end requests
|
||||
#define CVAR_SYSTEMINFO 8 // these cvars will be duplicated on all clients
|
||||
#define CVAR_INIT 16 // don't allow change from console at all,
|
||||
// but can be set from the command line
|
||||
#define CVAR_NOTIFY 32 // Will notify players when changed.
|
||||
#define CVAR_ROM 64 // display only, cannot be set by user at all
|
||||
#define CVAR_USER_CREATED 128 // created by a set command
|
||||
#define CVAR_HEAP 256 // allocated off the heap, safe to free
|
||||
#define CVAR_CHEAT 512 // can not be changed if cheats are disabled
|
||||
#define CVAR_NORESTART 1024 // do not clear when a cvar_restart is issued
|
||||
#define CVAR_LATCH 2048 // will only change when C code next does
|
||||
// a Cvar_Get(), so it can't be changed
|
||||
#define CVAR_TEMP 4096 // can be set even when cheats are
|
||||
// disabled, but is not archived
|
||||
|
||||
void Cvar_SetValue (char *var_name, float value);
|
||||
// expands value to a string and calls Cvar_Set
|
||||
// Zoid| A good CVAR_ROM example is userpath. The code should read "cvar_t
|
||||
// *fs_userpath = CvarGet("fs_userpath", ".", CVAR_ROM); The user can
|
||||
// override that with +set fs_userpath <blah> since the command line +set gets
|
||||
// created _before_ the C code for fs_basepath setup is called. The code goes
|
||||
// "look, the user made fs_basepath already", uses the users value, but sets
|
||||
// CVAR_ROM as per the call.
|
||||
|
||||
|
||||
// Returns the Cvar if found, creates it with value if not. Description and
|
||||
// flags are always updated.
|
||||
cvar_t *Cvar_Get (char *name, char *value, int cvarflags, char *description);
|
||||
|
||||
cvar_t *Cvar_FindAlias (char *alias_name);
|
||||
|
||||
void Cvar_Alias_Get (char *name, cvar_t *cvar);
|
||||
|
||||
// equivelants to "<name> <variable>" typed at the console
|
||||
void Cvar_Set (cvar_t *var, char *value);
|
||||
void Cvar_SetValue (cvar_t *var, float value);
|
||||
|
||||
// sets a CVAR_ROM variable from within the engine
|
||||
void Cvar_SetROM (cvar_t *var, char *value);
|
||||
|
||||
// allows you to change a Cvar's flags without a full Cvar_Get
|
||||
void Cvar_SetFlags (cvar_t *var, int cvarflags);
|
||||
|
||||
float Cvar_VariableValue (char *var_name);
|
||||
// returns 0 if not defined or non numeric
|
||||
float Cvar_VariableValue (char *var_name);
|
||||
|
||||
char *Cvar_VariableString (char *var_name);
|
||||
// returns an empty string if not defined
|
||||
char *Cvar_VariableString (char *var_name);
|
||||
|
||||
char *Cvar_CompleteVariable (char *partial);
|
||||
// attempts to match a partial variable name for command line completion
|
||||
// returns NULL if nothing fits
|
||||
char *Cvar_CompleteVariable (char *partial);
|
||||
|
||||
qboolean Cvar_Command (void);
|
||||
// called by Cmd_ExecuteString when Cmd_Argv(0) doesn't match a known
|
||||
// command. Returns true if the command was a variable reference that
|
||||
// was handled. (print or change)
|
||||
qboolean Cvar_Command (void);
|
||||
|
||||
void Cvar_WriteVariables (FILE *f);
|
||||
// Writes lines containing "set variable value" for all variables
|
||||
// with the archive flag set to true.
|
||||
void Cvar_WriteVariables (FILE *f);
|
||||
|
||||
// Returns a pointer to the Cvar, NULL if not found
|
||||
cvar_t *Cvar_FindVar (char *var_name);
|
||||
|
||||
void Cvar_Init();
|
||||
|
||||
void Cvar_Shutdown();
|
||||
|
||||
extern cvar_t *cvar_vars;
|
||||
|
||||
#endif // _CVAR_H
|
||||
|
|
|
@ -114,7 +114,7 @@ typedef struct
|
|||
int color;
|
||||
} zpointdesc_t;
|
||||
|
||||
extern cvar_t r_drawflat;
|
||||
extern cvar_t *r_drawflat;
|
||||
extern int d_spanpixcount;
|
||||
extern int r_framecount; // sequence # of current frame since Quake
|
||||
// started
|
||||
|
|
|
@ -62,7 +62,7 @@ typedef struct sspan_s
|
|||
int u, v, count;
|
||||
} sspan_t;
|
||||
|
||||
extern cvar_t d_subdiv16;
|
||||
extern cvar_t *d_subdiv16;
|
||||
|
||||
extern float scale_for_mip;
|
||||
|
||||
|
|
|
@ -193,39 +193,44 @@ extern int playertextures;
|
|||
|
||||
extern int skytexturenum; // index in cl.loadmodel, not gl texture object
|
||||
|
||||
extern cvar_t r_norefresh;
|
||||
extern cvar_t r_drawentities;
|
||||
extern cvar_t r_drawworld;
|
||||
extern cvar_t r_drawviewmodel;
|
||||
extern cvar_t r_speeds;
|
||||
extern cvar_t r_waterwarp;
|
||||
extern cvar_t r_fullbright;
|
||||
extern cvar_t r_lightmap;
|
||||
extern cvar_t r_shadows;
|
||||
extern cvar_t r_mirroralpha;
|
||||
extern cvar_t r_wateralpha;
|
||||
extern cvar_t r_dynamic;
|
||||
extern cvar_t r_novis;
|
||||
extern cvar_t *r_norefresh;
|
||||
extern cvar_t *r_drawentities;
|
||||
extern cvar_t *r_drawworld;
|
||||
extern cvar_t *r_drawviewmodel;
|
||||
extern cvar_t *r_speeds;
|
||||
extern cvar_t *r_waterwarp;
|
||||
extern cvar_t *r_fullbright;
|
||||
extern cvar_t *r_lightmap;
|
||||
extern cvar_t *r_shadows;
|
||||
extern cvar_t *r_mirroralpha;
|
||||
extern cvar_t *r_wateralpha;
|
||||
extern cvar_t *r_dynamic;
|
||||
extern cvar_t *r_novis;
|
||||
|
||||
extern cvar_t gl_clear;
|
||||
extern cvar_t gl_cull;
|
||||
extern cvar_t gl_poly;
|
||||
extern cvar_t gl_texsort;
|
||||
extern cvar_t gl_smoothmodels;
|
||||
extern cvar_t gl_affinemodels;
|
||||
extern cvar_t gl_polyblend;
|
||||
extern cvar_t gl_keeptjunctions;
|
||||
extern cvar_t gl_reporttjunctions;
|
||||
extern cvar_t gl_flashblend;
|
||||
extern cvar_t gl_nocolors;
|
||||
extern cvar_t gl_doubleeyes;
|
||||
extern cvar_t *gl_clear;
|
||||
extern cvar_t *gl_cull;
|
||||
extern cvar_t *gl_poly;
|
||||
extern cvar_t *gl_texsort;
|
||||
extern cvar_t *gl_smoothmodels;
|
||||
extern cvar_t *gl_affinemodels;
|
||||
extern cvar_t *gl_polyblend;
|
||||
extern cvar_t *gl_keeptjunctions;
|
||||
extern cvar_t *gl_reporttjunctions;
|
||||
extern cvar_t *gl_flashblend;
|
||||
extern cvar_t *gl_nocolors;
|
||||
extern cvar_t *gl_doubleeyes;
|
||||
|
||||
extern cvar_t *gl_ztrick;
|
||||
extern cvar_t *gl_finish;
|
||||
extern cvar_t *gl_clear;
|
||||
extern cvar_t *gl_subdivide_size;
|
||||
|
||||
extern int gl_lightmap_format;
|
||||
extern int gl_solid_format;
|
||||
extern int gl_alpha_format;
|
||||
|
||||
extern cvar_t gl_max_size;
|
||||
extern cvar_t gl_playermip;
|
||||
extern cvar_t *gl_max_size;
|
||||
extern cvar_t *gl_playermip;
|
||||
|
||||
extern int mirrortexturenum; // quake texturenum, not gltexturenum
|
||||
extern qboolean mirror;
|
||||
|
|
|
@ -189,26 +189,26 @@ extern int playertextures;
|
|||
|
||||
extern int skytexturenum; // index in cl.loadmodel, not gl texture object
|
||||
|
||||
extern cvar_t r_drawentities;
|
||||
extern cvar_t r_drawworld;
|
||||
extern cvar_t r_drawviewmodel;
|
||||
extern cvar_t r_speeds;
|
||||
extern cvar_t r_waterwarp;
|
||||
extern cvar_t r_fullbright;
|
||||
extern cvar_t r_lightmap;
|
||||
extern cvar_t r_shadows;
|
||||
extern cvar_t r_dynamic;
|
||||
extern cvar_t *r_drawentities;
|
||||
extern cvar_t *r_drawworld;
|
||||
extern cvar_t *r_drawviewmodel;
|
||||
extern cvar_t *r_speeds;
|
||||
extern cvar_t *r_waterwarp;
|
||||
extern cvar_t *r_fullbright;
|
||||
extern cvar_t *r_lightmap;
|
||||
extern cvar_t *r_shadows;
|
||||
extern cvar_t *r_dynamic;
|
||||
|
||||
extern cvar_t gl_clear;
|
||||
extern cvar_t gl_cull;
|
||||
extern cvar_t gl_poly;
|
||||
extern cvar_t gl_texsort;
|
||||
extern cvar_t gl_smoothmodels;
|
||||
extern cvar_t gl_affinemodels;
|
||||
extern cvar_t gl_fogblend;
|
||||
extern cvar_t gl_polyblend;
|
||||
extern cvar_t gl_keeptjunctions;
|
||||
extern cvar_t gl_reporttjunctions;
|
||||
extern cvar_t *gl_clear;
|
||||
extern cvar_t *gl_cull;
|
||||
extern cvar_t *gl_poly;
|
||||
extern cvar_t *gl_texsort;
|
||||
extern cvar_t *gl_smoothmodels;
|
||||
extern cvar_t *gl_affinemodels;
|
||||
extern cvar_t *gl_fogblend;
|
||||
extern cvar_t *gl_polyblend;
|
||||
extern cvar_t *gl_keeptjunctions;
|
||||
extern cvar_t *gl_reporttjunctions;
|
||||
|
||||
extern int gl_lightmap_format;
|
||||
extern int gl_solid_format;
|
||||
|
|
|
@ -215,7 +215,6 @@ extern int DEFAULTnet_hostport;
|
|||
extern int net_hostport;
|
||||
|
||||
extern int net_driverlevel;
|
||||
extern cvar_t hostname;
|
||||
extern char playername[];
|
||||
extern int playercolor;
|
||||
|
||||
|
@ -343,3 +342,13 @@ extern qboolean slistSilent;
|
|||
extern qboolean slistLocal;
|
||||
|
||||
void NET_Slist_f (void);
|
||||
|
||||
extern cvar_t *config_com_port;
|
||||
extern cvar_t *config_com_irq;
|
||||
extern cvar_t *config_com_baud;
|
||||
extern cvar_t *config_com_modem;
|
||||
extern cvar_t *config_modem_dialtype;
|
||||
extern cvar_t *config_modem_clear;
|
||||
extern cvar_t *config_modem_init;
|
||||
extern cvar_t *config_modem_hangup;
|
||||
extern cvar_t *hostname;
|
||||
|
|
|
@ -286,9 +286,11 @@ extern qboolean noclip_anglehack;
|
|||
//
|
||||
extern quakeparms_t host_parms;
|
||||
|
||||
extern cvar_t sys_ticrate;
|
||||
extern cvar_t sys_nostdout;
|
||||
extern cvar_t developer;
|
||||
extern cvar_t *sys_ticrate;
|
||||
extern cvar_t *sys_nostdout;
|
||||
extern cvar_t *developer;
|
||||
|
||||
extern cvar_t *pausable;
|
||||
|
||||
extern qboolean host_initialized; // true if into command execution
|
||||
extern double host_frametime;
|
||||
|
@ -323,7 +325,7 @@ extern int minimum_memory;
|
|||
//
|
||||
// chase
|
||||
//
|
||||
extern cvar_t chase_active;
|
||||
extern cvar_t *chase_active;
|
||||
|
||||
void Chase_Init (void);
|
||||
void Chase_Reset (void);
|
||||
|
|
|
@ -61,24 +61,24 @@ typedef struct {
|
|||
|
||||
//===========================================================================
|
||||
|
||||
extern cvar_t r_draworder;
|
||||
extern cvar_t r_speeds;
|
||||
extern cvar_t r_timegraph;
|
||||
extern cvar_t r_graphheight;
|
||||
extern cvar_t r_clearcolor;
|
||||
extern cvar_t r_waterwarp;
|
||||
extern cvar_t r_fullbright;
|
||||
extern cvar_t r_drawentities;
|
||||
extern cvar_t r_aliasstats;
|
||||
extern cvar_t r_dspeeds;
|
||||
extern cvar_t r_drawflat;
|
||||
extern cvar_t r_ambient;
|
||||
extern cvar_t r_reportsurfout;
|
||||
extern cvar_t r_maxsurfs;
|
||||
extern cvar_t r_numsurfs;
|
||||
extern cvar_t r_reportedgeout;
|
||||
extern cvar_t r_maxedges;
|
||||
extern cvar_t r_numedges;
|
||||
extern cvar_t *r_draworder;
|
||||
extern cvar_t *r_speeds;
|
||||
extern cvar_t *r_timegraph;
|
||||
extern cvar_t *r_graphheight;
|
||||
extern cvar_t *r_clearcolor;
|
||||
extern cvar_t *r_waterwarp;
|
||||
extern cvar_t *r_fullbright;
|
||||
extern cvar_t *r_drawentities;
|
||||
extern cvar_t *r_aliasstats;
|
||||
extern cvar_t *r_dspeeds;
|
||||
extern cvar_t *r_drawflat;
|
||||
extern cvar_t *r_ambient;
|
||||
extern cvar_t *r_reportsurfout;
|
||||
extern cvar_t *r_maxsurfs;
|
||||
extern cvar_t *r_numsurfs;
|
||||
extern cvar_t *r_reportedgeout;
|
||||
extern cvar_t *r_maxedges;
|
||||
extern cvar_t *r_numedges;
|
||||
|
||||
#define XCENTERING (1.0 / 2.0)
|
||||
#define YCENTERING (1.0 / 2.0)
|
||||
|
|
|
@ -61,7 +61,7 @@ extern float pixelAspect;
|
|||
|
||||
extern int r_drawnpolycount;
|
||||
|
||||
extern cvar_t r_clearcolor;
|
||||
extern cvar_t *r_clearcolor;
|
||||
|
||||
extern int sintable[SIN_BUFFER_SIZE];
|
||||
extern int intsintable[SIN_BUFFER_SIZE];
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
|
||||
void SCR_Init (void);
|
||||
void SCR_InitCvars (void);
|
||||
|
||||
void SCR_UpdateScreen (void);
|
||||
|
||||
|
@ -52,9 +53,9 @@ extern int clearnotify; // set to 0 whenever notify text is drawn
|
|||
extern qboolean scr_disabled_for_loading;
|
||||
extern qboolean scr_skipupdate;
|
||||
|
||||
extern cvar_t scr_viewsize;
|
||||
|
||||
extern cvar_t scr_viewsize;
|
||||
extern cvar_t *scr_viewsize;
|
||||
extern cvar_t *scr_fov;
|
||||
extern cvar_t *scr_viewsize;
|
||||
|
||||
// only the refresh window will be updated unless these variables are flagged
|
||||
extern int scr_copytop;
|
||||
|
|
|
@ -203,12 +203,26 @@ typedef struct client_s
|
|||
|
||||
//============================================================================
|
||||
|
||||
extern cvar_t teamplay;
|
||||
extern cvar_t skill;
|
||||
extern cvar_t deathmatch;
|
||||
extern cvar_t coop;
|
||||
extern cvar_t fraglimit;
|
||||
extern cvar_t timelimit;
|
||||
extern cvar_t *teamplay;
|
||||
extern cvar_t *skill;
|
||||
extern cvar_t *deathmatch;
|
||||
extern cvar_t *coop;
|
||||
extern cvar_t *fraglimit;
|
||||
extern cvar_t *timelimit;
|
||||
|
||||
|
||||
extern cvar_t *sv_maxvelocity;
|
||||
extern cvar_t *sv_gravity;
|
||||
extern cvar_t *sv_nostep;
|
||||
extern cvar_t *sv_friction;
|
||||
extern cvar_t *sv_edgefriction;
|
||||
extern cvar_t *sv_stopspeed;
|
||||
extern cvar_t *sv_maxspeed;
|
||||
extern cvar_t *sv_accelerate;
|
||||
extern cvar_t *sv_idealpitchscale;
|
||||
extern cvar_t *sv_aim;
|
||||
extern cvar_t *sv_friction;
|
||||
extern cvar_t *sv_stopspeed;
|
||||
|
||||
extern server_static_t svs; // persistant server info
|
||||
extern server_t sv; // local server
|
||||
|
|
|
@ -164,9 +164,9 @@ extern volatile dma_t *shm;
|
|||
extern volatile dma_t sn;
|
||||
extern vec_t sound_nominal_clip_dist;
|
||||
|
||||
extern cvar_t loadas8bit;
|
||||
extern cvar_t bgmvolume;
|
||||
extern cvar_t volume;
|
||||
extern cvar_t *loadas8bit;
|
||||
extern cvar_t *bgmvolume;
|
||||
extern cvar_t *volume;
|
||||
|
||||
extern qboolean snd_initialized;
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@ void VID_ShiftPalette (unsigned char *palette);
|
|||
// called for bonus and pain flashes, and for underwater color changes
|
||||
|
||||
void VID_Init (unsigned char *palette);
|
||||
void VID_InitCvars (void);
|
||||
// Called at startup to set up translation tables, takes 256 8 bit RGB values
|
||||
// the palette data will go away after the call, so it must be copied off if
|
||||
// the video driver will need it again
|
||||
|
|
|
@ -62,9 +62,9 @@ extern int VGA_width, VGA_height, VGA_rowbytes, VGA_bufferrowbytes;
|
|||
extern byte *VGA_pagebase;
|
||||
extern vmode_t *VGA_pcurmode;
|
||||
|
||||
extern cvar_t vid_wait;
|
||||
extern cvar_t vid_nopageflip;
|
||||
extern cvar_t _vid_wait_override;
|
||||
extern cvar_t *vid_wait;
|
||||
extern cvar_t *vid_nopageflip;
|
||||
extern cvar_t *_vid_wait_override;
|
||||
|
||||
extern unsigned char colormap256[32][256];
|
||||
|
||||
|
|
|
@ -26,14 +26,13 @@
|
|||
$Id$
|
||||
*/
|
||||
|
||||
|
||||
extern cvar_t v_gamma;
|
||||
|
||||
extern byte gammatable[256]; // palette is sent through this
|
||||
extern byte ramps[3][256];
|
||||
extern float v_blend[4];
|
||||
|
||||
extern cvar_t lcd_x;
|
||||
extern cvar_t *lcd_x;
|
||||
extern cvar_t *v_gamma;
|
||||
extern cvar_t *crosshair;
|
||||
|
||||
|
||||
void V_Init (void);
|
||||
|
|
|
@ -84,7 +84,7 @@ void IN_MouseEvent (int mstate);
|
|||
|
||||
extern qboolean winsock_lib_initialized;
|
||||
|
||||
extern cvar_t _windowed_mouse;
|
||||
extern cvar_t *_windowed_mouse;
|
||||
|
||||
extern int window_center_x, window_center_y;
|
||||
extern RECT window_rect;
|
||||
|
|
|
@ -34,8 +34,6 @@
|
|||
#include "quakedef.h"
|
||||
#include "dosisms.h"
|
||||
|
||||
extern cvar_t bgmvolume;
|
||||
|
||||
#define ADDRESS_MODE_HSG 0
|
||||
#define ADDRESS_MODE_RED_BOOK 1
|
||||
|
||||
|
@ -537,15 +535,15 @@ void CDAudio_Play(byte track, qboolean looping)
|
|||
return;
|
||||
}
|
||||
|
||||
volume = (int)(bgmvolume.value * 255.0);
|
||||
volume = (int)(bgmvolume->value * 255.0);
|
||||
if (volume < 0)
|
||||
{
|
||||
Cvar_SetValue ("bgmvolume", 0.0);
|
||||
Cvar_SetValue(bgmvolume, 0.0);
|
||||
volume = 0;
|
||||
}
|
||||
else if (volume > 255)
|
||||
{
|
||||
Cvar_SetValue ("bgmvolume", 1.0);
|
||||
Cvar_SetValue(bgmvolume, 1.0);
|
||||
volume = 255;
|
||||
}
|
||||
CDAudio_SetVolume (volume);
|
||||
|
@ -779,17 +777,17 @@ void CDAudio_Update(void)
|
|||
}
|
||||
}
|
||||
|
||||
newVolume = (int)(bgmvolume.value * 255.0);
|
||||
newVolume = (int)(bgmvolume->value * 255.0);
|
||||
if (newVolume != cdvolume)
|
||||
{
|
||||
if (newVolume < 0)
|
||||
{
|
||||
Cvar_SetValue ("bgmvolume", 0.0);
|
||||
Cvar_SetValue(bgmvolume, 0.0);
|
||||
newVolume = 0;
|
||||
}
|
||||
else if (newVolume > 255)
|
||||
{
|
||||
Cvar_SetValue ("bgmvolume", 1.0);
|
||||
Cvar_SetValue(bgmvolume, 1.0);
|
||||
newVolume = 255;
|
||||
}
|
||||
CDAudio_SetVolume (newVolume);
|
||||
|
|
|
@ -343,18 +343,18 @@ void CDAudio_Update(void)
|
|||
if (!enabled)
|
||||
return;
|
||||
|
||||
if (bgmvolume.value != cdvolume)
|
||||
if (bgmvolume->value != cdvolume)
|
||||
{
|
||||
if (cdvolume)
|
||||
{
|
||||
Cvar_SetValue ("bgmvolume", 0.0);
|
||||
cdvolume = bgmvolume.value;
|
||||
Cvar_SetValue(bgmvolume, 0.0);
|
||||
cdvolume = bgmvolume->value;
|
||||
CDAudio_Pause ();
|
||||
}
|
||||
else
|
||||
{
|
||||
Cvar_SetValue ("bgmvolume", 1.0);
|
||||
cdvolume = bgmvolume.value;
|
||||
Cvar_SetValue(bgmvolume, 1.0);
|
||||
cdvolume = bgmvolume->value;
|
||||
CDAudio_Resume ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include "quakedef.h"
|
||||
|
||||
extern HWND mainwindow;
|
||||
extern cvar_t bgmvolume;
|
||||
|
||||
static qboolean cdValid = false;
|
||||
static qboolean playing = false;
|
||||
|
@ -410,18 +409,18 @@ void CDAudio_Update(void)
|
|||
if (!enabled)
|
||||
return;
|
||||
|
||||
if (bgmvolume.value != cdvolume)
|
||||
if (bgmvolume->value != cdvolume)
|
||||
{
|
||||
if (cdvolume)
|
||||
{
|
||||
Cvar_SetValue ("bgmvolume", 0.0);
|
||||
cdvolume = bgmvolume.value;
|
||||
Cvar_SetValue(bgmvolume, 0.0);
|
||||
cdvolume = bgmvolume->value;
|
||||
CDAudio_Pause ();
|
||||
}
|
||||
else
|
||||
{
|
||||
Cvar_SetValue ("bgmvolume", 1.0);
|
||||
cdvolume = bgmvolume.value;
|
||||
Cvar_SetValue(bgmvolume, 1.0);
|
||||
cdvolume = bgmvolume->value;
|
||||
CDAudio_Resume ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,10 +34,10 @@
|
|||
|
||||
qboolean SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1, vec3_t p2, trace_t *trace);
|
||||
|
||||
cvar_t chase_back = {"chase_back", "100"};
|
||||
cvar_t chase_up = {"chase_up", "16"};
|
||||
cvar_t chase_right = {"chase_right", "0"};
|
||||
cvar_t chase_active = {"chase_active", "0"};
|
||||
cvar_t *chase_back;
|
||||
cvar_t *chase_up;
|
||||
cvar_t *chase_right;
|
||||
cvar_t *chase_active;
|
||||
|
||||
vec3_t chase_pos;
|
||||
vec3_t chase_angles;
|
||||
|
@ -48,10 +48,10 @@ vec3_t chase_dest_angles;
|
|||
|
||||
void Chase_Init (void)
|
||||
{
|
||||
Cvar_RegisterVariable (&chase_back);
|
||||
Cvar_RegisterVariable (&chase_up);
|
||||
Cvar_RegisterVariable (&chase_right);
|
||||
Cvar_RegisterVariable (&chase_active);
|
||||
chase_back = Cvar_Get("chase_back", "100", CVAR_NONE, "None");
|
||||
chase_up = Cvar_Get("chase_up", "16", CVAR_NONE, "None");
|
||||
chase_right = Cvar_Get("chase_right", "0", CVAR_NONE, "None");
|
||||
chase_active = Cvar_Get("chase_active", "0", CVAR_NONE, "None");
|
||||
}
|
||||
|
||||
void Chase_Reset (void)
|
||||
|
@ -84,9 +84,9 @@ void Chase_Update (void)
|
|||
// calc exact destination
|
||||
for (i=0 ; i<3 ; i++)
|
||||
chase_dest[i] = r_refdef.vieworg[i]
|
||||
- forward[i]*chase_back.value
|
||||
- right[i]*chase_right.value;
|
||||
chase_dest[2] = r_refdef.vieworg[2] + chase_up.value;
|
||||
- forward[i]*chase_back->value
|
||||
- right[i]*chase_right->value;
|
||||
chase_dest[2] = r_refdef.vieworg[2] + chase_up->value;
|
||||
|
||||
// find the spot the player is looking at
|
||||
VectorMA (r_refdef.vieworg, 4096, forward, dest);
|
||||
|
|
|
@ -127,7 +127,7 @@ void IN_KLookUp (void) {KeyUp(&in_klook);}
|
|||
void IN_MLookDown (void) {KeyDown(&in_mlook);}
|
||||
void IN_MLookUp (void) {
|
||||
KeyUp(&in_mlook);
|
||||
if ( !(in_mlook.state&1) && lookspring.value)
|
||||
if ( !(in_mlook.state&1) && lookspring->value)
|
||||
V_StartPitchDrift();
|
||||
}
|
||||
void IN_UpDown(void) {KeyDown(&in_up);}
|
||||
|
@ -221,17 +221,17 @@ float CL_KeyState (kbutton_t *key)
|
|||
|
||||
//==========================================================================
|
||||
|
||||
cvar_t cl_upspeed = {"cl_upspeed","200"};
|
||||
cvar_t cl_forwardspeed = {"cl_forwardspeed","200", true};
|
||||
cvar_t cl_backspeed = {"cl_backspeed","200", true};
|
||||
cvar_t cl_sidespeed = {"cl_sidespeed","350"};
|
||||
cvar_t *cl_upspeed;
|
||||
cvar_t *cl_forwardspeed;
|
||||
cvar_t *cl_backspeed;
|
||||
cvar_t *cl_sidespeed;
|
||||
|
||||
cvar_t cl_movespeedkey = {"cl_movespeedkey","2.0"};
|
||||
cvar_t *cl_movespeedkey;
|
||||
|
||||
cvar_t cl_yawspeed = {"cl_yawspeed","140"};
|
||||
cvar_t cl_pitchspeed = {"cl_pitchspeed","150"};
|
||||
cvar_t *cl_yawspeed;
|
||||
cvar_t *cl_pitchspeed;
|
||||
|
||||
cvar_t cl_anglespeedkey = {"cl_anglespeedkey","1.5"};
|
||||
cvar_t *cl_anglespeedkey;
|
||||
|
||||
|
||||
/*
|
||||
|
@ -247,28 +247,28 @@ void CL_AdjustAngles (void)
|
|||
float up, down;
|
||||
|
||||
if (in_speed.state & 1)
|
||||
speed = host_frametime * cl_anglespeedkey.value;
|
||||
speed = host_frametime * cl_anglespeedkey->value;
|
||||
else
|
||||
speed = host_frametime;
|
||||
|
||||
if (!(in_strafe.state & 1))
|
||||
{
|
||||
cl.viewangles[YAW] -= speed*cl_yawspeed.value*CL_KeyState (&in_right);
|
||||
cl.viewangles[YAW] += speed*cl_yawspeed.value*CL_KeyState (&in_left);
|
||||
cl.viewangles[YAW] -= speed*cl_yawspeed->value*CL_KeyState (&in_right);
|
||||
cl.viewangles[YAW] += speed*cl_yawspeed->value*CL_KeyState (&in_left);
|
||||
cl.viewangles[YAW] = anglemod(cl.viewangles[YAW]);
|
||||
}
|
||||
if (in_klook.state & 1)
|
||||
{
|
||||
V_StopPitchDrift ();
|
||||
cl.viewangles[PITCH] -= speed*cl_pitchspeed.value * CL_KeyState (&in_forward);
|
||||
cl.viewangles[PITCH] += speed*cl_pitchspeed.value * CL_KeyState (&in_back);
|
||||
cl.viewangles[PITCH] -= speed*cl_pitchspeed->value * CL_KeyState (&in_forward);
|
||||
cl.viewangles[PITCH] += speed*cl_pitchspeed->value * CL_KeyState (&in_back);
|
||||
}
|
||||
|
||||
up = CL_KeyState (&in_lookup);
|
||||
down = CL_KeyState(&in_lookdown);
|
||||
|
||||
cl.viewangles[PITCH] -= speed*cl_pitchspeed.value * up;
|
||||
cl.viewangles[PITCH] += speed*cl_pitchspeed.value * down;
|
||||
cl.viewangles[PITCH] -= speed*cl_pitchspeed->value * up;
|
||||
cl.viewangles[PITCH] += speed*cl_pitchspeed->value * down;
|
||||
|
||||
if (up || down)
|
||||
V_StopPitchDrift ();
|
||||
|
@ -303,20 +303,20 @@ void CL_BaseMove (usercmd_t *cmd)
|
|||
|
||||
if (in_strafe.state & 1)
|
||||
{
|
||||
cmd->sidemove += cl_sidespeed.value * CL_KeyState (&in_right);
|
||||
cmd->sidemove -= cl_sidespeed.value * CL_KeyState (&in_left);
|
||||
cmd->sidemove += cl_sidespeed->value * CL_KeyState (&in_right);
|
||||
cmd->sidemove -= cl_sidespeed->value * CL_KeyState (&in_left);
|
||||
}
|
||||
|
||||
cmd->sidemove += cl_sidespeed.value * CL_KeyState (&in_moveright);
|
||||
cmd->sidemove -= cl_sidespeed.value * CL_KeyState (&in_moveleft);
|
||||
cmd->sidemove += cl_sidespeed->value * CL_KeyState (&in_moveright);
|
||||
cmd->sidemove -= cl_sidespeed->value * CL_KeyState (&in_moveleft);
|
||||
|
||||
cmd->upmove += cl_upspeed.value * CL_KeyState (&in_up);
|
||||
cmd->upmove -= cl_upspeed.value * CL_KeyState (&in_down);
|
||||
cmd->upmove += cl_upspeed->value * CL_KeyState (&in_up);
|
||||
cmd->upmove -= cl_upspeed->value * CL_KeyState (&in_down);
|
||||
|
||||
if (! (in_klook.state & 1) )
|
||||
{
|
||||
cmd->forwardmove += cl_forwardspeed.value * CL_KeyState (&in_forward);
|
||||
cmd->forwardmove -= cl_backspeed.value * CL_KeyState (&in_back);
|
||||
cmd->forwardmove += cl_forwardspeed->value * CL_KeyState (&in_forward);
|
||||
cmd->forwardmove -= cl_backspeed->value * CL_KeyState (&in_back);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -324,9 +324,9 @@ void CL_BaseMove (usercmd_t *cmd)
|
|||
//
|
||||
if (in_speed.state & 1)
|
||||
{
|
||||
cmd->forwardmove *= cl_movespeedkey.value;
|
||||
cmd->sidemove *= cl_movespeedkey.value;
|
||||
cmd->upmove *= cl_movespeedkey.value;
|
||||
cmd->forwardmove *= cl_movespeedkey->value;
|
||||
cmd->sidemove *= cl_movespeedkey->value;
|
||||
cmd->upmove *= cl_movespeedkey->value;
|
||||
}
|
||||
|
||||
#ifdef QUAKE2
|
||||
|
|
|
@ -36,20 +36,20 @@
|
|||
// references them even when on a unix system.
|
||||
|
||||
// these two are not intended to be set directly
|
||||
cvar_t cl_name = {"_cl_name", "player", true};
|
||||
cvar_t cl_color = {"_cl_color", "0", true};
|
||||
cvar_t *cl_name;
|
||||
cvar_t *cl_color;
|
||||
|
||||
cvar_t cl_shownet = {"cl_shownet","0"}; // can be 0, 1, or 2
|
||||
cvar_t cl_nolerp = {"cl_nolerp","0"};
|
||||
cvar_t *cl_shownet;
|
||||
cvar_t *cl_nolerp;
|
||||
|
||||
cvar_t lookspring = {"lookspring","0", true};
|
||||
cvar_t lookstrafe = {"lookstrafe","0", true};
|
||||
cvar_t sensitivity = {"sensitivity","3", true};
|
||||
cvar_t *lookspring;
|
||||
cvar_t *lookstrafe;
|
||||
cvar_t *sensitivity;
|
||||
|
||||
cvar_t m_pitch = {"m_pitch","0.022", true};
|
||||
cvar_t m_yaw = {"m_yaw","0.022", true};
|
||||
cvar_t m_forward = {"m_forward","1", true};
|
||||
cvar_t m_side = {"m_side","0.8", true};
|
||||
cvar_t *m_pitch;
|
||||
cvar_t *m_yaw;
|
||||
cvar_t *m_forward;
|
||||
cvar_t *m_side;
|
||||
|
||||
|
||||
client_static_t cls;
|
||||
|
@ -64,6 +64,11 @@ dlight_t cl_dlights[MAX_DLIGHTS];
|
|||
int cl_numvisedicts;
|
||||
entity_t *cl_visedicts[MAX_VISEDICTS];
|
||||
|
||||
void
|
||||
CL_InitCvars(void)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
=====================
|
||||
CL_ClearState
|
||||
|
@ -198,10 +203,10 @@ Con_DPrintf ("CL_SignonReply: %i\n", cls.signon);
|
|||
|
||||
case 2:
|
||||
MSG_WriteByte (&cls.message, clc_stringcmd);
|
||||
MSG_WriteString (&cls.message, va("name \"%s\"\n", cl_name.string));
|
||||
MSG_WriteString (&cls.message, va("name \"%s\"\n", cl_name->string));
|
||||
|
||||
MSG_WriteByte (&cls.message, clc_stringcmd);
|
||||
MSG_WriteString (&cls.message, va("color %i %i\n", ((int)cl_color.value)>>4, ((int)cl_color.value)&15));
|
||||
MSG_WriteString (&cls.message, va("color %i %i\n", ((int)cl_color->value)>>4, ((int)cl_color->value)&15));
|
||||
|
||||
MSG_WriteByte (&cls.message, clc_stringcmd);
|
||||
sprintf (str, "spawn %s", cls.spawnparms);
|
||||
|
@ -405,7 +410,7 @@ float CL_LerpPoint (void)
|
|||
|
||||
f = cl.mtime[0] - cl.mtime[1];
|
||||
|
||||
if (!f || cl_nolerp.value || cls.timedemo || sv.active)
|
||||
if (!f || cl_nolerp->value || cls.timedemo || sv.active)
|
||||
{
|
||||
cl.time = cl.mtime[0];
|
||||
return 1;
|
||||
|
@ -618,7 +623,7 @@ void CL_RelinkEntities (void)
|
|||
|
||||
ent->forcelink = false;
|
||||
|
||||
if (i == cl.viewentity && !chase_active.value)
|
||||
if (i == cl.viewentity && !chase_active->value)
|
||||
continue;
|
||||
|
||||
#ifdef QUAKE2
|
||||
|
@ -661,7 +666,7 @@ int CL_ReadFromServer (void)
|
|||
CL_ParseServerMessage ();
|
||||
} while (ret && cls.state == ca_connected);
|
||||
|
||||
if (cl_shownet.value)
|
||||
if (cl_shownet->value)
|
||||
Con_Printf ("\n");
|
||||
|
||||
CL_RelinkEntities ();
|
||||
|
@ -735,26 +740,26 @@ void CL_Init (void)
|
|||
//
|
||||
// register our commands
|
||||
//
|
||||
Cvar_RegisterVariable (&cl_name);
|
||||
Cvar_RegisterVariable (&cl_color);
|
||||
Cvar_RegisterVariable (&cl_upspeed);
|
||||
Cvar_RegisterVariable (&cl_forwardspeed);
|
||||
Cvar_RegisterVariable (&cl_backspeed);
|
||||
Cvar_RegisterVariable (&cl_sidespeed);
|
||||
Cvar_RegisterVariable (&cl_movespeedkey);
|
||||
Cvar_RegisterVariable (&cl_yawspeed);
|
||||
Cvar_RegisterVariable (&cl_pitchspeed);
|
||||
Cvar_RegisterVariable (&cl_anglespeedkey);
|
||||
Cvar_RegisterVariable (&cl_shownet);
|
||||
Cvar_RegisterVariable (&cl_nolerp);
|
||||
Cvar_RegisterVariable (&lookspring);
|
||||
Cvar_RegisterVariable (&lookstrafe);
|
||||
Cvar_RegisterVariable (&sensitivity);
|
||||
cl_name = Cvar_Get("_cl_name", "player", CVAR_ARCHIVE, "None");
|
||||
cl_color = Cvar_Get("_cl_color", "0", CVAR_ARCHIVE, "None");
|
||||
cl_upspeed = Cvar_Get("cl_upspeed", "200", CVAR_NONE, "None");
|
||||
cl_forwardspeed = Cvar_Get("cl_forwardspeed", "200", CVAR_ARCHIVE, "None");
|
||||
cl_backspeed = Cvar_Get("cl_backspeed", "200", CVAR_ARCHIVE, "None");
|
||||
cl_sidespeed = Cvar_Get("cl_sidespeed", "350", CVAR_NONE, "None");
|
||||
cl_movespeedkey = Cvar_Get("cl_movespeedkey", "2.0", CVAR_NONE, "None");
|
||||
cl_yawspeed = Cvar_Get("cl_yawspeed", "140", CVAR_NONE, "None");
|
||||
cl_pitchspeed = Cvar_Get("cl_pitchspeed", "150", CVAR_NONE, "None");
|
||||
cl_anglespeedkey = Cvar_Get("cl_anglespeedkey", "1.5", CVAR_NONE, "None");
|
||||
cl_shownet = Cvar_Get("cl_shownet", "0", CVAR_NONE, "can be 0, 1, or 2");
|
||||
cl_nolerp = Cvar_Get("cl_nolerp", "0", CVAR_NONE, "None");
|
||||
lookspring = Cvar_Get("lookspring", "0", CVAR_ARCHIVE, "None");
|
||||
lookstrafe = Cvar_Get("lookstrafe", "0", CVAR_ARCHIVE, "None");
|
||||
sensitivity = Cvar_Get("sensitivity", "3", CVAR_ARCHIVE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&m_pitch);
|
||||
Cvar_RegisterVariable (&m_yaw);
|
||||
Cvar_RegisterVariable (&m_forward);
|
||||
Cvar_RegisterVariable (&m_side);
|
||||
m_pitch = Cvar_Get("m_pitch", "0.022", CVAR_ARCHIVE, "None");
|
||||
m_yaw = Cvar_Get("m_yaw", "0.022", CVAR_ARCHIVE, "None");
|
||||
m_forward = Cvar_Get("m_forward", "1", CVAR_ARCHIVE, "None");
|
||||
m_side = Cvar_Get("m_side", "0.8", CVAR_ARCHIVE, "None");
|
||||
|
||||
// Cvar_RegisterVariable (&cl_autofire);
|
||||
|
||||
|
|
|
@ -720,7 +720,7 @@ void CL_ParseStaticSound (void)
|
|||
}
|
||||
|
||||
|
||||
#define SHOWNET(x) if(cl_shownet.value==2)Con_Printf ("%3i:%s\n", msg_readcount-1, x);
|
||||
#define SHOWNET(x) if(cl_shownet->value==2)Con_Printf ("%3i:%s\n", msg_readcount-1, x);
|
||||
|
||||
/*
|
||||
=====================
|
||||
|
@ -735,9 +735,9 @@ void CL_ParseServerMessage (void)
|
|||
//
|
||||
// if recording demos, copy the message out
|
||||
//
|
||||
if (cl_shownet.value == 1)
|
||||
if (cl_shownet->value == 1)
|
||||
Con_Printf ("%i ",net_message.cursize);
|
||||
else if (cl_shownet.value == 2)
|
||||
else if (cl_shownet->value == 2)
|
||||
Con_Printf ("------------------\n");
|
||||
|
||||
cl.onground = false; // unless the server says otherwise
|
||||
|
|
|
@ -40,8 +40,8 @@ static char *argvdummy = " ";
|
|||
static char *safeargvs[NUM_SAFE_ARGVS] =
|
||||
{"-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse", "-dibonly"};
|
||||
|
||||
cvar_t registered = {"registered","0"};
|
||||
cvar_t cmdline = {"cmdline","0", false, true};
|
||||
cvar_t *registered;
|
||||
cvar_t *cmdline;
|
||||
|
||||
qboolean com_modified; // set true if using non-id files
|
||||
|
||||
|
@ -1050,8 +1050,8 @@ void COM_CheckRegistered (void)
|
|||
if (pop[i] != (unsigned short)BigShort (check[i]))
|
||||
Sys_Error ("Corrupted data file.");
|
||||
|
||||
Cvar_Set ("cmdline", com_cmdline);
|
||||
Cvar_Set ("registered", "1");
|
||||
Cvar_Set(cmdline, com_cmdline);
|
||||
Cvar_Set(registered, "1");
|
||||
static_registered = 1;
|
||||
Con_Printf ("Playing registered version.\n");
|
||||
}
|
||||
|
@ -1159,8 +1159,8 @@ void COM_Init (char *basedir)
|
|||
LittleFloat = FloatSwap;
|
||||
}
|
||||
|
||||
Cvar_RegisterVariable (®istered);
|
||||
Cvar_RegisterVariable (&cmdline);
|
||||
registered = Cvar_Get("registered", "0", CVAR_NONE, "None");
|
||||
cmdline = Cvar_Get("cmdline", "0", CVAR_SERVERINFO, "None");
|
||||
Cmd_AddCommand ("path", COM_Path_f);
|
||||
|
||||
COM_InitFilesystem ();
|
||||
|
|
|
@ -53,7 +53,7 @@ int con_current; // where next message will be printed
|
|||
int con_x; // offset in current line for next print
|
||||
char *con_text=0;
|
||||
|
||||
cvar_t con_notifytime = {"con_notifytime","3"}; //seconds
|
||||
cvar_t *con_notifytime;
|
||||
|
||||
#define NUM_CON_TIMES 4
|
||||
float con_times[NUM_CON_TIMES]; // realtime time the line was generated
|
||||
|
@ -247,7 +247,7 @@ void Con_Init (void)
|
|||
//
|
||||
// register our commands
|
||||
//
|
||||
Cvar_RegisterVariable (&con_notifytime);
|
||||
con_notifytime = Cvar_Get("con_notifytime", "3", CVAR_NONE, "seconds");
|
||||
|
||||
Cmd_AddCommand ("toggleconsole", Con_ToggleConsole_f);
|
||||
Cmd_AddCommand ("messagemode", Con_MessageMode_f);
|
||||
|
@ -437,7 +437,7 @@ void Con_DPrintf (char *fmt, ...)
|
|||
va_list argptr;
|
||||
char msg[MAXPRINTMSG];
|
||||
|
||||
if (!developer.value)
|
||||
if (!developer->value)
|
||||
return; // don't confuse non-developers with techie stuff...
|
||||
|
||||
va_start (argptr,fmt);
|
||||
|
@ -545,7 +545,7 @@ void Con_DrawNotify (void)
|
|||
if (time == 0)
|
||||
continue;
|
||||
time = realtime - time;
|
||||
if (time > con_notifytime.value)
|
||||
if (time > con_notifytime->value)
|
||||
continue;
|
||||
text = con_text + (i % con_totallines)*con_linewidth;
|
||||
|
||||
|
|
421
source/cvar.c
421
source/cvar.c
|
@ -1,9 +1,12 @@
|
|||
/*
|
||||
cvar.c
|
||||
|
||||
@description@
|
||||
dynamic variable tracking
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
Copyright (C) 1999,2000 Nelson Rush.
|
||||
Copyright (C) 1999,2000 contributors of the QuakeForge project
|
||||
Please see the file "AUTHORS" for a list of contributors
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -27,13 +30,27 @@
|
|||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
//#include "commdef.h"
|
||||
#include "quakedef.h"
|
||||
#include "cvar.h"
|
||||
#include "console.h"
|
||||
//#include "qargs.h"
|
||||
#include "cmd.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
cvar_t *cvar_vars;
|
||||
char *cvar_null_string = "";
|
||||
extern cvar_t *developer;
|
||||
cvar_alias_t *calias_vars;
|
||||
|
||||
/*
|
||||
============
|
||||
|
@ -43,14 +60,50 @@ Cvar_FindVar
|
|||
cvar_t *Cvar_FindVar (char *var_name)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
||||
|
||||
for (var=cvar_vars ; var ; var=var->next)
|
||||
if (!Q_strcmp (var_name, var->name))
|
||||
if (!strcmp (var_name, var->name))
|
||||
return var;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cvar_t *Cvar_FindAlias (char *alias_name)
|
||||
{
|
||||
cvar_alias_t *alias;
|
||||
|
||||
for (alias = calias_vars ; alias ; alias=alias->next)
|
||||
if (!strcmp (alias_name, alias->name))
|
||||
return alias->cvar;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Cvar_Alias_Get (char *name, cvar_t *cvar)
|
||||
{
|
||||
cvar_alias_t *alias;
|
||||
cvar_t *var;
|
||||
|
||||
if (Cmd_Exists (name))
|
||||
{
|
||||
Con_Printf ("CAlias_Get: %s is a command\n", name);
|
||||
return;
|
||||
}
|
||||
if (Cvar_FindVar(name))
|
||||
{
|
||||
Con_Printf ("CAlias_Get: tried to alias used cvar name %s\n",name);
|
||||
return;
|
||||
}
|
||||
var = Cvar_FindAlias(name);
|
||||
if (!var)
|
||||
{
|
||||
alias = (cvar_alias_t *) calloc(1, sizeof(cvar_alias_t));
|
||||
alias->next = calias_vars;
|
||||
calias_vars = alias;
|
||||
alias->name = strdup(name);
|
||||
alias->cvar = cvar;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
Cvar_VariableValue
|
||||
|
@ -59,11 +112,13 @@ Cvar_VariableValue
|
|||
float Cvar_VariableValue (char *var_name)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
||||
|
||||
var = Cvar_FindVar (var_name);
|
||||
if (!var)
|
||||
var = Cvar_FindAlias(var_name);
|
||||
if (!var)
|
||||
return 0;
|
||||
return Q_atof (var->string);
|
||||
return atof (var->string);
|
||||
}
|
||||
|
||||
|
||||
|
@ -75,8 +130,10 @@ Cvar_VariableString
|
|||
char *Cvar_VariableString (char *var_name)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
||||
|
||||
var = Cvar_FindVar (var_name);
|
||||
if (!var)
|
||||
var = Cvar_FindAlias(var_name);
|
||||
if (!var)
|
||||
return cvar_null_string;
|
||||
return var->string;
|
||||
|
@ -91,17 +148,33 @@ Cvar_CompleteVariable
|
|||
char *Cvar_CompleteVariable (char *partial)
|
||||
{
|
||||
cvar_t *cvar;
|
||||
int len;
|
||||
|
||||
len = Q_strlen(partial);
|
||||
|
||||
cvar_alias_t *alias;
|
||||
int len;
|
||||
|
||||
len = strlen(partial);
|
||||
|
||||
if (!len)
|
||||
return NULL;
|
||||
|
||||
// check functions
|
||||
|
||||
// check exact match
|
||||
for (cvar=cvar_vars ; cvar ; cvar=cvar->next)
|
||||
if (!Q_strncmp (partial,cvar->name, len))
|
||||
if (!strcasecmp (partial,cvar->name))
|
||||
return cvar->name;
|
||||
|
||||
// check aliases too :)
|
||||
for (alias=calias_vars ; alias ; alias=alias->next)
|
||||
if (!strcasecmp (partial, alias->name))
|
||||
return alias->name;
|
||||
|
||||
// check partial match
|
||||
for (cvar=cvar_vars ; cvar ; cvar=cvar->next)
|
||||
if (!strncasecmp (partial,cvar->name, len))
|
||||
return cvar->name;
|
||||
|
||||
// check aliases too :)
|
||||
for (alias=calias_vars ; alias ; alias=alias->next)
|
||||
if (!strncasecmp (partial, alias->name, len))
|
||||
return alias->name;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -112,27 +185,49 @@ char *Cvar_CompleteVariable (char *partial)
|
|||
Cvar_Set
|
||||
============
|
||||
*/
|
||||
void Cvar_Set (char *var_name, char *value)
|
||||
void Cvar_Set (cvar_t *var, char *value)
|
||||
{
|
||||
cvar_t *var;
|
||||
qboolean changed;
|
||||
|
||||
var = Cvar_FindVar (var_name);
|
||||
if (!var)
|
||||
{ // there is an error in C code if this happens
|
||||
Con_Printf ("Cvar_Set: variable %s not found\n", var_name);
|
||||
return;
|
||||
}
|
||||
int changed;
|
||||
|
||||
changed = Q_strcmp(var->string, value);
|
||||
|
||||
Z_Free (var->string); // free the old value string
|
||||
|
||||
var->string = Z_Malloc (Q_strlen(value)+1);
|
||||
Q_strcpy (var->string, value);
|
||||
var->value = Q_atof (var->string);
|
||||
if (var->server && changed)
|
||||
{
|
||||
if (!var)
|
||||
return;
|
||||
if(var->flags&CVAR_ROM)
|
||||
return;
|
||||
|
||||
changed = strcmp(var->string, value);
|
||||
free (var->string); // free the old value string
|
||||
|
||||
var->string = malloc (strlen(value)+1);
|
||||
strcpy (var->string, value);
|
||||
var->value = atof (var->string);
|
||||
|
||||
if ((var->flags & CVAR_SERVERINFO) && changed) {
|
||||
if (sv.active)
|
||||
SV_BroadcastPrintf ("\"%s\" changed to \"%s\"\n", var->name, var->string);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Cvar_SetROM
|
||||
|
||||
doesn't check for CVAR_ROM flag
|
||||
*/
|
||||
void Cvar_SetROM (cvar_t *var, char *value)
|
||||
{
|
||||
int changed;
|
||||
|
||||
if (!var)
|
||||
return;
|
||||
|
||||
changed = strcmp(var->string, value);
|
||||
free (var->string); // free the old value string
|
||||
|
||||
var->string = malloc (strlen(value)+1);
|
||||
strcpy (var->string, value);
|
||||
var->value = atof (var->string);
|
||||
|
||||
if ((var->flags & CVAR_SERVERINFO) && changed) {
|
||||
if (sv.active)
|
||||
SV_BroadcastPrintf ("\"%s\" changed to \"%s\"\n", var->name, var->string);
|
||||
}
|
||||
|
@ -143,51 +238,20 @@ void Cvar_Set (char *var_name, char *value)
|
|||
Cvar_SetValue
|
||||
============
|
||||
*/
|
||||
void Cvar_SetValue (char *var_name, float value)
|
||||
// 1999-09-07 weird cvar zeros fix by Maddes
|
||||
void Cvar_SetValue (cvar_t *var_name, float value)
|
||||
{
|
||||
char val[32];
|
||||
|
||||
sprintf (val, "%f",value);
|
||||
int i;
|
||||
|
||||
sprintf (val, "%f", value);
|
||||
for (i=strlen(val)-1 ; i>0 && val[i]=='0' && val[i-1]!='.' ; i--)
|
||||
{
|
||||
val[i] = 0;
|
||||
}
|
||||
Cvar_Set (var_name, val);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
============
|
||||
Cvar_RegisterVariable
|
||||
|
||||
Adds a freestanding variable to the variable list.
|
||||
============
|
||||
*/
|
||||
void Cvar_RegisterVariable (cvar_t *variable)
|
||||
{
|
||||
char *oldstr;
|
||||
|
||||
// first check to see if it has allready been defined
|
||||
if (Cvar_FindVar (variable->name))
|
||||
{
|
||||
Con_Printf ("Can't register variable %s, allready defined\n", variable->name);
|
||||
return;
|
||||
}
|
||||
|
||||
// check for overlap with a command
|
||||
if (Cmd_Exists (variable->name))
|
||||
{
|
||||
Con_Printf ("Cvar_RegisterVariable: %s is a command\n", variable->name);
|
||||
return;
|
||||
}
|
||||
|
||||
// copy the value off, because future sets will Z_Free it
|
||||
oldstr = variable->string;
|
||||
variable->string = Z_Malloc (Q_strlen(variable->string)+1);
|
||||
Q_strcpy (variable->string, oldstr);
|
||||
variable->value = Q_atof (variable->string);
|
||||
|
||||
// link the variable in
|
||||
variable->next = cvar_vars;
|
||||
cvar_vars = variable;
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
Cvar_Command
|
||||
|
@ -201,9 +265,11 @@ qboolean Cvar_Command (void)
|
|||
|
||||
// check variables
|
||||
v = Cvar_FindVar (Cmd_Argv(0));
|
||||
if (!v)
|
||||
v = Cvar_FindAlias (Cmd_Argv(0));
|
||||
if (!v)
|
||||
return false;
|
||||
|
||||
|
||||
// perform a variable print or set
|
||||
if (Cmd_Argc() == 1)
|
||||
{
|
||||
|
@ -211,7 +277,7 @@ qboolean Cvar_Command (void)
|
|||
return true;
|
||||
}
|
||||
|
||||
Cvar_Set (v->name, Cmd_Argv(1));
|
||||
Cvar_Set (v, Cmd_Argv(1));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -227,9 +293,210 @@ with the archive flag set to true.
|
|||
void Cvar_WriteVariables (FILE *f)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
||||
|
||||
for (var = cvar_vars ; var ; var = var->next)
|
||||
if (var->archive)
|
||||
if (var->flags&CVAR_ARCHIVE)
|
||||
fprintf (f, "%s \"%s\"\n", var->name, var->string);
|
||||
}
|
||||
|
||||
void Cvar_Set_f(void)
|
||||
{
|
||||
cvar_t *var;
|
||||
char *value;
|
||||
char *var_name;
|
||||
|
||||
if (Cmd_Argc() != 3)
|
||||
{
|
||||
Con_Printf ("usage: set <cvar> <value>\n");
|
||||
return;
|
||||
}
|
||||
var_name = Cmd_Argv (1);
|
||||
value = Cmd_Argv (2);
|
||||
var = Cvar_FindVar (var_name);
|
||||
if (!var)
|
||||
var = Cvar_FindAlias (var_name);
|
||||
if (var)
|
||||
{
|
||||
Cvar_Set (var, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
var = Cvar_Get (var_name, value, CVAR_USER_CREATED|CVAR_HEAP,
|
||||
"User created cvar");
|
||||
}
|
||||
}
|
||||
|
||||
void Cvar_Setrom_f(void)
|
||||
{
|
||||
cvar_t *var;
|
||||
char *value;
|
||||
char *var_name;
|
||||
|
||||
if (Cmd_Argc() != 2)
|
||||
{
|
||||
Con_Printf ("usage: setrom <cvar>\n");
|
||||
return;
|
||||
}
|
||||
var_name = Cmd_Argv (1);
|
||||
value = Cmd_Argv (2);
|
||||
var = Cvar_FindVar (var_name);
|
||||
if (!var)
|
||||
var = Cvar_FindAlias (var_name);
|
||||
if (var)
|
||||
{
|
||||
var->flags |= CVAR_ROM;
|
||||
}
|
||||
else
|
||||
{
|
||||
Con_Printf ("cvar %s not found\n", var_name);
|
||||
}
|
||||
}
|
||||
|
||||
void Cvar_Toggle_f (void)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
||||
if (Cmd_Argc() != 2)
|
||||
{
|
||||
Con_Printf ("toggle <cvar> : toggle a cvar on/off\n");
|
||||
return;
|
||||
}
|
||||
|
||||
var = Cvar_FindVar (Cmd_Argv(1));
|
||||
if (!var)
|
||||
var = Cvar_FindAlias(Cmd_Argv(1));
|
||||
if (!var)
|
||||
{
|
||||
Con_Printf ("Unknown variable \"%s\"\n", Cmd_Argv(1));
|
||||
return;
|
||||
}
|
||||
|
||||
Cvar_Set (var, var->value ? "0" : "1");
|
||||
}
|
||||
|
||||
void Cvar_Help_f (void)
|
||||
{
|
||||
char *var_name;
|
||||
cvar_t *var;
|
||||
|
||||
if (Cmd_Argc() != 2)
|
||||
{
|
||||
Con_Printf ("usage: help <cvar>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
var_name = Cmd_Argv (1);
|
||||
var = Cvar_FindVar (var_name);
|
||||
if (!var)
|
||||
var = Cvar_FindAlias (var_name);
|
||||
if (var)
|
||||
{
|
||||
Con_Printf ("%s\n",var->description);
|
||||
return;
|
||||
}
|
||||
Con_Printf ("variable not found\n");
|
||||
}
|
||||
|
||||
void Cvar_CvarList_f (void)
|
||||
{
|
||||
cvar_t *var;
|
||||
int i;
|
||||
|
||||
for (var=cvar_vars, i=0 ; var ; var=var->next, i++)
|
||||
{
|
||||
Con_Printf("%s\n",var->name);
|
||||
}
|
||||
Con_Printf ("------------\n%d variables\n", i);
|
||||
}
|
||||
|
||||
void Cvar_Init()
|
||||
{
|
||||
developer = Cvar_Get ("developer","0",0,"None");
|
||||
|
||||
Cmd_AddCommand ("set", Cvar_Set_f);
|
||||
Cmd_AddCommand ("setrom", Cvar_Setrom_f);
|
||||
Cmd_AddCommand ("toggle", Cvar_Toggle_f);
|
||||
Cmd_AddCommand ("help",Cvar_Help_f);
|
||||
Cmd_AddCommand ("cvarlist",Cvar_CvarList_f);
|
||||
}
|
||||
|
||||
void Cvar_Shutdown (void)
|
||||
{
|
||||
cvar_t *var,*next;
|
||||
cvar_alias_t *alias,*nextalias;
|
||||
|
||||
// Free cvars
|
||||
var = cvar_vars;
|
||||
while(var)
|
||||
{
|
||||
next = var->next;
|
||||
free(var->description);
|
||||
free(var->string);
|
||||
free(var->name);
|
||||
free(var);
|
||||
var = next;
|
||||
}
|
||||
// Free aliases
|
||||
alias = calias_vars;
|
||||
while(alias)
|
||||
{
|
||||
nextalias = alias->next;
|
||||
free(alias->name);
|
||||
free(alias);
|
||||
alias = nextalias;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cvar_t *Cvar_Get(char *name, char *string, int cvarflags, char *description)
|
||||
{
|
||||
|
||||
cvar_t *v;
|
||||
|
||||
if (Cmd_Exists (name))
|
||||
{
|
||||
Con_Printf ("Cvar_Get: %s is a command\n",name);
|
||||
return NULL;
|
||||
}
|
||||
v = Cvar_FindVar(name);
|
||||
if (!v)
|
||||
{
|
||||
v = (cvar_t *) calloc(1, sizeof(cvar_t));
|
||||
// Cvar doesn't exist, so we create it
|
||||
v->next = cvar_vars;
|
||||
cvar_vars = v;
|
||||
v->name = strdup(name);
|
||||
v->string = malloc (strlen(string)+1);
|
||||
strcpy (v->string, string);
|
||||
v->flags = cvarflags;
|
||||
v->description = strdup(description);
|
||||
v->value = atof (v->string);
|
||||
return v;
|
||||
}
|
||||
// Cvar does exist, so we update the flags and return.
|
||||
v->flags ^= CVAR_USER_CREATED;
|
||||
v->flags ^= CVAR_HEAP;
|
||||
v->flags |= cvarflags;
|
||||
if (!strcmp (v->description,"User created cvar"))
|
||||
{
|
||||
// Set with the real description
|
||||
free(v->description);
|
||||
v->description = strdup (description);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
/*
|
||||
Cvar_SetFlags
|
||||
|
||||
sets a Cvar's flags simply and easily
|
||||
*/
|
||||
void
|
||||
Cvar_SetFlags (cvar_t *var, int cvarflags)
|
||||
{
|
||||
if (var == NULL)
|
||||
return;
|
||||
|
||||
var->flags = cvarflags;
|
||||
}
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ void D_DrawSurfaces (void)
|
|||
VectorCopy (transformed_modelorg, world_transformed_modelorg);
|
||||
|
||||
// TODO: could preset a lot of this at mode set time
|
||||
if (r_drawflat.value)
|
||||
if (r_drawflat->value)
|
||||
{
|
||||
for (s = &surfaces[1] ; s<surface_p ; s++)
|
||||
{
|
||||
|
@ -241,7 +241,7 @@ void D_DrawSurfaces (void)
|
|||
d_zistepv = 0;
|
||||
d_ziorigin = -0.9;
|
||||
|
||||
D_DrawSolidSurface (s, (int)r_clearcolor.value & 0xFF);
|
||||
D_DrawSolidSurface (s, (int)r_clearcolor->value & 0xFF);
|
||||
D_DrawZSpans (s->spans);
|
||||
}
|
||||
else if (s->flags & SURF_DRAWTURB)
|
||||
|
|
|
@ -35,9 +35,9 @@
|
|||
|
||||
#define NUM_MIPS 4
|
||||
|
||||
cvar_t d_subdiv16 = {"d_subdiv16", "1"};
|
||||
cvar_t d_mipcap = {"d_mipcap", "0"};
|
||||
cvar_t d_mipscale = {"d_mipscale", "1"};
|
||||
cvar_t *d_subdiv16;
|
||||
cvar_t *d_mipcap;
|
||||
cvar_t *d_mipscale;
|
||||
|
||||
surfcache_t *d_initial_rover;
|
||||
qboolean d_roverwrapped;
|
||||
|
@ -61,9 +61,9 @@ void D_Init (void)
|
|||
|
||||
r_skydirect = 1;
|
||||
|
||||
Cvar_RegisterVariable (&d_subdiv16);
|
||||
Cvar_RegisterVariable (&d_mipcap);
|
||||
Cvar_RegisterVariable (&d_mipscale);
|
||||
d_subdiv16 = Cvar_Get("d_subdiv16", "1", CVAR_NONE, "None");
|
||||
d_mipcap = Cvar_Get("d_mipcap", "0", CVAR_NONE, "None");
|
||||
d_mipscale = Cvar_Get("d_mipscale", "1", CVAR_NONE, "None");
|
||||
|
||||
r_drawpolys = false;
|
||||
r_worldpolysbacktofront = false;
|
||||
|
@ -147,17 +147,17 @@ void D_SetupFrame (void)
|
|||
d_roverwrapped = false;
|
||||
d_initial_rover = sc_rover;
|
||||
|
||||
d_minmip = d_mipcap.value;
|
||||
d_minmip = d_mipcap->value;
|
||||
if (d_minmip > 3)
|
||||
d_minmip = 3;
|
||||
else if (d_minmip < 0)
|
||||
d_minmip = 0;
|
||||
|
||||
for (i=0 ; i<(NUM_MIPS-1) ; i++)
|
||||
d_scalemip[i] = basemip[i] * d_mipscale.value;
|
||||
d_scalemip[i] = basemip[i] * d_mipscale->value;
|
||||
|
||||
#ifdef USE_INTEL_ASM
|
||||
if (d_subdiv16.value)
|
||||
if (d_subdiv16->value)
|
||||
d_drawspans = D_DrawSpans16;
|
||||
else
|
||||
d_drawspans = D_DrawSpans8;
|
||||
|
|
|
@ -36,9 +36,9 @@
|
|||
|
||||
extern unsigned char d_15to8table[65536];
|
||||
|
||||
cvar_t gl_nobind = {"gl_nobind", "0"};
|
||||
cvar_t gl_max_size = {"gl_max_size", "1024"};
|
||||
cvar_t gl_picmip = {"gl_picmip", "0"};
|
||||
cvar_t *gl_nobind;
|
||||
cvar_t *gl_max_size;
|
||||
cvar_t *gl_picmip;
|
||||
|
||||
byte *draw_chars; // 8*8 graphic characters
|
||||
qpic_t *draw_disc;
|
||||
|
@ -81,7 +81,7 @@ int numgltextures;
|
|||
|
||||
void GL_Bind (int texnum)
|
||||
{
|
||||
if (gl_nobind.value)
|
||||
if (gl_nobind->value)
|
||||
texnum = char_texture;
|
||||
if (currenttexture == texnum)
|
||||
return;
|
||||
|
@ -387,14 +387,14 @@ void Draw_Init (void)
|
|||
int f, fstep;
|
||||
|
||||
|
||||
Cvar_RegisterVariable (&gl_nobind);
|
||||
Cvar_RegisterVariable (&gl_max_size);
|
||||
Cvar_RegisterVariable (&gl_picmip);
|
||||
gl_nobind = Cvar_Get("gl_nobind", "0", CVAR_NONE, "None");
|
||||
gl_max_size = Cvar_Get("gl_max_size", "1024", CVAR_NONE, "None");
|
||||
gl_picmip = Cvar_Get("gl_picmip", "0", CVAR_NONE, "None");
|
||||
|
||||
// 3dfx can only handle 256 wide textures
|
||||
if (!Q_strncasecmp ((char *)gl_renderer, "3dfx",4) ||
|
||||
strstr((char *)gl_renderer, "Glide"))
|
||||
Cvar_Set ("gl_max_size", "256");
|
||||
Cvar_Set(gl_max_size, "256");
|
||||
|
||||
Cmd_AddCommand ("gl_texturemode", &Draw_TextureMode_f);
|
||||
|
||||
|
@ -1021,13 +1021,13 @@ static unsigned scaled[1024*512]; // [512*256];
|
|||
for (scaled_height = 1 ; scaled_height < height ; scaled_height<<=1)
|
||||
;
|
||||
|
||||
scaled_width >>= (int)gl_picmip.value;
|
||||
scaled_height >>= (int)gl_picmip.value;
|
||||
scaled_width >>= (int)gl_picmip->value;
|
||||
scaled_height >>= (int)gl_picmip->value;
|
||||
|
||||
if (scaled_width > gl_max_size.value)
|
||||
scaled_width = gl_max_size.value;
|
||||
if (scaled_height > gl_max_size.value)
|
||||
scaled_height = gl_max_size.value;
|
||||
if (scaled_width > gl_max_size->value)
|
||||
scaled_width = gl_max_size->value;
|
||||
if (scaled_height > gl_max_size->value)
|
||||
scaled_height = gl_max_size->value;
|
||||
|
||||
if (scaled_width * scaled_height > sizeof(scaled)/4)
|
||||
Sys_Error ("GL_LoadTexture: too big");
|
||||
|
@ -1125,13 +1125,13 @@ void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboole
|
|||
for (scaled_height = 1 ; scaled_height < height ; scaled_height<<=1)
|
||||
;
|
||||
|
||||
scaled_width >>= (int)gl_picmip.value;
|
||||
scaled_height >>= (int)gl_picmip.value;
|
||||
scaled_width >>= (int)gl_picmip->value;
|
||||
scaled_height >>= (int)gl_picmip->value;
|
||||
|
||||
if (scaled_width > gl_max_size.value)
|
||||
scaled_width = gl_max_size.value;
|
||||
if (scaled_height > gl_max_size.value)
|
||||
scaled_height = gl_max_size.value;
|
||||
if (scaled_width > gl_max_size->value)
|
||||
scaled_width = gl_max_size->value;
|
||||
if (scaled_height > gl_max_size->value)
|
||||
scaled_height = gl_max_size->value;
|
||||
|
||||
if (scaled_width * scaled_height > sizeof(scaled))
|
||||
Sys_Error ("GL_LoadTexture: too big");
|
||||
|
|
|
@ -46,7 +46,7 @@ byte mod_novis[MAX_MAP_LEAFS/8];
|
|||
model_t mod_known[MAX_MOD_KNOWN];
|
||||
int mod_numknown;
|
||||
|
||||
cvar_t gl_subdivide_size = {"gl_subdivide_size", "128", true};
|
||||
cvar_t *gl_subdivide_size;
|
||||
|
||||
/*
|
||||
===============
|
||||
|
@ -55,7 +55,7 @@ Mod_Init
|
|||
*/
|
||||
void Mod_Init (void)
|
||||
{
|
||||
Cvar_RegisterVariable (&gl_subdivide_size);
|
||||
gl_subdivide_size = Cvar_Get("gl_subdivide_size", "128", CVAR_ARCHIVE, "None");
|
||||
memset (mod_novis, 0xff, sizeof(mod_novis));
|
||||
}
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ void R_RenderDlights (void)
|
|||
int i;
|
||||
dlight_t *l;
|
||||
|
||||
if (!gl_flashblend.value)
|
||||
if (!gl_flashblend->value)
|
||||
return;
|
||||
|
||||
r_dlightframecount = r_framecount + 1; // because the count hasn't
|
||||
|
@ -217,7 +217,7 @@ void R_PushDlights (void)
|
|||
int i;
|
||||
dlight_t *l;
|
||||
|
||||
if (gl_flashblend.value)
|
||||
if (gl_flashblend->value)
|
||||
return;
|
||||
|
||||
r_dlightframecount = r_framecount + 1; // because the count hasn't
|
||||
|
|
|
@ -84,33 +84,31 @@ int d_lightstylevalue[256]; // 8.8 fraction of base light value
|
|||
|
||||
void R_MarkLeaves (void);
|
||||
|
||||
cvar_t r_norefresh = {"r_norefresh","0"};
|
||||
cvar_t r_drawentities = {"r_drawentities","1"};
|
||||
cvar_t r_drawviewmodel = {"r_drawviewmodel","1"};
|
||||
cvar_t r_speeds = {"r_speeds","0"};
|
||||
cvar_t r_fullbright = {"r_fullbright","0"};
|
||||
cvar_t r_lightmap = {"r_lightmap","0"};
|
||||
cvar_t r_shadows = {"r_shadows","0"};
|
||||
cvar_t r_mirroralpha = {"r_mirroralpha","1"};
|
||||
cvar_t r_wateralpha = {"r_wateralpha","1"};
|
||||
cvar_t r_dynamic = {"r_dynamic","1"};
|
||||
cvar_t r_novis = {"r_novis","0"};
|
||||
cvar_t *r_norefresh;
|
||||
cvar_t *r_drawentities;
|
||||
cvar_t *r_drawviewmodel;
|
||||
cvar_t *r_speeds;
|
||||
cvar_t *r_fullbright;
|
||||
cvar_t *r_lightmap;
|
||||
cvar_t *r_shadows;
|
||||
cvar_t *r_mirroralpha;
|
||||
cvar_t *r_wateralpha;
|
||||
cvar_t *r_dynamic;
|
||||
cvar_t *r_novis;
|
||||
|
||||
cvar_t gl_finish = {"gl_finish","0"};
|
||||
cvar_t gl_clear = {"gl_clear","0"};
|
||||
cvar_t gl_cull = {"gl_cull","1"};
|
||||
cvar_t gl_texsort = {"gl_texsort","1"};
|
||||
cvar_t gl_smoothmodels = {"gl_smoothmodels","1"};
|
||||
cvar_t gl_affinemodels = {"gl_affinemodels","0"};
|
||||
cvar_t gl_polyblend = {"gl_polyblend","1"};
|
||||
cvar_t gl_flashblend = {"gl_flashblend","1"};
|
||||
cvar_t gl_playermip = {"gl_playermip","0"};
|
||||
cvar_t gl_nocolors = {"gl_nocolors","0"};
|
||||
cvar_t gl_keeptjunctions = {"gl_keeptjunctions","0"};
|
||||
cvar_t gl_reporttjunctions = {"gl_reporttjunctions","0"};
|
||||
cvar_t gl_doubleeyes = {"gl_doubleeys", "1"};
|
||||
|
||||
extern cvar_t gl_ztrick;
|
||||
cvar_t *gl_finish;
|
||||
cvar_t *gl_clear;
|
||||
cvar_t *gl_cull;
|
||||
cvar_t *gl_texsort;
|
||||
cvar_t *gl_smoothmodels;
|
||||
cvar_t *gl_affinemodels;
|
||||
cvar_t *gl_polyblend;
|
||||
cvar_t *gl_flashblend;
|
||||
cvar_t *gl_playermip;
|
||||
cvar_t *gl_nocolors;
|
||||
cvar_t *gl_keeptjunctions;
|
||||
cvar_t *gl_reporttjunctions;
|
||||
cvar_t *gl_doubleeyes;
|
||||
|
||||
/*
|
||||
=================
|
||||
|
@ -549,7 +547,7 @@ void R_DrawAliasModel (entity_t *e)
|
|||
glPushMatrix ();
|
||||
R_RotateForEntity (e);
|
||||
|
||||
if (!strcmp (clmodel->name, "progs/eyes.mdl") && gl_doubleeyes.value) {
|
||||
if (!strcmp (clmodel->name, "progs/eyes.mdl") && gl_doubleeyes->value) {
|
||||
glTranslatef (paliashdr->scale_origin[0], paliashdr->scale_origin[1], paliashdr->scale_origin[2] - (22 + 8));
|
||||
// double size of eyes, since they are really hard to see in gl
|
||||
glScalef (paliashdr->scale[0]*2, paliashdr->scale[1]*2, paliashdr->scale[2]*2);
|
||||
|
@ -563,18 +561,18 @@ void R_DrawAliasModel (entity_t *e)
|
|||
|
||||
// we can't dynamically colormap textures, so they are cached
|
||||
// seperately for the players. Heads are just uncolored.
|
||||
if (currententity->colormap != vid.colormap && !gl_nocolors.value)
|
||||
if (currententity->colormap != vid.colormap && !gl_nocolors->value)
|
||||
{
|
||||
i = currententity - cl_entities;
|
||||
if (i >= 1 && i<=cl.maxclients /* && !strcmp (currententity->model->name, "progs/player.mdl") */)
|
||||
GL_Bind(playertextures - 1 + i);
|
||||
}
|
||||
|
||||
if (gl_smoothmodels.value)
|
||||
if (gl_smoothmodels->value)
|
||||
glShadeModel (GL_SMOOTH);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
if (gl_affinemodels.value)
|
||||
if (gl_affinemodels->value)
|
||||
glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
|
||||
|
||||
R_SetupAliasFrame (currententity->frame, paliashdr);
|
||||
|
@ -582,12 +580,12 @@ void R_DrawAliasModel (entity_t *e)
|
|||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
|
||||
glShadeModel (GL_FLAT);
|
||||
if (gl_affinemodels.value)
|
||||
if (gl_affinemodels->value)
|
||||
glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
|
||||
|
||||
glPopMatrix ();
|
||||
|
||||
if (r_shadows.value)
|
||||
if (r_shadows->value)
|
||||
{
|
||||
glPushMatrix ();
|
||||
R_RotateForEntity (e);
|
||||
|
@ -614,7 +612,7 @@ void R_DrawEntitiesOnList (void)
|
|||
{
|
||||
int i;
|
||||
|
||||
if (!r_drawentities.value)
|
||||
if (!r_drawentities->value)
|
||||
return;
|
||||
|
||||
// draw sprites seperately, because of alpha blending
|
||||
|
@ -665,16 +663,16 @@ void R_DrawViewModel (void)
|
|||
dlight_t *dl;
|
||||
int ambientlight, shadelight;
|
||||
|
||||
if (!r_drawviewmodel.value)
|
||||
if (!r_drawviewmodel->value)
|
||||
return;
|
||||
|
||||
if (chase_active.value)
|
||||
if (chase_active->value)
|
||||
return;
|
||||
|
||||
if (envmap)
|
||||
return;
|
||||
|
||||
if (!r_drawentities.value)
|
||||
if (!r_drawentities->value)
|
||||
return;
|
||||
|
||||
if (cl.items & IT_INVISIBILITY)
|
||||
|
@ -728,7 +726,7 @@ R_PolyBlend
|
|||
*/
|
||||
void R_PolyBlend (void)
|
||||
{
|
||||
if (!gl_polyblend.value)
|
||||
if (!gl_polyblend->value)
|
||||
return;
|
||||
if (!v_blend[3])
|
||||
return;
|
||||
|
@ -826,7 +824,7 @@ void R_SetupFrame (void)
|
|||
|
||||
// don't allow cheats in multiplayer
|
||||
if (cl.maxclients > 1)
|
||||
Cvar_Set ("r_fullbright", "0");
|
||||
Cvar_Set(r_fullbright, "0");
|
||||
|
||||
R_AnimateLight ();
|
||||
|
||||
|
@ -940,7 +938,7 @@ void R_SetupGL (void)
|
|||
//
|
||||
// set drawing parms
|
||||
//
|
||||
if (gl_cull.value)
|
||||
if (gl_cull->value)
|
||||
glEnable(GL_CULL_FACE);
|
||||
else
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
@ -993,9 +991,9 @@ R_Clear
|
|||
*/
|
||||
void R_Clear (void)
|
||||
{
|
||||
if (r_mirroralpha.value != 1.0)
|
||||
if (r_mirroralpha->value != 1.0)
|
||||
{
|
||||
if (gl_clear.value)
|
||||
if (gl_clear->value)
|
||||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
else
|
||||
glClear (GL_DEPTH_BUFFER_BIT);
|
||||
|
@ -1003,11 +1001,11 @@ void R_Clear (void)
|
|||
gldepthmax = 0.5;
|
||||
glDepthFunc (GL_LEQUAL);
|
||||
}
|
||||
else if (gl_ztrick.value)
|
||||
else if (gl_ztrick->value)
|
||||
{
|
||||
static int trickframe;
|
||||
|
||||
if (gl_clear.value)
|
||||
if (gl_clear->value)
|
||||
glClear (GL_COLOR_BUFFER_BIT);
|
||||
|
||||
trickframe++;
|
||||
|
@ -1026,7 +1024,7 @@ void R_Clear (void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (gl_clear.value)
|
||||
if (gl_clear->value)
|
||||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
else
|
||||
glClear (GL_DEPTH_BUFFER_BIT);
|
||||
|
@ -1096,7 +1094,7 @@ void R_Mirror (void)
|
|||
|
||||
glLoadMatrixf (r_base_world_matrix);
|
||||
|
||||
glColor4f (1,1,1,r_mirroralpha.value);
|
||||
glColor4f (1,1,1,r_mirroralpha->value);
|
||||
s = cl.worldmodel->textures[mirrortexturenum]->texturechain;
|
||||
for ( ; s ; s=s->texturechain)
|
||||
R_RenderBrushPoly (s);
|
||||
|
@ -1117,13 +1115,13 @@ void R_RenderView (void)
|
|||
double time1, time2;
|
||||
GLfloat colors[4] = {(GLfloat) 0.0, (GLfloat) 0.0, (GLfloat) 1, (GLfloat) 0.20};
|
||||
|
||||
if (r_norefresh.value)
|
||||
if (r_norefresh->value)
|
||||
return;
|
||||
|
||||
if (!r_worldentity.model || !cl.worldmodel)
|
||||
Sys_Error ("R_RenderView: NULL worldmodel");
|
||||
|
||||
if (r_speeds.value)
|
||||
if (r_speeds->value)
|
||||
{
|
||||
glFinish ();
|
||||
time1 = Sys_DoubleTime ();
|
||||
|
@ -1133,7 +1131,7 @@ void R_RenderView (void)
|
|||
|
||||
mirror = false;
|
||||
|
||||
if (gl_finish.value)
|
||||
if (gl_finish->value)
|
||||
glFinish ();
|
||||
|
||||
R_Clear ();
|
||||
|
@ -1161,7 +1159,7 @@ void R_RenderView (void)
|
|||
|
||||
R_PolyBlend ();
|
||||
|
||||
if (r_speeds.value)
|
||||
if (r_speeds->value)
|
||||
{
|
||||
// glFinish ();
|
||||
time2 = Sys_DoubleTime ();
|
||||
|
|
|
@ -182,43 +182,42 @@ R_Init
|
|||
void R_Init (void)
|
||||
{
|
||||
extern byte *hunk_base;
|
||||
extern cvar_t gl_finish;
|
||||
|
||||
Cmd_AddCommand ("timerefresh", R_TimeRefresh_f);
|
||||
Cmd_AddCommand ("envmap", R_Envmap_f);
|
||||
Cmd_AddCommand ("pointfile", R_ReadPointFile_f);
|
||||
|
||||
Cvar_RegisterVariable (&r_norefresh);
|
||||
Cvar_RegisterVariable (&r_lightmap);
|
||||
Cvar_RegisterVariable (&r_fullbright);
|
||||
Cvar_RegisterVariable (&r_drawentities);
|
||||
Cvar_RegisterVariable (&r_drawviewmodel);
|
||||
Cvar_RegisterVariable (&r_shadows);
|
||||
Cvar_RegisterVariable (&r_mirroralpha);
|
||||
Cvar_RegisterVariable (&r_wateralpha);
|
||||
Cvar_RegisterVariable (&r_dynamic);
|
||||
Cvar_RegisterVariable (&r_novis);
|
||||
Cvar_RegisterVariable (&r_speeds);
|
||||
r_norefresh = Cvar_Get("r_norefresh", "0", CVAR_NONE, "None");
|
||||
r_lightmap = Cvar_Get("r_lightmap", "0", CVAR_NONE, "None");
|
||||
r_fullbright = Cvar_Get("r_fullbright", "0", CVAR_NONE, "None");
|
||||
r_drawentities = Cvar_Get("r_drawentities", "1", CVAR_NONE, "None");
|
||||
r_drawviewmodel = Cvar_Get("r_drawviewmodel", "1", CVAR_NONE, "None");
|
||||
r_shadows = Cvar_Get("r_shadows", "0", CVAR_NONE, "None");
|
||||
r_mirroralpha = Cvar_Get("r_mirroralpha", "1", CVAR_NONE, "None");
|
||||
r_wateralpha = Cvar_Get("r_wateralpha", "1", CVAR_NONE, "None");
|
||||
r_dynamic = Cvar_Get("r_dynamic", "1", CVAR_NONE, "None");
|
||||
r_novis = Cvar_Get("r_novis", "0", CVAR_NONE, "None");
|
||||
r_speeds = Cvar_Get("r_speeds", "0", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&gl_finish);
|
||||
Cvar_RegisterVariable (&gl_clear);
|
||||
Cvar_RegisterVariable (&gl_texsort);
|
||||
gl_finish = Cvar_Get("gl_finish", "0", CVAR_NONE, "None");
|
||||
gl_clear = Cvar_Get("gl_clear", "0", CVAR_NONE, "None");
|
||||
gl_texsort = Cvar_Get("gl_texsort", "1", CVAR_NONE, "None");
|
||||
|
||||
if (gl_mtexable)
|
||||
Cvar_SetValue ("gl_texsort", 0.0);
|
||||
Cvar_SetValue(gl_texsort, 0.0);
|
||||
|
||||
Cvar_RegisterVariable (&gl_cull);
|
||||
Cvar_RegisterVariable (&gl_smoothmodels);
|
||||
Cvar_RegisterVariable (&gl_affinemodels);
|
||||
Cvar_RegisterVariable (&gl_polyblend);
|
||||
Cvar_RegisterVariable (&gl_flashblend);
|
||||
Cvar_RegisterVariable (&gl_playermip);
|
||||
Cvar_RegisterVariable (&gl_nocolors);
|
||||
gl_cull = Cvar_Get("gl_cull", "1", CVAR_NONE, "None");
|
||||
gl_smoothmodels = Cvar_Get("gl_smoothmodels", "1", CVAR_NONE, "None");
|
||||
gl_affinemodels = Cvar_Get("gl_affinemodels", "0", CVAR_NONE, "None");
|
||||
gl_polyblend = Cvar_Get("gl_polyblend", "1", CVAR_NONE, "None");
|
||||
gl_flashblend = Cvar_Get("gl_flashblend", "1", CVAR_NONE, "None");
|
||||
gl_playermip = Cvar_Get("gl_playermip", "0", CVAR_NONE, "None");
|
||||
gl_nocolors = Cvar_Get("gl_nocolors", "0", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&gl_keeptjunctions);
|
||||
Cvar_RegisterVariable (&gl_reporttjunctions);
|
||||
gl_keeptjunctions = Cvar_Get("gl_keeptjunctions", "0", CVAR_NONE, "None");
|
||||
gl_reporttjunctions = Cvar_Get("gl_reporttjunctions", "0", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&gl_doubleeyes);
|
||||
gl_doubleeyes = Cvar_Get("gl_doubleeys", "1", CVAR_NONE, "None");
|
||||
|
||||
R_InitParticles ();
|
||||
R_InitParticleTexture ();
|
||||
|
@ -317,12 +316,12 @@ void R_TranslatePlayerSkin (int playernum)
|
|||
// don't mipmap these, because it takes too long
|
||||
GL_Upload8 (translated, paliashdr->skinwidth, paliashdr->skinheight, false, false, true);
|
||||
#else
|
||||
scaled_width = gl_max_size.value < 512 ? gl_max_size.value : 512;
|
||||
scaled_height = gl_max_size.value < 256 ? gl_max_size.value : 256;
|
||||
scaled_width = gl_max_size->value < 512 ? gl_max_size->value : 512;
|
||||
scaled_height = gl_max_size->value < 256 ? gl_max_size->value : 256;
|
||||
|
||||
// allow users to crunch sizes down even more if they want
|
||||
scaled_width >>= (int)gl_playermip.value;
|
||||
scaled_height >>= (int)gl_playermip.value;
|
||||
scaled_width >>= (int)gl_playermip->value;
|
||||
scaled_height >>= (int)gl_playermip->value;
|
||||
|
||||
if (VID_Is8bit()) { // 8bit texture upload
|
||||
byte *out2;
|
||||
|
|
|
@ -165,7 +165,7 @@ void R_BuildLightMap (msurface_t *surf, byte *dest, int stride)
|
|||
lightmap = surf->samples;
|
||||
|
||||
// set to full bright if no light data
|
||||
if (r_fullbright.value || !cl.worldmodel->lightdata)
|
||||
if (r_fullbright->value || !cl.worldmodel->lightdata)
|
||||
{
|
||||
for (i=0 ; i<size ; i++)
|
||||
blocklights[i] = 255*256;
|
||||
|
@ -682,9 +682,9 @@ void R_BlendLightmaps (void)
|
|||
float *v;
|
||||
glRect_t *theRect;
|
||||
|
||||
if (r_fullbright.value)
|
||||
if (r_fullbright->value)
|
||||
return;
|
||||
if (!gl_texsort.value)
|
||||
if (!gl_texsort->value)
|
||||
return;
|
||||
|
||||
glDepthMask (0); // don't bother writing Z
|
||||
|
@ -698,7 +698,7 @@ void R_BlendLightmaps (void)
|
|||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
||||
if (!r_lightmap.value)
|
||||
if (!r_lightmap->value)
|
||||
{
|
||||
glEnable (GL_BLEND);
|
||||
}
|
||||
|
@ -807,7 +807,7 @@ void R_RenderBrushPoly (msurface_t *fa)
|
|||
|| fa->cached_dlight) // dynamic previously
|
||||
{
|
||||
dynamic:
|
||||
if (r_dynamic.value)
|
||||
if (r_dynamic->value)
|
||||
{
|
||||
lightmap_modified[fa->lightmaptexturenum] = true;
|
||||
theRect = &lightmap_rectchange[fa->lightmaptexturenum];
|
||||
|
@ -866,7 +866,7 @@ void R_RenderDynamicLightmaps (msurface_t *fa)
|
|||
|| fa->cached_dlight) // dynamic previously
|
||||
{
|
||||
dynamic:
|
||||
if (r_dynamic.value)
|
||||
if (r_dynamic->value)
|
||||
{
|
||||
lightmap_modified[fa->lightmaptexturenum] = true;
|
||||
theRect = &lightmap_rectchange[fa->lightmaptexturenum];
|
||||
|
@ -919,7 +919,7 @@ void R_DrawWaterSurfaces (void)
|
|||
msurface_t *s;
|
||||
texture_t *t;
|
||||
|
||||
if (r_wateralpha.value == 1.0)
|
||||
if (r_wateralpha->value == 1.0)
|
||||
return;
|
||||
|
||||
//
|
||||
|
@ -928,7 +928,7 @@ void R_DrawWaterSurfaces (void)
|
|||
glLoadMatrixf (r_world_matrix);
|
||||
|
||||
glEnable (GL_BLEND);
|
||||
glColor4f (1,1,1,r_wateralpha.value);
|
||||
glColor4f (1,1,1,r_wateralpha->value);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
for (i=0 ; i<cl.worldmodel->numtextures ; i++)
|
||||
|
@ -968,7 +968,7 @@ void R_DrawWaterSurfaces (void)
|
|||
msurface_t *s;
|
||||
texture_t *t;
|
||||
|
||||
if (r_wateralpha.value == 1.0 && gl_texsort.value)
|
||||
if (r_wateralpha->value == 1.0 && gl_texsort->value)
|
||||
return;
|
||||
|
||||
//
|
||||
|
@ -977,13 +977,13 @@ void R_DrawWaterSurfaces (void)
|
|||
|
||||
glLoadMatrixf (r_world_matrix);
|
||||
|
||||
if (r_wateralpha.value < 1.0) {
|
||||
if (r_wateralpha->value < 1.0) {
|
||||
glEnable (GL_BLEND);
|
||||
glColor4f (1,1,1,r_wateralpha.value);
|
||||
glColor4f (1,1,1,r_wateralpha->value);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
}
|
||||
|
||||
if (!gl_texsort.value) {
|
||||
if (!gl_texsort->value) {
|
||||
if (!waterchain)
|
||||
return;
|
||||
|
||||
|
@ -1018,7 +1018,7 @@ void R_DrawWaterSurfaces (void)
|
|||
|
||||
}
|
||||
|
||||
if (r_wateralpha.value < 1.0) {
|
||||
if (r_wateralpha->value < 1.0) {
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
|
||||
glColor4f (1,1,1,1);
|
||||
|
@ -1040,7 +1040,7 @@ void DrawTextureChains (void)
|
|||
msurface_t *s;
|
||||
texture_t *t;
|
||||
|
||||
if (!gl_texsort.value) {
|
||||
if (!gl_texsort->value) {
|
||||
GL_DisableMultitexture();
|
||||
|
||||
if (skychain) {
|
||||
|
@ -1061,14 +1061,14 @@ void DrawTextureChains (void)
|
|||
continue;
|
||||
if (i == skytexturenum)
|
||||
R_DrawSkyChain (s);
|
||||
else if (i == mirrortexturenum && r_mirroralpha.value != 1.0)
|
||||
else if (i == mirrortexturenum && r_mirroralpha->value != 1.0)
|
||||
{
|
||||
R_MirrorChain (s);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((s->flags & SURF_DRAWTURB) && r_wateralpha.value != 1.0)
|
||||
if ((s->flags & SURF_DRAWTURB) && r_wateralpha->value != 1.0)
|
||||
continue; // draw translucent water later
|
||||
for ( ; s ; s=s->texturechain)
|
||||
R_RenderBrushPoly (s);
|
||||
|
@ -1138,7 +1138,7 @@ void R_DrawBrushModel (entity_t *e)
|
|||
|
||||
// calculate dynamic lighting for bmodel if it's not an
|
||||
// instanced model
|
||||
if (clmodel->firstmodelsurface != 0 && !gl_flashblend.value)
|
||||
if (clmodel->firstmodelsurface != 0 && !gl_flashblend->value)
|
||||
{
|
||||
for (k=0 ; k<MAX_DLIGHTS ; k++)
|
||||
{
|
||||
|
@ -1170,7 +1170,7 @@ e->angles[0] = -e->angles[0]; // stupid quake bug
|
|||
if (((psurf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) ||
|
||||
(!(psurf->flags & SURF_PLANEBACK) && (dot > BACKFACE_EPSILON)))
|
||||
{
|
||||
if (gl_texsort.value)
|
||||
if (gl_texsort->value)
|
||||
R_RenderBrushPoly (psurf);
|
||||
else
|
||||
R_DrawSequentialPoly (psurf);
|
||||
|
@ -1288,7 +1288,7 @@ void R_RecursiveWorldNode (mnode_t *node)
|
|||
continue; // wrong side
|
||||
|
||||
// if sorting by texture, just store it out
|
||||
if (gl_texsort.value)
|
||||
if (gl_texsort->value)
|
||||
{
|
||||
if (!mirror
|
||||
|| surf->texinfo->texture != cl.worldmodel->textures[mirrortexturenum])
|
||||
|
@ -1364,7 +1364,7 @@ void R_MarkLeaves (void)
|
|||
int i;
|
||||
byte solid[4096];
|
||||
|
||||
if (r_oldviewleaf == r_viewleaf && !r_novis.value)
|
||||
if (r_oldviewleaf == r_viewleaf && !r_novis->value)
|
||||
return;
|
||||
|
||||
if (mirror)
|
||||
|
@ -1373,7 +1373,7 @@ void R_MarkLeaves (void)
|
|||
r_visframecount++;
|
||||
r_oldviewleaf = r_viewleaf;
|
||||
|
||||
if (r_novis.value)
|
||||
if (r_novis->value)
|
||||
{
|
||||
vis = solid;
|
||||
memset (solid, 0xff, (cl.worldmodel->numleafs+7)>>3);
|
||||
|
@ -1534,7 +1534,7 @@ void BuildSurfaceDisplayList (msurface_t *fa)
|
|||
//
|
||||
// remove co-linear points - Ed
|
||||
//
|
||||
if (!gl_keeptjunctions.value && !(fa->flags & SURF_UNDERWATER) )
|
||||
if (!gl_keeptjunctions->value && !(fa->flags & SURF_UNDERWATER) )
|
||||
{
|
||||
for (i = 0 ; i < lnumverts ; ++i)
|
||||
{
|
||||
|
@ -1675,7 +1675,7 @@ void GL_BuildLightmaps (void)
|
|||
}
|
||||
}
|
||||
|
||||
if (!gl_texsort.value)
|
||||
if (!gl_texsort->value)
|
||||
GL_SelectTexture(TEXTURE1_SGIS);
|
||||
|
||||
//
|
||||
|
@ -1698,7 +1698,7 @@ void GL_BuildLightmaps (void)
|
|||
gl_lightmap_format, GL_UNSIGNED_BYTE, lightmaps+i*BLOCK_WIDTH*BLOCK_HEIGHT*lightmap_bytes);
|
||||
}
|
||||
|
||||
if (!gl_texsort.value)
|
||||
if (!gl_texsort->value)
|
||||
GL_SelectTexture(TEXTURE0_SGIS);
|
||||
|
||||
}
|
||||
|
|
|
@ -90,17 +90,15 @@ float scr_con_current;
|
|||
float scr_conlines; // lines of console to display
|
||||
|
||||
float oldscreensize, oldfov;
|
||||
cvar_t scr_viewsize = {"viewsize","100", true};
|
||||
cvar_t scr_fov = {"fov","90"}; // 10 - 170
|
||||
cvar_t scr_conspeed = {"scr_conspeed","300"};
|
||||
cvar_t scr_centertime = {"scr_centertime","2"};
|
||||
cvar_t scr_showram = {"showram","1"};
|
||||
cvar_t scr_showturtle = {"showturtle","0"};
|
||||
cvar_t scr_showpause = {"showpause","1"};
|
||||
cvar_t scr_printspeed = {"scr_printspeed","8"};
|
||||
cvar_t gl_triplebuffer = {"gl_triplebuffer", "1", true };
|
||||
|
||||
extern cvar_t crosshair;
|
||||
cvar_t *scr_viewsize;
|
||||
cvar_t *scr_fov;
|
||||
cvar_t *scr_conspeed;
|
||||
cvar_t *scr_centertime;
|
||||
cvar_t *scr_showram;
|
||||
cvar_t *scr_showturtle;
|
||||
cvar_t *scr_showpause;
|
||||
cvar_t *scr_printspeed;
|
||||
cvar_t *gl_triplebuffer;
|
||||
|
||||
qboolean scr_initialized; // ready to draw
|
||||
|
||||
|
@ -153,7 +151,7 @@ for a few moments
|
|||
void SCR_CenterPrint (char *str)
|
||||
{
|
||||
strncpy (scr_centerstring, str, sizeof(scr_centerstring)-1);
|
||||
scr_centertime_off = scr_centertime.value;
|
||||
scr_centertime_off = scr_centertime->value;
|
||||
scr_centertime_start = cl.time;
|
||||
|
||||
// count the number of lines for centering
|
||||
|
@ -177,7 +175,7 @@ void SCR_DrawCenterString (void)
|
|||
|
||||
// the finale prints the characters one at a time
|
||||
if (cl.intermission)
|
||||
remaining = scr_printspeed.value * (cl.time - scr_centertime_start);
|
||||
remaining = scr_printspeed->value * (cl.time - scr_centertime_start);
|
||||
else
|
||||
remaining = 9999;
|
||||
|
||||
|
@ -279,22 +277,22 @@ static void SCR_CalcRefdef (void)
|
|||
//========================================
|
||||
|
||||
// bound viewsize
|
||||
if (scr_viewsize.value < 30)
|
||||
if (scr_viewsize->value < 30)
|
||||
Cvar_Set ("viewsize","30");
|
||||
if (scr_viewsize.value > 120)
|
||||
if (scr_viewsize->value > 120)
|
||||
Cvar_Set ("viewsize","120");
|
||||
|
||||
// bound field of view
|
||||
if (scr_fov.value < 10)
|
||||
if (scr_fov->value < 10)
|
||||
Cvar_Set ("fov","10");
|
||||
if (scr_fov.value > 170)
|
||||
if (scr_fov->value > 170)
|
||||
Cvar_Set ("fov","170");
|
||||
|
||||
// intermission is always full screen
|
||||
if (cl.intermission)
|
||||
size = 120;
|
||||
else
|
||||
size = scr_viewsize.value;
|
||||
size = scr_viewsize->value;
|
||||
|
||||
if (size >= 120)
|
||||
sb_lines = 0; // no status bar at all
|
||||
|
@ -303,11 +301,11 @@ static void SCR_CalcRefdef (void)
|
|||
else
|
||||
sb_lines = 24+16+8;
|
||||
|
||||
if (scr_viewsize.value >= 100.0) {
|
||||
if (scr_viewsize->value >= 100.0) {
|
||||
full = true;
|
||||
size = 100.0;
|
||||
} else
|
||||
size = scr_viewsize.value;
|
||||
size = scr_viewsize->value;
|
||||
if (cl.intermission)
|
||||
{
|
||||
full = true;
|
||||
|
@ -336,7 +334,7 @@ static void SCR_CalcRefdef (void)
|
|||
else
|
||||
r_refdef.vrect.y = (h - r_refdef.vrect.height)/2;
|
||||
|
||||
r_refdef.fov_x = scr_fov.value;
|
||||
r_refdef.fov_x = scr_fov->value;
|
||||
r_refdef.fov_y = CalcFov (r_refdef.fov_x, r_refdef.vrect.width, r_refdef.vrect.height);
|
||||
|
||||
scr_vrect = r_refdef.vrect;
|
||||
|
@ -352,7 +350,7 @@ Keybinding command
|
|||
*/
|
||||
void SCR_SizeUp_f (void)
|
||||
{
|
||||
Cvar_SetValue ("viewsize",scr_viewsize.value+10);
|
||||
Cvar_SetValue ("viewsize",scr_viewsize->value+10);
|
||||
vid.recalc_refdef = 1;
|
||||
}
|
||||
|
||||
|
@ -366,7 +364,7 @@ Keybinding command
|
|||
*/
|
||||
void SCR_SizeDown_f (void)
|
||||
{
|
||||
Cvar_SetValue ("viewsize",scr_viewsize.value-10);
|
||||
Cvar_SetValue ("viewsize",scr_viewsize->value-10);
|
||||
vid.recalc_refdef = 1;
|
||||
}
|
||||
|
||||
|
@ -380,15 +378,15 @@ SCR_Init
|
|||
void SCR_Init (void)
|
||||
{
|
||||
|
||||
Cvar_RegisterVariable (&scr_fov);
|
||||
Cvar_RegisterVariable (&scr_viewsize);
|
||||
Cvar_RegisterVariable (&scr_conspeed);
|
||||
Cvar_RegisterVariable (&scr_showram);
|
||||
Cvar_RegisterVariable (&scr_showturtle);
|
||||
Cvar_RegisterVariable (&scr_showpause);
|
||||
Cvar_RegisterVariable (&scr_centertime);
|
||||
Cvar_RegisterVariable (&scr_printspeed);
|
||||
Cvar_RegisterVariable (&gl_triplebuffer);
|
||||
scr_fov = Cvar_Get("fov", "90", CVAR_NONE, "10 - 170");
|
||||
scr_viewsize = Cvar_Get("viewsize", "100", CVAR_ARCHIVE, "None");
|
||||
scr_conspeed = Cvar_Get("scr_conspeed", "300", CVAR_NONE, "None");
|
||||
scr_showram = Cvar_Get("showram", "1", CVAR_NONE, "None");
|
||||
scr_showturtle = Cvar_Get("showturtle", "0", CVAR_NONE, "None");
|
||||
scr_showpause = Cvar_Get("showpause", "1", CVAR_NONE, "None");
|
||||
scr_centertime = Cvar_Get("scr_centertime", "2", CVAR_NONE, "None");
|
||||
scr_printspeed = Cvar_Get("scr_printspeed", "8", CVAR_NONE, "None");
|
||||
gl_triplebuffer = Cvar_Get("gl_triplebuffer", "1", CVAR_ARCHIVE, "None");
|
||||
|
||||
//
|
||||
// register our commands
|
||||
|
@ -413,7 +411,7 @@ SCR_DrawRam
|
|||
*/
|
||||
void SCR_DrawRam (void)
|
||||
{
|
||||
if (!scr_showram.value)
|
||||
if (!scr_showram->value)
|
||||
return;
|
||||
|
||||
if (!r_cache_thrash)
|
||||
|
@ -431,7 +429,7 @@ void SCR_DrawTurtle (void)
|
|||
{
|
||||
static int count;
|
||||
|
||||
if (!scr_showturtle.value)
|
||||
if (!scr_showturtle->value)
|
||||
return;
|
||||
|
||||
if (host_frametime < 0.1)
|
||||
|
@ -471,7 +469,7 @@ void SCR_DrawPause (void)
|
|||
{
|
||||
qpic_t *pic;
|
||||
|
||||
if (!scr_showpause.value) // turn off for screenshots
|
||||
if (!scr_showpause->value) // turn off for screenshots
|
||||
return;
|
||||
|
||||
if (!cl.paused)
|
||||
|
@ -533,14 +531,14 @@ void SCR_SetUpToDrawConsole (void)
|
|||
|
||||
if (scr_conlines < scr_con_current)
|
||||
{
|
||||
scr_con_current -= scr_conspeed.value*host_frametime;
|
||||
scr_con_current -= scr_conspeed->value*host_frametime;
|
||||
if (scr_conlines > scr_con_current)
|
||||
scr_con_current = scr_conlines;
|
||||
|
||||
}
|
||||
else if (scr_conlines > scr_con_current)
|
||||
{
|
||||
scr_con_current += scr_conspeed.value*host_frametime;
|
||||
scr_con_current += scr_conspeed->value*host_frametime;
|
||||
if (scr_conlines < scr_con_current)
|
||||
scr_con_current = scr_conlines;
|
||||
}
|
||||
|
@ -836,7 +834,7 @@ void SCR_UpdateScreen (void)
|
|||
if (block_drawing)
|
||||
return;
|
||||
|
||||
vid.numpages = 2 + gl_triplebuffer.value;
|
||||
vid.numpages = 2 + gl_triplebuffer->value;
|
||||
|
||||
scr_copytop = 0;
|
||||
scr_copyeverything = 0;
|
||||
|
@ -861,15 +859,15 @@ void SCR_UpdateScreen (void)
|
|||
//
|
||||
// determine size of refresh window
|
||||
//
|
||||
if (oldfov != scr_fov.value)
|
||||
if (oldfov != scr_fov->value)
|
||||
{
|
||||
oldfov = scr_fov.value;
|
||||
oldfov = scr_fov->value;
|
||||
vid.recalc_refdef = true;
|
||||
}
|
||||
|
||||
if (oldscreensize != scr_viewsize.value)
|
||||
if (oldscreensize != scr_viewsize->value)
|
||||
{
|
||||
oldscreensize = scr_viewsize.value;
|
||||
oldscreensize = scr_viewsize->value;
|
||||
vid.recalc_refdef = true;
|
||||
}
|
||||
|
||||
|
@ -913,7 +911,7 @@ void SCR_UpdateScreen (void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (crosshair.value)
|
||||
if (crosshair->value)
|
||||
Draw_Character (scr_vrect.x + scr_vrect.width/2, scr_vrect.y + scr_vrect.height/2, '+');
|
||||
|
||||
SCR_DrawRam ();
|
||||
|
|
|
@ -86,9 +86,9 @@ int UseKeyboard = 1;
|
|||
|
||||
int mouserate = MOUSE_DEFAULTSAMPLERATE;
|
||||
|
||||
cvar_t vid_mode = {"vid_mode","5",false};
|
||||
cvar_t vid_redrawfull = {"vid_redrawfull","0",false};
|
||||
cvar_t vid_waitforrefresh = {"vid_waitforrefresh","0",true};
|
||||
cvar_t *vid_mode;
|
||||
cvar_t *vid_redrawfull;
|
||||
cvar_t *vid_waitforrefresh;
|
||||
|
||||
char *framebuffer_ptr;
|
||||
|
||||
|
@ -106,7 +106,7 @@ float mouse_x, mouse_y;
|
|||
float old_mouse_x, old_mouse_y;
|
||||
int mx, my;
|
||||
|
||||
cvar_t m_filter = {"m_filter","1"};
|
||||
cvar_t *m_filter;
|
||||
|
||||
int scr_width, scr_height;
|
||||
|
||||
|
@ -123,7 +123,7 @@ int texture_extension_number = 1;
|
|||
|
||||
float gldepthmin, gldepthmax;
|
||||
|
||||
cvar_t gl_ztrick = {"gl_ztrick","1"};
|
||||
cvar_t *gl_ztrick;
|
||||
|
||||
const char *gl_vendor;
|
||||
const char *gl_renderer;
|
||||
|
@ -139,6 +139,11 @@ qboolean is8bit = false;
|
|||
qboolean isPermedia = false;
|
||||
qboolean gl_mtexable = false;
|
||||
|
||||
void
|
||||
VID_InitCvars(void)
|
||||
{
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
void D_BeginDirectRect (int x, int y, byte *pbitmap, int width, int height)
|
||||
{
|
||||
|
@ -356,8 +361,6 @@ GL_BeginRendering
|
|||
*/
|
||||
void GL_BeginRendering (int *x, int *y, int *width, int *height)
|
||||
{
|
||||
extern cvar_t gl_clear;
|
||||
|
||||
*x = *y = 0;
|
||||
*width = scr_width;
|
||||
*height = scr_height;
|
||||
|
@ -627,10 +630,10 @@ void VID_Init(unsigned char *palette)
|
|||
|
||||
Init_KBD();
|
||||
|
||||
Cvar_RegisterVariable (&vid_mode);
|
||||
Cvar_RegisterVariable (&vid_redrawfull);
|
||||
Cvar_RegisterVariable (&vid_waitforrefresh);
|
||||
Cvar_RegisterVariable (&gl_ztrick);
|
||||
vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None");
|
||||
vid_redrawfull = Cvar_Get("vid_redrawfull", "0", CVAR_NONE, "None");
|
||||
vid_waitforrefresh = Cvar_Get("vid_waitforrefresh", "0", CVAR_ARCHIVE, "None");
|
||||
gl_ztrick = Cvar_Get("gl_ztrick", "1", CVAR_NONE, "None");
|
||||
|
||||
vid.maxwarpwidth = WARP_WIDTH;
|
||||
vid.maxwarpheight = WARP_HEIGHT;
|
||||
|
@ -828,7 +831,7 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
while (mouse_update())
|
||||
;
|
||||
|
||||
if (m_filter.value)
|
||||
if (m_filter->value)
|
||||
{
|
||||
mouse_x = (mx + old_mouse_x) * 0.5;
|
||||
mouse_y = (my + old_mouse_y) * 0.5;
|
||||
|
@ -842,21 +845,21 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
old_mouse_y = my;
|
||||
mx = my = 0; // clear for next update
|
||||
|
||||
mouse_x *= sensitivity.value;
|
||||
mouse_y *= sensitivity.value;
|
||||
mouse_x *= sensitivity->value;
|
||||
mouse_y *= sensitivity->value;
|
||||
|
||||
// add mouse X/Y movement to cmd
|
||||
if ( (in_strafe.state & 1) || (lookstrafe.value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side.value * mouse_x;
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
cl.viewangles[YAW] -= m_yaw->value * mouse_x;
|
||||
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
if ( (in_mlook.state & 1) && !(in_strafe.state & 1))
|
||||
{
|
||||
cl.viewangles[PITCH] += m_pitch.value * mouse_y;
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70)
|
||||
|
@ -865,9 +868,9 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
else
|
||||
{
|
||||
if ((in_strafe.state & 1) && noclip_anglehack)
|
||||
cmd->upmove -= m_forward.value * mouse_y;
|
||||
cmd->upmove -= m_forward->value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
cmd->forwardmove -= m_forward->value * mouse_y;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ unsigned short d_8to16table[256];
|
|||
unsigned d_8to24table[256];
|
||||
unsigned char d_15to8table[65536];
|
||||
|
||||
cvar_t vid_mode = {"vid_mode","0",false};
|
||||
cvar_t *vid_mode;
|
||||
|
||||
static qboolean mouse_avail;
|
||||
static qboolean mouse_active;
|
||||
|
@ -104,7 +104,7 @@ int texture_extension_number = 1;
|
|||
|
||||
float gldepthmin, gldepthmax;
|
||||
|
||||
cvar_t gl_ztrick = {"gl_ztrick","1"};
|
||||
cvar_t *gl_ztrick;
|
||||
|
||||
const char *gl_vendor;
|
||||
const char *gl_renderer;
|
||||
|
@ -627,8 +627,6 @@ GL_BeginRendering
|
|||
*/
|
||||
void GL_BeginRendering (int *x, int *y, int *width, int *height)
|
||||
{
|
||||
extern cvar_t gl_clear;
|
||||
|
||||
*x = *y = 0;
|
||||
*width = scr_width;
|
||||
*height = scr_height;
|
||||
|
@ -753,11 +751,11 @@ void VID_Init(unsigned char *palette)
|
|||
int MajorVersion, MinorVersion;
|
||||
int actualWidth, actualHeight;
|
||||
|
||||
Cvar_RegisterVariable (&vid_mode);
|
||||
vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None");
|
||||
Cvar_RegisterVariable (&in_mouse);
|
||||
Cvar_RegisterVariable (&in_dgamouse);
|
||||
Cvar_RegisterVariable (&m_filter);
|
||||
Cvar_RegisterVariable (&gl_ztrick);
|
||||
m_filter = Cvar_Get("m_filter", "0", CVAR_ARCHIVE, "None");
|
||||
gl_ztrick = Cvar_Get("gl_ztrick", "1", CVAR_NONE, "None");
|
||||
|
||||
vid.maxwarpwidth = WARP_WIDTH;
|
||||
vid.maxwarpheight = WARP_HEIGHT;
|
||||
|
@ -964,7 +962,7 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
if (!mouse_avail)
|
||||
return;
|
||||
|
||||
if (m_filter.value)
|
||||
if (m_filter->value)
|
||||
{
|
||||
mx = (mx + old_mouse_x) * 0.5;
|
||||
my = (my + old_mouse_y) * 0.5;
|
||||
|
@ -972,21 +970,21 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
old_mouse_x = mx;
|
||||
old_mouse_y = my;
|
||||
|
||||
mx *= sensitivity.value;
|
||||
my *= sensitivity.value;
|
||||
mx *= sensitivity->value;
|
||||
my *= sensitivity->value;
|
||||
|
||||
// add mouse X/Y movement to cmd
|
||||
if ( (in_strafe.state & 1) || (lookstrafe.value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side.value * mx;
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side->value * mx;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mx;
|
||||
cl.viewangles[YAW] -= m_yaw->value * mx;
|
||||
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
if ( (in_mlook.state & 1) && !(in_strafe.state & 1))
|
||||
{
|
||||
cl.viewangles[PITCH] += m_pitch.value * my;
|
||||
cl.viewangles[PITCH] += m_pitch->value * my;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70)
|
||||
|
@ -995,9 +993,9 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
else
|
||||
{
|
||||
if ((in_strafe.state & 1) && noclip_anglehack)
|
||||
cmd->upmove -= m_forward.value * my;
|
||||
cmd->upmove -= m_forward->value * my;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * my;
|
||||
cmd->forwardmove -= m_forward->value * my;
|
||||
}
|
||||
mx = my = 0;
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ HDC maindc;
|
|||
|
||||
glvert_t glv;
|
||||
|
||||
cvar_t gl_ztrick = {"gl_ztrick","1"};
|
||||
cvar_t *gl_ztrick;
|
||||
|
||||
HWND WINAPI InitializeWindow (HINSTANCE hInstance, int nCmdShow);
|
||||
|
||||
|
@ -151,22 +151,27 @@ qboolean gl_mtexable = false;
|
|||
|
||||
//====================================
|
||||
|
||||
cvar_t vid_mode = {"vid_mode","0", false};
|
||||
cvar_t *vid_mode;
|
||||
// Note that 0 is MODE_WINDOWED
|
||||
cvar_t _vid_default_mode = {"_vid_default_mode","0", true};
|
||||
cvar_t *_vid_default_mode;
|
||||
// Note that 3 is MODE_FULLSCREEN_DEFAULT
|
||||
cvar_t _vid_default_mode_win = {"_vid_default_mode_win","3", true};
|
||||
cvar_t vid_wait = {"vid_wait","0"};
|
||||
cvar_t vid_nopageflip = {"vid_nopageflip","0", true};
|
||||
cvar_t _vid_wait_override = {"_vid_wait_override", "0", true};
|
||||
cvar_t vid_config_x = {"vid_config_x","800", true};
|
||||
cvar_t vid_config_y = {"vid_config_y","600", true};
|
||||
cvar_t vid_stretch_by_2 = {"vid_stretch_by_2","1", true};
|
||||
cvar_t _windowed_mouse = {"_windowed_mouse","1", true};
|
||||
cvar_t *_vid_default_mode_win;
|
||||
cvar_t *vid_wait;
|
||||
cvar_t *vid_nopageflip;
|
||||
cvar_t *_vid_wait_override;
|
||||
cvar_t *vid_config_x;
|
||||
cvar_t *vid_config_y;
|
||||
cvar_t *vid_stretch_by_2;
|
||||
cvar_t *_windowed_mouse;
|
||||
|
||||
int window_center_x, window_center_y, window_x, window_y, window_width, window_height;
|
||||
RECT window_rect;
|
||||
|
||||
void
|
||||
VID_InitCvars(void)
|
||||
{
|
||||
}
|
||||
|
||||
// direct draw software compatability stuff
|
||||
|
||||
void VID_HandlePause (qboolean pause)
|
||||
|
@ -409,7 +414,7 @@ int VID_SetMode (int modenum, unsigned char *palette)
|
|||
// Set either the fullscreen or windowed mode
|
||||
if (modelist[modenum].type == MS_WINDOWED)
|
||||
{
|
||||
if (_windowed_mouse.value && key_dest == key_game)
|
||||
if (_windowed_mouse->value && key_dest == key_game)
|
||||
{
|
||||
stat = VID_SetWindowedMode(modenum);
|
||||
IN_ActivateMouse ();
|
||||
|
@ -454,7 +459,7 @@ int VID_SetMode (int modenum, unsigned char *palette)
|
|||
SetForegroundWindow (mainwindow);
|
||||
VID_SetPalette (palette);
|
||||
vid_modenum = modenum;
|
||||
Cvar_SetValue ("vid_mode", (float)vid_modenum);
|
||||
Cvar_SetValue(vid_mode, (float)vid_modenum);
|
||||
|
||||
while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
|
||||
{
|
||||
|
@ -669,8 +674,6 @@ GL_BeginRendering
|
|||
*/
|
||||
void GL_BeginRendering (int *x, int *y, int *width, int *height)
|
||||
{
|
||||
extern cvar_t gl_clear;
|
||||
|
||||
*x = *y = 0;
|
||||
*width = WindowRect.right - WindowRect.left;
|
||||
*height = WindowRect.bottom - WindowRect.top;
|
||||
|
@ -690,7 +693,7 @@ void GL_EndRendering (void)
|
|||
// handle the mouse state when windowed if that's changed
|
||||
if (modestate == MS_WINDOWED)
|
||||
{
|
||||
if (!_windowed_mouse.value) {
|
||||
if (!_windowed_mouse->value) {
|
||||
if (windowed_mouse) {
|
||||
IN_DeactivateMouse ();
|
||||
IN_ShowMouse ();
|
||||
|
@ -996,7 +999,7 @@ void AppActivate(BOOL fActive, BOOL minimize)
|
|||
ShowWindow(mainwindow, SW_SHOWNORMAL);
|
||||
}
|
||||
}
|
||||
else if ((modestate == MS_WINDOWED) && _windowed_mouse.value && key_dest == key_game)
|
||||
else if ((modestate == MS_WINDOWED) && _windowed_mouse->value && key_dest == key_game)
|
||||
{
|
||||
IN_ActivateMouse ();
|
||||
IN_HideMouse ();
|
||||
|
@ -1014,7 +1017,7 @@ void AppActivate(BOOL fActive, BOOL minimize)
|
|||
vid_wassuspended = true;
|
||||
}
|
||||
}
|
||||
else if ((modestate == MS_WINDOWED) && _windowed_mouse.value)
|
||||
else if ((modestate == MS_WINDOWED) && _windowed_mouse->value)
|
||||
{
|
||||
IN_DeactivateMouse ();
|
||||
IN_ShowMouse ();
|
||||
|
@ -1592,17 +1595,17 @@ void VID_Init (unsigned char *palette)
|
|||
|
||||
memset(&devmode, 0, sizeof(devmode));
|
||||
|
||||
Cvar_RegisterVariable (&vid_mode);
|
||||
Cvar_RegisterVariable (&vid_wait);
|
||||
Cvar_RegisterVariable (&vid_nopageflip);
|
||||
Cvar_RegisterVariable (&_vid_wait_override);
|
||||
Cvar_RegisterVariable (&_vid_default_mode);
|
||||
Cvar_RegisterVariable (&_vid_default_mode_win);
|
||||
Cvar_RegisterVariable (&vid_config_x);
|
||||
Cvar_RegisterVariable (&vid_config_y);
|
||||
Cvar_RegisterVariable (&vid_stretch_by_2);
|
||||
Cvar_RegisterVariable (&_windowed_mouse);
|
||||
Cvar_RegisterVariable (&gl_ztrick);
|
||||
vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None");
|
||||
vid_wait = Cvar_Get("vid_wait", "0", CVAR_NONE, "None");
|
||||
vid_nopageflip = Cvar_Get("vid_nopageflip", "0", CVAR_ARCHIVE, "None");
|
||||
_vid_wait_override = Cvar_Get("_vid_wait_override", "0", CVAR_ARCHIVE, "None");
|
||||
_vid_default_mode = Cvar_Get("_vid_default_mode", "0", CVAR_ARCHIVE, "None");
|
||||
_vid_default_mode_win = Cvar_Get("_vid_default_mode_win", "3", CVAR_ARCHIVE, "None");
|
||||
vid_config_x = Cvar_Get("vid_config_x", "800", CVAR_ARCHIVE, "None");
|
||||
vid_config_y = Cvar_Get("vid_config_y", "600", CVAR_ARCHIVE, "None");
|
||||
vid_stretch_by_2 = Cvar_Get("vid_stretch_by_2", "1", CVAR_ARCHIVE, "None");
|
||||
_windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_ARCHIVE, "None");
|
||||
gl_ztrick = Cvar_Get("gl_ztrick", "1", CVAR_NONE, "None");
|
||||
|
||||
Cmd_AddCommand ("vid_nummodes", VID_NumModes_f);
|
||||
Cmd_AddCommand ("vid_describecurrentmode", VID_DescribeCurrentMode_f);
|
||||
|
|
|
@ -42,8 +42,6 @@ float speedscale; // for top sky and bottom sky
|
|||
|
||||
msurface_t *warpface;
|
||||
|
||||
extern cvar_t gl_subdivide_size;
|
||||
|
||||
void BoundPoly (int numverts, float *verts, vec3_t mins, vec3_t maxs)
|
||||
{
|
||||
int i, j;
|
||||
|
@ -83,7 +81,7 @@ void SubdividePolygon (int numverts, float *verts)
|
|||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
m = (mins[i] + maxs[i]) * 0.5;
|
||||
m = gl_subdivide_size.value * floor (m/gl_subdivide_size.value + 0.5);
|
||||
m = gl_subdivide_size->value * floor (m/gl_subdivide_size->value + 0.5);
|
||||
if (maxs[i] - m < 8)
|
||||
continue;
|
||||
if (m - mins[i] < 8)
|
||||
|
|
106
source/host.c
106
source/host.c
|
@ -65,32 +65,32 @@ jmp_buf host_abortserver;
|
|||
byte *host_basepal;
|
||||
byte *host_colormap;
|
||||
|
||||
cvar_t host_framerate = {"host_framerate","0"}; // set for slow motion
|
||||
cvar_t host_speeds = {"host_speeds","0"}; // set for running times
|
||||
cvar_t *host_framerate;
|
||||
cvar_t *host_speeds;
|
||||
|
||||
cvar_t sys_ticrate = {"sys_ticrate","0.05"};
|
||||
cvar_t serverprofile = {"serverprofile","0"};
|
||||
cvar_t *sys_ticrate;
|
||||
cvar_t *serverprofile;
|
||||
|
||||
cvar_t fraglimit = {"fraglimit","0",false,true};
|
||||
cvar_t timelimit = {"timelimit","0",false,true};
|
||||
cvar_t teamplay = {"teamplay","0",false,true};
|
||||
cvar_t *fraglimit;
|
||||
cvar_t *timelimit;
|
||||
cvar_t *teamplay;
|
||||
|
||||
cvar_t samelevel = {"samelevel","0"};
|
||||
cvar_t noexit = {"noexit","0",false,true};
|
||||
cvar_t *samelevel;
|
||||
cvar_t *noexit;
|
||||
|
||||
#ifdef QUAKE2
|
||||
cvar_t developer = {"developer","1"}; // should be 0 for release!
|
||||
cvar_t *developer;
|
||||
#else
|
||||
cvar_t developer = {"developer","0"};
|
||||
cvar_t *developer;
|
||||
#endif
|
||||
|
||||
cvar_t skill = {"skill","1"}; // 0 - 3
|
||||
cvar_t deathmatch = {"deathmatch","0"}; // 0, 1, or 2
|
||||
cvar_t coop = {"coop","0"}; // 0 or 1
|
||||
cvar_t *skill;
|
||||
cvar_t *deathmatch;
|
||||
cvar_t *coop;
|
||||
|
||||
cvar_t pausable = {"pausable","1"};
|
||||
cvar_t *pausable;
|
||||
|
||||
cvar_t temp1 = {"temp1","0"};
|
||||
cvar_t *temp1;
|
||||
|
||||
|
||||
/*
|
||||
|
@ -206,9 +206,9 @@ void Host_FindMaxClients (void)
|
|||
svs.clients = Hunk_AllocName (svs.maxclientslimit*sizeof(client_t), "clients");
|
||||
|
||||
if (svs.maxclients > 1)
|
||||
Cvar_SetValue ("deathmatch", 1.0);
|
||||
Cvar_SetValue(deathmatch, 1.0);
|
||||
else
|
||||
Cvar_SetValue ("deathmatch", 0.0);
|
||||
Cvar_SetValue(deathmatch, 0.0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -221,25 +221,25 @@ void Host_InitLocal (void)
|
|||
{
|
||||
Host_InitCommands ();
|
||||
|
||||
Cvar_RegisterVariable (&host_framerate);
|
||||
Cvar_RegisterVariable (&host_speeds);
|
||||
host_framerate = Cvar_Get("host_framerate", "0", CVAR_NONE, "set for slow motion");
|
||||
host_speeds = Cvar_Get("host_speeds", "0", CVAR_NONE, "set for running times");
|
||||
|
||||
Cvar_RegisterVariable (&sys_ticrate);
|
||||
Cvar_RegisterVariable (&serverprofile);
|
||||
sys_ticrate = Cvar_Get("sys_ticrate", "0.05", CVAR_NONE, "None");
|
||||
serverprofile = Cvar_Get("serverprofile", "0", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&fraglimit);
|
||||
Cvar_RegisterVariable (&timelimit);
|
||||
Cvar_RegisterVariable (&teamplay);
|
||||
Cvar_RegisterVariable (&samelevel);
|
||||
Cvar_RegisterVariable (&noexit);
|
||||
Cvar_RegisterVariable (&skill);
|
||||
Cvar_RegisterVariable (&developer);
|
||||
Cvar_RegisterVariable (&deathmatch);
|
||||
Cvar_RegisterVariable (&coop);
|
||||
fraglimit = Cvar_Get("fraglimit", "0", CVAR_SERVERINFO, "None");
|
||||
timelimit = Cvar_Get("timelimit", "0", CVAR_SERVERINFO, "None");
|
||||
teamplay = Cvar_Get("teamplay", "0", CVAR_SERVERINFO, "None");
|
||||
samelevel = Cvar_Get("samelevel", "0", CVAR_NONE, "None");
|
||||
noexit = Cvar_Get("noexit", "0", CVAR_SERVERINFO, "None");
|
||||
skill = Cvar_Get("skill", "1", CVAR_NONE, "0 - 3");
|
||||
developer = Cvar_Get("developer", "0", CVAR_NONE, "should be 0 for release!");
|
||||
deathmatch = Cvar_Get("deathmatch", "0", CVAR_NONE, "0, 1, or 2");
|
||||
coop = Cvar_Get("coop", "0", CVAR_NONE, "0 or 1");
|
||||
|
||||
Cvar_RegisterVariable (&pausable);
|
||||
pausable = Cvar_Get("pausable", "1", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&temp1);
|
||||
temp1 = Cvar_Get("temp1", "0", CVAR_NONE, "None");
|
||||
|
||||
Host_FindMaxClients ();
|
||||
|
||||
|
@ -519,8 +519,8 @@ qboolean Host_FilterTime (float time)
|
|||
host_frametime = realtime - oldrealtime;
|
||||
oldrealtime = realtime;
|
||||
|
||||
if (host_framerate.value > 0)
|
||||
host_frametime = host_framerate.value;
|
||||
if (host_framerate->value > 0)
|
||||
host_frametime = host_framerate->value;
|
||||
else
|
||||
{ // don't allow really long or short frames
|
||||
if (host_frametime > 0.1)
|
||||
|
@ -705,12 +705,12 @@ void _Host_Frame (float time)
|
|||
}
|
||||
|
||||
// update video
|
||||
if (host_speeds.value)
|
||||
if (host_speeds->value)
|
||||
time1 = Sys_DoubleTime ();
|
||||
|
||||
SCR_UpdateScreen ();
|
||||
|
||||
if (host_speeds.value)
|
||||
if (host_speeds->value)
|
||||
time2 = Sys_DoubleTime ();
|
||||
|
||||
// update audio
|
||||
|
@ -724,7 +724,7 @@ void _Host_Frame (float time)
|
|||
|
||||
CDAudio_Update();
|
||||
|
||||
if (host_speeds.value)
|
||||
if (host_speeds->value)
|
||||
{
|
||||
pass1 = (time1 - time3)*1000;
|
||||
time3 = Sys_DoubleTime ();
|
||||
|
@ -744,7 +744,7 @@ void Host_Frame (float time)
|
|||
static int timecount;
|
||||
int i, c, m;
|
||||
|
||||
if (!serverprofile.value)
|
||||
if (!serverprofile->value)
|
||||
{
|
||||
_Host_Frame (time);
|
||||
return;
|
||||
|
@ -857,18 +857,24 @@ void Host_Init (quakeparms_t *parms)
|
|||
host_parms = *parms;
|
||||
|
||||
if (parms->memsize < minimum_memory)
|
||||
Sys_Error ("Only %4.1f megs of memory available, can't execute game", parms->memsize / (float)0x100000);
|
||||
Sys_Error ("Only %4.1fMB of memory available, can't execute game", parms->memsize / (float)0x100000);
|
||||
|
||||
com_argc = parms->argc;
|
||||
com_argv = parms->argv;
|
||||
|
||||
Memory_Init (parms->membase, parms->memsize);
|
||||
Cbuf_Init ();
|
||||
Cmd_Init ();
|
||||
Cmd_Init ();
|
||||
Cvar_Init ();
|
||||
|
||||
CL_InitCvars ();
|
||||
SCR_InitCvars ();
|
||||
VID_InitCvars ();
|
||||
COM_Init (parms->basedir);
|
||||
|
||||
V_Init ();
|
||||
Chase_Init ();
|
||||
Host_InitVCR (parms);
|
||||
COM_Init (parms->basedir);
|
||||
Host_InitLocal ();
|
||||
W_LoadWadFile ("gfx.wad");
|
||||
Key_Init ();
|
||||
|
@ -893,32 +899,18 @@ void Host_Init (quakeparms_t *parms)
|
|||
if (!host_colormap)
|
||||
Sys_Error ("Couldn't load gfx/colormap.lmp");
|
||||
|
||||
#ifndef _WIN32 // on non win32, mouse comes before video for security reasons
|
||||
IN_Init ();
|
||||
#endif
|
||||
VID_Init (host_basepal);
|
||||
IN_Init ();
|
||||
|
||||
Draw_Init ();
|
||||
SCR_Init ();
|
||||
R_Init ();
|
||||
#ifndef _WIN32
|
||||
// on Win32, sound initialization has to come before video initialization, so we
|
||||
// can put up a popup if the sound hardware is in use
|
||||
S_Init ();
|
||||
#else
|
||||
|
||||
#ifdef GLQUAKE
|
||||
// FIXME: doesn't use the new one-window approach yet
|
||||
S_Init ();
|
||||
#endif
|
||||
|
||||
#endif // _WIN32
|
||||
CDAudio_Init ();
|
||||
Sbar_Init ();
|
||||
CL_Init ();
|
||||
#ifdef _WIN32 // on non win32, mouse comes before video for security reasons
|
||||
IN_Init ();
|
||||
#endif
|
||||
}
|
||||
|
||||
Cbuf_InsertText ("exec quake.rc\n");
|
||||
|
|
|
@ -32,8 +32,6 @@
|
|||
|
||||
#include "quakedef.h"
|
||||
|
||||
extern cvar_t pausable;
|
||||
|
||||
int current_skill;
|
||||
|
||||
void Mod_Print (void);
|
||||
|
@ -622,12 +620,12 @@ void Host_Loadgame_f (void)
|
|||
// this silliness is so we can load 1.06 save files, which have float skill values
|
||||
fscanf (f, "%f\n", &tfloat);
|
||||
current_skill = (int)(tfloat + 0.1);
|
||||
Cvar_SetValue ("skill", (float)current_skill);
|
||||
Cvar_SetValue(skill, (float)current_skill);
|
||||
|
||||
#ifdef QUAKE2
|
||||
Cvar_SetValue ("deathmatch", 0);
|
||||
Cvar_SetValue ("coop", 0);
|
||||
Cvar_SetValue ("teamplay", 0);
|
||||
Cvar_SetValue(deathmatch, 0);
|
||||
Cvar_SetValue(coop, 0);
|
||||
Cvar_SetValue(teamplay, 0);
|
||||
#endif
|
||||
|
||||
fscanf (f, "%s\n",mapname);
|
||||
|
@ -742,7 +740,7 @@ void SaveGamestate()
|
|||
fprintf (f, "%s\n", comment);
|
||||
// for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
|
||||
// fprintf (f, "%f\n", svs.clients->spawn_parms[i]);
|
||||
fprintf (f, "%f\n", skill.value);
|
||||
fprintf (f, "%f\n", skill->value);
|
||||
fprintf (f, "%s\n", sv.name);
|
||||
fprintf (f, "%f\n", sv.time);
|
||||
|
||||
|
@ -804,7 +802,7 @@ int LoadGamestate(char *level, char *startspot)
|
|||
// for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
|
||||
// fscanf (f, "%f\n", &spawn_parms[i]);
|
||||
fscanf (f, "%f\n", &sk);
|
||||
Cvar_SetValue ("skill", sk);
|
||||
Cvar_SetValue(skill, sk);
|
||||
|
||||
fscanf (f, "%s\n",mapname);
|
||||
fscanf (f, "%f\n",&time);
|
||||
|
@ -925,7 +923,7 @@ void Host_Name_f (void)
|
|||
|
||||
if (Cmd_Argc () == 1)
|
||||
{
|
||||
Con_Printf ("\"name\" is \"%s\"\n", cl_name.string);
|
||||
Con_Printf ("\"name\" is \"%s\"\n", cl_name->string);
|
||||
return;
|
||||
}
|
||||
if (Cmd_Argc () == 2)
|
||||
|
@ -936,9 +934,9 @@ void Host_Name_f (void)
|
|||
|
||||
if (cmd_source == src_command)
|
||||
{
|
||||
if (Q_strcmp(cl_name.string, newName) == 0)
|
||||
if (Q_strcmp(cl_name->string, newName) == 0)
|
||||
return;
|
||||
Cvar_Set ("_cl_name", newName);
|
||||
Cvar_Set (cl_name, newName);
|
||||
if (cls.state == ca_connected)
|
||||
Cmd_ForwardToServer ();
|
||||
return;
|
||||
|
@ -1057,7 +1055,7 @@ void Host_Say(qboolean teamonly)
|
|||
if (!fromServer)
|
||||
sprintf (text, "%c%s: ", 1, save->name);
|
||||
else
|
||||
sprintf (text, "%c<%s> ", 1, hostname.string);
|
||||
sprintf (text, "%c<%s> ", 1, hostname->string);
|
||||
|
||||
j = sizeof(text) - 2 - Q_strlen(text); // -2 for /n and null terminator
|
||||
if (Q_strlen(p) > j)
|
||||
|
@ -1070,7 +1068,7 @@ void Host_Say(qboolean teamonly)
|
|||
{
|
||||
if (!client || !client->active || !client->spawned)
|
||||
continue;
|
||||
if (teamplay.value && teamonly && client->edict->v.team != save->edict->v.team)
|
||||
if (teamplay->value && teamonly && client->edict->v.team != save->edict->v.team)
|
||||
continue;
|
||||
host_client = client;
|
||||
SV_ClientPrintf("%s", text);
|
||||
|
@ -1157,7 +1155,7 @@ void Host_Color_f(void)
|
|||
|
||||
if (Cmd_Argc() == 1)
|
||||
{
|
||||
Con_Printf ("\"color\" is \"%i %i\"\n", ((int)cl_color.value) >> 4, ((int)cl_color.value) & 0x0f);
|
||||
Con_Printf ("\"color\" is \"%i %i\"\n", ((int)cl_color->value) >> 4, ((int)cl_color->value) & 0x0f);
|
||||
Con_Printf ("color <0-13> [0-13]\n");
|
||||
return;
|
||||
}
|
||||
|
@ -1181,7 +1179,7 @@ void Host_Color_f(void)
|
|||
|
||||
if (cmd_source == src_command)
|
||||
{
|
||||
Cvar_SetValue ("_cl_color", playercolor);
|
||||
Cvar_SetValue (cl_color, playercolor);
|
||||
if (cls.state == ca_connected)
|
||||
Cmd_ForwardToServer ();
|
||||
return;
|
||||
|
@ -1234,7 +1232,7 @@ void Host_Pause_f (void)
|
|||
Cmd_ForwardToServer ();
|
||||
return;
|
||||
}
|
||||
if (!pausable.value)
|
||||
if (!pausable->value)
|
||||
SV_ClientPrintf ("Pause not allowed.\n");
|
||||
else
|
||||
{
|
||||
|
@ -1481,7 +1479,7 @@ void Host_Kick_f (void)
|
|||
if (cls.state == ca_dedicated)
|
||||
who = "Console";
|
||||
else
|
||||
who = cl_name.string;
|
||||
who = cl_name->string;
|
||||
else
|
||||
who = save->name;
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ typedef struct
|
|||
} externControl_t;
|
||||
*/
|
||||
|
||||
cvar_t m_filter = {"m_filter","1"};
|
||||
cvar_t *m_filter;
|
||||
|
||||
qboolean mouse_avail;
|
||||
int mouse_buttons;
|
||||
|
@ -96,8 +96,8 @@ float mouse_x, mouse_y;
|
|||
float old_mouse_x, old_mouse_y;
|
||||
|
||||
|
||||
cvar_t in_joystick = {"joystick","1"};
|
||||
cvar_t joy_numbuttons = {"joybuttons","4", true};
|
||||
cvar_t *in_joystick;
|
||||
cvar_t *joy_numbuttons;
|
||||
|
||||
qboolean joy_avail;
|
||||
int joy_oldbuttonstate;
|
||||
|
@ -112,7 +112,7 @@ qboolean extern_avail;
|
|||
int extern_buttons;
|
||||
int extern_oldbuttonstate;
|
||||
int extern_buttonstate;
|
||||
cvar_t aux_look = {"auxlook","1", true};
|
||||
cvar_t *aux_look;
|
||||
externControl_t *extern_control;
|
||||
void IN_StartupExternal (void);
|
||||
void IN_ExternalMove (usercmd_t *cmd);
|
||||
|
@ -123,7 +123,7 @@ qboolean IN_ReadJoystick (void);
|
|||
|
||||
void Toggle_AuxLook_f (void)
|
||||
{
|
||||
if (aux_look.value)
|
||||
if (aux_look->value)
|
||||
Cvar_Set ("auxlook","0");
|
||||
else
|
||||
Cvar_Set ("auxlook","1");
|
||||
|
@ -171,10 +171,10 @@ void IN_Init (void)
|
|||
{
|
||||
int i;
|
||||
|
||||
Cvar_RegisterVariable (&m_filter);
|
||||
Cvar_RegisterVariable (&in_joystick);
|
||||
Cvar_RegisterVariable (&joy_numbuttons);
|
||||
Cvar_RegisterVariable (&aux_look);
|
||||
m_filter = Cvar_Get("m_filter", "0", CVAR_ARCHIVE, "None");
|
||||
in_joystick = Cvar_Get("joystick", "0", CVAR_ARCHIVE, "None");
|
||||
joy_numbuttons = Cvar_Get("joybuttons", "4", CVAR_ARCHIVE, "None");
|
||||
aux_look = Cvar_Get("auxlook", "1", CVAR_ARCHIVE, "None");
|
||||
Cmd_AddCommand ("toggle_auxlook", Toggle_AuxLook_f);
|
||||
Cmd_AddCommand ("force_centerview", Force_CenterView_f);
|
||||
|
||||
|
@ -237,7 +237,7 @@ void IN_Commands (void)
|
|||
{
|
||||
joy_buttonstate = ((dos_inportb(0x201) >> 4)&15)^15;
|
||||
// perform button actions
|
||||
for (i=0 ; i<joy_numbuttons.value ; i++)
|
||||
for (i=0 ; i<joy_numbuttons->value ; i++)
|
||||
{
|
||||
if ( (joy_buttonstate & (1<<i)) &&
|
||||
!(joy_oldbuttonstate & (1<<i)) )
|
||||
|
@ -296,7 +296,7 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
mx = (short)regs.x.cx;
|
||||
my = (short)regs.x.dx;
|
||||
|
||||
if (m_filter.value)
|
||||
if (m_filter->value)
|
||||
{
|
||||
mouse_x = (mx + old_mouse_x) * 0.5;
|
||||
mouse_y = (my + old_mouse_y) * 0.5;
|
||||
|
@ -309,21 +309,21 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
old_mouse_x = mx;
|
||||
old_mouse_y = my;
|
||||
|
||||
mouse_x *= sensitivity.value;
|
||||
mouse_y *= sensitivity.value;
|
||||
mouse_x *= sensitivity->value;
|
||||
mouse_y *= sensitivity->value;
|
||||
|
||||
// add mouse X/Y movement to cmd
|
||||
if ( (in_strafe.state & 1) || (lookstrafe.value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side.value * mouse_x;
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
cl.viewangles[YAW] -= m_yaw->value * mouse_x;
|
||||
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
if ( (in_mlook.state & 1) && !(in_strafe.state & 1))
|
||||
{
|
||||
cl.viewangles[PITCH] += m_pitch.value * mouse_y;
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70)
|
||||
|
@ -332,9 +332,9 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
else
|
||||
{
|
||||
if ((in_strafe.state & 1) && noclip_anglehack)
|
||||
cmd->upmove -= m_forward.value * mouse_y;
|
||||
cmd->upmove -= m_forward->value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
cmd->forwardmove -= m_forward->value * mouse_y;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -347,7 +347,7 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
{
|
||||
float speed, aspeed;
|
||||
|
||||
if (!joy_avail || !in_joystick.value)
|
||||
if (!joy_avail || !in_joystick->value)
|
||||
return;
|
||||
|
||||
IN_ReadJoystick ();
|
||||
|
@ -356,7 +356,7 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
// reading time (win 95)
|
||||
|
||||
if (in_speed.state & 1)
|
||||
speed = cl_movespeedkey.value;
|
||||
speed = cl_movespeedkey->value;
|
||||
else
|
||||
speed = 1;
|
||||
aspeed = speed*host_frametime;
|
||||
|
@ -364,35 +364,35 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
if (in_strafe.state & 1)
|
||||
{
|
||||
if (joystickx < joyxl)
|
||||
cmd->sidemove -= speed*cl_sidespeed.value;
|
||||
cmd->sidemove -= speed*cl_sidespeed->value;
|
||||
else if (joystickx > joyxh)
|
||||
cmd->sidemove += speed*cl_sidespeed.value;
|
||||
cmd->sidemove += speed*cl_sidespeed->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (joystickx < joyxl)
|
||||
cl.viewangles[YAW] += aspeed*cl_yawspeed.value;
|
||||
cl.viewangles[YAW] += aspeed*cl_yawspeed->value;
|
||||
else if (joystickx > joyxh)
|
||||
cl.viewangles[YAW] -= aspeed*cl_yawspeed.value;
|
||||
cl.viewangles[YAW] -= aspeed*cl_yawspeed->value;
|
||||
cl.viewangles[YAW] = anglemod(cl.viewangles[YAW]);
|
||||
}
|
||||
|
||||
if (in_mlook.state & 1)
|
||||
{
|
||||
if (m_pitch.value < 0)
|
||||
if (m_pitch->value < 0)
|
||||
speed *= -1;
|
||||
|
||||
if (joysticky < joyyl)
|
||||
cl.viewangles[PITCH] += aspeed*cl_pitchspeed.value;
|
||||
cl.viewangles[PITCH] += aspeed*cl_pitchspeed->value;
|
||||
else if (joysticky > joyyh)
|
||||
cl.viewangles[PITCH] -= aspeed*cl_pitchspeed.value;
|
||||
cl.viewangles[PITCH] -= aspeed*cl_pitchspeed->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (joysticky < joyyl)
|
||||
cmd->forwardmove += speed*cl_forwardspeed.value;
|
||||
cmd->forwardmove += speed*cl_forwardspeed->value;
|
||||
else if (joysticky > joyyh)
|
||||
cmd->forwardmove -= speed*cl_backspeed.value;
|
||||
cmd->forwardmove -= speed*cl_backspeed->value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -618,7 +618,7 @@ Con_DPrintf("OUT: y:%f p:%f r:%f f:%f s:%f u:%f\n", extern_control->viewangles[Y
|
|||
if (cl.viewangles[PITCH] < -70)
|
||||
cl.viewangles[PITCH] = -70;
|
||||
|
||||
freelook = (extern_control->flags & AUX_FLAG_FREELOOK || aux_look.value || in_mlook.state & 1);
|
||||
freelook = (extern_control->flags & AUX_FLAG_FREELOOK || aux_look->value || in_mlook.state & 1);
|
||||
|
||||
if (freelook)
|
||||
V_StopPitchDrift ();
|
||||
|
|
|
@ -69,7 +69,7 @@ extern int global_dx, global_dy;
|
|||
// globals
|
||||
//
|
||||
|
||||
cvar_t _windowed_mouse = {"_windowed_mouse","1", true};
|
||||
cvar_t *_windowed_mouse;
|
||||
int x_root, y_root;
|
||||
int x_root_old, y_root_old;
|
||||
//
|
||||
|
@ -104,7 +104,7 @@ void IN_CenterMouse( void )
|
|||
//
|
||||
static void CheckMouseState(void)
|
||||
{
|
||||
if (x_focus && _windowed_mouse.value && !x_grabbed) {
|
||||
if (x_focus && _windowed_mouse->value && !x_grabbed) {
|
||||
x_grabbed = true;
|
||||
printf("fooling with mouse!\n");
|
||||
if (XGetPointerControl( x_disp, &x_mouse_num, &x_mouse_denom, &x_mouse_thresh ))
|
||||
|
@ -126,7 +126,7 @@ static void CheckMouseState(void)
|
|||
// safe initial values
|
||||
x_root = x_root_old = vid.width >> 1;
|
||||
y_root = y_root_old = vid.height >> 1;
|
||||
} else if (x_grabbed && (!_windowed_mouse.value || !x_focus)) {
|
||||
} else if (x_grabbed && (!_windowed_mouse->value || !x_focus)) {
|
||||
printf("fooling with mouse!\n");
|
||||
x_grabbed = false;
|
||||
// undo mouse warp
|
||||
|
@ -148,7 +148,7 @@ void IN_Init (void)
|
|||
{
|
||||
if (!x_disp) Sys_Error( "X display not open!\n" );
|
||||
|
||||
Cvar_RegisterVariable (&_windowed_mouse);
|
||||
_windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_ARCHIVE, "None");
|
||||
|
||||
// we really really want to clean these up...
|
||||
atexit( IN_Shutdown );
|
||||
|
@ -210,8 +210,8 @@ IN_Move (usercmd_t *cmd)
|
|||
|
||||
// printf("GOT: dx %d dy %d\n", dx, dy);
|
||||
|
||||
dx *= sensitivity.value;
|
||||
dy *= sensitivity.value;
|
||||
dx *= sensitivity->value;
|
||||
dy *= sensitivity->value;
|
||||
|
||||
//
|
||||
// implement low pass filter to smooth motion a bit
|
||||
|
@ -236,21 +236,21 @@ IN_Move (usercmd_t *cmd)
|
|||
}
|
||||
|
||||
// add mouse X/Y movement to cmd
|
||||
if ((in_strafe.state & 1) || (lookstrafe.value && (in_mlook.state & 1)))
|
||||
cmd->sidemove += m_side.value * dx;
|
||||
if ((in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1)))
|
||||
cmd->sidemove += m_side->value * dx;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * dx;
|
||||
cl.viewangles[YAW] -= m_yaw->value * dx;
|
||||
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
if ((in_mlook.state & 1) && !(in_strafe.state & 1)) {
|
||||
cl.viewangles[PITCH] += m_pitch.value * dy;
|
||||
cl.viewangles[PITCH] += m_pitch->value * dy;
|
||||
if (cl.viewangles[PITCH] > 80) cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70) cl.viewangles[PITCH] = -70;
|
||||
}
|
||||
else {
|
||||
if ((in_strafe.state & 1) && noclip_anglehack) cmd->upmove -= m_forward.value * dy;
|
||||
else cmd->forwardmove -= m_forward.value * dy;
|
||||
if ((in_strafe.state & 1) && noclip_anglehack) cmd->upmove -= m_forward->value * dy;
|
||||
else cmd->forwardmove -= m_forward->value * dy;
|
||||
}
|
||||
}
|
||||
|
|
164
source/in_win.c
164
source/in_win.c
|
@ -42,7 +42,7 @@ HRESULT (WINAPI *pDirectInputCreate)(HINSTANCE hinst, DWORD dwVersion,
|
|||
LPDIRECTINPUT * lplpDirectInput, LPUNKNOWN punkOuter);
|
||||
|
||||
// mouse variables
|
||||
cvar_t m_filter = {"m_filter","0"};
|
||||
cvar_t *m_filter;
|
||||
|
||||
int mouse_buttons;
|
||||
int mouse_oldbuttonstate;
|
||||
|
@ -92,25 +92,25 @@ PDWORD pdwRawValue[JOY_MAX_AXES];
|
|||
// 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 = {"joystick","0", true};
|
||||
cvar_t joy_name = {"joyname", "joystick"};
|
||||
cvar_t joy_advanced = {"joyadvanced", "0"};
|
||||
cvar_t joy_advaxisx = {"joyadvaxisx", "0"};
|
||||
cvar_t joy_advaxisy = {"joyadvaxisy", "0"};
|
||||
cvar_t joy_advaxisz = {"joyadvaxisz", "0"};
|
||||
cvar_t joy_advaxisr = {"joyadvaxisr", "0"};
|
||||
cvar_t joy_advaxisu = {"joyadvaxisu", "0"};
|
||||
cvar_t joy_advaxisv = {"joyadvaxisv", "0"};
|
||||
cvar_t joy_forwardthreshold = {"joyforwardthreshold", "0.15"};
|
||||
cvar_t joy_sidethreshold = {"joysidethreshold", "0.15"};
|
||||
cvar_t joy_pitchthreshold = {"joypitchthreshold", "0.15"};
|
||||
cvar_t joy_yawthreshold = {"joyyawthreshold", "0.15"};
|
||||
cvar_t joy_forwardsensitivity = {"joyforwardsensitivity", "-1.0"};
|
||||
cvar_t joy_sidesensitivity = {"joysidesensitivity", "-1.0"};
|
||||
cvar_t joy_pitchsensitivity = {"joypitchsensitivity", "1.0"};
|
||||
cvar_t joy_yawsensitivity = {"joyyawsensitivity", "-1.0"};
|
||||
cvar_t joy_wwhack1 = {"joywwhack1", "0.0"};
|
||||
cvar_t joy_wwhack2 = {"joywwhack2", "0.0"};
|
||||
cvar_t *in_joystick;
|
||||
cvar_t *joy_name;
|
||||
cvar_t *joy_advanced;
|
||||
cvar_t *joy_advaxisx;
|
||||
cvar_t *joy_advaxisy;
|
||||
cvar_t *joy_advaxisz;
|
||||
cvar_t *joy_advaxisr;
|
||||
cvar_t *joy_advaxisu;
|
||||
cvar_t *joy_advaxisv;
|
||||
cvar_t *joy_forwardthreshold;
|
||||
cvar_t *joy_sidethreshold;
|
||||
cvar_t *joy_pitchthreshold;
|
||||
cvar_t *joy_yawthreshold;
|
||||
cvar_t *joy_forwardsensitivity;
|
||||
cvar_t *joy_sidesensitivity;
|
||||
cvar_t *joy_pitchsensitivity;
|
||||
cvar_t *joy_yawsensitivity;
|
||||
cvar_t *joy_wwhack1;
|
||||
cvar_t *joy_wwhack2;
|
||||
|
||||
qboolean joy_avail, joy_advancedinit, joy_haspov;
|
||||
DWORD joy_oldbuttonstate, joy_oldpovstate;
|
||||
|
@ -494,28 +494,28 @@ IN_Init
|
|||
void IN_Init (void)
|
||||
{
|
||||
// mouse variables
|
||||
Cvar_RegisterVariable (&m_filter);
|
||||
m_filter = Cvar_Get("m_filter", "0", CVAR_ARCHIVE, "None");
|
||||
|
||||
// joystick variables
|
||||
Cvar_RegisterVariable (&in_joystick);
|
||||
Cvar_RegisterVariable (&joy_name);
|
||||
Cvar_RegisterVariable (&joy_advanced);
|
||||
Cvar_RegisterVariable (&joy_advaxisx);
|
||||
Cvar_RegisterVariable (&joy_advaxisy);
|
||||
Cvar_RegisterVariable (&joy_advaxisz);
|
||||
Cvar_RegisterVariable (&joy_advaxisr);
|
||||
Cvar_RegisterVariable (&joy_advaxisu);
|
||||
Cvar_RegisterVariable (&joy_advaxisv);
|
||||
Cvar_RegisterVariable (&joy_forwardthreshold);
|
||||
Cvar_RegisterVariable (&joy_sidethreshold);
|
||||
Cvar_RegisterVariable (&joy_pitchthreshold);
|
||||
Cvar_RegisterVariable (&joy_yawthreshold);
|
||||
Cvar_RegisterVariable (&joy_forwardsensitivity);
|
||||
Cvar_RegisterVariable (&joy_sidesensitivity);
|
||||
Cvar_RegisterVariable (&joy_pitchsensitivity);
|
||||
Cvar_RegisterVariable (&joy_yawsensitivity);
|
||||
Cvar_RegisterVariable (&joy_wwhack1);
|
||||
Cvar_RegisterVariable (&joy_wwhack2);
|
||||
in_joystick = Cvar_Get("joystick", "0", CVAR_ARCHIVE, "None");
|
||||
joy_name = Cvar_Get("joyname", "joystick", CVAR_NONE, "None");
|
||||
joy_advanced = Cvar_Get("joyadvanced", "0", CVAR_NONE, "None");
|
||||
joy_advaxisx = Cvar_Get("joyadvaxisx", "0", CVAR_NONE, "None");
|
||||
joy_advaxisy = Cvar_Get("joyadvaxisy", "0", CVAR_NONE, "None");
|
||||
joy_advaxisz = Cvar_Get("joyadvaxisz", "0", CVAR_NONE, "None");
|
||||
joy_advaxisr = Cvar_Get("joyadvaxisr", "0", CVAR_NONE, "None");
|
||||
joy_advaxisu = Cvar_Get("joyadvaxisu", "0", CVAR_NONE, "None");
|
||||
joy_advaxisv = Cvar_Get("joyadvaxisv", "0", CVAR_NONE, "None");
|
||||
joy_forwardthreshold = Cvar_Get("joyforwardthreshold", "0.15", CVAR_NONE, "None");
|
||||
joy_sidethreshold = Cvar_Get("joysidethreshold", "0.15", CVAR_NONE, "None");
|
||||
joy_pitchthreshold = Cvar_Get("joypitchthreshold", "0.15", CVAR_NONE, "None");
|
||||
joy_yawthreshold = Cvar_Get("joyyawthreshold", "0.15", CVAR_NONE, "None");
|
||||
joy_forwardsensitivity = Cvar_Get("joyforwardsensitivity", "-1.0", CVAR_NONE, "None");
|
||||
joy_sidesensitivity = Cvar_Get("joysidesensitivity", "-1.0", CVAR_NONE, "None");
|
||||
joy_pitchsensitivity = Cvar_Get("joypitchsensitivity", "1.0", CVAR_NONE, "None");
|
||||
joy_yawsensitivity = Cvar_Get("joyyawsensitivity", "-1.0", CVAR_NONE, "None");
|
||||
joy_wwhack1 = Cvar_Get("joywwhack1", "0.0", CVAR_NONE, "None");
|
||||
joy_wwhack2 = Cvar_Get("joywwhack2", "0.0", CVAR_NONE, "None");
|
||||
|
||||
Cmd_AddCommand ("force_centerview", Force_CenterView_f);
|
||||
Cmd_AddCommand ("joyadvancedupdate", Joy_AdvancedUpdate_f);
|
||||
|
@ -690,7 +690,7 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
//if (mx || my)
|
||||
// Con_DPrintf("mx=%d, my=%d\n", mx, my);
|
||||
|
||||
if (m_filter.value)
|
||||
if (m_filter->value)
|
||||
{
|
||||
mouse_x = (mx + old_mouse_x) * 0.5;
|
||||
mouse_y = (my + old_mouse_y) * 0.5;
|
||||
|
@ -704,21 +704,21 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
old_mouse_x = mx;
|
||||
old_mouse_y = my;
|
||||
|
||||
mouse_x *= sensitivity.value;
|
||||
mouse_y *= sensitivity.value;
|
||||
mouse_x *= sensitivity->value;
|
||||
mouse_y *= sensitivity->value;
|
||||
|
||||
// add mouse X/Y movement to cmd
|
||||
if ( (in_strafe.state & 1) || (lookstrafe.value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side.value * mouse_x;
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
cl.viewangles[YAW] -= m_yaw->value * mouse_x;
|
||||
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
if ( (in_mlook.state & 1) && !(in_strafe.state & 1))
|
||||
{
|
||||
cl.viewangles[PITCH] += m_pitch.value * mouse_y;
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70)
|
||||
|
@ -727,9 +727,9 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
else
|
||||
{
|
||||
if ((in_strafe.state & 1) && noclip_anglehack)
|
||||
cmd->upmove -= m_forward.value * mouse_y;
|
||||
cmd->upmove -= m_forward->value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
cmd->forwardmove -= m_forward->value * mouse_y;
|
||||
}
|
||||
|
||||
// if the mouse has moved, force it to the center, so there's room to move
|
||||
|
@ -914,7 +914,7 @@ void Joy_AdvancedUpdate_f (void)
|
|||
pdwRawValue[i] = RawValuePointer(i);
|
||||
}
|
||||
|
||||
if( joy_advanced.value == 0.0)
|
||||
if( joy_advanced->value == 0.0)
|
||||
{
|
||||
// default joystick initialization
|
||||
// 2 axes only with joystick control
|
||||
|
@ -925,30 +925,30 @@ void Joy_AdvancedUpdate_f (void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (Q_strcmp (joy_name.string, "joystick") != 0)
|
||||
if (Q_strcmp (joy_name->string, "joystick") != 0)
|
||||
{
|
||||
// notify user of advanced controller
|
||||
Con_Printf ("\n%s configured\n\n", joy_name.string);
|
||||
Con_Printf ("\n%s configured\n\n", joy_name->string);
|
||||
}
|
||||
|
||||
// advanced initialization here
|
||||
// data supplied by user via joy_axisn cvars
|
||||
dwTemp = (DWORD) joy_advaxisx.value;
|
||||
dwTemp = (DWORD) joy_advaxisx->value;
|
||||
dwAxisMap[JOY_AXIS_X] = dwTemp & 0x0000000f;
|
||||
dwControlMap[JOY_AXIS_X] = dwTemp & JOY_RELATIVE_AXIS;
|
||||
dwTemp = (DWORD) joy_advaxisy.value;
|
||||
dwTemp = (DWORD) joy_advaxisy->value;
|
||||
dwAxisMap[JOY_AXIS_Y] = dwTemp & 0x0000000f;
|
||||
dwControlMap[JOY_AXIS_Y] = dwTemp & JOY_RELATIVE_AXIS;
|
||||
dwTemp = (DWORD) joy_advaxisz.value;
|
||||
dwTemp = (DWORD) joy_advaxisz->value;
|
||||
dwAxisMap[JOY_AXIS_Z] = dwTemp & 0x0000000f;
|
||||
dwControlMap[JOY_AXIS_Z] = dwTemp & JOY_RELATIVE_AXIS;
|
||||
dwTemp = (DWORD) joy_advaxisr.value;
|
||||
dwTemp = (DWORD) joy_advaxisr->value;
|
||||
dwAxisMap[JOY_AXIS_R] = dwTemp & 0x0000000f;
|
||||
dwControlMap[JOY_AXIS_R] = dwTemp & JOY_RELATIVE_AXIS;
|
||||
dwTemp = (DWORD) joy_advaxisu.value;
|
||||
dwTemp = (DWORD) joy_advaxisu->value;
|
||||
dwAxisMap[JOY_AXIS_U] = dwTemp & 0x0000000f;
|
||||
dwControlMap[JOY_AXIS_U] = dwTemp & JOY_RELATIVE_AXIS;
|
||||
dwTemp = (DWORD) joy_advaxisv.value;
|
||||
dwTemp = (DWORD) joy_advaxisv->value;
|
||||
dwAxisMap[JOY_AXIS_V] = dwTemp & 0x0000000f;
|
||||
dwControlMap[JOY_AXIS_V] = dwTemp & JOY_RELATIVE_AXIS;
|
||||
}
|
||||
|
@ -1052,7 +1052,7 @@ qboolean IN_ReadJoystick (void)
|
|||
// this is a hack -- there is a bug in the Logitech WingMan Warrior DirectInput Driver
|
||||
// rather than having 32768 be the zero point, they have the zero point at 32668
|
||||
// go figure -- anyway, now we get the full resolution out of the device
|
||||
if (joy_wwhack1.value != 0.0)
|
||||
if (joy_wwhack1->value != 0.0)
|
||||
{
|
||||
ji.dwUpos += 100;
|
||||
}
|
||||
|
@ -1090,7 +1090,7 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
}
|
||||
|
||||
// verify joystick is available and that the user wants to use it
|
||||
if (!joy_avail || !in_joystick.value)
|
||||
if (!joy_avail || !in_joystick->value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1102,7 +1102,7 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
}
|
||||
|
||||
if (in_speed.state & 1)
|
||||
speed = cl_movespeedkey.value;
|
||||
speed = cl_movespeedkey->value;
|
||||
else
|
||||
speed = 1;
|
||||
aspeed = speed * host_frametime;
|
||||
|
@ -1115,7 +1115,7 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
// move centerpoint to zero
|
||||
fAxisValue -= 32768.0;
|
||||
|
||||
if (joy_wwhack2.value != 0.0)
|
||||
if (joy_wwhack2->value != 0.0)
|
||||
{
|
||||
if (dwAxisMap[i] == AxisTurn)
|
||||
{
|
||||
|
@ -1137,20 +1137,20 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
switch (dwAxisMap[i])
|
||||
{
|
||||
case AxisForward:
|
||||
if ((joy_advanced.value == 0.0) && (in_mlook.state & 1))
|
||||
if ((joy_advanced->value == 0.0) && (in_mlook.state & 1))
|
||||
{
|
||||
// user wants forward control to become look control
|
||||
if (fabs(fAxisValue) > joy_pitchthreshold.value)
|
||||
if (fabs(fAxisValue) > joy_pitchthreshold->value)
|
||||
{
|
||||
// if mouse invert is on, invert the joystick pitch value
|
||||
// only absolute control support here (joy_advanced is false)
|
||||
if (m_pitch.value < 0.0)
|
||||
if (m_pitch->value < 0.0)
|
||||
{
|
||||
cl.viewangles[PITCH] -= (fAxisValue * joy_pitchsensitivity.value) * aspeed * cl_pitchspeed.value;
|
||||
cl.viewangles[PITCH] -= (fAxisValue * joy_pitchsensitivity->value) * aspeed * cl_pitchspeed->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity.value) * aspeed * cl_pitchspeed.value;
|
||||
cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity->value) * aspeed * cl_pitchspeed->value;
|
||||
}
|
||||
V_StopPitchDrift();
|
||||
}
|
||||
|
@ -1160,48 +1160,48 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
// disable pitch return-to-center unless requested by user
|
||||
// *** this code can be removed when the lookspring bug is fixed
|
||||
// *** the bug always has the lookspring feature on
|
||||
if(lookspring.value == 0.0)
|
||||
if(lookspring->value == 0.0)
|
||||
V_StopPitchDrift();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// user wants forward control to be forward control
|
||||
if (fabs(fAxisValue) > joy_forwardthreshold.value)
|
||||
if (fabs(fAxisValue) > joy_forwardthreshold->value)
|
||||
{
|
||||
cmd->forwardmove += (fAxisValue * joy_forwardsensitivity.value) * speed * cl_forwardspeed.value;
|
||||
cmd->forwardmove += (fAxisValue * joy_forwardsensitivity->value) * speed * cl_forwardspeed->value;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case AxisSide:
|
||||
if (fabs(fAxisValue) > joy_sidethreshold.value)
|
||||
if (fabs(fAxisValue) > joy_sidethreshold->value)
|
||||
{
|
||||
cmd->sidemove += (fAxisValue * joy_sidesensitivity.value) * speed * cl_sidespeed.value;
|
||||
cmd->sidemove += (fAxisValue * joy_sidesensitivity->value) * speed * cl_sidespeed->value;
|
||||
}
|
||||
break;
|
||||
|
||||
case AxisTurn:
|
||||
if ((in_strafe.state & 1) || (lookstrafe.value && (in_mlook.state & 1)))
|
||||
if ((in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1)))
|
||||
{
|
||||
// user wants turn control to become side control
|
||||
if (fabs(fAxisValue) > joy_sidethreshold.value)
|
||||
if (fabs(fAxisValue) > joy_sidethreshold->value)
|
||||
{
|
||||
cmd->sidemove -= (fAxisValue * joy_sidesensitivity.value) * speed * cl_sidespeed.value;
|
||||
cmd->sidemove -= (fAxisValue * joy_sidesensitivity->value) * speed * cl_sidespeed->value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// user wants turn control to be turn control
|
||||
if (fabs(fAxisValue) > joy_yawthreshold.value)
|
||||
if (fabs(fAxisValue) > joy_yawthreshold->value)
|
||||
{
|
||||
if(dwControlMap[i] == JOY_ABSOLUTE_AXIS)
|
||||
{
|
||||
cl.viewangles[YAW] += (fAxisValue * joy_yawsensitivity.value) * aspeed * cl_yawspeed.value;
|
||||
cl.viewangles[YAW] += (fAxisValue * joy_yawsensitivity->value) * aspeed * cl_yawspeed->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
cl.viewangles[YAW] += (fAxisValue * joy_yawsensitivity.value) * speed * 180.0;
|
||||
cl.viewangles[YAW] += (fAxisValue * joy_yawsensitivity->value) * speed * 180.0;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1211,16 +1211,16 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
case AxisLook:
|
||||
if (in_mlook.state & 1)
|
||||
{
|
||||
if (fabs(fAxisValue) > joy_pitchthreshold.value)
|
||||
if (fabs(fAxisValue) > joy_pitchthreshold->value)
|
||||
{
|
||||
// pitch movement detected and pitch movement desired by user
|
||||
if(dwControlMap[i] == JOY_ABSOLUTE_AXIS)
|
||||
{
|
||||
cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity.value) * aspeed * cl_pitchspeed.value;
|
||||
cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity->value) * aspeed * cl_pitchspeed->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity.value) * speed * 180.0;
|
||||
cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity->value) * speed * 180.0;
|
||||
}
|
||||
V_StopPitchDrift();
|
||||
}
|
||||
|
@ -1230,7 +1230,7 @@ void IN_JoyMove (usercmd_t *cmd)
|
|||
// disable pitch return-to-center unless requested by user
|
||||
// *** this code can be removed when the lookspring bug is fixed
|
||||
// *** the bug always has the lookspring feature on
|
||||
if(lookspring.value == 0.0)
|
||||
if(lookspring->value == 0.0)
|
||||
V_StopPitchDrift();
|
||||
}
|
||||
}
|
||||
|
|
178
source/menu.c
178
source/menu.c
|
@ -710,10 +710,10 @@ void M_Menu_Setup_f (void)
|
|||
key_dest = key_menu;
|
||||
m_state = m_setup;
|
||||
m_entersound = true;
|
||||
Q_strcpy(setup_myname, cl_name.string);
|
||||
Q_strcpy(setup_hostname, hostname.string);
|
||||
setup_top = setup_oldtop = ((int)cl_color.value) >> 4;
|
||||
setup_bottom = setup_oldbottom = ((int)cl_color.value) & 15;
|
||||
Q_strcpy(setup_myname, cl_name->string);
|
||||
Q_strcpy(setup_hostname, hostname->string);
|
||||
setup_top = setup_oldtop = ((int)cl_color->value) >> 4;
|
||||
setup_bottom = setup_oldbottom = ((int)cl_color->value) & 15;
|
||||
}
|
||||
|
||||
|
||||
|
@ -807,10 +807,10 @@ forward:
|
|||
goto forward;
|
||||
|
||||
// setup_cursor == 4 (OK)
|
||||
if (Q_strcmp(cl_name.string, setup_myname) != 0)
|
||||
if (Q_strcmp(cl_name->string, setup_myname) != 0)
|
||||
Cbuf_AddText ( va ("name \"%s\"\n", setup_myname) );
|
||||
if (Q_strcmp(hostname.string, setup_hostname) != 0)
|
||||
Cvar_Set("hostname", setup_hostname);
|
||||
if (Q_strcmp(hostname->string, setup_hostname) != 0)
|
||||
Cvar_Set(hostname, setup_hostname);
|
||||
if (setup_top != setup_oldtop || setup_bottom != setup_oldbottom)
|
||||
Cbuf_AddText( va ("color %i %i\n", setup_top, setup_bottom) );
|
||||
m_entersound = true;
|
||||
|
@ -1081,78 +1081,78 @@ void M_AdjustSliders (int dir)
|
|||
switch (options_cursor)
|
||||
{
|
||||
case 3: // screen size
|
||||
scr_viewsize.value += dir * 10;
|
||||
if (scr_viewsize.value < 30)
|
||||
scr_viewsize.value = 30;
|
||||
if (scr_viewsize.value > 120)
|
||||
scr_viewsize.value = 120;
|
||||
Cvar_SetValue ("viewsize", scr_viewsize.value);
|
||||
scr_viewsize->value += dir * 10;
|
||||
if (scr_viewsize->value < 30)
|
||||
scr_viewsize->value = 30;
|
||||
if (scr_viewsize->value > 120)
|
||||
scr_viewsize->value = 120;
|
||||
Cvar_SetValue (scr_viewsize, scr_viewsize->value);
|
||||
break;
|
||||
case 4: // gamma
|
||||
v_gamma.value -= dir * 0.05;
|
||||
if (v_gamma.value < 0.5)
|
||||
v_gamma.value = 0.5;
|
||||
if (v_gamma.value > 1)
|
||||
v_gamma.value = 1;
|
||||
Cvar_SetValue ("gamma", v_gamma.value);
|
||||
v_gamma->value -= dir * 0.05;
|
||||
if (v_gamma->value < 0.5)
|
||||
v_gamma->value = 0.5;
|
||||
if (v_gamma->value > 1)
|
||||
v_gamma->value = 1;
|
||||
Cvar_SetValue (v_gamma, v_gamma->value);
|
||||
break;
|
||||
case 5: // mouse speed
|
||||
sensitivity.value += dir * 0.5;
|
||||
if (sensitivity.value < 1)
|
||||
sensitivity.value = 1;
|
||||
if (sensitivity.value > 11)
|
||||
sensitivity.value = 11;
|
||||
Cvar_SetValue ("sensitivity", sensitivity.value);
|
||||
sensitivity->value += dir * 0.5;
|
||||
if (sensitivity->value < 1)
|
||||
sensitivity->value = 1;
|
||||
if (sensitivity->value > 11)
|
||||
sensitivity->value = 11;
|
||||
Cvar_SetValue(sensitivity, sensitivity->value);
|
||||
break;
|
||||
case 6: // music volume
|
||||
#ifdef _WIN32
|
||||
bgmvolume.value += dir * 1.0;
|
||||
bgmvolume->value += dir * 1.0;
|
||||
#else
|
||||
bgmvolume.value += dir * 0.1;
|
||||
bgmvolume->value += dir * 0.1;
|
||||
#endif
|
||||
if (bgmvolume.value < 0)
|
||||
bgmvolume.value = 0;
|
||||
if (bgmvolume.value > 1)
|
||||
bgmvolume.value = 1;
|
||||
Cvar_SetValue ("bgmvolume", bgmvolume.value);
|
||||
if (bgmvolume->value < 0)
|
||||
bgmvolume->value = 0;
|
||||
if (bgmvolume->value > 1)
|
||||
bgmvolume->value = 1;
|
||||
Cvar_SetValue(bgmvolume, bgmvolume->value);
|
||||
break;
|
||||
case 7: // sfx volume
|
||||
volume.value += dir * 0.1;
|
||||
if (volume.value < 0)
|
||||
volume.value = 0;
|
||||
if (volume.value > 1)
|
||||
volume.value = 1;
|
||||
Cvar_SetValue ("volume", volume.value);
|
||||
volume->value += dir * 0.1;
|
||||
if (volume->value < 0)
|
||||
volume->value = 0;
|
||||
if (volume->value > 1)
|
||||
volume->value = 1;
|
||||
Cvar_SetValue(volume, volume->value);
|
||||
break;
|
||||
|
||||
case 8: // allways run
|
||||
if (cl_forwardspeed.value > 200)
|
||||
if (cl_forwardspeed->value > 200)
|
||||
{
|
||||
Cvar_SetValue ("cl_forwardspeed", 200);
|
||||
Cvar_SetValue ("cl_backspeed", 200);
|
||||
Cvar_SetValue(cl_forwardspeed, 200);
|
||||
Cvar_SetValue(cl_backspeed, 200);
|
||||
}
|
||||
else
|
||||
{
|
||||
Cvar_SetValue ("cl_forwardspeed", 400);
|
||||
Cvar_SetValue ("cl_backspeed", 400);
|
||||
Cvar_SetValue(cl_forwardspeed, 400);
|
||||
Cvar_SetValue(cl_backspeed, 400);
|
||||
}
|
||||
break;
|
||||
|
||||
case 9: // invert mouse
|
||||
Cvar_SetValue ("m_pitch", -m_pitch.value);
|
||||
Cvar_SetValue(m_pitch, -m_pitch->value);
|
||||
break;
|
||||
|
||||
case 10: // lookspring
|
||||
Cvar_SetValue ("lookspring", !lookspring.value);
|
||||
Cvar_SetValue(lookspring, !lookspring->value);
|
||||
break;
|
||||
|
||||
case 11: // lookstrafe
|
||||
Cvar_SetValue ("lookstrafe", !lookstrafe.value);
|
||||
Cvar_SetValue(lookstrafe, !lookstrafe->value);
|
||||
break;
|
||||
|
||||
#ifdef _WIN32
|
||||
case 13: // _windowed_mouse
|
||||
Cvar_SetValue ("_windowed_mouse", !_windowed_mouse.value);
|
||||
Cvar_SetValue(_windowed_mouse, !_windowed_mouse->value);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
@ -1202,36 +1202,36 @@ void M_Options_Draw (void)
|
|||
M_Print (16, 48, " Reset to defaults");
|
||||
|
||||
M_Print (16, 56, " Screen size");
|
||||
r = (scr_viewsize.value - 30) / (120 - 30);
|
||||
r = (scr_viewsize->value - 30) / (120 - 30);
|
||||
M_DrawSlider (220, 56, r);
|
||||
|
||||
M_Print (16, 64, " Brightness");
|
||||
r = (1.0 - v_gamma.value) / 0.5;
|
||||
r = (1.0 - v_gamma->value) / 0.5;
|
||||
M_DrawSlider (220, 64, r);
|
||||
|
||||
M_Print (16, 72, " Mouse Speed");
|
||||
r = (sensitivity.value - 1)/10;
|
||||
r = (sensitivity->value - 1)/10;
|
||||
M_DrawSlider (220, 72, r);
|
||||
|
||||
M_Print (16, 80, " CD Music Volume");
|
||||
r = bgmvolume.value;
|
||||
r = bgmvolume->value;
|
||||
M_DrawSlider (220, 80, r);
|
||||
|
||||
M_Print (16, 88, " Sound Volume");
|
||||
r = volume.value;
|
||||
r = volume->value;
|
||||
M_DrawSlider (220, 88, r);
|
||||
|
||||
M_Print (16, 96, " Always Run");
|
||||
M_DrawCheckbox (220, 96, cl_forwardspeed.value > 200);
|
||||
M_DrawCheckbox (220, 96, cl_forwardspeed->value > 200);
|
||||
|
||||
M_Print (16, 104, " Invert Mouse");
|
||||
M_DrawCheckbox (220, 104, m_pitch.value < 0);
|
||||
M_DrawCheckbox (220, 104, m_pitch->value < 0);
|
||||
|
||||
M_Print (16, 112, " Lookspring");
|
||||
M_DrawCheckbox (220, 112, lookspring.value);
|
||||
M_DrawCheckbox (220, 112, lookspring->value);
|
||||
|
||||
M_Print (16, 120, " Lookstrafe");
|
||||
M_DrawCheckbox (220, 120, lookstrafe.value);
|
||||
M_DrawCheckbox (220, 120, lookstrafe->value);
|
||||
|
||||
if (vid_menudrawfn)
|
||||
M_Print (16, 128, " Video Options");
|
||||
|
@ -1240,7 +1240,7 @@ void M_Options_Draw (void)
|
|||
if (modestate == MS_WINDOWED)
|
||||
{
|
||||
M_Print (16, 136, " Use Mouse");
|
||||
M_DrawCheckbox (220, 136, _windowed_mouse.value);
|
||||
M_DrawCheckbox (220, 136, _windowed_mouse->value);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -2577,7 +2577,7 @@ void M_GameOptions_Draw (void)
|
|||
M_Print (160, 56, va("%i", maxplayers) );
|
||||
|
||||
M_Print (0, 64, " Game Type");
|
||||
if (coop.value)
|
||||
if (coop->value)
|
||||
M_Print (160, 64, "Cooperative");
|
||||
else
|
||||
M_Print (160, 64, "Deathmatch");
|
||||
|
@ -2587,7 +2587,7 @@ void M_GameOptions_Draw (void)
|
|||
{
|
||||
char *msg;
|
||||
|
||||
switch((int)teamplay.value)
|
||||
switch((int)teamplay->value)
|
||||
{
|
||||
case 1: msg = "No Friendly Fire"; break;
|
||||
case 2: msg = "Friendly Fire"; break;
|
||||
|
@ -2603,7 +2603,7 @@ void M_GameOptions_Draw (void)
|
|||
{
|
||||
char *msg;
|
||||
|
||||
switch((int)teamplay.value)
|
||||
switch((int)teamplay->value)
|
||||
{
|
||||
case 1: msg = "No Friendly Fire"; break;
|
||||
case 2: msg = "Friendly Fire"; break;
|
||||
|
@ -2613,26 +2613,26 @@ void M_GameOptions_Draw (void)
|
|||
}
|
||||
|
||||
M_Print (0, 80, " Skill");
|
||||
if (skill.value == 0)
|
||||
if (skill->value == 0)
|
||||
M_Print (160, 80, "Easy difficulty");
|
||||
else if (skill.value == 1)
|
||||
else if (skill->value == 1)
|
||||
M_Print (160, 80, "Normal difficulty");
|
||||
else if (skill.value == 2)
|
||||
else if (skill->value == 2)
|
||||
M_Print (160, 80, "Hard difficulty");
|
||||
else
|
||||
M_Print (160, 80, "Nightmare difficulty");
|
||||
|
||||
M_Print (0, 88, " Frag Limit");
|
||||
if (fraglimit.value == 0)
|
||||
if (fraglimit->value == 0)
|
||||
M_Print (160, 88, "none");
|
||||
else
|
||||
M_Print (160, 88, va("%i frags", (int)fraglimit.value));
|
||||
M_Print (160, 88, va("%i frags", (int)fraglimit->value));
|
||||
|
||||
M_Print (0, 96, " Time Limit");
|
||||
if (timelimit.value == 0)
|
||||
if (timelimit->value == 0)
|
||||
M_Print (160, 96, "none");
|
||||
else
|
||||
M_Print (160, 96, va("%i minutes", (int)timelimit.value));
|
||||
M_Print (160, 96, va("%i minutes", (int)timelimit->value));
|
||||
|
||||
M_Print (0, 112, " Episode");
|
||||
//MED 01/06/97 added hipnotic episodes
|
||||
|
@ -2705,7 +2705,7 @@ void M_NetStart_Change (int dir)
|
|||
break;
|
||||
|
||||
case 2:
|
||||
Cvar_SetValue ("coop", coop.value ? 0 : 1);
|
||||
Cvar_SetValue(coop, coop->value ? 0 : 1);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
|
@ -2714,35 +2714,35 @@ void M_NetStart_Change (int dir)
|
|||
else
|
||||
count = 2;
|
||||
|
||||
Cvar_SetValue ("teamplay", teamplay.value + dir);
|
||||
if (teamplay.value > count)
|
||||
Cvar_SetValue ("teamplay", 0);
|
||||
else if (teamplay.value < 0)
|
||||
Cvar_SetValue ("teamplay", count);
|
||||
Cvar_SetValue(teamplay, teamplay->value + dir);
|
||||
if (teamplay->value > count)
|
||||
Cvar_SetValue(teamplay, 0);
|
||||
else if (teamplay->value < 0)
|
||||
Cvar_SetValue(teamplay, count);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
Cvar_SetValue ("skill", skill.value + dir);
|
||||
if (skill.value > 3)
|
||||
Cvar_SetValue ("skill", 0);
|
||||
if (skill.value < 0)
|
||||
Cvar_SetValue ("skill", 3);
|
||||
Cvar_SetValue(skill, skill->value + dir);
|
||||
if (skill->value > 3)
|
||||
Cvar_SetValue(skill, 0);
|
||||
if (skill->value < 0)
|
||||
Cvar_SetValue(skill, 3);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
Cvar_SetValue ("fraglimit", fraglimit.value + dir*10);
|
||||
if (fraglimit.value > 100)
|
||||
Cvar_SetValue ("fraglimit", 0);
|
||||
if (fraglimit.value < 0)
|
||||
Cvar_SetValue ("fraglimit", 100);
|
||||
Cvar_SetValue(fraglimit, fraglimit->value + dir*10);
|
||||
if (fraglimit->value > 100)
|
||||
Cvar_SetValue(fraglimit, 0);
|
||||
if (fraglimit->value < 0)
|
||||
Cvar_SetValue(fraglimit, 100);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
Cvar_SetValue ("timelimit", timelimit.value + dir*5);
|
||||
if (timelimit.value > 60)
|
||||
Cvar_SetValue ("timelimit", 0);
|
||||
if (timelimit.value < 0)
|
||||
Cvar_SetValue ("timelimit", 60);
|
||||
Cvar_SetValue(timelimit, timelimit->value + dir*5);
|
||||
if (timelimit->value > 60)
|
||||
Cvar_SetValue(timelimit, 0);
|
||||
if (timelimit->value < 0)
|
||||
Cvar_SetValue(timelimit, 60);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
|
@ -2754,7 +2754,7 @@ void M_NetStart_Change (int dir)
|
|||
//PGM 03/02/97 added 1 for dmatch episode
|
||||
else if (rogue)
|
||||
count = 4;
|
||||
else if (registered.value)
|
||||
else if (registered->value)
|
||||
count = 7;
|
||||
else
|
||||
count = 2;
|
||||
|
|
|
@ -54,15 +54,6 @@ typedef struct
|
|||
#define ENQUEUE(q,b) (q.data[q.head] = b, q.head = (q.head + 1) & QUEUEMASK)
|
||||
#define DEQUEUE(q,b) (b = q.data[q.tail], q.tail = (q.tail + 1) & QUEUEMASK)
|
||||
|
||||
extern cvar_t config_com_port;
|
||||
extern cvar_t config_com_irq;
|
||||
extern cvar_t config_com_baud;
|
||||
extern cvar_t config_com_modem;
|
||||
extern cvar_t config_modem_dialtype;
|
||||
extern cvar_t config_modem_clear;
|
||||
extern cvar_t config_modem_init;
|
||||
extern cvar_t config_modem_hangup;
|
||||
|
||||
extern int m_return_state;
|
||||
extern int m_state;
|
||||
extern qboolean m_return_onerror;
|
||||
|
|
|
@ -884,7 +884,7 @@ static qsocket_t *_Datagram_CheckNewConnections (void)
|
|||
MSG_WriteByte(&net_message, CCREP_SERVER_INFO);
|
||||
dfunc.GetSocketAddr(acceptsock, &newaddr);
|
||||
MSG_WriteString(&net_message, dfunc.AddrToString(&newaddr));
|
||||
MSG_WriteString(&net_message, hostname.string);
|
||||
MSG_WriteString(&net_message, hostname->string);
|
||||
MSG_WriteString(&net_message, sv.name);
|
||||
MSG_WriteByte(&net_message, net_activeconnections);
|
||||
MSG_WriteByte(&net_message, svs.maxclients);
|
||||
|
@ -953,7 +953,7 @@ static qsocket_t *_Datagram_CheckNewConnections (void)
|
|||
// search for the next server cvar
|
||||
while (var)
|
||||
{
|
||||
if (var->server)
|
||||
if (var->flags&CVAR_SERVERINFO)
|
||||
break;
|
||||
var = var->next;
|
||||
}
|
||||
|
|
|
@ -61,10 +61,10 @@ void Loop_SearchForHosts (qboolean xmit)
|
|||
return;
|
||||
|
||||
hostCacheCount = 1;
|
||||
if (Q_strcmp(hostname.string, "UNNAMED") == 0)
|
||||
if (Q_strcmp(hostname->string, "UNNAMED") == 0)
|
||||
Q_strcpy(hostcache[0].name, "local");
|
||||
else
|
||||
Q_strcpy(hostcache[0].name, hostname.string);
|
||||
Q_strcpy(hostcache[0].name, hostname->string);
|
||||
Q_strcpy(hostcache[0].map, sv.name);
|
||||
hostcache[0].users = net_activeconnections;
|
||||
hostcache[0].maxusers = svs.maxclients;
|
||||
|
|
|
@ -74,21 +74,21 @@ int messagesReceived = 0;
|
|||
int unreliableMessagesSent = 0;
|
||||
int unreliableMessagesReceived = 0;
|
||||
|
||||
cvar_t net_messagetimeout = {"net_messagetimeout","300"};
|
||||
cvar_t hostname = {"hostname", "UNNAMED"};
|
||||
cvar_t *net_messagetimeout;
|
||||
cvar_t *hostname;
|
||||
|
||||
qboolean configRestored = false;
|
||||
cvar_t config_com_port = {"_config_com_port", "0x3f8", true};
|
||||
cvar_t config_com_irq = {"_config_com_irq", "4", true};
|
||||
cvar_t config_com_baud = {"_config_com_baud", "57600", true};
|
||||
cvar_t config_com_modem = {"_config_com_modem", "1", true};
|
||||
cvar_t config_modem_dialtype = {"_config_modem_dialtype", "T", true};
|
||||
cvar_t config_modem_clear = {"_config_modem_clear", "ATZ", true};
|
||||
cvar_t config_modem_init = {"_config_modem_init", "", true};
|
||||
cvar_t config_modem_hangup = {"_config_modem_hangup", "AT H", true};
|
||||
cvar_t *config_com_port;
|
||||
cvar_t *config_com_irq;
|
||||
cvar_t *config_com_baud;
|
||||
cvar_t *config_com_modem;
|
||||
cvar_t *config_modem_dialtype;
|
||||
cvar_t *config_modem_clear;
|
||||
cvar_t *config_modem_init;
|
||||
cvar_t *config_modem_hangup;
|
||||
|
||||
#ifdef IDGODS
|
||||
cvar_t idgods = {"idgods", "0"};
|
||||
cvar_t *idgods;
|
||||
#endif
|
||||
|
||||
int vcrFile = -1;
|
||||
|
@ -235,9 +235,9 @@ static void MaxPlayers_f (void)
|
|||
|
||||
svs.maxclients = n;
|
||||
if (n == 1)
|
||||
Cvar_Set ("deathmatch", "0");
|
||||
Cvar_Set(deathmatch, "0");
|
||||
else
|
||||
Cvar_Set ("deathmatch", "1");
|
||||
Cvar_Set(deathmatch, "1");
|
||||
}
|
||||
|
||||
|
||||
|
@ -568,7 +568,7 @@ int NET_GetMessage (qsocket_t *sock)
|
|||
// see if this connection has timed out
|
||||
if (ret == 0 && sock->driver)
|
||||
{
|
||||
if (net_time - sock->lastMessageTime > net_messagetimeout.value)
|
||||
if (net_time - sock->lastMessageTime > net_messagetimeout->value)
|
||||
{
|
||||
NET_Close(sock);
|
||||
return -1;
|
||||
|
@ -861,18 +861,18 @@ void NET_Init (void)
|
|||
// allocate space for network message buffer
|
||||
SZ_Alloc (&net_message, NET_MAXMESSAGE);
|
||||
|
||||
Cvar_RegisterVariable (&net_messagetimeout);
|
||||
Cvar_RegisterVariable (&hostname);
|
||||
Cvar_RegisterVariable (&config_com_port);
|
||||
Cvar_RegisterVariable (&config_com_irq);
|
||||
Cvar_RegisterVariable (&config_com_baud);
|
||||
Cvar_RegisterVariable (&config_com_modem);
|
||||
Cvar_RegisterVariable (&config_modem_dialtype);
|
||||
Cvar_RegisterVariable (&config_modem_clear);
|
||||
Cvar_RegisterVariable (&config_modem_init);
|
||||
Cvar_RegisterVariable (&config_modem_hangup);
|
||||
net_messagetimeout = Cvar_Get("net_messagetimeout", "300", CVAR_NONE, "None");
|
||||
hostname = Cvar_Get("hostname", "UNNAMED", CVAR_NONE, "None");
|
||||
config_com_port = Cvar_Get("_config_com_port", "0x3f8", CVAR_ARCHIVE, "None");
|
||||
config_com_irq = Cvar_Get("_config_com_irq", "4", CVAR_ARCHIVE, "None");
|
||||
config_com_baud = Cvar_Get("_config_com_baud", "57600", CVAR_ARCHIVE, "None");
|
||||
config_com_modem = Cvar_Get("_config_com_modem", "1", CVAR_ARCHIVE, "None");
|
||||
config_modem_dialtype = Cvar_Get("_config_modem_dialtype", "T", CVAR_ARCHIVE, "None");
|
||||
config_modem_clear = Cvar_Get("_config_modem_clear", "ATZ", CVAR_ARCHIVE, "None");
|
||||
config_modem_init = Cvar_Get("_config_modem_init", "", CVAR_ARCHIVE, "None");
|
||||
config_modem_hangup = Cvar_Get("_config_modem_hangup", "AT H", CVAR_ARCHIVE, "None");
|
||||
#ifdef IDGODS
|
||||
Cvar_RegisterVariable (&idgods);
|
||||
idgods = Cvar_Get("idgods", "0", CVAR_NONE, "None");
|
||||
#endif
|
||||
|
||||
Cmd_AddCommand ("slist", NET_Slist_f);
|
||||
|
@ -944,12 +944,12 @@ void NET_Poll(void)
|
|||
{
|
||||
if (serialAvailable)
|
||||
{
|
||||
if (config_com_modem.value == 1.0)
|
||||
if (config_com_modem->value == 1.0)
|
||||
useModem = true;
|
||||
else
|
||||
useModem = false;
|
||||
SetComPortConfig (0, (int)config_com_port.value, (int)config_com_irq.value, (int)config_com_baud.value, useModem);
|
||||
SetModemConfig (0, config_modem_dialtype.string, config_modem_clear.string, config_modem_init.string, config_modem_hangup.string);
|
||||
SetComPortConfig (0, (int)config_com_port->value, (int)config_com_irq->value, (int)config_com_baud->value, useModem);
|
||||
SetModemConfig (0, config_modem_dialtype->string, config_modem_clear->string, config_modem_init->string, config_modem_hangup->string);
|
||||
}
|
||||
configRestored = true;
|
||||
}
|
||||
|
@ -995,7 +995,7 @@ void SchedulePollProcedure(PollProcedure *proc, double timeOffset)
|
|||
|
||||
qboolean IsID(struct qsockaddr *addr)
|
||||
{
|
||||
if (idgods.value == 0.0)
|
||||
if (idgods->value == 0.0)
|
||||
return false;
|
||||
|
||||
if (addr->sa_family != 2)
|
||||
|
|
|
@ -39,8 +39,6 @@ short flat_selector;
|
|||
int WSAGetLastError(void);
|
||||
void sockets_flush(void);
|
||||
|
||||
extern cvar_t hostname;
|
||||
|
||||
#define MAXHOSTNAMELEN 256
|
||||
|
||||
static int net_acceptsocket = -1; // socket for fielding new connections
|
||||
|
@ -88,7 +86,7 @@ int MPATH_Init (void)
|
|||
myAddr = *(int *)local->h_addr_list[0];
|
||||
|
||||
// if the quake hostname isn't set, set it to the machine name
|
||||
if (Q_strcmp(hostname.string, "UNNAMED") == 0)
|
||||
if (Q_strcmp(hostname->string, "UNNAMED") == 0)
|
||||
{
|
||||
// see if it's a text IP address (well, close enough)
|
||||
for (p = buff; *p; p++)
|
||||
|
@ -103,7 +101,7 @@ int MPATH_Init (void)
|
|||
break;
|
||||
buff[i] = 0;
|
||||
}
|
||||
Cvar_Set ("hostname", buff);
|
||||
Cvar_Set(hostname, buff);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -920,7 +920,7 @@ static qsocket_t *_Serial_CheckNewConnections (SerialLine *p)
|
|||
|
||||
SZ_Clear(&net_message);
|
||||
MSG_WriteByte(&net_message, CCREP_SERVER_INFO);
|
||||
MSG_WriteString(&net_message, hostname.string);
|
||||
MSG_WriteString(&net_message, hostname->string);
|
||||
MSG_WriteString(&net_message, sv.name);
|
||||
MSG_WriteByte(&net_message, net_activeconnections);
|
||||
MSG_WriteByte(&net_message, svs.maxclients);
|
||||
|
|
|
@ -52,8 +52,6 @@
|
|||
extern int gethostname (char *, int);
|
||||
extern int close (int);
|
||||
|
||||
extern cvar_t hostname;
|
||||
|
||||
static int net_acceptsocket = -1; // socket for fielding new connections
|
||||
static int net_controlsocket;
|
||||
static int net_broadcastsocket = 0;
|
||||
|
@ -81,10 +79,10 @@ int UDP_Init (void)
|
|||
myAddr = *(int *)local->h_addr_list[0];
|
||||
|
||||
// if the quake hostname isn't set, set it to the machine name
|
||||
if (Q_strcmp(hostname.string, "UNNAMED") == 0)
|
||||
if (Q_strcmp(hostname->string, "UNNAMED") == 0)
|
||||
{
|
||||
buff[15] = 0;
|
||||
Cvar_Set ("hostname", buff);
|
||||
Cvar_Set(hostname, buff);
|
||||
}
|
||||
|
||||
if ((net_controlsocket = UDP_OpenSocket (0)) == -1)
|
||||
|
|
|
@ -33,8 +33,6 @@
|
|||
#include "quakedef.h"
|
||||
#include "winquake.h"
|
||||
|
||||
extern cvar_t hostname;
|
||||
|
||||
#define MAXHOSTNAMELEN 256
|
||||
|
||||
static int net_acceptsocket = -1; // socket for fielding new connections
|
||||
|
@ -198,7 +196,7 @@ int WINS_Init (void)
|
|||
}
|
||||
|
||||
// if the quake hostname isn't set, set it to the machine name
|
||||
if (Q_strcmp(hostname.string, "UNNAMED") == 0)
|
||||
if (Q_strcmp(hostname->string, "UNNAMED") == 0)
|
||||
{
|
||||
// see if it's a text IP address (well, close enough)
|
||||
for (p = buff; *p; p++)
|
||||
|
@ -213,7 +211,7 @@ int WINS_Init (void)
|
|||
break;
|
||||
buff[i] = 0;
|
||||
}
|
||||
Cvar_Set ("hostname", buff);
|
||||
Cvar_Set(hostname, buff);
|
||||
}
|
||||
|
||||
i = COM_CheckParm ("-ip");
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
#include <wsipx.h>
|
||||
#include "net_wipx.h"
|
||||
|
||||
extern cvar_t hostname;
|
||||
|
||||
#define MAXHOSTNAMELEN 256
|
||||
|
||||
static int net_acceptsocket = -1; // socket for fielding new connections
|
||||
|
@ -89,7 +87,7 @@ int WIPX_Init (void)
|
|||
if (pgethostname(buff, MAXHOSTNAMELEN) == 0)
|
||||
{
|
||||
// if the quake hostname isn't set, set it to the machine name
|
||||
if (Q_strcmp(hostname.string, "UNNAMED") == 0)
|
||||
if (Q_strcmp(hostname->string, "UNNAMED") == 0)
|
||||
{
|
||||
// see if it's a text IP address (well, close enough)
|
||||
for (p = buff; *p; p++)
|
||||
|
@ -104,7 +102,7 @@ int WIPX_Init (void)
|
|||
break;
|
||||
buff[i] = 0;
|
||||
}
|
||||
Cvar_Set ("hostname", buff);
|
||||
Cvar_Set(hostname, buff);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -872,10 +872,19 @@ float cvar (string)
|
|||
*/
|
||||
void PF_cvar_set (void)
|
||||
{
|
||||
char *var, *val;
|
||||
char *var_name, *val;
|
||||
cvar_t *var;
|
||||
|
||||
var = G_STRING(OFS_PARM0);
|
||||
var_name = G_STRING(OFS_PARM0);
|
||||
val = G_STRING(OFS_PARM1);
|
||||
var = Cvar_FindVar(var_name);
|
||||
if (!var)
|
||||
var = Cvar_FindAlias(var_name);
|
||||
if (!var) {
|
||||
// FIXME: make Con_DPrint?
|
||||
Con_Printf ("PF_cvar_set: variable %s not found\n", var_name);
|
||||
return;
|
||||
}
|
||||
|
||||
Cvar_Set (var, val);
|
||||
}
|
||||
|
@ -1341,7 +1350,7 @@ Pick a vector for the player to shoot along
|
|||
vector aim(entity, missilespeed)
|
||||
=============
|
||||
*/
|
||||
cvar_t sv_aim = {"sv_aim", "0.93"};
|
||||
cvar_t *sv_aim;
|
||||
void PF_aim (void)
|
||||
{
|
||||
edict_t *ent, *check, *bestent;
|
||||
|
@ -1362,7 +1371,7 @@ void PF_aim (void)
|
|||
VectorMA (start, 2048, dir, end);
|
||||
tr = SV_Move (start, vec3_origin, vec3_origin, end, false, ent);
|
||||
if (tr.ent && tr.ent->v.takedamage == DAMAGE_AIM
|
||||
&& (!teamplay.value || ent->v.team <=0 || ent->v.team != tr.ent->v.team) )
|
||||
&& (!teamplay->value || ent->v.team <=0 || ent->v.team != tr.ent->v.team) )
|
||||
{
|
||||
VectorCopy (pr_global_struct->v_forward, G_VECTOR(OFS_RETURN));
|
||||
return;
|
||||
|
@ -1371,7 +1380,7 @@ void PF_aim (void)
|
|||
|
||||
// try all possible entities
|
||||
VectorCopy (dir, bestdir);
|
||||
bestdist = sv_aim.value;
|
||||
bestdist = sv_aim->value;
|
||||
bestent = NULL;
|
||||
|
||||
check = NEXT_EDICT(sv.edicts);
|
||||
|
@ -1381,7 +1390,7 @@ void PF_aim (void)
|
|||
continue;
|
||||
if (check == ent)
|
||||
continue;
|
||||
if (teamplay.value && ent->v.team > 0 && ent->v.team == check->v.team)
|
||||
if (teamplay->value && ent->v.team > 0 && ent->v.team == check->v.team)
|
||||
continue; // don't aim at teammate
|
||||
for (j=0 ; j<3 ; j++)
|
||||
end[j] = check->v.origin[j]
|
||||
|
|
|
@ -49,17 +49,17 @@ int type_size[8] = {1,sizeof(string_t)/4,1,3,1,1,sizeof(func_t)/4,sizeof(void *
|
|||
ddef_t *ED_FieldAtOfs (int ofs);
|
||||
qboolean ED_ParseEpair (void *base, ddef_t *key, char *s);
|
||||
|
||||
cvar_t nomonsters = {"nomonsters", "0"};
|
||||
cvar_t gamecfg = {"gamecfg", "0"};
|
||||
cvar_t scratch1 = {"scratch1", "0"};
|
||||
cvar_t scratch2 = {"scratch2", "0"};
|
||||
cvar_t scratch3 = {"scratch3", "0"};
|
||||
cvar_t scratch4 = {"scratch4", "0"};
|
||||
cvar_t savedgamecfg = {"savedgamecfg", "0", true};
|
||||
cvar_t saved1 = {"saved1", "0", true};
|
||||
cvar_t saved2 = {"saved2", "0", true};
|
||||
cvar_t saved3 = {"saved3", "0", true};
|
||||
cvar_t saved4 = {"saved4", "0", true};
|
||||
cvar_t *nomonsters;
|
||||
cvar_t *gamecfg;
|
||||
cvar_t *scratch1;
|
||||
cvar_t *scratch2;
|
||||
cvar_t *scratch3;
|
||||
cvar_t *scratch4;
|
||||
cvar_t *savedgamecfg;
|
||||
cvar_t *saved1;
|
||||
cvar_t *saved2;
|
||||
cvar_t *saved3;
|
||||
cvar_t *saved4;
|
||||
|
||||
#define MAX_FIELD_LEN 64
|
||||
#define GEFV_CACHESIZE 2
|
||||
|
@ -940,7 +940,7 @@ void ED_LoadFromFile (char *data)
|
|||
data = ED_ParseEdict (data, ent);
|
||||
|
||||
// remove things from different skill levels or deathmatch
|
||||
if (deathmatch.value)
|
||||
if (deathmatch->value)
|
||||
{
|
||||
if (((int)ent->v.spawnflags & SPAWNFLAG_NOT_DEATHMATCH))
|
||||
{
|
||||
|
@ -1082,17 +1082,17 @@ void PR_Init (void)
|
|||
Cmd_AddCommand ("edicts", ED_PrintEdicts);
|
||||
Cmd_AddCommand ("edictcount", ED_Count);
|
||||
Cmd_AddCommand ("profile", PR_Profile_f);
|
||||
Cvar_RegisterVariable (&nomonsters);
|
||||
Cvar_RegisterVariable (&gamecfg);
|
||||
Cvar_RegisterVariable (&scratch1);
|
||||
Cvar_RegisterVariable (&scratch2);
|
||||
Cvar_RegisterVariable (&scratch3);
|
||||
Cvar_RegisterVariable (&scratch4);
|
||||
Cvar_RegisterVariable (&savedgamecfg);
|
||||
Cvar_RegisterVariable (&saved1);
|
||||
Cvar_RegisterVariable (&saved2);
|
||||
Cvar_RegisterVariable (&saved3);
|
||||
Cvar_RegisterVariable (&saved4);
|
||||
nomonsters = Cvar_Get("nomonsters", "0", CVAR_NONE, "None");
|
||||
gamecfg = Cvar_Get("gamecfg", "0", CVAR_NONE, "None");
|
||||
scratch1 = Cvar_Get("scratch1", "0", CVAR_NONE, "None");
|
||||
scratch2 = Cvar_Get("scratch2", "0", CVAR_NONE, "None");
|
||||
scratch3 = Cvar_Get("scratch3", "0", CVAR_NONE, "None");
|
||||
scratch4 = Cvar_Get("scratch4", "0", CVAR_NONE, "None");
|
||||
savedgamecfg = Cvar_Get("savedgamecfg", "0", CVAR_ARCHIVE, "None");
|
||||
saved1 = Cvar_Get("saved1", "0", CVAR_ARCHIVE, "None");
|
||||
saved2 = Cvar_Get("saved2", "0", CVAR_ARCHIVE, "None");
|
||||
saved3 = Cvar_Get("saved3", "0", CVAR_ARCHIVE, "None");
|
||||
saved4 = Cvar_Get("saved4", "0", CVAR_ARCHIVE, "None");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ void R_BeginEdgeFrame (void)
|
|||
surfaces[1].flags = SURF_DRAWBACKGROUND;
|
||||
|
||||
// put the background behind everything in the world
|
||||
if (r_draworder.value)
|
||||
if (r_draworder->value)
|
||||
{
|
||||
pdrawfunc = R_GenerateSpansBackward;
|
||||
surfaces[1].key = 0;
|
||||
|
|
144
source/r_main.c
144
source/r_main.c
|
@ -126,29 +126,27 @@ float se_time1, se_time2, de_time1, de_time2, dv_time1, dv_time2;
|
|||
|
||||
void R_MarkLeaves (void);
|
||||
|
||||
cvar_t r_draworder = {"r_draworder","0"};
|
||||
cvar_t r_speeds = {"r_speeds","0"};
|
||||
cvar_t r_timegraph = {"r_timegraph","0"};
|
||||
cvar_t r_graphheight = {"r_graphheight","10"};
|
||||
cvar_t r_clearcolor = {"r_clearcolor","2"};
|
||||
cvar_t r_waterwarp = {"r_waterwarp","1"};
|
||||
cvar_t r_fullbright = {"r_fullbright","0"};
|
||||
cvar_t r_drawentities = {"r_drawentities","1"};
|
||||
cvar_t r_drawviewmodel = {"r_drawviewmodel","1"};
|
||||
cvar_t r_aliasstats = {"r_polymodelstats","0"};
|
||||
cvar_t r_dspeeds = {"r_dspeeds","0"};
|
||||
cvar_t r_drawflat = {"r_drawflat", "0"};
|
||||
cvar_t r_ambient = {"r_ambient", "0"};
|
||||
cvar_t r_reportsurfout = {"r_reportsurfout", "0"};
|
||||
cvar_t r_maxsurfs = {"r_maxsurfs", "0"};
|
||||
cvar_t r_numsurfs = {"r_numsurfs", "0"};
|
||||
cvar_t r_reportedgeout = {"r_reportedgeout", "0"};
|
||||
cvar_t r_maxedges = {"r_maxedges", "0"};
|
||||
cvar_t r_numedges = {"r_numedges", "0"};
|
||||
cvar_t r_aliastransbase = {"r_aliastransbase", "200"};
|
||||
cvar_t r_aliastransadj = {"r_aliastransadj", "100"};
|
||||
|
||||
extern cvar_t scr_fov;
|
||||
cvar_t *r_draworder;
|
||||
cvar_t *r_speeds;
|
||||
cvar_t *r_timegraph;
|
||||
cvar_t *r_graphheight;
|
||||
cvar_t *r_clearcolor;
|
||||
cvar_t *r_waterwarp;
|
||||
cvar_t *r_fullbright;
|
||||
cvar_t *r_drawentities;
|
||||
cvar_t *r_drawviewmodel;
|
||||
cvar_t *r_aliasstats;
|
||||
cvar_t *r_dspeeds;
|
||||
cvar_t *r_drawflat;
|
||||
cvar_t *r_ambient;
|
||||
cvar_t *r_reportsurfout;
|
||||
cvar_t *r_maxsurfs;
|
||||
cvar_t *r_numsurfs;
|
||||
cvar_t *r_reportedgeout;
|
||||
cvar_t *r_maxedges;
|
||||
cvar_t *r_numedges;
|
||||
cvar_t *r_aliastransbase;
|
||||
cvar_t *r_aliastransadj;
|
||||
|
||||
void CreatePassages (void);
|
||||
void SetVisibilityByPassages (void);
|
||||
|
@ -203,30 +201,30 @@ void R_Init (void)
|
|||
Cmd_AddCommand ("timerefresh", R_TimeRefresh_f);
|
||||
Cmd_AddCommand ("pointfile", R_ReadPointFile_f);
|
||||
|
||||
Cvar_RegisterVariable (&r_draworder);
|
||||
Cvar_RegisterVariable (&r_speeds);
|
||||
Cvar_RegisterVariable (&r_timegraph);
|
||||
Cvar_RegisterVariable (&r_graphheight);
|
||||
Cvar_RegisterVariable (&r_drawflat);
|
||||
Cvar_RegisterVariable (&r_ambient);
|
||||
Cvar_RegisterVariable (&r_clearcolor);
|
||||
Cvar_RegisterVariable (&r_waterwarp);
|
||||
Cvar_RegisterVariable (&r_fullbright);
|
||||
Cvar_RegisterVariable (&r_drawentities);
|
||||
Cvar_RegisterVariable (&r_drawviewmodel);
|
||||
Cvar_RegisterVariable (&r_aliasstats);
|
||||
Cvar_RegisterVariable (&r_dspeeds);
|
||||
Cvar_RegisterVariable (&r_reportsurfout);
|
||||
Cvar_RegisterVariable (&r_maxsurfs);
|
||||
Cvar_RegisterVariable (&r_numsurfs);
|
||||
Cvar_RegisterVariable (&r_reportedgeout);
|
||||
Cvar_RegisterVariable (&r_maxedges);
|
||||
Cvar_RegisterVariable (&r_numedges);
|
||||
Cvar_RegisterVariable (&r_aliastransbase);
|
||||
Cvar_RegisterVariable (&r_aliastransadj);
|
||||
r_draworder = Cvar_Get("r_draworder", "0", CVAR_NONE, "None");
|
||||
r_speeds = Cvar_Get("r_speeds", "0", CVAR_NONE, "None");
|
||||
r_timegraph = Cvar_Get("r_timegraph", "0", CVAR_NONE, "None");
|
||||
r_graphheight = Cvar_Get("r_graphheight", "10", CVAR_NONE, "None");
|
||||
r_drawflat = Cvar_Get("r_drawflat", "0", CVAR_NONE, "None");
|
||||
r_ambient = Cvar_Get("r_ambient", "0", CVAR_NONE, "None");
|
||||
r_clearcolor = Cvar_Get("r_clearcolor", "2", CVAR_NONE, "None");
|
||||
r_waterwarp = Cvar_Get("r_waterwarp", "1", CVAR_NONE, "None");
|
||||
r_fullbright = Cvar_Get("r_fullbright", "0", CVAR_NONE, "None");
|
||||
r_drawentities = Cvar_Get("r_drawentities", "1", CVAR_NONE, "None");
|
||||
r_drawviewmodel = Cvar_Get("r_drawviewmodel", "1", CVAR_NONE, "None");
|
||||
r_aliasstats = Cvar_Get("r_polymodelstats", "0", CVAR_NONE, "None");
|
||||
r_dspeeds = Cvar_Get("r_dspeeds", "0", CVAR_NONE, "None");
|
||||
r_reportsurfout = Cvar_Get("r_reportsurfout", "0", CVAR_NONE, "None");
|
||||
r_maxsurfs = Cvar_Get("r_maxsurfs", "0", CVAR_NONE, "None");
|
||||
r_numsurfs = Cvar_Get("r_numsurfs", "0", CVAR_NONE, "None");
|
||||
r_reportedgeout = Cvar_Get("r_reportedgeout", "0", CVAR_NONE, "None");
|
||||
r_maxedges = Cvar_Get("r_maxedges", "0", CVAR_NONE, "None");
|
||||
r_numedges = Cvar_Get("r_numedges", "0", CVAR_NONE, "None");
|
||||
r_aliastransbase = Cvar_Get("r_aliastransbase", "200", CVAR_NONE, "None");
|
||||
r_aliastransadj = Cvar_Get("r_aliastransadj", "100", CVAR_NONE, "None");
|
||||
|
||||
Cvar_SetValue ("r_maxedges", (float)NUMSTACKEDGES);
|
||||
Cvar_SetValue ("r_maxsurfs", (float)NUMSTACKSURFACES);
|
||||
Cvar_SetValue(r_maxedges, (float)NUMSTACKEDGES);
|
||||
Cvar_SetValue(r_maxsurfs, (float)NUMSTACKSURFACES);
|
||||
|
||||
view_clipplanes[0].leftedge = true;
|
||||
view_clipplanes[1].rightedge = true;
|
||||
|
@ -266,7 +264,7 @@ void R_NewMap (void)
|
|||
r_viewleaf = NULL;
|
||||
R_ClearParticles ();
|
||||
|
||||
r_cnumsurfs = r_maxsurfs.value;
|
||||
r_cnumsurfs = r_maxsurfs->value;
|
||||
|
||||
if (r_cnumsurfs <= MINSURFACES)
|
||||
r_cnumsurfs = MINSURFACES;
|
||||
|
@ -290,7 +288,7 @@ void R_NewMap (void)
|
|||
r_maxedgesseen = 0;
|
||||
r_maxsurfsseen = 0;
|
||||
|
||||
r_numallocatededges = r_maxedges.value;
|
||||
r_numallocatededges = r_maxedges->value;
|
||||
|
||||
if (r_numallocatededges < MINEDGES)
|
||||
r_numallocatededges = MINEDGES;
|
||||
|
@ -323,7 +321,7 @@ void R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
|
|||
int h;
|
||||
float size;
|
||||
|
||||
size = scr_viewsize.value > 100 ? 100 : scr_viewsize.value;
|
||||
size = scr_viewsize->value > 100 ? 100 : scr_viewsize->value;
|
||||
if (cl.intermission)
|
||||
{
|
||||
size = 100;
|
||||
|
@ -349,7 +347,7 @@ void R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
|
|||
pvrect->y = (h - pvrect->height)/2;
|
||||
|
||||
{
|
||||
if (lcd_x.value)
|
||||
if (lcd_x->value)
|
||||
{
|
||||
pvrect->y >>= 1;
|
||||
pvrect->height >>= 1;
|
||||
|
@ -464,10 +462,10 @@ void R_ViewChanged (vrect_t *pvrect, int lineadj, float aspect)
|
|||
res_scale = sqrt ((double)(r_refdef.vrect.width * r_refdef.vrect.height) /
|
||||
(320.0 * 152.0)) *
|
||||
(2.0 / r_refdef.horizontalFieldOfView);
|
||||
r_aliastransition = r_aliastransbase.value * res_scale;
|
||||
r_resfudge = r_aliastransadj.value * res_scale;
|
||||
r_aliastransition = r_aliastransbase->value * res_scale;
|
||||
r_resfudge = r_aliastransadj->value * res_scale;
|
||||
|
||||
if (scr_fov.value <= 90.0)
|
||||
if (scr_fov->value <= 90.0)
|
||||
r_fov_greater_than_90 = false;
|
||||
else
|
||||
r_fov_greater_than_90 = true;
|
||||
|
@ -545,7 +543,7 @@ void R_DrawEntitiesOnList (void)
|
|||
vec3_t dist;
|
||||
float add;
|
||||
|
||||
if (!r_drawentities.value)
|
||||
if (!r_drawentities->value)
|
||||
return;
|
||||
|
||||
for (i=0 ; i<cl_numvisedicts ; i++)
|
||||
|
@ -624,7 +622,7 @@ void R_DrawViewModel (void)
|
|||
float add;
|
||||
dlight_t *dl;
|
||||
|
||||
if (!r_drawviewmodel.value || r_fov_greater_than_90)
|
||||
if (!r_drawviewmodel->value || r_fov_greater_than_90)
|
||||
return;
|
||||
|
||||
if (cl.items & IT_INVISIBILITY)
|
||||
|
@ -759,7 +757,7 @@ void R_DrawBEntitiesOnList (void)
|
|||
model_t *clmodel;
|
||||
float minmaxs[6];
|
||||
|
||||
if (!r_drawentities.value)
|
||||
if (!r_drawentities->value)
|
||||
return;
|
||||
|
||||
VectorCopy (modelorg, oldorigin);
|
||||
|
@ -914,7 +912,7 @@ void R_EdgeDrawing (void)
|
|||
|
||||
R_BeginEdgeFrame ();
|
||||
|
||||
if (r_dspeeds.value)
|
||||
if (r_dspeeds->value)
|
||||
{
|
||||
rw_time1 = Sys_DoubleTime ();
|
||||
}
|
||||
|
@ -928,7 +926,7 @@ void R_EdgeDrawing (void)
|
|||
// z writes, so have the driver turn z compares on now
|
||||
D_TurnZOn ();
|
||||
|
||||
if (r_dspeeds.value)
|
||||
if (r_dspeeds->value)
|
||||
{
|
||||
rw_time2 = Sys_DoubleTime ();
|
||||
db_time1 = rw_time2;
|
||||
|
@ -936,13 +934,13 @@ void R_EdgeDrawing (void)
|
|||
|
||||
R_DrawBEntitiesOnList ();
|
||||
|
||||
if (r_dspeeds.value)
|
||||
if (r_dspeeds->value)
|
||||
{
|
||||
db_time2 = Sys_DoubleTime ();
|
||||
se_time1 = db_time2;
|
||||
}
|
||||
|
||||
if (!r_dspeeds.value)
|
||||
if (!r_dspeeds->value)
|
||||
{
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if going slow
|
||||
|
@ -967,7 +965,7 @@ void R_RenderView_ (void)
|
|||
|
||||
r_warpbuffer = warpbuffer;
|
||||
|
||||
if (r_timegraph.value || r_speeds.value || r_dspeeds.value)
|
||||
if (r_timegraph->value || r_speeds->value || r_dspeeds->value)
|
||||
r_time1 = Sys_DoubleTime ();
|
||||
|
||||
R_SetupFrame ();
|
||||
|
@ -987,7 +985,7 @@ SetVisibilityByPassages ();
|
|||
if (!cl_entities[0].model || !cl.worldmodel)
|
||||
Sys_Error ("R_RenderView: NULL worldmodel");
|
||||
|
||||
if (!r_dspeeds.value)
|
||||
if (!r_dspeeds->value)
|
||||
{
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if going slow
|
||||
|
@ -996,14 +994,14 @@ SetVisibilityByPassages ();
|
|||
|
||||
R_EdgeDrawing ();
|
||||
|
||||
if (!r_dspeeds.value)
|
||||
if (!r_dspeeds->value)
|
||||
{
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if going slow
|
||||
VID_LockBuffer ();
|
||||
}
|
||||
|
||||
if (r_dspeeds.value)
|
||||
if (r_dspeeds->value)
|
||||
{
|
||||
se_time2 = Sys_DoubleTime ();
|
||||
de_time1 = se_time2;
|
||||
|
@ -1011,7 +1009,7 @@ SetVisibilityByPassages ();
|
|||
|
||||
R_DrawEntitiesOnList ();
|
||||
|
||||
if (r_dspeeds.value)
|
||||
if (r_dspeeds->value)
|
||||
{
|
||||
de_time2 = Sys_DoubleTime ();
|
||||
dv_time1 = de_time2;
|
||||
|
@ -1019,7 +1017,7 @@ SetVisibilityByPassages ();
|
|||
|
||||
R_DrawViewModel ();
|
||||
|
||||
if (r_dspeeds.value)
|
||||
if (r_dspeeds->value)
|
||||
{
|
||||
dv_time2 = Sys_DoubleTime ();
|
||||
dp_time1 = Sys_DoubleTime ();
|
||||
|
@ -1027,7 +1025,7 @@ SetVisibilityByPassages ();
|
|||
|
||||
R_DrawParticles ();
|
||||
|
||||
if (r_dspeeds.value)
|
||||
if (r_dspeeds->value)
|
||||
dp_time2 = Sys_DoubleTime ();
|
||||
|
||||
if (r_dowarp)
|
||||
|
@ -1035,22 +1033,22 @@ SetVisibilityByPassages ();
|
|||
|
||||
V_SetContentsColor (r_viewleaf->contents);
|
||||
|
||||
if (r_timegraph.value)
|
||||
if (r_timegraph->value)
|
||||
R_TimeGraph ();
|
||||
|
||||
if (r_aliasstats.value)
|
||||
if (r_aliasstats->value)
|
||||
R_PrintAliasStats ();
|
||||
|
||||
if (r_speeds.value)
|
||||
if (r_speeds->value)
|
||||
R_PrintTimes ();
|
||||
|
||||
if (r_dspeeds.value)
|
||||
if (r_dspeeds->value)
|
||||
R_PrintDSpeeds ();
|
||||
|
||||
if (r_reportsurfout.value && r_outofsurfaces)
|
||||
if (r_reportsurfout->value && r_outofsurfaces)
|
||||
Con_Printf ("Short %d surfaces\n", r_outofsurfaces);
|
||||
|
||||
if (r_reportedgeout.value && r_outofedges)
|
||||
if (r_reportedgeout->value && r_outofedges)
|
||||
Con_Printf ("Short roughly %d edges\n", r_outofedges * 2 / 3);
|
||||
|
||||
// back to high floating-point precision
|
||||
|
|
|
@ -43,9 +43,9 @@ void R_CheckVariables (void)
|
|||
{
|
||||
static float oldbright;
|
||||
|
||||
if (r_fullbright.value != oldbright)
|
||||
if (r_fullbright->value != oldbright)
|
||||
{
|
||||
oldbright = r_fullbright.value;
|
||||
oldbright = r_fullbright->value;
|
||||
D_FlushCaches (); // so all lighting changes
|
||||
}
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ void R_LineGraph (int x, int y, int h)
|
|||
|
||||
dest = vid.buffer + vid.rowbytes*y + x;
|
||||
|
||||
s = r_graphheight.value;
|
||||
s = r_graphheight->value;
|
||||
|
||||
if (h>s)
|
||||
h = s;
|
||||
|
@ -170,7 +170,7 @@ void R_TimeGraph (void)
|
|||
|
||||
a = (r_time2-r_time1)/0.01;
|
||||
//a = fabs(mouse_y * 0.05);
|
||||
//a = (int)((r_refdef.vieworg[2] + 1024)/1)%(int)r_graphheight.value;
|
||||
//a = (int)((r_refdef.vieworg[2] + 1024)/1)%(int)r_graphheight->value;
|
||||
//a = fabs(velocity[0])/20;
|
||||
//a = ((int)fabs(origin[0])/8)%20;
|
||||
//a = (cl.idealpitch + 30)/5;
|
||||
|
@ -384,13 +384,13 @@ void R_SetupFrame (void)
|
|||
// don't allow cheats in multiplayer
|
||||
if (cl.maxclients > 1)
|
||||
{
|
||||
Cvar_Set ("r_draworder", "0");
|
||||
Cvar_Set ("r_fullbright", "0");
|
||||
Cvar_Set ("r_ambient", "0");
|
||||
Cvar_Set ("r_drawflat", "0");
|
||||
Cvar_Set(r_draworder, "0");
|
||||
Cvar_Set(r_fullbright, "0");
|
||||
Cvar_Set(r_ambient, "0");
|
||||
Cvar_Set(r_drawflat, "0");
|
||||
}
|
||||
|
||||
if (r_numsurfs.value)
|
||||
if (r_numsurfs->value)
|
||||
{
|
||||
if ((surface_p - surfaces) > r_maxsurfsseen)
|
||||
r_maxsurfsseen = surface_p - surfaces;
|
||||
|
@ -399,7 +399,7 @@ void R_SetupFrame (void)
|
|||
surf_max - surfaces, r_maxsurfsseen);
|
||||
}
|
||||
|
||||
if (r_numedges.value)
|
||||
if (r_numedges->value)
|
||||
{
|
||||
edgecount = edge_p - r_edges;
|
||||
|
||||
|
@ -410,13 +410,13 @@ void R_SetupFrame (void)
|
|||
r_numallocatededges, r_maxedgesseen);
|
||||
}
|
||||
|
||||
r_refdef.ambientlight = r_ambient.value;
|
||||
r_refdef.ambientlight = r_ambient->value;
|
||||
|
||||
if (r_refdef.ambientlight < 0)
|
||||
r_refdef.ambientlight = 0;
|
||||
|
||||
if (!sv.active)
|
||||
r_draworder.value = 0; // don't let cheaters look behind walls
|
||||
r_draworder->value = 0; // don't let cheaters look behind walls
|
||||
|
||||
R_CheckVariables ();
|
||||
|
||||
|
@ -447,9 +447,9 @@ r_refdef.viewangles[2]= 0;
|
|||
r_viewleaf = Mod_PointInLeaf (r_origin, cl.worldmodel);
|
||||
|
||||
r_dowarpold = r_dowarp;
|
||||
r_dowarp = r_waterwarp.value && (r_viewleaf->contents <= CONTENTS_WATER);
|
||||
r_dowarp = r_waterwarp->value && (r_viewleaf->contents <= CONTENTS_WATER);
|
||||
|
||||
if ((r_dowarp != r_dowarpold) || r_viewchanged || lcd_x.value)
|
||||
if ((r_dowarp != r_dowarpold) || r_viewchanged || lcd_x->value)
|
||||
{
|
||||
if (r_dowarp)
|
||||
{
|
||||
|
|
|
@ -656,7 +656,6 @@ void R_RocketTrail (vec3_t start, vec3_t end, int type)
|
|||
R_DrawParticles
|
||||
===============
|
||||
*/
|
||||
extern cvar_t sv_gravity;
|
||||
|
||||
void R_DrawParticles (void)
|
||||
{
|
||||
|
@ -690,7 +689,7 @@ void R_DrawParticles (void)
|
|||
time3 = frametime * 15;
|
||||
time2 = frametime * 10; // 15;
|
||||
time1 = frametime * 5;
|
||||
grav = frametime * sv_gravity.value * 0.05;
|
||||
grav = frametime * sv_gravity->value * 0.05;
|
||||
dvel = 4*frametime;
|
||||
|
||||
for ( ;; )
|
||||
|
|
|
@ -174,7 +174,7 @@ void R_BuildLightMap (void)
|
|||
size = smax*tmax;
|
||||
lightmap = surf->samples;
|
||||
|
||||
if (r_fullbright.value || !cl.worldmodel->lightdata)
|
||||
if (r_fullbright->value || !cl.worldmodel->lightdata)
|
||||
{
|
||||
for (i=0 ; i<size ; i++)
|
||||
blocklights[i] = 0;
|
||||
|
|
|
@ -844,8 +844,8 @@ void Sbar_DrawFace (void)
|
|||
// PGM 03/02/97 - fixed so color swatch only appears in CTF modes
|
||||
if (rogue &&
|
||||
(cl.maxclients != 1) &&
|
||||
(teamplay.value>3) &&
|
||||
(teamplay.value<7))
|
||||
(teamplay->value>3) &&
|
||||
(teamplay->value<7))
|
||||
{
|
||||
int top, bottom;
|
||||
int xofs;
|
||||
|
|
|
@ -41,14 +41,14 @@ float scr_con_current;
|
|||
float scr_conlines; // lines of console to display
|
||||
|
||||
float oldscreensize, oldfov;
|
||||
cvar_t scr_viewsize = {"viewsize","100", true};
|
||||
cvar_t scr_fov = {"fov","90"}; // 10 - 170
|
||||
cvar_t scr_conspeed = {"scr_conspeed","300"};
|
||||
cvar_t scr_centertime = {"scr_centertime","2"};
|
||||
cvar_t scr_showram = {"showram","1"};
|
||||
cvar_t scr_showturtle = {"showturtle","0"};
|
||||
cvar_t scr_showpause = {"showpause","1"};
|
||||
cvar_t scr_printspeed = {"scr_printspeed","8"};
|
||||
cvar_t *scr_viewsize;
|
||||
cvar_t *scr_fov;
|
||||
cvar_t *scr_conspeed;
|
||||
cvar_t *scr_centertime;
|
||||
cvar_t *scr_showram;
|
||||
cvar_t *scr_showturtle;
|
||||
cvar_t *scr_showpause;
|
||||
cvar_t *scr_printspeed;
|
||||
|
||||
qboolean scr_initialized; // ready to draw
|
||||
|
||||
|
@ -75,6 +75,11 @@ qboolean block_drawing;
|
|||
|
||||
void SCR_ScreenShot_f (void);
|
||||
|
||||
void
|
||||
SCR_InitCvars(void)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
===============================================================================
|
||||
|
||||
|
@ -101,7 +106,7 @@ for a few moments
|
|||
void SCR_CenterPrint (char *str)
|
||||
{
|
||||
strncpy (scr_centerstring, str, sizeof(scr_centerstring)-1);
|
||||
scr_centertime_off = scr_centertime.value;
|
||||
scr_centertime_off = scr_centertime->value;
|
||||
scr_centertime_start = cl.time;
|
||||
|
||||
// count the number of lines for centering
|
||||
|
@ -143,7 +148,7 @@ void SCR_DrawCenterString (void)
|
|||
|
||||
// the finale prints the characters one at a time
|
||||
if (cl.intermission)
|
||||
remaining = scr_printspeed.value * (cl.time - scr_centertime_start);
|
||||
remaining = scr_printspeed->value * (cl.time - scr_centertime_start);
|
||||
else
|
||||
remaining = 9999;
|
||||
|
||||
|
@ -242,25 +247,25 @@ static void SCR_CalcRefdef (void)
|
|||
//========================================
|
||||
|
||||
// bound viewsize
|
||||
if (scr_viewsize.value < 30)
|
||||
Cvar_Set ("viewsize","30");
|
||||
if (scr_viewsize.value > 120)
|
||||
Cvar_Set ("viewsize","120");
|
||||
if (scr_viewsize->value < 30)
|
||||
Cvar_Set (scr_viewsize,"30");
|
||||
if (scr_viewsize->value > 120)
|
||||
Cvar_Set (scr_viewsize,"120");
|
||||
|
||||
// bound field of view
|
||||
if (scr_fov.value < 10)
|
||||
Cvar_Set ("fov","10");
|
||||
if (scr_fov.value > 170)
|
||||
Cvar_Set ("fov","170");
|
||||
if (scr_fov->value < 10)
|
||||
Cvar_Set (scr_fov,"10");
|
||||
if (scr_fov->value > 170)
|
||||
Cvar_Set (scr_fov,"170");
|
||||
|
||||
r_refdef.fov_x = scr_fov.value;
|
||||
r_refdef.fov_x = scr_fov->value;
|
||||
r_refdef.fov_y = CalcFov (r_refdef.fov_x, r_refdef.vrect.width, r_refdef.vrect.height);
|
||||
|
||||
// intermission is always full screen
|
||||
if (cl.intermission)
|
||||
size = 120;
|
||||
else
|
||||
size = scr_viewsize.value;
|
||||
size = scr_viewsize->value;
|
||||
|
||||
if (size >= 120)
|
||||
sb_lines = 0; // no status bar at all
|
||||
|
@ -297,7 +302,7 @@ Keybinding command
|
|||
*/
|
||||
void SCR_SizeUp_f (void)
|
||||
{
|
||||
Cvar_SetValue ("viewsize",scr_viewsize.value+10);
|
||||
Cvar_SetValue (scr_viewsize,scr_viewsize->value+10);
|
||||
vid.recalc_refdef = 1;
|
||||
}
|
||||
|
||||
|
@ -311,7 +316,7 @@ Keybinding command
|
|||
*/
|
||||
void SCR_SizeDown_f (void)
|
||||
{
|
||||
Cvar_SetValue ("viewsize",scr_viewsize.value-10);
|
||||
Cvar_SetValue (scr_viewsize,scr_viewsize->value-10);
|
||||
vid.recalc_refdef = 1;
|
||||
}
|
||||
|
||||
|
@ -324,14 +329,14 @@ SCR_Init
|
|||
*/
|
||||
void SCR_Init (void)
|
||||
{
|
||||
Cvar_RegisterVariable (&scr_fov);
|
||||
Cvar_RegisterVariable (&scr_viewsize);
|
||||
Cvar_RegisterVariable (&scr_conspeed);
|
||||
Cvar_RegisterVariable (&scr_showram);
|
||||
Cvar_RegisterVariable (&scr_showturtle);
|
||||
Cvar_RegisterVariable (&scr_showpause);
|
||||
Cvar_RegisterVariable (&scr_centertime);
|
||||
Cvar_RegisterVariable (&scr_printspeed);
|
||||
scr_fov = Cvar_Get("fov", "90", CVAR_NONE, "10 - 170");
|
||||
scr_viewsize = Cvar_Get("viewsize", "100", CVAR_ARCHIVE, "None");
|
||||
scr_conspeed = Cvar_Get("scr_conspeed", "300", CVAR_NONE, "None");
|
||||
scr_showram = Cvar_Get("showram", "1", CVAR_NONE, "None");
|
||||
scr_showturtle = Cvar_Get("showturtle", "0", CVAR_NONE, "None");
|
||||
scr_showpause = Cvar_Get("showpause", "1", CVAR_NONE, "None");
|
||||
scr_centertime = Cvar_Get("scr_centertime", "2", CVAR_NONE, "None");
|
||||
scr_printspeed = Cvar_Get("scr_printspeed", "8", CVAR_NONE, "None");
|
||||
|
||||
//
|
||||
// register our commands
|
||||
|
@ -356,7 +361,7 @@ SCR_DrawRam
|
|||
*/
|
||||
void SCR_DrawRam (void)
|
||||
{
|
||||
if (!scr_showram.value)
|
||||
if (!scr_showram->value)
|
||||
return;
|
||||
|
||||
if (!r_cache_thrash)
|
||||
|
@ -374,7 +379,7 @@ void SCR_DrawTurtle (void)
|
|||
{
|
||||
static int count;
|
||||
|
||||
if (!scr_showturtle.value)
|
||||
if (!scr_showturtle->value)
|
||||
return;
|
||||
|
||||
if (host_frametime < 0.1)
|
||||
|
@ -414,7 +419,7 @@ void SCR_DrawPause (void)
|
|||
{
|
||||
qpic_t *pic;
|
||||
|
||||
if (!scr_showpause.value) // turn off for screenshots
|
||||
if (!scr_showpause->value) // turn off for screenshots
|
||||
return;
|
||||
|
||||
if (!cl.paused)
|
||||
|
@ -476,14 +481,14 @@ void SCR_SetUpToDrawConsole (void)
|
|||
|
||||
if (scr_conlines < scr_con_current)
|
||||
{
|
||||
scr_con_current -= scr_conspeed.value*host_frametime;
|
||||
scr_con_current -= scr_conspeed->value*host_frametime;
|
||||
if (scr_conlines > scr_con_current)
|
||||
scr_con_current = scr_conlines;
|
||||
|
||||
}
|
||||
else if (scr_conlines > scr_con_current)
|
||||
{
|
||||
scr_con_current += scr_conspeed.value*host_frametime;
|
||||
scr_con_current += scr_conspeed->value*host_frametime;
|
||||
if (scr_conlines < scr_con_current)
|
||||
scr_con_current = scr_conlines;
|
||||
}
|
||||
|
@ -845,30 +850,30 @@ void SCR_UpdateScreen (void)
|
|||
if (!scr_initialized || !con_initialized)
|
||||
return; // not initialized yet
|
||||
|
||||
if (scr_viewsize.value != oldscr_viewsize)
|
||||
if (scr_viewsize->value != oldscr_viewsize)
|
||||
{
|
||||
oldscr_viewsize = scr_viewsize.value;
|
||||
oldscr_viewsize = scr_viewsize->value;
|
||||
vid.recalc_refdef = 1;
|
||||
}
|
||||
|
||||
//
|
||||
// check for vid changes
|
||||
//
|
||||
if (oldfov != scr_fov.value)
|
||||
if (oldfov != scr_fov->value)
|
||||
{
|
||||
oldfov = scr_fov.value;
|
||||
oldfov = scr_fov->value;
|
||||
vid.recalc_refdef = true;
|
||||
}
|
||||
|
||||
if (oldlcd_x != lcd_x.value)
|
||||
if (oldlcd_x != lcd_x->value)
|
||||
{
|
||||
oldlcd_x = lcd_x.value;
|
||||
oldlcd_x = lcd_x->value;
|
||||
vid.recalc_refdef = true;
|
||||
}
|
||||
|
||||
if (oldscreensize != scr_viewsize.value)
|
||||
if (oldscreensize != scr_viewsize->value)
|
||||
{
|
||||
oldscreensize = scr_viewsize.value;
|
||||
oldscreensize = scr_viewsize->value;
|
||||
vid.recalc_refdef = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,18 +79,18 @@ int desired_bits = 16;
|
|||
|
||||
int sound_started=0;
|
||||
|
||||
cvar_t bgmvolume = {"bgmvolume", "1", true};
|
||||
cvar_t volume = {"volume", "0.7", true};
|
||||
cvar_t *bgmvolume;
|
||||
cvar_t *volume;
|
||||
|
||||
cvar_t nosound = {"nosound", "0"};
|
||||
cvar_t precache = {"precache", "1"};
|
||||
cvar_t loadas8bit = {"loadas8bit", "0"};
|
||||
cvar_t bgmbuffer = {"bgmbuffer", "4096"};
|
||||
cvar_t ambient_level = {"ambient_level", "0.3"};
|
||||
cvar_t ambient_fade = {"ambient_fade", "100"};
|
||||
cvar_t snd_noextraupdate = {"snd_noextraupdate", "0"};
|
||||
cvar_t snd_show = {"snd_show", "0"};
|
||||
cvar_t _snd_mixahead = {"_snd_mixahead", "0.1", true};
|
||||
cvar_t *nosound;
|
||||
cvar_t *precache;
|
||||
cvar_t *loadas8bit;
|
||||
cvar_t *bgmbuffer;
|
||||
cvar_t *ambient_level;
|
||||
cvar_t *ambient_fade;
|
||||
cvar_t *snd_noextraupdate;
|
||||
cvar_t *snd_show;
|
||||
cvar_t *_snd_mixahead;
|
||||
|
||||
|
||||
// ====================================================================
|
||||
|
@ -186,17 +186,17 @@ void S_Init (void)
|
|||
Cmd_AddCommand("soundlist", S_SoundList);
|
||||
Cmd_AddCommand("soundinfo", S_SoundInfo_f);
|
||||
|
||||
Cvar_RegisterVariable(&nosound);
|
||||
Cvar_RegisterVariable(&volume);
|
||||
Cvar_RegisterVariable(&precache);
|
||||
Cvar_RegisterVariable(&loadas8bit);
|
||||
Cvar_RegisterVariable(&bgmvolume);
|
||||
Cvar_RegisterVariable(&bgmbuffer);
|
||||
Cvar_RegisterVariable(&ambient_level);
|
||||
Cvar_RegisterVariable(&ambient_fade);
|
||||
Cvar_RegisterVariable(&snd_noextraupdate);
|
||||
Cvar_RegisterVariable(&snd_show);
|
||||
Cvar_RegisterVariable(&_snd_mixahead);
|
||||
nosound = Cvar_Get("nosound", "0", CVAR_NONE, "None");
|
||||
volume = Cvar_Get("volume", "0.7", CVAR_ARCHIVE, "None");
|
||||
precache = Cvar_Get("precache", "1", CVAR_NONE, "None");
|
||||
loadas8bit = Cvar_Get("loadas8bit", "0", CVAR_NONE, "None");
|
||||
bgmvolume = Cvar_Get("bgmvolume", "1", CVAR_ARCHIVE, "None");
|
||||
bgmbuffer = Cvar_Get("bgmbuffer", "4096", CVAR_NONE, "None");
|
||||
ambient_level = Cvar_Get("ambient_level", "0.3", CVAR_NONE, "None");
|
||||
ambient_fade = Cvar_Get("ambient_fade", "100", CVAR_NONE, "None");
|
||||
snd_noextraupdate = Cvar_Get("snd_noextraupdate", "0", CVAR_NONE, "None");
|
||||
snd_show = Cvar_Get("snd_show", "0", CVAR_NONE, "None");
|
||||
_snd_mixahead = Cvar_Get("_snd_mixahead", "0.1", CVAR_ARCHIVE, "None");
|
||||
|
||||
if (COM_CheckParm("-nosound"))
|
||||
return;
|
||||
|
@ -206,7 +206,7 @@ void S_Init (void)
|
|||
|
||||
if (host_parms.memsize < 0x800000)
|
||||
{
|
||||
Cvar_Set ("loadas8bit", "1");
|
||||
Cvar_Set(loadas8bit, "1");
|
||||
Con_Printf ("loading all sounds as 8bit\n");
|
||||
}
|
||||
|
||||
|
@ -342,13 +342,13 @@ sfx_t *S_PrecacheSound (char *name)
|
|||
{
|
||||
sfx_t *sfx;
|
||||
|
||||
if (!sound_started || nosound.value)
|
||||
if (!sound_started || nosound->value)
|
||||
return NULL;
|
||||
|
||||
sfx = S_FindName (name);
|
||||
|
||||
// cache it in
|
||||
if (precache.value)
|
||||
if (precache->value)
|
||||
S_LoadSound (sfx);
|
||||
|
||||
return sfx;
|
||||
|
@ -473,7 +473,7 @@ void S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float f
|
|||
if (!sfx)
|
||||
return;
|
||||
|
||||
if (nosound.value)
|
||||
if (nosound->value)
|
||||
return;
|
||||
|
||||
vol = fvol*255;
|
||||
|
@ -687,7 +687,7 @@ void S_UpdateAmbientSounds (void)
|
|||
return;
|
||||
|
||||
l = Mod_PointInLeaf (listener_origin, cl.worldmodel);
|
||||
if (!l || !ambient_level.value)
|
||||
if (!l || !ambient_level->value)
|
||||
{
|
||||
for (ambient_channel = 0 ; ambient_channel< NUM_AMBIENTS ; ambient_channel++)
|
||||
channels[ambient_channel].sfx = NULL;
|
||||
|
@ -699,20 +699,20 @@ void S_UpdateAmbientSounds (void)
|
|||
chan = &channels[ambient_channel];
|
||||
chan->sfx = ambient_sfx[ambient_channel];
|
||||
|
||||
vol = ambient_level.value * l->ambient_sound_level[ambient_channel];
|
||||
vol = ambient_level->value * l->ambient_sound_level[ambient_channel];
|
||||
if (vol < 8)
|
||||
vol = 0;
|
||||
|
||||
// don't adjust volume too fast
|
||||
if (chan->master_vol < vol)
|
||||
{
|
||||
chan->master_vol += host_frametime * ambient_fade.value;
|
||||
chan->master_vol += host_frametime * ambient_fade->value;
|
||||
if (chan->master_vol > vol)
|
||||
chan->master_vol = vol;
|
||||
}
|
||||
else if (chan->master_vol > vol)
|
||||
{
|
||||
chan->master_vol -= host_frametime * ambient_fade.value;
|
||||
chan->master_vol -= host_frametime * ambient_fade->value;
|
||||
if (chan->master_vol < vol)
|
||||
chan->master_vol = vol;
|
||||
}
|
||||
|
@ -800,7 +800,7 @@ void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
|
|||
//
|
||||
// debugging output
|
||||
//
|
||||
if (snd_show.value)
|
||||
if (snd_show->value)
|
||||
{
|
||||
total = 0;
|
||||
ch = channels;
|
||||
|
@ -859,7 +859,7 @@ void S_ExtraUpdate (void)
|
|||
IN_Accumulate ();
|
||||
#endif
|
||||
|
||||
if (snd_noextraupdate.value)
|
||||
if (snd_noextraupdate->value)
|
||||
return; // don't pollute timings
|
||||
S_Update_();
|
||||
}
|
||||
|
@ -883,7 +883,7 @@ void S_Update_(void)
|
|||
}
|
||||
|
||||
// mix ahead of current position
|
||||
endtime = soundtime + _snd_mixahead.value * shm->speed;
|
||||
endtime = soundtime + _snd_mixahead->value * shm->speed;
|
||||
samps = shm->samples >> (shm->channels-1);
|
||||
if (endtime - soundtime > samps)
|
||||
endtime = soundtime + samps;
|
||||
|
@ -997,7 +997,7 @@ void S_LocalSound (char *sound)
|
|||
{
|
||||
sfx_t *sfx;
|
||||
|
||||
if (nosound.value)
|
||||
if (nosound->value)
|
||||
return;
|
||||
if (!sound_started)
|
||||
return;
|
||||
|
|
|
@ -62,7 +62,7 @@ void ResampleSfx (sfx_t *sfx, int inrate, int inwidth, byte *data)
|
|||
sc->loopstart = sc->loopstart / stepscale;
|
||||
|
||||
sc->speed = shm->speed;
|
||||
if (loadas8bit.value)
|
||||
if (loadas8bit->value)
|
||||
sc->width = 1;
|
||||
else
|
||||
sc->width = inwidth;
|
||||
|
|
|
@ -85,7 +85,7 @@ void S_TransferStereo16 (int endtime)
|
|||
HRESULT hresult;
|
||||
#endif
|
||||
|
||||
snd_vol = volume.value*256;
|
||||
snd_vol = volume->value*256;
|
||||
|
||||
snd_p = (int *) paintbuffer;
|
||||
lpaintedtime = paintedtime;
|
||||
|
@ -175,7 +175,7 @@ void S_TransferPaintBuffer(int endtime)
|
|||
out_mask = shm->samples - 1;
|
||||
out_idx = paintedtime * shm->channels & out_mask;
|
||||
step = 3 - shm->channels;
|
||||
snd_vol = volume.value*256;
|
||||
snd_vol = volume->value*256;
|
||||
|
||||
#ifdef _WIN32
|
||||
if (pDSBuf)
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
|
||||
#include "quakedef.h"
|
||||
|
||||
cvar_t bgmvolume = {"bgmvolume", "1", true};
|
||||
cvar_t volume = {"volume", "0.7", true};
|
||||
cvar_t *bgmvolume;
|
||||
cvar_t *volume;
|
||||
|
||||
|
||||
void S_Init (void)
|
||||
|
|
|
@ -47,27 +47,17 @@ SV_Init
|
|||
void SV_Init (void)
|
||||
{
|
||||
int i;
|
||||
extern cvar_t sv_maxvelocity;
|
||||
extern cvar_t sv_gravity;
|
||||
extern cvar_t sv_nostep;
|
||||
extern cvar_t sv_friction;
|
||||
extern cvar_t sv_edgefriction;
|
||||
extern cvar_t sv_stopspeed;
|
||||
extern cvar_t sv_maxspeed;
|
||||
extern cvar_t sv_accelerate;
|
||||
extern cvar_t sv_idealpitchscale;
|
||||
extern cvar_t sv_aim;
|
||||
|
||||
Cvar_RegisterVariable (&sv_maxvelocity);
|
||||
Cvar_RegisterVariable (&sv_gravity);
|
||||
Cvar_RegisterVariable (&sv_friction);
|
||||
Cvar_RegisterVariable (&sv_edgefriction);
|
||||
Cvar_RegisterVariable (&sv_stopspeed);
|
||||
Cvar_RegisterVariable (&sv_maxspeed);
|
||||
Cvar_RegisterVariable (&sv_accelerate);
|
||||
Cvar_RegisterVariable (&sv_idealpitchscale);
|
||||
Cvar_RegisterVariable (&sv_aim);
|
||||
Cvar_RegisterVariable (&sv_nostep);
|
||||
sv_maxvelocity = Cvar_Get("sv_maxvelocity", "2000", CVAR_NONE, "None");
|
||||
sv_gravity = Cvar_Get("sv_gravity", "800", CVAR_SERVERINFO, "None");
|
||||
sv_friction = Cvar_Get("sv_friction", "4", CVAR_SERVERINFO, "None");
|
||||
sv_edgefriction = Cvar_Get("edgefriction", "2", CVAR_NONE, "None");
|
||||
sv_stopspeed = Cvar_Get("sv_stopspeed", "100", CVAR_NONE, "None");
|
||||
sv_maxspeed = Cvar_Get("sv_maxspeed", "320", CVAR_SERVERINFO, "None");
|
||||
sv_accelerate = Cvar_Get("sv_accelerate", "10", CVAR_NONE, "None");
|
||||
sv_idealpitchscale = Cvar_Get("sv_idealpitchscale", "0.8", CVAR_NONE, "None");
|
||||
sv_aim = Cvar_Get("sv_aim", "0.93", CVAR_NONE, "None");
|
||||
sv_nostep = Cvar_Get("sv_nostep", "0", CVAR_NONE, "None");
|
||||
|
||||
for (i=0 ; i<MAX_MODELS ; i++)
|
||||
sprintf (localmodels[i], "*%i", i);
|
||||
|
@ -210,7 +200,7 @@ void SV_SendServerinfo (client_t *client)
|
|||
MSG_WriteLong (&client->message, PROTOCOL_VERSION);
|
||||
MSG_WriteByte (&client->message, svs.maxclients);
|
||||
|
||||
if (!coop.value && deathmatch.value)
|
||||
if (!coop->value && deathmatch->value)
|
||||
MSG_WriteByte (&client->message, GAME_DEATHMATCH);
|
||||
else
|
||||
MSG_WriteByte (&client->message, GAME_COOP);
|
||||
|
@ -1062,8 +1052,8 @@ void SV_SpawnServer (char *server)
|
|||
int i;
|
||||
|
||||
// let's not have any servers with no name
|
||||
if (hostname.string[0] == 0)
|
||||
Cvar_Set ("hostname", "UNNAMED");
|
||||
if (hostname->string[0] == 0)
|
||||
Cvar_Set(hostname, "UNNAMED");
|
||||
scr_centertime_off = 0;
|
||||
|
||||
Con_DPrintf ("SpawnServer: %s\n",server);
|
||||
|
@ -1080,15 +1070,15 @@ void SV_SpawnServer (char *server)
|
|||
//
|
||||
// make cvars consistant
|
||||
//
|
||||
if (coop.value)
|
||||
Cvar_SetValue ("deathmatch", 0);
|
||||
current_skill = (int)(skill.value + 0.5);
|
||||
if (coop->value)
|
||||
Cvar_SetValue(deathmatch, 0);
|
||||
current_skill = (int)(skill->value + 0.5);
|
||||
if (current_skill < 0)
|
||||
current_skill = 0;
|
||||
if (current_skill > 3)
|
||||
current_skill = 3;
|
||||
|
||||
Cvar_SetValue ("skill", (float)current_skill);
|
||||
Cvar_SetValue(skill, (float)current_skill);
|
||||
|
||||
//
|
||||
// set up the new server
|
||||
|
@ -1173,10 +1163,10 @@ void SV_SpawnServer (char *server)
|
|||
ent->v.solid = SOLID_BSP;
|
||||
ent->v.movetype = MOVETYPE_PUSH;
|
||||
|
||||
if (coop.value)
|
||||
pr_global_struct->coop = coop.value;
|
||||
if (coop->value)
|
||||
pr_global_struct->coop = coop->value;
|
||||
else
|
||||
pr_global_struct->deathmatch = deathmatch.value;
|
||||
pr_global_struct->deathmatch = deathmatch->value;
|
||||
|
||||
pr_global_struct->mapname = sv.name - pr_strings;
|
||||
#ifdef QUAKE2
|
||||
|
|
|
@ -50,11 +50,11 @@ solid_edge items only clip against bsp models.
|
|||
|
||||
*/
|
||||
|
||||
cvar_t sv_friction = {"sv_friction","4",false,true};
|
||||
cvar_t sv_stopspeed = {"sv_stopspeed","100"};
|
||||
cvar_t sv_gravity = {"sv_gravity","800",false,true};
|
||||
cvar_t sv_maxvelocity = {"sv_maxvelocity","2000"};
|
||||
cvar_t sv_nostep = {"sv_nostep","0"};
|
||||
cvar_t *sv_friction;
|
||||
cvar_t *sv_stopspeed;
|
||||
cvar_t *sv_gravity;
|
||||
cvar_t *sv_maxvelocity;
|
||||
cvar_t *sv_nostep;
|
||||
|
||||
#ifdef QUAKE2
|
||||
static vec3_t vec_origin = {0.0, 0.0, 0.0};
|
||||
|
@ -117,10 +117,10 @@ void SV_CheckVelocity (edict_t *ent)
|
|||
Con_Printf ("Got a NaN origin on %s\n", pr_strings + ent->v.classname);
|
||||
ent->v.origin[i] = 0;
|
||||
}
|
||||
if (ent->v.velocity[i] > sv_maxvelocity.value)
|
||||
ent->v.velocity[i] = sv_maxvelocity.value;
|
||||
else if (ent->v.velocity[i] < -sv_maxvelocity.value)
|
||||
ent->v.velocity[i] = -sv_maxvelocity.value;
|
||||
if (ent->v.velocity[i] > sv_maxvelocity->value)
|
||||
ent->v.velocity[i] = sv_maxvelocity->value;
|
||||
else if (ent->v.velocity[i] < -sv_maxvelocity->value)
|
||||
ent->v.velocity[i] = -sv_maxvelocity->value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -397,7 +397,7 @@ void SV_AddGravity (edict_t *ent)
|
|||
else
|
||||
ent_gravity = 1.0;
|
||||
#endif
|
||||
ent->v.velocity[2] -= ent_gravity * sv_gravity.value * host_frametime;
|
||||
ent->v.velocity[2] -= ent_gravity * sv_gravity->value * host_frametime;
|
||||
}
|
||||
|
||||
|
||||
|
@ -995,7 +995,7 @@ void SV_WalkMove (edict_t *ent)
|
|||
if (ent->v.movetype != MOVETYPE_WALK)
|
||||
return; // gibbed by a trigger
|
||||
|
||||
if (sv_nostep.value)
|
||||
if (sv_nostep->value)
|
||||
return;
|
||||
|
||||
if ( (int)sv_player->v.flags & FL_WATERJUMP )
|
||||
|
@ -1404,7 +1404,7 @@ void SV_Physics_Step (edict_t *ent)
|
|||
if (!((int)ent->v.flags & FL_FLY))
|
||||
if (!(((int)ent->v.flags & FL_SWIM) && (ent->v.waterlevel > 0)))
|
||||
{
|
||||
if (ent->v.velocity[2] < sv_gravity.value*-0.1)
|
||||
if (ent->v.velocity[2] < sv_gravity->value*-0.1)
|
||||
hitsound = true;
|
||||
if (!inwater)
|
||||
SV_AddGravity (ent);
|
||||
|
@ -1422,9 +1422,9 @@ void SV_Physics_Step (edict_t *ent)
|
|||
speed = sqrt(vel[0]*vel[0] +vel[1]*vel[1]);
|
||||
if (speed)
|
||||
{
|
||||
friction = sv_friction.value;
|
||||
friction = sv_friction->value;
|
||||
|
||||
control = speed < sv_stopspeed.value ? sv_stopspeed.value : speed;
|
||||
control = speed < sv_stopspeed->value ? sv_stopspeed->value : speed;
|
||||
newspeed = speed - host_frametime*control*friction;
|
||||
|
||||
if (newspeed < 0)
|
||||
|
@ -1483,7 +1483,7 @@ void SV_Physics_Step (edict_t *ent)
|
|||
// freefall if not onground
|
||||
if ( ! ((int)ent->v.flags & (FL_ONGROUND | FL_FLY | FL_SWIM) ) )
|
||||
{
|
||||
if (ent->v.velocity[2] < sv_gravity.value*-0.1)
|
||||
if (ent->v.velocity[2] < sv_gravity->value*-0.1)
|
||||
hitsound = true;
|
||||
else
|
||||
hitsound = false;
|
||||
|
|
|
@ -34,9 +34,7 @@
|
|||
|
||||
edict_t *sv_player;
|
||||
|
||||
extern cvar_t sv_friction;
|
||||
cvar_t sv_edgefriction = {"edgefriction", "2"};
|
||||
extern cvar_t sv_stopspeed;
|
||||
cvar_t *sv_edgefriction;
|
||||
|
||||
static vec3_t forward, right, up;
|
||||
|
||||
|
@ -52,7 +50,7 @@ qboolean onground;
|
|||
|
||||
usercmd_t cmd;
|
||||
|
||||
cvar_t sv_idealpitchscale = {"sv_idealpitchscale","0.8"};
|
||||
cvar_t *sv_idealpitchscale;
|
||||
|
||||
|
||||
/*
|
||||
|
@ -120,7 +118,7 @@ void SV_SetIdealPitch (void)
|
|||
|
||||
if (steps < 2)
|
||||
return;
|
||||
sv_player->v.idealpitch = -dir * sv_idealpitchscale.value;
|
||||
sv_player->v.idealpitch = -dir * sv_idealpitchscale->value;
|
||||
}
|
||||
|
||||
|
||||
|
@ -153,12 +151,12 @@ void SV_UserFriction (void)
|
|||
trace = SV_Move (start, vec3_origin, vec3_origin, stop, true, sv_player);
|
||||
|
||||
if (trace.fraction == 1.0)
|
||||
friction = sv_friction.value*sv_edgefriction.value;
|
||||
friction = sv_friction->value*sv_edgefriction->value;
|
||||
else
|
||||
friction = sv_friction.value;
|
||||
friction = sv_friction->value;
|
||||
|
||||
// apply friction
|
||||
control = speed < sv_stopspeed.value ? sv_stopspeed.value : speed;
|
||||
control = speed < sv_stopspeed->value ? sv_stopspeed->value : speed;
|
||||
newspeed = speed - host_frametime*control*friction;
|
||||
|
||||
if (newspeed < 0)
|
||||
|
@ -175,8 +173,8 @@ void SV_UserFriction (void)
|
|||
SV_Accelerate
|
||||
==============
|
||||
*/
|
||||
cvar_t sv_maxspeed = {"sv_maxspeed", "320", false, true};
|
||||
cvar_t sv_accelerate = {"sv_accelerate", "10"};
|
||||
cvar_t *sv_maxspeed;
|
||||
cvar_t *sv_accelerate;
|
||||
#if 0
|
||||
void SV_Accelerate (vec3_t wishvel)
|
||||
{
|
||||
|
@ -190,7 +188,7 @@ void SV_Accelerate (vec3_t wishvel)
|
|||
VectorSubtract (wishvel, velocity, pushvec);
|
||||
addspeed = VectorNormalize (pushvec);
|
||||
|
||||
accelspeed = sv_accelerate.value*host_frametime*addspeed;
|
||||
accelspeed = sv_accelerate->value*host_frametime*addspeed;
|
||||
if (accelspeed > addspeed)
|
||||
accelspeed = addspeed;
|
||||
|
||||
|
@ -207,7 +205,7 @@ void SV_Accelerate (void)
|
|||
addspeed = wishspeed - currentspeed;
|
||||
if (addspeed <= 0)
|
||||
return;
|
||||
accelspeed = sv_accelerate.value*host_frametime*wishspeed;
|
||||
accelspeed = sv_accelerate->value*host_frametime*wishspeed;
|
||||
if (accelspeed > addspeed)
|
||||
accelspeed = addspeed;
|
||||
|
||||
|
@ -227,8 +225,8 @@ void SV_AirAccelerate (vec3_t wishveloc)
|
|||
addspeed = wishspd - currentspeed;
|
||||
if (addspeed <= 0)
|
||||
return;
|
||||
// accelspeed = sv_accelerate.value * host_frametime;
|
||||
accelspeed = sv_accelerate.value*wishspeed * host_frametime;
|
||||
// accelspeed = sv_accelerate->value * host_frametime;
|
||||
accelspeed = sv_accelerate->value*wishspeed * host_frametime;
|
||||
if (accelspeed > addspeed)
|
||||
accelspeed = addspeed;
|
||||
|
||||
|
@ -275,10 +273,10 @@ void SV_WaterMove (void)
|
|||
wishvel[2] += cmd.upmove;
|
||||
|
||||
wishspeed = Length(wishvel);
|
||||
if (wishspeed > sv_maxspeed.value)
|
||||
if (wishspeed > sv_maxspeed->value)
|
||||
{
|
||||
VectorScale (wishvel, sv_maxspeed.value/wishspeed, wishvel);
|
||||
wishspeed = sv_maxspeed.value;
|
||||
VectorScale (wishvel, sv_maxspeed->value/wishspeed, wishvel);
|
||||
wishspeed = sv_maxspeed->value;
|
||||
}
|
||||
wishspeed *= 0.7;
|
||||
|
||||
|
@ -288,7 +286,7 @@ void SV_WaterMove (void)
|
|||
speed = Length (velocity);
|
||||
if (speed)
|
||||
{
|
||||
newspeed = speed - host_frametime * speed * sv_friction.value;
|
||||
newspeed = speed - host_frametime * speed * sv_friction->value;
|
||||
if (newspeed < 0)
|
||||
newspeed = 0;
|
||||
VectorScale (velocity, newspeed/speed, velocity);
|
||||
|
@ -307,7 +305,7 @@ void SV_WaterMove (void)
|
|||
return;
|
||||
|
||||
VectorNormalize (wishvel);
|
||||
accelspeed = sv_accelerate.value * wishspeed * host_frametime;
|
||||
accelspeed = sv_accelerate->value * wishspeed * host_frametime;
|
||||
if (accelspeed > addspeed)
|
||||
accelspeed = addspeed;
|
||||
|
||||
|
@ -359,10 +357,10 @@ void SV_AirMove (void)
|
|||
|
||||
VectorCopy (wishvel, wishdir);
|
||||
wishspeed = VectorNormalize(wishdir);
|
||||
if (wishspeed > sv_maxspeed.value)
|
||||
if (wishspeed > sv_maxspeed->value)
|
||||
{
|
||||
VectorScale (wishvel, sv_maxspeed.value/wishspeed, wishvel);
|
||||
wishspeed = sv_maxspeed.value;
|
||||
VectorScale (wishvel, sv_maxspeed->value/wishspeed, wishvel);
|
||||
wishspeed = sv_maxspeed->value;
|
||||
}
|
||||
|
||||
if ( sv_player->v.movetype == MOVETYPE_NOCLIP)
|
||||
|
|
|
@ -584,7 +584,7 @@ void Sys_Quit (void)
|
|||
|
||||
|
||||
// load the sell screen before shuting everything down
|
||||
if (registered.value)
|
||||
if (registered->value)
|
||||
d = COM_LoadHunkFile ("end2.bin");
|
||||
else
|
||||
d = COM_LoadHunkFile ("end1.bin");
|
||||
|
@ -952,7 +952,7 @@ int main (int c, char **v)
|
|||
newtime = Sys_DoubleTime ();
|
||||
time = newtime - oldtime;
|
||||
|
||||
if (cls.state == ca_dedicated && (time<sys_ticrate.value))
|
||||
if (cls.state == ca_dedicated && (time<sys_ticrate->value))
|
||||
continue;
|
||||
|
||||
Host_Frame (time);
|
||||
|
|
|
@ -59,9 +59,9 @@ int nostdout = 0;
|
|||
char *basedir = ".";
|
||||
char *cachedir = "/tmp";
|
||||
|
||||
cvar_t sys_linerefresh = {"sys_linerefresh","0"};// set for entity display
|
||||
cvar_t timestamps = {"timestamps", "0"}; // Set for timestamps
|
||||
cvar_t timeformat = {"timeformat", "[%b %e %X] "}; // Default timestamp format
|
||||
cvar_t *sys_linerefresh;
|
||||
cvar_t *timestamps;
|
||||
cvar_t *timeformat;
|
||||
|
||||
/* The translation table between the graphical font and plain ASCII --KB */
|
||||
static char qfont_table[256] = {
|
||||
|
@ -272,10 +272,10 @@ Sys_Printf (char *fmt, ...)
|
|||
if (nostdout)
|
||||
return;
|
||||
|
||||
if (timestamps.value && timeformat.string) {
|
||||
if (timestamps && timeformat && timestamps->value && timeformat->string) {
|
||||
mytime = time (NULL);
|
||||
local = localtime (&mytime);
|
||||
strftime (stamp, sizeof (stamp), timeformat.string, local);
|
||||
strftime (stamp, sizeof (stamp), timeformat->string, local);
|
||||
|
||||
snprintf (final, sizeof (final), "%s%s", stamp, start);
|
||||
} else {
|
||||
|
@ -466,15 +466,15 @@ int main (int c, char **v)
|
|||
|
||||
if (cls.state == ca_dedicated)
|
||||
{ // play vcrfiles at max speed
|
||||
if (time < sys_ticrate.value && (vcrFile == -1 || recording) )
|
||||
if (time < sys_ticrate->value && (vcrFile == -1 || recording) )
|
||||
{
|
||||
usleep(1);
|
||||
continue; // not time to run a server only tic yet
|
||||
}
|
||||
time = sys_ticrate.value;
|
||||
time = sys_ticrate->value;
|
||||
}
|
||||
|
||||
if (time > sys_ticrate.value*2)
|
||||
if (time > sys_ticrate->value*2)
|
||||
oldtime = newtime;
|
||||
else
|
||||
oldtime += time;
|
||||
|
@ -482,8 +482,8 @@ int main (int c, char **v)
|
|||
Host_Frame (time);
|
||||
|
||||
// graphic debugging aids
|
||||
if (sys_linerefresh.value)
|
||||
Sys_LineRefresh ();
|
||||
// if (sys_linerefresh->value)
|
||||
// Sys_LineRefresh ();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -57,9 +57,9 @@ int nostdout = 0;
|
|||
char *basedir = ".";
|
||||
char *cachedir = "/tmp";
|
||||
|
||||
cvar_t sys_linerefresh = {"sys_linerefresh","0"}; // set for entity display
|
||||
cvar_t timestamps = {"timestamps", "0"}; // Set for timestamps
|
||||
cvar_t timeformat = {"timeformat", "[%b %e %X] "}; // Default timestamp format
|
||||
cvar_t *sys_linerefresh;
|
||||
cvar_t *timestamps;
|
||||
cvar_t *timeformat;
|
||||
|
||||
/* The translation table between the graphical font and plain ASCII --KB */
|
||||
static char qfont_table[256] = {
|
||||
|
@ -257,10 +257,10 @@ Sys_Printf (char *fmt, ...)
|
|||
if (nostdout)
|
||||
return;
|
||||
|
||||
if (timestamps && timeformat && timeformat.string && timestamps.value) {
|
||||
if (timestamps && timeformat && timestamps && timeformat && timeformat->string && timestamps->value) {
|
||||
mytime = time (NULL);
|
||||
local = localtime (&mytime);
|
||||
strftime (stamp, sizeof (stamp), timeformat.string, local);
|
||||
strftime (stamp, sizeof (stamp), timeformat->string, local);
|
||||
|
||||
snprintf (final, sizeof (final), "%s%s", stamp, start);
|
||||
} else {
|
||||
|
@ -442,7 +442,7 @@ main (int argc, char *argv[])
|
|||
|
||||
while (1) { // Main message loop
|
||||
time = Sys_DoubleTime ();
|
||||
if ((time - oldtime) < sys_ticrate.value {
|
||||
if ((time - oldtime) < sys_ticrate->value {
|
||||
usleep(1);
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -870,7 +870,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
|
|||
newtime = Sys_DoubleTime ();
|
||||
time = newtime - oldtime;
|
||||
|
||||
while (time < sys_ticrate.value )
|
||||
while (time < sys_ticrate->value )
|
||||
{
|
||||
Sys_Sleep();
|
||||
newtime = Sys_DoubleTime ();
|
||||
|
|
|
@ -320,7 +320,7 @@ int main (int argc, char **argv)
|
|||
while (1)
|
||||
{
|
||||
time = Sys_DoubleTime();
|
||||
if (time - oldtime < sys_ticrate.value )
|
||||
if (time - oldtime < sys_ticrate->value )
|
||||
{
|
||||
Sleep(1);
|
||||
continue;
|
||||
|
|
|
@ -48,21 +48,21 @@ vmode_t *pcurrentmode = NULL;
|
|||
int vid_testingmode, vid_realmode;
|
||||
double vid_testendtime;
|
||||
|
||||
cvar_t vid_mode = {"vid_mode","0", false};
|
||||
cvar_t vid_wait = {"vid_wait","0"};
|
||||
cvar_t vid_nopageflip = {"vid_nopageflip","0", true};
|
||||
cvar_t _vid_wait_override = {"_vid_wait_override", "0", true};
|
||||
cvar_t _vid_default_mode = {"_vid_default_mode","0", true};
|
||||
cvar_t _vid_default_mode_win = {"_vid_default_mode_win","1", true};
|
||||
cvar_t vid_config_x = {"vid_config_x","800", true};
|
||||
cvar_t vid_config_y = {"vid_config_y","600", true};
|
||||
cvar_t vid_stretch_by_2 = {"vid_stretch_by_2","1", true};
|
||||
cvar_t _windowed_mouse = {"_windowed_mouse","0", true};
|
||||
cvar_t vid_fullscreen_mode = {"vid_fullscreen_mode","3", true};
|
||||
cvar_t vid_windowed_mode = {"vid_windowed_mode","0", true};
|
||||
cvar_t block_switch = {"block_switch","0", true};
|
||||
cvar_t vid_window_x = {"vid_window_x", "0", true};
|
||||
cvar_t vid_window_y = {"vid_window_y", "0", true};
|
||||
cvar_t *vid_mode;
|
||||
cvar_t *vid_wait;
|
||||
cvar_t *vid_nopageflip;
|
||||
cvar_t *_vid_wait_override;
|
||||
cvar_t *_vid_default_mode;
|
||||
cvar_t *_vid_default_mode_win;
|
||||
cvar_t *vid_config_x;
|
||||
cvar_t *vid_config_y;
|
||||
cvar_t *vid_stretch_by_2;
|
||||
cvar_t *_windowed_mouse;
|
||||
cvar_t *vid_fullscreen_mode;
|
||||
cvar_t *vid_windowed_mode;
|
||||
cvar_t *block_switch;
|
||||
cvar_t *vid_window_x;
|
||||
cvar_t *vid_window_y;
|
||||
|
||||
int d_con_indirect = 0;
|
||||
|
||||
|
@ -90,6 +90,11 @@ unsigned d_8to24table[256]; // not used in 8 bpp mode
|
|||
void VID_MenuDraw (void);
|
||||
void VID_MenuKey (int key);
|
||||
|
||||
void
|
||||
VID_InitCvars(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
|
@ -98,19 +103,19 @@ VID_Init
|
|||
*/
|
||||
void VID_Init (unsigned char *palette)
|
||||
{
|
||||
Cvar_RegisterVariable (&vid_mode);
|
||||
Cvar_RegisterVariable (&vid_wait);
|
||||
Cvar_RegisterVariable (&vid_nopageflip);
|
||||
Cvar_RegisterVariable (&_vid_wait_override);
|
||||
Cvar_RegisterVariable (&_vid_default_mode);
|
||||
Cvar_RegisterVariable (&_vid_default_mode_win);
|
||||
Cvar_RegisterVariable (&vid_config_x);
|
||||
Cvar_RegisterVariable (&vid_config_y);
|
||||
Cvar_RegisterVariable (&vid_stretch_by_2);
|
||||
Cvar_RegisterVariable (&_windowed_mouse);
|
||||
Cvar_RegisterVariable (&vid_fullscreen_mode);
|
||||
Cvar_RegisterVariable (&vid_windowed_mode);
|
||||
Cvar_RegisterVariable (&block_switch);
|
||||
vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None");
|
||||
vid_wait = Cvar_Get("vid_wait", "0", CVAR_NONE, "None");
|
||||
vid_nopageflip = Cvar_Get("vid_nopageflip", "0", CVAR_ARCHIVE, "None");
|
||||
_vid_wait_override = Cvar_Get("_vid_wait_override", "0", CVAR_ARCHIVE, "None");
|
||||
_vid_default_mode = Cvar_Get("_vid_default_mode", "0", CVAR_ARCHIVE, "None");
|
||||
_vid_default_mode_win = Cvar_Get("_vid_default_mode_win", "3", CVAR_ARCHIVE, "None");
|
||||
vid_config_x = Cvar_Get("vid_config_x", "800", CVAR_ARCHIVE, "None");
|
||||
vid_config_y = Cvar_Get("vid_config_y", "600", CVAR_ARCHIVE, "None");
|
||||
vid_stretch_by_2 = Cvar_Get("vid_stretch_by_2", "1", CVAR_ARCHIVE, "None");
|
||||
_windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_ARCHIVE, "None");
|
||||
vid_fullscreen_mode = Cvar_Get("vid_fullscreen_mode", "3", CVAR_ARCHIVE, "None");
|
||||
vid_windowed_mode = Cvar_Get("vid_windowed_mode", "0", CVAR_ARCHIVE, "None");
|
||||
block_switch = Cvar_Get("block_switch", "0", CVAR_ARCHIVE, "None");
|
||||
|
||||
Cmd_AddCommand ("vid_testmode", VID_TestMode_f);
|
||||
Cmd_AddCommand ("vid_nummodes", VID_NumModes_f);
|
||||
|
@ -127,7 +132,7 @@ void VID_Init (unsigned char *palette)
|
|||
|
||||
vid_testingmode = 0;
|
||||
|
||||
vid_modenum = vid_mode.value;
|
||||
vid_modenum = vid_mode->value;
|
||||
|
||||
VID_SetMode (vid_modenum, palette);
|
||||
|
||||
|
@ -211,7 +216,7 @@ int VID_SetMode (int modenum, unsigned char *palette)
|
|||
|
||||
if ((modenum >= numvidmodes) || (modenum < 0))
|
||||
{
|
||||
Cvar_SetValue ("vid_mode", (float)vid_modenum);
|
||||
Cvar_SetValue(vid_mode, (float)vid_modenum);
|
||||
|
||||
nomodecheck = true;
|
||||
Con_Printf ("No such video mode: %d\n", modenum);
|
||||
|
@ -274,7 +279,7 @@ int VID_SetMode (int modenum, unsigned char *palette)
|
|||
(*pcurrentmode->setpalette) (&vid, pcurrentmode, palette);
|
||||
|
||||
vid_modenum = modenum;
|
||||
Cvar_SetValue ("vid_mode", (float)vid_modenum);
|
||||
Cvar_SetValue(vid_mode, (float)vid_modenum);
|
||||
|
||||
nomodecheck = true;
|
||||
Con_Printf ("%s\n", VID_ModeInfo (vid_modenum, NULL));
|
||||
|
@ -334,13 +339,13 @@ VID_Update
|
|||
*/
|
||||
void VID_Update (vrect_t *rects)
|
||||
{
|
||||
if (firstupdate && _vid_default_mode.value)
|
||||
if (firstupdate && _vid_default_mode->value)
|
||||
{
|
||||
if(_vid_default_mode.value >= numvidmodes)
|
||||
Cvar_SetValue ("_vid_default_mode", 0);
|
||||
if(_vid_default_mode->value >= numvidmodes)
|
||||
Cvar_SetValue(_vid_default_mode, 0);
|
||||
|
||||
firstupdate = 0;
|
||||
Cvar_SetValue ("vid_mode", _vid_default_mode.value);
|
||||
Cvar_SetValue(vid_mode, _vid_default_mode->value);
|
||||
}
|
||||
|
||||
(*pcurrentmode->swapbuffers)(&vid, pcurrentmode, rects);
|
||||
|
@ -357,10 +362,10 @@ void VID_Update (vrect_t *rects)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (vid_mode.value != vid_realmode)
|
||||
if (vid_mode->value != vid_realmode)
|
||||
{
|
||||
VID_SetMode ((int)vid_mode.value, vid_current_palette);
|
||||
Cvar_SetValue ("vid_mode", (float)vid_modenum);
|
||||
VID_SetMode ((int)vid_mode->value, vid_current_palette);
|
||||
Cvar_SetValue(vid_mode, (float)vid_modenum);
|
||||
// so if mode set fails, we don't keep on
|
||||
// trying to set that mode
|
||||
vid_realmode = vid_modenum;
|
||||
|
@ -436,7 +441,7 @@ void VID_DescribeModes_f (void)
|
|||
Con_Printf ("\n%s\n", pheader);
|
||||
|
||||
if (VGA_CheckAdequateMem (pv->width, pv->height, pv->rowbytes,
|
||||
(pv->numpages == 1) || vid_nopageflip.value))
|
||||
(pv->numpages == 1) || vid_nopageflip->value))
|
||||
{
|
||||
Con_Printf ("%2d: %s\n", i, pinfo);
|
||||
}
|
||||
|
@ -468,7 +473,7 @@ char *VID_GetModeDescription (int mode)
|
|||
pinfo = VID_ModeInfo (mode, &pheader);
|
||||
|
||||
if (VGA_CheckAdequateMem (pv->width, pv->height, pv->rowbytes,
|
||||
(pv->numpages == 1) || vid_nopageflip.value))
|
||||
(pv->numpages == 1) || vid_nopageflip->value))
|
||||
{
|
||||
return pinfo;
|
||||
}
|
||||
|
@ -678,7 +683,7 @@ void VID_MenuDraw (void)
|
|||
ptr = VID_GetModeDescription (vid_modenum);
|
||||
sprintf (temp, "D to make %s the default", ptr);
|
||||
M_Print (6*8, 36 + MAX_COLUMN_SIZE * 8 + 8*5, temp);
|
||||
ptr = VID_GetModeDescription ((int)_vid_default_mode.value);
|
||||
ptr = VID_GetModeDescription ((int)_vid_default_mode->value);
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
|
@ -777,7 +782,7 @@ void VID_MenuKey (int key)
|
|||
case 'd':
|
||||
S_LocalSound ("misc/menu1.wav");
|
||||
firstupdate = 0;
|
||||
Cvar_SetValue ("_vid_default_mode", vid_modenum);
|
||||
Cvar_SetValue(_vid_default_mode, vid_modenum);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -597,7 +597,7 @@ int VID_ExtraInitMode (viddef_t *lvid, vmode_t *pcurrentmode)
|
|||
|
||||
pextra = pcurrentmode->pextradata;
|
||||
|
||||
if (vid_nopageflip.value)
|
||||
if (vid_nopageflip->value)
|
||||
lvid->numpages = 1;
|
||||
else
|
||||
lvid->numpages = pcurrentmode->numpages;
|
||||
|
@ -638,23 +638,23 @@ int VID_ExtraInitMode (viddef_t *lvid, vmode_t *pcurrentmode)
|
|||
if (!pextra->vga_incompatible &&
|
||||
(lvid->numpages == 3) &&
|
||||
de_exists &&
|
||||
(_vid_wait_override.value == 0.0))
|
||||
(_vid_wait_override->value == 0.0))
|
||||
{
|
||||
Cvar_SetValue ("vid_wait", (float)VID_WAIT_DISPLAY_ENABLE);
|
||||
Cvar_SetValue(vid_wait, (float)VID_WAIT_DISPLAY_ENABLE);
|
||||
|
||||
VID_displayedpage = 0;
|
||||
VID_currentpage = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((lvid->numpages == 1) && (_vid_wait_override.value == 0.0))
|
||||
if ((lvid->numpages == 1) && (_vid_wait_override->value == 0.0))
|
||||
{
|
||||
Cvar_SetValue ("vid_wait", (float)VID_WAIT_NONE);
|
||||
Cvar_SetValue(vid_wait, (float)VID_WAIT_NONE);
|
||||
VID_displayedpage = VID_currentpage = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Cvar_SetValue ("vid_wait", (float)VID_WAIT_VSYNC);
|
||||
Cvar_SetValue(vid_wait, (float)VID_WAIT_VSYNC);
|
||||
|
||||
VID_displayedpage = 0;
|
||||
|
||||
|
@ -735,9 +735,9 @@ void VID_ExtraSwapBuffers (viddef_t *lvid, vmode_t *pcurrentmode,
|
|||
// page flipped
|
||||
regs.x.ax = 0x4f07;
|
||||
|
||||
if (vid_wait.value != VID_WAIT_VSYNC)
|
||||
if (vid_wait->value != VID_WAIT_VSYNC)
|
||||
{
|
||||
if ((vid_wait.value == VID_WAIT_DISPLAY_ENABLE) && de_exists)
|
||||
if ((vid_wait->value == VID_WAIT_DISPLAY_ENABLE) && de_exists)
|
||||
VID_ExtraWaitDisplayEnable ();
|
||||
|
||||
regs.x.bx = VESA_DONT_WAIT_VSYNC;
|
||||
|
@ -779,7 +779,7 @@ void VID_ExtraSwapBuffers (viddef_t *lvid, vmode_t *pcurrentmode,
|
|||
else
|
||||
{
|
||||
// non-page-flipped
|
||||
if (vsync_exists && (vid_wait.value == VID_WAIT_VSYNC))
|
||||
if (vsync_exists && (vid_wait->value == VID_WAIT_VSYNC))
|
||||
{
|
||||
VGA_WaitVsync ();
|
||||
}
|
||||
|
|
|
@ -86,6 +86,11 @@ static void *vid_surfcache;
|
|||
|
||||
int VID_options_items = 1;
|
||||
|
||||
void
|
||||
VID_InitCvars(void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
do_scale8(int xsize, int ysize, uint8 *dest, uint8 *src)
|
||||
{
|
||||
|
|
|
@ -45,6 +45,11 @@ byte surfcache[256*1024];
|
|||
unsigned short d_8to16table[256];
|
||||
unsigned d_8to24table[256];
|
||||
|
||||
void
|
||||
VID_InitCvars(void)
|
||||
{
|
||||
}
|
||||
|
||||
void VID_SetPalette (unsigned char *palette)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include "quakedef.h"
|
||||
#include "d_local.h"
|
||||
|
||||
cvar_t m_filter = {"m_filter","0", true};
|
||||
cvar_t *m_filter;
|
||||
|
||||
qboolean mouse_avail;
|
||||
int mouse_buttons=3;
|
||||
|
@ -160,6 +160,11 @@ static int shiftmask_fl=0;
|
|||
static long r_shift,g_shift,b_shift;
|
||||
static unsigned long r_mask,g_mask,b_mask;
|
||||
|
||||
void
|
||||
VID_InitCvars(void)
|
||||
{
|
||||
}
|
||||
|
||||
void shiftmask_init()
|
||||
{
|
||||
unsigned int x;
|
||||
|
@ -1199,7 +1204,7 @@ char *Sys_ConsoleInput (void)
|
|||
|
||||
void IN_Init (void)
|
||||
{
|
||||
Cvar_RegisterVariable (&m_filter);
|
||||
m_filter = Cvar_Get("m_filter", "0", CVAR_ARCHIVE, "None");
|
||||
if ( COM_CheckParm ("-nomouse") )
|
||||
return;
|
||||
mouse_x = mouse_y = 0.0;
|
||||
|
@ -1232,7 +1237,7 @@ void IN_Move (usercmd_t *cmd)
|
|||
if (!mouse_avail)
|
||||
return;
|
||||
|
||||
if (m_filter.value) {
|
||||
if (m_filter->value) {
|
||||
mouse_x = (mouse_x + old_mouse_x) * 0.5;
|
||||
mouse_y = (mouse_y + old_mouse_y) * 0.5;
|
||||
}
|
||||
|
@ -1240,27 +1245,27 @@ void IN_Move (usercmd_t *cmd)
|
|||
old_mouse_x = mouse_x;
|
||||
old_mouse_y = mouse_y;
|
||||
|
||||
mouse_x *= sensitivity.value;
|
||||
mouse_y *= sensitivity.value;
|
||||
mouse_x *= sensitivity->value;
|
||||
mouse_y *= sensitivity->value;
|
||||
|
||||
if ( (in_strafe.state & 1) || (lookstrafe.value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side.value * mouse_x;
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
cl.viewangles[YAW] -= m_yaw->value * mouse_x;
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
if ( (in_mlook.state & 1) && !(in_strafe.state & 1)) {
|
||||
cl.viewangles[PITCH] += m_pitch.value * mouse_y;
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70)
|
||||
cl.viewangles[PITCH] = -70;
|
||||
} else {
|
||||
if ((in_strafe.state & 1) && noclip_anglehack)
|
||||
cmd->upmove -= m_forward.value * mouse_y;
|
||||
cmd->upmove -= m_forward->value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
cmd->forwardmove -= m_forward->value * mouse_y;
|
||||
}
|
||||
mouse_x = mouse_y = 0.0;
|
||||
}
|
||||
|
|
|
@ -53,8 +53,8 @@
|
|||
#define MIN_WIDTH 320
|
||||
#define MIN_HEIGHT 200
|
||||
|
||||
cvar_t _windowed_mouse = {"_windowed_mouse","0", true};
|
||||
cvar_t m_filter = {"m_filter","0", true};
|
||||
cvar_t *_windowed_mouse;
|
||||
cvar_t *m_filter;
|
||||
float old_windowed_mouse;
|
||||
|
||||
// The following X property format is defined in Motif 1.1's
|
||||
|
@ -156,7 +156,7 @@ static int verbose=1;
|
|||
|
||||
static byte current_palette[768];
|
||||
|
||||
cvar_t pixel_multiply = {"pixel_multiply", "2", true};
|
||||
cvar_t *pixel_multiply;
|
||||
int current_pixel_multiply = 2;
|
||||
|
||||
#define PM(a) (int)((current_pixel_multiply)?((a)*current_pixel_multiply):(a))
|
||||
|
@ -169,6 +169,11 @@ static XilImage quake_image = NULL;
|
|||
static int use_mt = 0;
|
||||
static int count_frames = 0;
|
||||
|
||||
void
|
||||
VID_InitCvars(void)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
D_BeginDirectRect
|
||||
|
@ -236,7 +241,7 @@ qboolean CheckPixelMultiply (void)
|
|||
unsigned int value_mask;
|
||||
int old_pixel;
|
||||
|
||||
if ((m = (int)pixel_multiply.value) != current_pixel_multiply) {
|
||||
if ((m = (int)pixel_multiply->value) != current_pixel_multiply) {
|
||||
if (m < 1)
|
||||
m = 1;
|
||||
if (m > 4)
|
||||
|
@ -244,7 +249,7 @@ qboolean CheckPixelMultiply (void)
|
|||
|
||||
old_pixel = current_pixel_multiply;
|
||||
current_pixel_multiply = m;
|
||||
Cvar_SetValue("pixel_multiply", m);
|
||||
Cvar_SetValue(pixel_multiply, m);
|
||||
|
||||
if(XGetWindowAttributes(x_disp, x_win, & wattr) == 0)
|
||||
return true; // ???
|
||||
|
@ -400,7 +405,7 @@ void VID_Init (unsigned char *palette)
|
|||
|
||||
Cmd_AddCommand ("gamma", VID_Gamma_f);
|
||||
|
||||
Cvar_RegisterVariable (&pixel_multiply);
|
||||
pixel_multiply = Cvar_Get("pixel_multiply", "2", CVAR_ARCHIVE, "None");
|
||||
|
||||
if (pipe(render_pipeline) < 0)
|
||||
Sys_Error("VID_Init: pipe");
|
||||
|
@ -515,9 +520,9 @@ void VID_Init (unsigned char *palette)
|
|||
//
|
||||
// See if we're going to do pixel multiply
|
||||
//
|
||||
if (pixel_multiply.value < 1 || pixel_multiply.value > 4)
|
||||
Cvar_SetValue("pixel_multiply", 2);
|
||||
current_pixel_multiply = pixel_multiply.value;
|
||||
if (pixel_multiply->value < 1 || pixel_multiply->value > 4)
|
||||
Cvar_SetValue(pixel_multiply, 2);
|
||||
current_pixel_multiply = pixel_multiply->value;
|
||||
|
||||
w = 320*current_pixel_multiply; // minimum width
|
||||
h = 200*current_pixel_multiply; // minimum height
|
||||
|
@ -847,7 +852,7 @@ void GetEvent(void)
|
|||
|
||||
case MotionNotify:
|
||||
|
||||
if (_windowed_mouse.value) {
|
||||
if (_windowed_mouse->value) {
|
||||
mouse_x = (float) ((int)x_event.xmotion.x - (int)(vid.width/2));
|
||||
mouse_y = (float) ((int)x_event.xmotion.y - (int)(vid.height/2));
|
||||
//printf("m: x=%d,y=%d, mx=%3.2f,my=%3.2f\n",
|
||||
|
@ -915,10 +920,10 @@ void GetEvent(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
if (old_windowed_mouse != _windowed_mouse.value) {
|
||||
old_windowed_mouse = _windowed_mouse.value;
|
||||
if (old_windowed_mouse != _windowed_mouse->value) {
|
||||
old_windowed_mouse = _windowed_mouse->value;
|
||||
|
||||
if (!_windowed_mouse.value) {
|
||||
if (!_windowed_mouse->value) {
|
||||
/* ungrab the pointer */
|
||||
XUngrabPointer(x_disp,CurrentTime);
|
||||
} else {
|
||||
|
@ -1223,8 +1228,8 @@ void Sys_SendKeyEvents(void)
|
|||
|
||||
void IN_Init (void)
|
||||
{
|
||||
Cvar_RegisterVariable (&_windowed_mouse);
|
||||
Cvar_RegisterVariable (&m_filter);
|
||||
_windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_ARCHIVE, "None");
|
||||
m_filter = Cvar_Get("m_filter", "0", CVAR_ARCHIVE, "None");
|
||||
if ( COM_CheckParm ("-nomouse") )
|
||||
return;
|
||||
mouse_x = mouse_y = 0.0;
|
||||
|
@ -1257,7 +1262,7 @@ void IN_Move (usercmd_t *cmd)
|
|||
if (!mouse_avail)
|
||||
return;
|
||||
|
||||
if (m_filter.value) {
|
||||
if (m_filter->value) {
|
||||
mouse_x = (mouse_x + old_mouse_x) * 0.5;
|
||||
mouse_y = (mouse_y + old_mouse_y) * 0.5;
|
||||
}
|
||||
|
@ -1265,27 +1270,27 @@ void IN_Move (usercmd_t *cmd)
|
|||
old_mouse_x = mouse_x;
|
||||
old_mouse_y = mouse_y;
|
||||
|
||||
mouse_x *= sensitivity.value;
|
||||
mouse_y *= sensitivity.value;
|
||||
mouse_x *= sensitivity->value;
|
||||
mouse_y *= sensitivity->value;
|
||||
|
||||
if ( (in_strafe.state & 1) || (lookstrafe.value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side.value * mouse_x;
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
cl.viewangles[YAW] -= m_yaw->value * mouse_x;
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
if ( (in_mlook.state & 1) && !(in_strafe.state & 1)) {
|
||||
cl.viewangles[PITCH] += m_pitch.value * mouse_y;
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70)
|
||||
cl.viewangles[PITCH] = -70;
|
||||
} else {
|
||||
if ((in_strafe.state & 1) && noclip_anglehack)
|
||||
cmd->upmove -= m_forward.value * mouse_y;
|
||||
cmd->upmove -= m_forward->value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
cmd->forwardmove -= m_forward->value * mouse_y;
|
||||
}
|
||||
mouse_x = mouse_y = 0.0;
|
||||
}
|
||||
|
|
|
@ -87,18 +87,13 @@ int UseKeyboard = 1;
|
|||
|
||||
int mouserate = MOUSE_DEFAULTSAMPLERATE;
|
||||
|
||||
cvar_t vid_mode = {"vid_mode","5",false};
|
||||
cvar_t vid_redrawfull = {"vid_redrawfull","0",false};
|
||||
cvar_t vid_waitforrefresh = {"vid_waitforrefresh","0",true};
|
||||
cvar_t *vid_mode;
|
||||
cvar_t *vid_redrawfull;
|
||||
cvar_t *vid_waitforrefresh;
|
||||
|
||||
char *framebuffer_ptr;
|
||||
|
||||
cvar_t mouse_button_commands[3] =
|
||||
{
|
||||
{"mouse1","+attack"},
|
||||
{"mouse2","+strafe"},
|
||||
{"mouse3","+forward"},
|
||||
};
|
||||
cvar_t *mouse_button_commands[3];
|
||||
|
||||
int mouse_buttons;
|
||||
int mouse_buttonstate;
|
||||
|
@ -107,7 +102,7 @@ float mouse_x, mouse_y;
|
|||
float old_mouse_x, old_mouse_y;
|
||||
int mx, my;
|
||||
|
||||
cvar_t m_filter = {"m_filter","0"};
|
||||
cvar_t *m_filter;
|
||||
|
||||
static byte backingbuf[48*24];
|
||||
|
||||
|
@ -116,6 +111,11 @@ byte *VGA_pagebase;
|
|||
|
||||
void VGA_UpdatePlanarScreen (void *srcbuffer);
|
||||
|
||||
void
|
||||
VID_InitCvars(void)
|
||||
{
|
||||
}
|
||||
|
||||
void D_BeginDirectRect (int x, int y, byte *pbitmap, int width, int height)
|
||||
{
|
||||
int i, j, k, plane, reps, repshift, offset, vidpage, off;
|
||||
|
@ -488,14 +488,14 @@ int VID_SetMode (int modenum, unsigned char *palette)
|
|||
|
||||
if ((modenum >= num_modes) || (modenum < 0) || !modes[modenum].width)
|
||||
{
|
||||
Cvar_SetValue ("vid_mode", (float)current_mode);
|
||||
Cvar_SetValue(vid_mode, (float)current_mode);
|
||||
|
||||
Con_Printf("No such video mode: %d\n",modenum);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Cvar_SetValue ("vid_mode", (float)modenum);
|
||||
Cvar_SetValue(vid_mode, (float)modenum);
|
||||
|
||||
current_mode=modenum;
|
||||
|
||||
|
@ -582,9 +582,9 @@ void VID_Init(unsigned char *palette)
|
|||
|
||||
VID_InitModes();
|
||||
|
||||
Cvar_RegisterVariable (&vid_mode);
|
||||
Cvar_RegisterVariable (&vid_redrawfull);
|
||||
Cvar_RegisterVariable (&vid_waitforrefresh);
|
||||
vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None");
|
||||
vid_redrawfull = Cvar_Get("vid_redrawfull", "0", CVAR_NONE, "None");
|
||||
vid_waitforrefresh = Cvar_Get("vid_waitforrefresh", "0", CVAR_ARCHIVE, "None");
|
||||
|
||||
Cmd_AddCommand("vid_nummodes", VID_NumModes_f);
|
||||
Cmd_AddCommand("vid_describemode", VID_DescribeMode_f);
|
||||
|
@ -740,13 +740,13 @@ void VID_Update(vrect_t *rects)
|
|||
if (!vga_oktowrite())
|
||||
return; // can't update screen if it's not active
|
||||
|
||||
if (vid_waitforrefresh.value)
|
||||
if (vid_waitforrefresh->value)
|
||||
vga_waitretrace();
|
||||
|
||||
if (VGA_planar)
|
||||
VGA_UpdatePlanarScreen (vid.buffer);
|
||||
|
||||
else if (vid_redrawfull.value) {
|
||||
else if (vid_redrawfull->value) {
|
||||
int total = vid.rowbytes * vid.height;
|
||||
int offset;
|
||||
|
||||
|
@ -794,8 +794,8 @@ void VID_Update(vrect_t *rects)
|
|||
}
|
||||
}
|
||||
|
||||
if (vid_mode.value != current_mode)
|
||||
VID_SetMode ((int)vid_mode.value, vid_current_palette);
|
||||
if (vid_mode->value != current_mode)
|
||||
VID_SetMode ((int)vid_mode->value, vid_current_palette);
|
||||
}
|
||||
|
||||
static int dither;
|
||||
|
@ -850,10 +850,10 @@ void IN_Init(void)
|
|||
if (UseMouse)
|
||||
{
|
||||
|
||||
Cvar_RegisterVariable (&mouse_button_commands[0]);
|
||||
Cvar_RegisterVariable (&mouse_button_commands[1]);
|
||||
Cvar_RegisterVariable (&mouse_button_commands[2]);
|
||||
Cvar_RegisterVariable (&m_filter);
|
||||
mouse_button_commands[0]=Cvar_Get("mouse1","+attack",CVAR_NONE,"None");
|
||||
mouse_button_commands[0]=Cvar_Get("mouse2","+strafe",CVAR_NONE,"None");
|
||||
mouse_button_commands[0]=Cvar_Get("mouse3","+forward",CVAR_NONE,"None");
|
||||
m_filter = Cvar_Get("m_filter", "0", CVAR_ARCHIVE, "None");
|
||||
Cmd_AddCommand ("force_centerview", Force_CenterView_f);
|
||||
|
||||
mouse_buttons = 3;
|
||||
|
@ -943,7 +943,7 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
while (mouse_update())
|
||||
;
|
||||
|
||||
if (m_filter.value)
|
||||
if (m_filter->value)
|
||||
{
|
||||
mouse_x = (mx + old_mouse_x) * 0.5;
|
||||
mouse_y = (my + old_mouse_y) * 0.5;
|
||||
|
@ -957,21 +957,21 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
old_mouse_y = my;
|
||||
mx = my = 0; // clear for next update
|
||||
|
||||
mouse_x *= sensitivity.value;
|
||||
mouse_y *= sensitivity.value;
|
||||
mouse_x *= sensitivity->value;
|
||||
mouse_y *= sensitivity->value;
|
||||
|
||||
// add mouse X/Y movement to cmd
|
||||
if ( (in_strafe.state & 1) || (lookstrafe.value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side.value * mouse_x;
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
cl.viewangles[YAW] -= m_yaw->value * mouse_x;
|
||||
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
if ( (in_mlook.state & 1) && !(in_strafe.state & 1))
|
||||
{
|
||||
cl.viewangles[PITCH] += m_pitch.value * mouse_y;
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70)
|
||||
|
@ -980,9 +980,9 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
else
|
||||
{
|
||||
if ((in_strafe.state & 1) && noclip_anglehack)
|
||||
cmd->upmove -= m_forward.value * mouse_y;
|
||||
cmd->upmove -= m_forward->value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
cmd->forwardmove -= m_forward->value * mouse_y;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -395,13 +395,13 @@ int VGA_InitMode (viddef_t *lvid, vmode_t *pcurrentmode)
|
|||
|
||||
VGA_ClearVideoMem (pcurrentmode->planar);
|
||||
|
||||
if (_vid_wait_override.value)
|
||||
if (_vid_wait_override->value)
|
||||
{
|
||||
Cvar_SetValue ("vid_wait", (float)VID_WAIT_VSYNC);
|
||||
Cvar_SetValue(vid_wait, (float)VID_WAIT_VSYNC);
|
||||
}
|
||||
else
|
||||
{
|
||||
Cvar_SetValue ("vid_wait", (float)VID_WAIT_NONE);
|
||||
Cvar_SetValue(vid_wait, (float)VID_WAIT_NONE);
|
||||
}
|
||||
|
||||
D_InitCaches (vid_surfcache, vid_surfcachesize);
|
||||
|
@ -477,7 +477,7 @@ void VGA_SwapBuffers (viddef_t *lvid, vmode_t *pcurrentmode, vrect_t *rects)
|
|||
{
|
||||
UNUSED(lvid);
|
||||
|
||||
if (vid_wait.value == VID_WAIT_VSYNC)
|
||||
if (vid_wait->value == VID_WAIT_VSYNC)
|
||||
VGA_WaitVsync ();
|
||||
|
||||
VGA_SwapBuffersCopy (lvid, pcurrentmode, rects);
|
||||
|
|
173
source/vid_win.c
173
source/vid_win.c
|
@ -73,23 +73,23 @@ viddef_t vid; // global video state
|
|||
#define MODE_FULLSCREEN_DEFAULT (MODE_WINDOWED + 3)
|
||||
|
||||
// Note that 0 is MODE_WINDOWED
|
||||
cvar_t vid_mode = {"vid_mode","0", false};
|
||||
cvar_t *vid_mode;
|
||||
// Note that 0 is MODE_WINDOWED
|
||||
cvar_t _vid_default_mode = {"_vid_default_mode","0", true};
|
||||
cvar_t *_vid_default_mode;
|
||||
// Note that 3 is MODE_FULLSCREEN_DEFAULT
|
||||
cvar_t _vid_default_mode_win = {"_vid_default_mode_win","3", true};
|
||||
cvar_t vid_wait = {"vid_wait","0"};
|
||||
cvar_t vid_nopageflip = {"vid_nopageflip","0", true};
|
||||
cvar_t _vid_wait_override = {"_vid_wait_override", "0", true};
|
||||
cvar_t vid_config_x = {"vid_config_x","800", true};
|
||||
cvar_t vid_config_y = {"vid_config_y","600", true};
|
||||
cvar_t vid_stretch_by_2 = {"vid_stretch_by_2","1", true};
|
||||
cvar_t _windowed_mouse = {"_windowed_mouse","0", true};
|
||||
cvar_t vid_fullscreen_mode = {"vid_fullscreen_mode","3", true};
|
||||
cvar_t vid_windowed_mode = {"vid_windowed_mode","0", true};
|
||||
cvar_t block_switch = {"block_switch","0", true};
|
||||
cvar_t vid_window_x = {"vid_window_x", "0", true};
|
||||
cvar_t vid_window_y = {"vid_window_y", "0", true};
|
||||
cvar_t *_vid_default_mode_win;
|
||||
cvar_t *vid_wait;
|
||||
cvar_t *vid_nopageflip;
|
||||
cvar_t *_vid_wait_override;
|
||||
cvar_t *vid_config_x;
|
||||
cvar_t *vid_config_y;
|
||||
cvar_t *vid_stretch_by_2;
|
||||
cvar_t *_windowed_mouse;
|
||||
cvar_t *vid_fullscreen_mode;
|
||||
cvar_t *vid_windowed_mode;
|
||||
cvar_t *block_switch;
|
||||
cvar_t *vid_window_x;
|
||||
cvar_t *vid_window_y;
|
||||
|
||||
typedef struct {
|
||||
int width;
|
||||
|
@ -156,6 +156,11 @@ void VID_MenuKey (int key);
|
|||
LONG WINAPI MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
void AppActivate(BOOL fActive, BOOL minimize);
|
||||
|
||||
void
|
||||
VID_InitCvars(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
|
@ -173,8 +178,8 @@ void VID_RememberWindowPos (void)
|
|||
(rect.right > 0) &&
|
||||
(rect.bottom > 0))
|
||||
{
|
||||
Cvar_SetValue ("vid_window_x", (float)rect.left);
|
||||
Cvar_SetValue ("vid_window_y", (float)rect.top);
|
||||
Cvar_SetValue(vid_window_x, (float)rect.left);
|
||||
Cvar_SetValue(vid_window_y, (float)rect.top);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -188,13 +193,13 @@ VID_CheckWindowXY
|
|||
void VID_CheckWindowXY (void)
|
||||
{
|
||||
|
||||
if (((int)vid_window_x.value > (GetSystemMetrics (SM_CXSCREEN) - 160)) ||
|
||||
((int)vid_window_y.value > (GetSystemMetrics (SM_CYSCREEN) - 120)) ||
|
||||
((int)vid_window_x.value < 0) ||
|
||||
((int)vid_window_y.value < 0))
|
||||
if (((int)vid_window_x->value > (GetSystemMetrics (SM_CXSCREEN) - 160)) ||
|
||||
((int)vid_window_y->value > (GetSystemMetrics (SM_CYSCREEN) - 120)) ||
|
||||
((int)vid_window_x->value < 0) ||
|
||||
((int)vid_window_y->value < 0))
|
||||
{
|
||||
Cvar_SetValue ("vid_window_x", 0.0);
|
||||
Cvar_SetValue ("vid_window_y", 0.0 );
|
||||
Cvar_SetValue(vid_window_x, 0.0);
|
||||
Cvar_SetValue(vid_window_y, 0.0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -321,7 +326,7 @@ int VID_Suspend (MGLDC *dc,m_int flags)
|
|||
if (flags & MGL_DEACTIVATE)
|
||||
{
|
||||
// FIXME: this doesn't currently work on NT
|
||||
if (block_switch.value && !WinNT)
|
||||
if (block_switch->value && !WinNT)
|
||||
{
|
||||
return MGL_NO_DEACTIVATE;
|
||||
}
|
||||
|
@ -1041,17 +1046,17 @@ void VID_CheckModedescFixup (int mode)
|
|||
|
||||
if (mode == MODE_SETTABLE_WINDOW)
|
||||
{
|
||||
modelist[mode].stretched = (int)vid_stretch_by_2.value;
|
||||
modelist[mode].stretched = (int)vid_stretch_by_2->value;
|
||||
stretch = modelist[mode].stretched;
|
||||
|
||||
if (vid_config_x.value < (320 << stretch))
|
||||
vid_config_x.value = 320 << stretch;
|
||||
if (vid_config_x->value < (320 << stretch))
|
||||
vid_config_x->value = 320 << stretch;
|
||||
|
||||
if (vid_config_y.value < (200 << stretch))
|
||||
vid_config_y.value = 200 << stretch;
|
||||
if (vid_config_y->value < (200 << stretch))
|
||||
vid_config_y->value = 200 << stretch;
|
||||
|
||||
x = (int)vid_config_x.value;
|
||||
y = (int)vid_config_y.value;
|
||||
x = (int)vid_config_x->value;
|
||||
y = (int)vid_config_y->value;
|
||||
sprintf (modelist[mode].modedesc, "%dx%d", x, y);
|
||||
modelist[mode].width = x;
|
||||
modelist[mode].height = y;
|
||||
|
@ -1235,8 +1240,8 @@ qboolean VID_SetWindowedMode (int modenum)
|
|||
{
|
||||
if (COM_CheckParm ("-resetwinpos"))
|
||||
{
|
||||
Cvar_SetValue ("vid_window_x", 0.0);
|
||||
Cvar_SetValue ("vid_window_y", 0.0);
|
||||
Cvar_SetValue(vid_window_x, 0.0);
|
||||
Cvar_SetValue(vid_window_y, 0.0);
|
||||
}
|
||||
|
||||
windowed_mode_set;
|
||||
|
@ -1328,8 +1333,8 @@ qboolean VID_SetWindowedMode (int modenum)
|
|||
|
||||
// position and show the DIB window
|
||||
VID_CheckWindowXY ();
|
||||
SetWindowPos (mainwindow, NULL, (int)vid_window_x.value,
|
||||
(int)vid_window_y.value, 0, 0,
|
||||
SetWindowPos (mainwindow, NULL, (int)vid_window_x->value,
|
||||
(int)vid_window_y->value, 0, 0,
|
||||
SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW | SWP_DRAWFRAME);
|
||||
|
||||
if (force_minimized)
|
||||
|
@ -1396,7 +1401,7 @@ qboolean VID_SetFullscreenMode (int modenum)
|
|||
mgldc = memdc = NULL;
|
||||
|
||||
if ((mgldc = createDisplayDC (modelist[modenum].stretched ||
|
||||
(int)vid_nopageflip.value)) == NULL)
|
||||
(int)vid_nopageflip->value)) == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -1592,11 +1597,11 @@ int VID_SetMode (int modenum, unsigned char *palette)
|
|||
modenum = vid_default;
|
||||
}
|
||||
|
||||
Cvar_SetValue ("vid_mode", (float)modenum);
|
||||
Cvar_SetValue(vid_mode, (float)modenum);
|
||||
}
|
||||
else
|
||||
{
|
||||
Cvar_SetValue ("vid_mode", (float)vid_modenum);
|
||||
Cvar_SetValue(vid_mode, (float)vid_modenum);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1620,7 +1625,7 @@ int VID_SetMode (int modenum, unsigned char *palette)
|
|||
// Set either the fullscreen or windowed mode
|
||||
if (modelist[modenum].type == MS_WINDOWED)
|
||||
{
|
||||
if (_windowed_mouse.value)
|
||||
if (_windowed_mouse->value)
|
||||
{
|
||||
stat = VID_SetWindowedMode(modenum);
|
||||
IN_ActivateMouse ();
|
||||
|
@ -1683,7 +1688,7 @@ int VID_SetMode (int modenum, unsigned char *palette)
|
|||
ReleaseDC(NULL,hdc);
|
||||
|
||||
vid_modenum = modenum;
|
||||
Cvar_SetValue ("vid_mode", (float)vid_modenum);
|
||||
Cvar_SetValue(vid_mode, (float)vid_modenum);
|
||||
|
||||
if (!VID_AllocBuffers (vid.width, vid.height))
|
||||
{
|
||||
|
@ -1761,7 +1766,7 @@ void VID_LockBuffer (void)
|
|||
else
|
||||
screenwidth = vid.rowbytes;
|
||||
|
||||
if (lcd_x.value)
|
||||
if (lcd_x->value)
|
||||
screenwidth <<= 1;
|
||||
}
|
||||
|
||||
|
@ -2013,7 +2018,7 @@ VID_Windowed_f
|
|||
void VID_Windowed_f (void)
|
||||
{
|
||||
|
||||
VID_SetMode ((int)vid_windowed_mode.value, vid_curpal);
|
||||
VID_SetMode ((int)vid_windowed_mode->value, vid_curpal);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2025,7 +2030,7 @@ VID_Fullscreen_f
|
|||
void VID_Fullscreen_f (void)
|
||||
{
|
||||
|
||||
VID_SetMode ((int)vid_fullscreen_mode.value, vid_curpal);
|
||||
VID_SetMode ((int)vid_fullscreen_mode->value, vid_curpal);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2072,21 +2077,21 @@ void VID_Init (unsigned char *palette)
|
|||
int basenummodes;
|
||||
byte *ptmp;
|
||||
|
||||
Cvar_RegisterVariable (&vid_mode);
|
||||
Cvar_RegisterVariable (&vid_wait);
|
||||
Cvar_RegisterVariable (&vid_nopageflip);
|
||||
Cvar_RegisterVariable (&_vid_wait_override);
|
||||
Cvar_RegisterVariable (&_vid_default_mode);
|
||||
Cvar_RegisterVariable (&_vid_default_mode_win);
|
||||
Cvar_RegisterVariable (&vid_config_x);
|
||||
Cvar_RegisterVariable (&vid_config_y);
|
||||
Cvar_RegisterVariable (&vid_stretch_by_2);
|
||||
Cvar_RegisterVariable (&_windowed_mouse);
|
||||
Cvar_RegisterVariable (&vid_fullscreen_mode);
|
||||
Cvar_RegisterVariable (&vid_windowed_mode);
|
||||
Cvar_RegisterVariable (&block_switch);
|
||||
Cvar_RegisterVariable (&vid_window_x);
|
||||
Cvar_RegisterVariable (&vid_window_y);
|
||||
vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None");
|
||||
vid_wait = Cvar_Get("vid_wait", "0", CVAR_NONE, "None");
|
||||
vid_nopageflip = Cvar_Get("vid_nopageflip", "0", CVAR_ARCHIVE, "None");
|
||||
_vid_wait_override = Cvar_Get("_vid_wait_override", "0", CVAR_ARCHIVE, "None");
|
||||
_vid_default_mode = Cvar_Get("_vid_default_mode", "0", CVAR_ARCHIVE, "None");
|
||||
_vid_default_mode_win = Cvar_Get("_vid_default_mode_win", "3", CVAR_ARCHIVE, "None");
|
||||
vid_config_x = Cvar_Get("vid_config_x", "800", CVAR_ARCHIVE, "None");
|
||||
vid_config_y = Cvar_Get("vid_config_y", "600", CVAR_ARCHIVE, "None");
|
||||
vid_stretch_by_2 = Cvar_Get("vid_stretch_by_2", "1", CVAR_ARCHIVE, "None");
|
||||
_windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_ARCHIVE, "None");
|
||||
vid_fullscreen_mode = Cvar_Get("vid_fullscreen_mode", "3", CVAR_ARCHIVE, "None");
|
||||
vid_windowed_mode = Cvar_Get("vid_windowed_mode", "0", CVAR_ARCHIVE, "None");
|
||||
block_switch = Cvar_Get("block_switch", "0", CVAR_ARCHIVE, "None");
|
||||
vid_window_x = Cvar_Get("vid_window_x", "0", CVAR_ARCHIVE, "None");
|
||||
vid_window_y = Cvar_Get("vid_window_y", "0", CVAR_ARCHIVE, "None");
|
||||
|
||||
Cmd_AddCommand ("vid_testmode", VID_TestMode_f);
|
||||
Cmd_AddCommand ("vid_nummodes", VID_NumModes_f);
|
||||
|
@ -2335,40 +2340,40 @@ void VID_Update (vrect_t *rects)
|
|||
{
|
||||
GetWindowRect (mainwindow, &trect);
|
||||
|
||||
if ((trect.left != (int)vid_window_x.value) ||
|
||||
(trect.top != (int)vid_window_y.value))
|
||||
if ((trect.left != (int)vid_window_x->value) ||
|
||||
(trect.top != (int)vid_window_y->value))
|
||||
{
|
||||
if (COM_CheckParm ("-resetwinpos"))
|
||||
{
|
||||
Cvar_SetValue ("vid_window_x", 0.0);
|
||||
Cvar_SetValue ("vid_window_y", 0.0);
|
||||
Cvar_SetValue(vid_window_x, 0.0);
|
||||
Cvar_SetValue(vid_window_y, 0.0);
|
||||
}
|
||||
|
||||
VID_CheckWindowXY ();
|
||||
SetWindowPos (mainwindow, NULL, (int)vid_window_x.value,
|
||||
(int)vid_window_y.value, 0, 0,
|
||||
SetWindowPos (mainwindow, NULL, (int)vid_window_x->value,
|
||||
(int)vid_window_y->value, 0, 0,
|
||||
SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW | SWP_DRAWFRAME);
|
||||
}
|
||||
}
|
||||
|
||||
if ((_vid_default_mode_win.value != vid_default) &&
|
||||
(!startwindowed || (_vid_default_mode_win.value < MODE_FULLSCREEN_DEFAULT)))
|
||||
if ((_vid_default_mode_win->value != vid_default) &&
|
||||
(!startwindowed || (_vid_default_mode_win->value < MODE_FULLSCREEN_DEFAULT)))
|
||||
{
|
||||
firstupdate = 0;
|
||||
|
||||
if (COM_CheckParm ("-resetwinpos"))
|
||||
{
|
||||
Cvar_SetValue ("vid_window_x", 0.0);
|
||||
Cvar_SetValue ("vid_window_y", 0.0);
|
||||
Cvar_SetValue(vid_window_x, 0.0);
|
||||
Cvar_SetValue(vid_window_y, 0.0);
|
||||
}
|
||||
|
||||
if ((_vid_default_mode_win.value < 0) ||
|
||||
(_vid_default_mode_win.value >= nummodes))
|
||||
if ((_vid_default_mode_win->value < 0) ||
|
||||
(_vid_default_mode_win->value >= nummodes))
|
||||
{
|
||||
Cvar_SetValue ("_vid_default_mode_win", windowed_default);
|
||||
Cvar_SetValue(_vid_default_mode_win, windowed_default);
|
||||
}
|
||||
|
||||
Cvar_SetValue ("vid_mode", _vid_default_mode_win.value);
|
||||
Cvar_SetValue(vid_mode, _vid_default_mode_win->value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2385,10 +2390,10 @@ void VID_Update (vrect_t *rects)
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((int)vid_mode.value != vid_realmode)
|
||||
if ((int)vid_mode->value != vid_realmode)
|
||||
{
|
||||
VID_SetMode ((int)vid_mode.value, vid_curpal);
|
||||
Cvar_SetValue ("vid_mode", (float)vid_modenum);
|
||||
VID_SetMode ((int)vid_mode->value, vid_curpal);
|
||||
Cvar_SetValue(vid_mode, (float)vid_modenum);
|
||||
// so if mode set fails, we don't keep on
|
||||
// trying to set that mode
|
||||
vid_realmode = vid_modenum;
|
||||
|
@ -2398,9 +2403,9 @@ void VID_Update (vrect_t *rects)
|
|||
// handle the mouse state when windowed if that's changed
|
||||
if (modestate == MS_WINDOWED)
|
||||
{
|
||||
if ((int)_windowed_mouse.value != windowed_mouse)
|
||||
if ((int)_windowed_mouse->value != windowed_mouse)
|
||||
{
|
||||
if (_windowed_mouse.value)
|
||||
if (_windowed_mouse->value)
|
||||
{
|
||||
IN_ActivateMouse ();
|
||||
IN_HideMouse ();
|
||||
|
@ -2411,7 +2416,7 @@ void VID_Update (vrect_t *rects)
|
|||
IN_ShowMouse ();
|
||||
}
|
||||
|
||||
windowed_mouse = (int)_windowed_mouse.value;
|
||||
windowed_mouse = (int)_windowed_mouse->value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2746,7 +2751,7 @@ void AppActivate(BOOL fActive, BOOL minimize)
|
|||
IN_ActivateMouse ();
|
||||
IN_HideMouse ();
|
||||
}
|
||||
else if ((modestate == MS_WINDOWED) && _windowed_mouse.value)
|
||||
else if ((modestate == MS_WINDOWED) && _windowed_mouse->value)
|
||||
{
|
||||
IN_ActivateMouse ();
|
||||
IN_HideMouse ();
|
||||
|
@ -2778,7 +2783,7 @@ void AppActivate(BOOL fActive, BOOL minimize)
|
|||
IN_DeactivateMouse ();
|
||||
IN_ShowMouse ();
|
||||
}
|
||||
else if ((modestate == MS_WINDOWED) && _windowed_mouse.value)
|
||||
else if ((modestate == MS_WINDOWED) && _windowed_mouse->value)
|
||||
{
|
||||
IN_DeactivateMouse ();
|
||||
IN_ShowMouse ();
|
||||
|
@ -2796,7 +2801,7 @@ VID_HandlePause
|
|||
void VID_HandlePause (qboolean pause)
|
||||
{
|
||||
|
||||
if ((modestate == MS_WINDOWED) && _windowed_mouse.value)
|
||||
if ((modestate == MS_WINDOWED) && _windowed_mouse->value)
|
||||
{
|
||||
if (pause)
|
||||
{
|
||||
|
@ -2855,7 +2860,7 @@ LONG WINAPI MainWndProc (
|
|||
force_mode_set = false;
|
||||
}
|
||||
|
||||
VID_SetMode ((int)vid_fullscreen_mode.value, vid_curpal);
|
||||
VID_SetMode ((int)vid_fullscreen_mode->value, vid_curpal);
|
||||
break;
|
||||
|
||||
case SC_SCREENSAVE:
|
||||
|
@ -3236,7 +3241,7 @@ void VID_MenuDraw (void)
|
|||
M_Print (2*8, 36 + MODE_AREA_HEIGHT * 8 + 8*5, temp);
|
||||
}
|
||||
|
||||
ptr = VID_GetModeDescription2 ((int)_vid_default_mode_win.value);
|
||||
ptr = VID_GetModeDescription2 ((int)_vid_default_mode_win->value);
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
|
@ -3345,7 +3350,7 @@ void VID_MenuKey (int key)
|
|||
case 'd':
|
||||
S_LocalSound ("misc/menu1.wav");
|
||||
firstupdate = 0;
|
||||
Cvar_SetValue ("_vid_default_mode_win", vid_modenum);
|
||||
Cvar_SetValue(_vid_default_mode_win, vid_modenum);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
#include "quakedef.h"
|
||||
#include "d_local.h"
|
||||
|
||||
cvar_t _windowed_mouse = {"_windowed_mouse","0", true};
|
||||
cvar_t m_filter = {"m_filter","0", true};
|
||||
cvar_t *_windowed_mouse;
|
||||
cvar_t *m_filter;
|
||||
float old_windowed_mouse;
|
||||
|
||||
qboolean mouse_avail;
|
||||
|
@ -122,6 +122,11 @@ static int shiftmask_fl=0;
|
|||
static long r_shift,g_shift,b_shift;
|
||||
static unsigned long r_mask,g_mask,b_mask;
|
||||
|
||||
void
|
||||
VID_InitCvars(void)
|
||||
{
|
||||
}
|
||||
|
||||
void shiftmask_init()
|
||||
{
|
||||
unsigned int x;
|
||||
|
@ -885,7 +890,7 @@ void GetEvent(void)
|
|||
break;
|
||||
|
||||
case MotionNotify:
|
||||
if (_windowed_mouse.value) {
|
||||
if (_windowed_mouse->value) {
|
||||
mouse_x = (float) ((int)x_event.xmotion.x - (int)(vid.width/2));
|
||||
mouse_y = (float) ((int)x_event.xmotion.y - (int)(vid.height/2));
|
||||
//printf("m: x=%d,y=%d, mx=%3.2f,my=%3.2f\n",
|
||||
|
@ -946,10 +951,10 @@ void GetEvent(void)
|
|||
oktodraw = true;
|
||||
}
|
||||
|
||||
if (old_windowed_mouse != _windowed_mouse.value) {
|
||||
old_windowed_mouse = _windowed_mouse.value;
|
||||
if (old_windowed_mouse != _windowed_mouse->value) {
|
||||
old_windowed_mouse = _windowed_mouse->value;
|
||||
|
||||
if (!_windowed_mouse.value) {
|
||||
if (!_windowed_mouse->value) {
|
||||
/* ungrab the pointer */
|
||||
XUngrabPointer(x_disp,CurrentTime);
|
||||
} else {
|
||||
|
@ -1137,8 +1142,8 @@ void D_EndDirectRect (int x, int y, int width, int height)
|
|||
|
||||
void IN_Init (void)
|
||||
{
|
||||
Cvar_RegisterVariable (&_windowed_mouse);
|
||||
Cvar_RegisterVariable (&m_filter);
|
||||
_windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_ARCHIVE, "None");
|
||||
m_filter = Cvar_Get("m_filter", "0", CVAR_ARCHIVE, "None");
|
||||
if ( COM_CheckParm ("-nomouse") )
|
||||
return;
|
||||
mouse_x = mouse_y = 0.0;
|
||||
|
@ -1171,7 +1176,7 @@ void IN_Move (usercmd_t *cmd)
|
|||
if (!mouse_avail)
|
||||
return;
|
||||
|
||||
if (m_filter.value) {
|
||||
if (m_filter->value) {
|
||||
mouse_x = (mouse_x + old_mouse_x) * 0.5;
|
||||
mouse_y = (mouse_y + old_mouse_y) * 0.5;
|
||||
}
|
||||
|
@ -1179,27 +1184,27 @@ void IN_Move (usercmd_t *cmd)
|
|||
old_mouse_x = mouse_x;
|
||||
old_mouse_y = mouse_y;
|
||||
|
||||
mouse_x *= sensitivity.value;
|
||||
mouse_y *= sensitivity.value;
|
||||
mouse_x *= sensitivity->value;
|
||||
mouse_y *= sensitivity->value;
|
||||
|
||||
if ( (in_strafe.state & 1) || (lookstrafe.value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side.value * mouse_x;
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
cl.viewangles[YAW] -= m_yaw->value * mouse_x;
|
||||
if (in_mlook.state & 1)
|
||||
V_StopPitchDrift ();
|
||||
|
||||
if ( (in_mlook.state & 1) && !(in_strafe.state & 1)) {
|
||||
cl.viewangles[PITCH] += m_pitch.value * mouse_y;
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70)
|
||||
cl.viewangles[PITCH] = -70;
|
||||
} else {
|
||||
if ((in_strafe.state & 1) && noclip_anglehack)
|
||||
cmd->upmove -= m_forward.value * mouse_y;
|
||||
cmd->upmove -= m_forward->value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
cmd->forwardmove -= m_forward->value * mouse_y;
|
||||
}
|
||||
mouse_x = mouse_y = 0.0;
|
||||
}
|
||||
|
|
210
source/view.c
210
source/view.c
|
@ -42,38 +42,38 @@ when crossing a water boudnary.
|
|||
|
||||
*/
|
||||
|
||||
cvar_t lcd_x = {"lcd_x","0"};
|
||||
cvar_t lcd_yaw = {"lcd_yaw","0"};
|
||||
cvar_t *lcd_x;
|
||||
cvar_t *lcd_yaw;
|
||||
|
||||
cvar_t scr_ofsx = {"scr_ofsx","0", false};
|
||||
cvar_t scr_ofsy = {"scr_ofsy","0", false};
|
||||
cvar_t scr_ofsz = {"scr_ofsz","0", false};
|
||||
cvar_t *scr_ofsx;
|
||||
cvar_t *scr_ofsy;
|
||||
cvar_t *scr_ofsz;
|
||||
|
||||
cvar_t cl_rollspeed = {"cl_rollspeed", "200"};
|
||||
cvar_t cl_rollangle = {"cl_rollangle", "2.0"};
|
||||
cvar_t *cl_rollspeed;
|
||||
cvar_t *cl_rollangle;
|
||||
|
||||
cvar_t cl_bob = {"cl_bob","0.02", false};
|
||||
cvar_t cl_bobcycle = {"cl_bobcycle","0.6", false};
|
||||
cvar_t cl_bobup = {"cl_bobup","0.5", false};
|
||||
cvar_t *cl_bob;
|
||||
cvar_t *cl_bobcycle;
|
||||
cvar_t *cl_bobup;
|
||||
|
||||
cvar_t v_kicktime = {"v_kicktime", "0.5", false};
|
||||
cvar_t v_kickroll = {"v_kickroll", "0.6", false};
|
||||
cvar_t v_kickpitch = {"v_kickpitch", "0.6", false};
|
||||
cvar_t *v_kicktime;
|
||||
cvar_t *v_kickroll;
|
||||
cvar_t *v_kickpitch;
|
||||
|
||||
cvar_t v_iyaw_cycle = {"v_iyaw_cycle", "2", false};
|
||||
cvar_t v_iroll_cycle = {"v_iroll_cycle", "0.5", false};
|
||||
cvar_t v_ipitch_cycle = {"v_ipitch_cycle", "1", false};
|
||||
cvar_t v_iyaw_level = {"v_iyaw_level", "0.3", false};
|
||||
cvar_t v_iroll_level = {"v_iroll_level", "0.1", false};
|
||||
cvar_t v_ipitch_level = {"v_ipitch_level", "0.3", false};
|
||||
cvar_t *v_iyaw_cycle;
|
||||
cvar_t *v_iroll_cycle;
|
||||
cvar_t *v_ipitch_cycle;
|
||||
cvar_t *v_iyaw_level;
|
||||
cvar_t *v_iroll_level;
|
||||
cvar_t *v_ipitch_level;
|
||||
|
||||
cvar_t v_idlescale = {"v_idlescale", "0", false};
|
||||
cvar_t *v_idlescale;
|
||||
|
||||
cvar_t crosshair = {"crosshair", "0", true};
|
||||
cvar_t cl_crossx = {"cl_crossx", "0", false};
|
||||
cvar_t cl_crossy = {"cl_crossy", "0", false};
|
||||
cvar_t *crosshair;
|
||||
cvar_t *cl_crossx;
|
||||
cvar_t *cl_crossy;
|
||||
|
||||
cvar_t gl_cshiftpercent = {"gl_cshiftpercent", "100", false};
|
||||
cvar_t *gl_cshiftpercent;
|
||||
|
||||
float v_dmg_time, v_dmg_roll, v_dmg_pitch;
|
||||
|
||||
|
@ -100,12 +100,12 @@ float V_CalcRoll (vec3_t angles, vec3_t velocity)
|
|||
sign = side < 0 ? -1 : 1;
|
||||
side = fabs(side);
|
||||
|
||||
value = cl_rollangle.value;
|
||||
value = cl_rollangle->value;
|
||||
// if (cl.inwater)
|
||||
// value *= 6;
|
||||
|
||||
if (side < cl_rollspeed.value)
|
||||
side = side * value / cl_rollspeed.value;
|
||||
if (side < cl_rollspeed->value)
|
||||
side = side * value / cl_rollspeed->value;
|
||||
else
|
||||
side = value;
|
||||
|
||||
|
@ -125,17 +125,17 @@ float V_CalcBob (void)
|
|||
float bob;
|
||||
float cycle;
|
||||
|
||||
cycle = cl.time - (int)(cl.time/cl_bobcycle.value)*cl_bobcycle.value;
|
||||
cycle /= cl_bobcycle.value;
|
||||
if (cycle < cl_bobup.value)
|
||||
cycle = M_PI * cycle / cl_bobup.value;
|
||||
cycle = cl.time - (int)(cl.time/cl_bobcycle->value)*cl_bobcycle->value;
|
||||
cycle /= cl_bobcycle->value;
|
||||
if (cycle < cl_bobup->value)
|
||||
cycle = M_PI * cycle / cl_bobup->value;
|
||||
else
|
||||
cycle = M_PI + M_PI*(cycle-cl_bobup.value)/(1.0 - cl_bobup.value);
|
||||
cycle = M_PI + M_PI*(cycle-cl_bobup->value)/(1.0 - cl_bobup->value);
|
||||
|
||||
// bob is proportional to velocity in the xy plane
|
||||
// (don't count Z, or jumping messes it up)
|
||||
|
||||
bob = sqrt(cl.velocity[0]*cl.velocity[0] + cl.velocity[1]*cl.velocity[1]) * cl_bob.value;
|
||||
bob = sqrt(cl.velocity[0]*cl.velocity[0] + cl.velocity[1]*cl.velocity[1]) * cl_bob->value;
|
||||
//Con_Printf ("speed: %5.1f\n", Length(cl.velocity));
|
||||
bob = bob*0.3 + bob*0.7*sin(cycle);
|
||||
if (bob > 4)
|
||||
|
@ -150,8 +150,8 @@ float V_CalcBob (void)
|
|||
//=============================================================================
|
||||
|
||||
|
||||
cvar_t v_centermove = {"v_centermove", "0.15", false};
|
||||
cvar_t v_centerspeed = {"v_centerspeed","500"};
|
||||
cvar_t *v_centermove;
|
||||
cvar_t *v_centerspeed;
|
||||
|
||||
|
||||
void V_StartPitchDrift (void)
|
||||
|
@ -164,7 +164,7 @@ void V_StartPitchDrift (void)
|
|||
#endif
|
||||
if (cl.nodrift || !cl.pitchvel)
|
||||
{
|
||||
cl.pitchvel = v_centerspeed.value;
|
||||
cl.pitchvel = v_centerspeed->value;
|
||||
cl.nodrift = false;
|
||||
cl.driftmove = 0;
|
||||
}
|
||||
|
@ -204,12 +204,12 @@ void V_DriftPitch (void)
|
|||
// don't count small mouse motion
|
||||
if (cl.nodrift)
|
||||
{
|
||||
if ( fabs(cl.cmd.forwardmove) < cl_forwardspeed.value)
|
||||
if ( fabs(cl.cmd.forwardmove) < cl_forwardspeed->value)
|
||||
cl.driftmove = 0;
|
||||
else
|
||||
cl.driftmove += host_frametime;
|
||||
|
||||
if ( cl.driftmove > v_centermove.value)
|
||||
if ( cl.driftmove > v_centermove->value)
|
||||
{
|
||||
V_StartPitchDrift ();
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ void V_DriftPitch (void)
|
|||
}
|
||||
|
||||
move = host_frametime * cl.pitchvel;
|
||||
cl.pitchvel += host_frametime * v_centerspeed.value;
|
||||
cl.pitchvel += host_frametime * v_centerspeed->value;
|
||||
|
||||
//Con_Printf ("move: %f (%f)\n", move, host_frametime);
|
||||
|
||||
|
@ -267,7 +267,7 @@ cshift_t cshift_water = { {130,80,50}, 128 };
|
|||
cshift_t cshift_slime = { {0,25,5}, 150 };
|
||||
cshift_t cshift_lava = { {255,80,0}, 150 };
|
||||
|
||||
cvar_t v_gamma = {"gamma", "1", true};
|
||||
cvar_t *v_gamma;
|
||||
|
||||
byte gammatable[256]; // palette is sent through this
|
||||
|
||||
|
@ -307,11 +307,11 @@ qboolean V_CheckGamma (void)
|
|||
{
|
||||
static float oldgammavalue;
|
||||
|
||||
if (v_gamma.value == oldgammavalue)
|
||||
if (v_gamma->value == oldgammavalue)
|
||||
return false;
|
||||
oldgammavalue = v_gamma.value;
|
||||
oldgammavalue = v_gamma->value;
|
||||
|
||||
BuildGammaTable (v_gamma.value);
|
||||
BuildGammaTable (v_gamma->value);
|
||||
vid.recalc_refdef = 1; // force a surface cache flush
|
||||
|
||||
return true;
|
||||
|
@ -381,12 +381,12 @@ void V_ParseDamage (void)
|
|||
AngleVectors (ent->angles, forward, right, up);
|
||||
|
||||
side = DotProduct (from, right);
|
||||
v_dmg_roll = count*side*v_kickroll.value;
|
||||
v_dmg_roll = count*side*v_kickroll->value;
|
||||
|
||||
side = DotProduct (from, forward);
|
||||
v_dmg_pitch = count*side*v_kickpitch.value;
|
||||
v_dmg_pitch = count*side*v_kickpitch->value;
|
||||
|
||||
v_dmg_time = v_kicktime.value;
|
||||
v_dmg_time = v_kicktime->value;
|
||||
}
|
||||
|
||||
|
||||
|
@ -502,10 +502,10 @@ void V_CalcBlend (void)
|
|||
|
||||
for (j=0 ; j<NUM_CSHIFTS ; j++)
|
||||
{
|
||||
if (!gl_cshiftpercent.value)
|
||||
if (!gl_cshiftpercent->value)
|
||||
continue;
|
||||
|
||||
a2 = ((cl.cshifts[j].percent * gl_cshiftpercent.value) / 100.0) / 255.0;
|
||||
a2 = ((cl.cshifts[j].percent * gl_cshiftpercent->value) / 100.0) / 255.0;
|
||||
|
||||
// a2 = cl.cshifts[j].percent/255.0;
|
||||
if (!a2)
|
||||
|
@ -761,9 +761,9 @@ void CalcGunAngle (void)
|
|||
cl.viewent.angles[YAW] = r_refdef.viewangles[YAW] + yaw;
|
||||
cl.viewent.angles[PITCH] = - (r_refdef.viewangles[PITCH] + pitch);
|
||||
|
||||
cl.viewent.angles[ROLL] -= v_idlescale.value * sin(cl.time*v_iroll_cycle.value) * v_iroll_level.value;
|
||||
cl.viewent.angles[PITCH] -= v_idlescale.value * sin(cl.time*v_ipitch_cycle.value) * v_ipitch_level.value;
|
||||
cl.viewent.angles[YAW] -= v_idlescale.value * sin(cl.time*v_iyaw_cycle.value) * v_iyaw_level.value;
|
||||
cl.viewent.angles[ROLL] -= v_idlescale->value * sin(cl.time*v_iroll_cycle->value) * v_iroll_level->value;
|
||||
cl.viewent.angles[PITCH] -= v_idlescale->value * sin(cl.time*v_ipitch_cycle->value) * v_ipitch_level->value;
|
||||
cl.viewent.angles[YAW] -= v_idlescale->value * sin(cl.time*v_iyaw_cycle->value) * v_iyaw_level->value;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -803,9 +803,9 @@ Idle swaying
|
|||
*/
|
||||
void V_AddIdle (void)
|
||||
{
|
||||
r_refdef.viewangles[ROLL] += v_idlescale.value * sin(cl.time*v_iroll_cycle.value) * v_iroll_level.value;
|
||||
r_refdef.viewangles[PITCH] += v_idlescale.value * sin(cl.time*v_ipitch_cycle.value) * v_ipitch_level.value;
|
||||
r_refdef.viewangles[YAW] += v_idlescale.value * sin(cl.time*v_iyaw_cycle.value) * v_iyaw_level.value;
|
||||
r_refdef.viewangles[ROLL] += v_idlescale->value * sin(cl.time*v_iroll_cycle->value) * v_iroll_level->value;
|
||||
r_refdef.viewangles[PITCH] += v_idlescale->value * sin(cl.time*v_ipitch_cycle->value) * v_ipitch_level->value;
|
||||
r_refdef.viewangles[YAW] += v_idlescale->value * sin(cl.time*v_iyaw_cycle->value) * v_iyaw_level->value;
|
||||
}
|
||||
|
||||
|
||||
|
@ -825,8 +825,8 @@ void V_CalcViewRoll (void)
|
|||
|
||||
if (v_dmg_time > 0)
|
||||
{
|
||||
r_refdef.viewangles[ROLL] += v_dmg_time/v_kicktime.value*v_dmg_roll;
|
||||
r_refdef.viewangles[PITCH] += v_dmg_time/v_kicktime.value*v_dmg_pitch;
|
||||
r_refdef.viewangles[ROLL] += v_dmg_time/v_kicktime->value*v_dmg_roll;
|
||||
r_refdef.viewangles[PITCH] += v_dmg_time/v_kicktime->value*v_dmg_pitch;
|
||||
v_dmg_time -= host_frametime;
|
||||
}
|
||||
|
||||
|
@ -860,10 +860,10 @@ void V_CalcIntermissionRefdef (void)
|
|||
view->model = NULL;
|
||||
|
||||
// allways idle in intermission
|
||||
old = v_idlescale.value;
|
||||
v_idlescale.value = 1;
|
||||
old = v_idlescale->value;
|
||||
v_idlescale->value = 1;
|
||||
V_AddIdle ();
|
||||
v_idlescale.value = old;
|
||||
v_idlescale->value = old;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -923,9 +923,9 @@ void V_CalcRefdef (void)
|
|||
AngleVectors (angles, forward, right, up);
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
r_refdef.vieworg[i] += scr_ofsx.value*forward[i]
|
||||
+ scr_ofsy.value*right[i]
|
||||
+ scr_ofsz.value*up[i];
|
||||
r_refdef.vieworg[i] += scr_ofsx->value*forward[i]
|
||||
+ scr_ofsy->value*right[i]
|
||||
+ scr_ofsz->value*up[i];
|
||||
|
||||
|
||||
V_BoundOffsets ();
|
||||
|
@ -952,13 +952,13 @@ void V_CalcRefdef (void)
|
|||
#if 0
|
||||
if (cl.model_precache[cl.stats[STAT_WEAPON]] && strcmp (cl.model_precache[cl.stats[STAT_WEAPON]]->name, "progs/v_shot2.mdl"))
|
||||
#endif
|
||||
if (scr_viewsize.value == 110)
|
||||
if (scr_viewsize->value == 110)
|
||||
view->origin[2] += 1;
|
||||
else if (scr_viewsize.value == 100)
|
||||
else if (scr_viewsize->value == 100)
|
||||
view->origin[2] += 2;
|
||||
else if (scr_viewsize.value == 90)
|
||||
else if (scr_viewsize->value == 90)
|
||||
view->origin[2] += 1;
|
||||
else if (scr_viewsize.value == 80)
|
||||
else if (scr_viewsize->value == 80)
|
||||
view->origin[2] += 0.5;
|
||||
|
||||
view->model = cl.model_precache[cl.stats[STAT_WEAPON]];
|
||||
|
@ -989,7 +989,7 @@ if (cl.onground && ent->origin[2] - oldz > 0)
|
|||
else
|
||||
oldz = ent->origin[2];
|
||||
|
||||
if (chase_active.value)
|
||||
if (chase_active->value)
|
||||
Chase_Update ();
|
||||
}
|
||||
|
||||
|
@ -1011,9 +1011,9 @@ void V_RenderView (void)
|
|||
// don't allow cheats in multiplayer
|
||||
if (cl.maxclients > 1)
|
||||
{
|
||||
Cvar_Set ("scr_ofsx", "0");
|
||||
Cvar_Set ("scr_ofsy", "0");
|
||||
Cvar_Set ("scr_ofsz", "0");
|
||||
Cvar_Set(scr_ofsx, "0");
|
||||
Cvar_Set(scr_ofsy, "0");
|
||||
Cvar_Set(scr_ofsz, "0");
|
||||
}
|
||||
|
||||
if (cl.intermission)
|
||||
|
@ -1028,7 +1028,7 @@ void V_RenderView (void)
|
|||
|
||||
R_PushDlights ();
|
||||
|
||||
if (lcd_x.value)
|
||||
if (lcd_x->value)
|
||||
{
|
||||
//
|
||||
// render two interleaved views
|
||||
|
@ -1038,18 +1038,18 @@ void V_RenderView (void)
|
|||
vid.rowbytes <<= 1;
|
||||
vid.aspect *= 0.5;
|
||||
|
||||
r_refdef.viewangles[YAW] -= lcd_yaw.value;
|
||||
r_refdef.viewangles[YAW] -= lcd_yaw->value;
|
||||
for (i=0 ; i<3 ; i++)
|
||||
r_refdef.vieworg[i] -= right[i]*lcd_x.value;
|
||||
r_refdef.vieworg[i] -= right[i]*lcd_x->value;
|
||||
R_RenderView ();
|
||||
|
||||
vid.buffer += vid.rowbytes>>1;
|
||||
|
||||
R_PushDlights ();
|
||||
|
||||
r_refdef.viewangles[YAW] += lcd_yaw.value*2;
|
||||
r_refdef.viewangles[YAW] += lcd_yaw->value*2;
|
||||
for (i=0 ; i<3 ; i++)
|
||||
r_refdef.vieworg[i] += 2*right[i]*lcd_x.value;
|
||||
r_refdef.vieworg[i] += 2*right[i]*lcd_x->value;
|
||||
R_RenderView ();
|
||||
|
||||
vid.buffer -= vid.rowbytes>>1;
|
||||
|
@ -1065,9 +1065,9 @@ void V_RenderView (void)
|
|||
}
|
||||
|
||||
#ifndef GLQUAKE
|
||||
if (crosshair.value)
|
||||
Draw_Character (scr_vrect.x + scr_vrect.width/2 + cl_crossx.value,
|
||||
scr_vrect.y + scr_vrect.height/2 + cl_crossy.value, '+');
|
||||
if (crosshair->value)
|
||||
Draw_Character (scr_vrect.x + scr_vrect.width/2 + cl_crossx->value,
|
||||
scr_vrect.y + scr_vrect.height/2 + cl_crossy->value, '+');
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@ -1085,40 +1085,40 @@ void V_Init (void)
|
|||
Cmd_AddCommand ("bf", V_BonusFlash_f);
|
||||
Cmd_AddCommand ("centerview", V_StartPitchDrift);
|
||||
|
||||
Cvar_RegisterVariable (&lcd_x);
|
||||
Cvar_RegisterVariable (&lcd_yaw);
|
||||
lcd_x = Cvar_Get("lcd_x", "0", CVAR_NONE, "None");
|
||||
lcd_yaw = Cvar_Get("lcd_yaw", "0", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&v_centermove);
|
||||
Cvar_RegisterVariable (&v_centerspeed);
|
||||
v_centermove = Cvar_Get("v_centermove", "0.15", CVAR_NONE, "None");
|
||||
v_centerspeed = Cvar_Get("v_centerspeed", "500", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&v_iyaw_cycle);
|
||||
Cvar_RegisterVariable (&v_iroll_cycle);
|
||||
Cvar_RegisterVariable (&v_ipitch_cycle);
|
||||
Cvar_RegisterVariable (&v_iyaw_level);
|
||||
Cvar_RegisterVariable (&v_iroll_level);
|
||||
Cvar_RegisterVariable (&v_ipitch_level);
|
||||
v_iyaw_cycle = Cvar_Get("v_iyaw_cycle", "2", CVAR_NONE, "None");
|
||||
v_iroll_cycle = Cvar_Get("v_iroll_cycle", "0.5", CVAR_NONE, "None");
|
||||
v_ipitch_cycle = Cvar_Get("v_ipitch_cycle", "1", CVAR_NONE, "None");
|
||||
v_iyaw_level = Cvar_Get("v_iyaw_level", "0.3", CVAR_NONE, "None");
|
||||
v_iroll_level = Cvar_Get("v_iroll_level", "0.1", CVAR_NONE, "None");
|
||||
v_ipitch_level = Cvar_Get("v_ipitch_level", "0.3", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&v_idlescale);
|
||||
Cvar_RegisterVariable (&crosshair);
|
||||
Cvar_RegisterVariable (&cl_crossx);
|
||||
Cvar_RegisterVariable (&cl_crossy);
|
||||
Cvar_RegisterVariable (&gl_cshiftpercent);
|
||||
v_idlescale = Cvar_Get("v_idlescale", "0", CVAR_NONE, "None");
|
||||
crosshair = Cvar_Get("crosshair", "0", CVAR_ARCHIVE, "None");
|
||||
cl_crossx = Cvar_Get("cl_crossx", "0", CVAR_NONE, "None");
|
||||
cl_crossy = Cvar_Get("cl_crossy", "0", CVAR_NONE, "None");
|
||||
gl_cshiftpercent = Cvar_Get("gl_cshiftpercent", "100", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&scr_ofsx);
|
||||
Cvar_RegisterVariable (&scr_ofsy);
|
||||
Cvar_RegisterVariable (&scr_ofsz);
|
||||
Cvar_RegisterVariable (&cl_rollspeed);
|
||||
Cvar_RegisterVariable (&cl_rollangle);
|
||||
Cvar_RegisterVariable (&cl_bob);
|
||||
Cvar_RegisterVariable (&cl_bobcycle);
|
||||
Cvar_RegisterVariable (&cl_bobup);
|
||||
scr_ofsx = Cvar_Get("scr_ofsx", "0", CVAR_NONE, "None");
|
||||
scr_ofsy = Cvar_Get("scr_ofsy", "0", CVAR_NONE, "None");
|
||||
scr_ofsz = Cvar_Get("scr_ofsz", "0", CVAR_NONE, "None");
|
||||
cl_rollspeed = Cvar_Get("cl_rollspeed", "200", CVAR_NONE, "None");
|
||||
cl_rollangle = Cvar_Get("cl_rollangle", "2.0", CVAR_NONE, "None");
|
||||
cl_bob = Cvar_Get("cl_bob", "0.02", CVAR_NONE, "None");
|
||||
cl_bobcycle = Cvar_Get("cl_bobcycle", "0.6", CVAR_NONE, "None");
|
||||
cl_bobup = Cvar_Get("cl_bobup", "0.5", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&v_kicktime);
|
||||
Cvar_RegisterVariable (&v_kickroll);
|
||||
Cvar_RegisterVariable (&v_kickpitch);
|
||||
v_kicktime = Cvar_Get("v_kicktime", "0.5", CVAR_NONE, "None");
|
||||
v_kickroll = Cvar_Get("v_kickroll", "0.6", CVAR_NONE, "None");
|
||||
v_kickpitch = Cvar_Get("v_kickpitch", "0.6", CVAR_NONE, "None");
|
||||
|
||||
BuildGammaTable (1.0); // no gamma yet
|
||||
Cvar_RegisterVariable (&v_gamma);
|
||||
v_gamma = Cvar_Get("gamma", "1", CVAR_ARCHIVE, "None");
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue