mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-22 04:01:17 +00:00
Cvar merge... segfault problems... also unknown problems in vid_svga.c
This commit is contained in:
parent
5c58a21a1c
commit
1d26c02826
74 changed files with 4288 additions and 1509 deletions
|
@ -294,36 +294,80 @@ typedef struct
|
|||
//
|
||||
// cvars
|
||||
//
|
||||
extern cvar_t cl_warncmd;
|
||||
extern cvar_t cl_upspeed;
|
||||
extern cvar_t cl_forwardspeed;
|
||||
extern cvar_t cl_backspeed;
|
||||
extern cvar_t cl_sidespeed;
|
||||
/* extern cvar_t cl_warncmd;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_warncmd;
|
||||
/* extern cvar_t cl_upspeed;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_upspeed;
|
||||
/* extern cvar_t cl_forwardspeed;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_forwardspeed;
|
||||
/* extern cvar_t cl_backspeed;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_backspeed;
|
||||
/* extern cvar_t cl_sidespeed;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_sidespeed;
|
||||
|
||||
extern cvar_t cl_movespeedkey;
|
||||
/* extern cvar_t cl_movespeedkey;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_movespeedkey;
|
||||
|
||||
extern cvar_t cl_yawspeed;
|
||||
extern cvar_t cl_pitchspeed;
|
||||
/* extern cvar_t cl_yawspeed;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_yawspeed;
|
||||
/* extern cvar_t cl_pitchspeed;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_pitchspeed;
|
||||
|
||||
extern cvar_t cl_anglespeedkey;
|
||||
/* extern cvar_t cl_anglespeedkey;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_anglespeedkey;
|
||||
|
||||
extern cvar_t cl_shownet;
|
||||
extern cvar_t cl_sbar;
|
||||
extern cvar_t cl_hudswap;
|
||||
/* extern cvar_t cl_shownet;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_shownet;
|
||||
/* extern cvar_t cl_sbar;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_sbar;
|
||||
/* extern cvar_t cl_hudswap;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_hudswap;
|
||||
|
||||
extern cvar_t cl_pitchdriftspeed;
|
||||
extern cvar_t lookspring;
|
||||
extern cvar_t lookstrafe;
|
||||
extern cvar_t sensitivity;
|
||||
/* extern cvar_t cl_pitchdriftspeed;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_pitchdriftspeed;
|
||||
/* extern cvar_t lookspring;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *lookspring;
|
||||
/* extern cvar_t lookstrafe;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *lookstrafe;
|
||||
/* extern cvar_t sensitivity;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *m_pitch;
|
||||
/* extern cvar_t m_yaw;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *m_yaw;
|
||||
/* extern cvar_t m_forward;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *m_forward;
|
||||
/* extern cvar_t m_side;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *m_side;
|
||||
|
||||
extern cvar_t _windowed_mouse;
|
||||
/* extern cvar_t _windowed_mouse;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *_windowed_mouse;
|
||||
|
||||
extern cvar_t name;
|
||||
/* extern cvar_t name;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *name;
|
||||
|
||||
|
||||
#define MAX_STATIC_ENTITIES 128 // torches, etc
|
||||
|
|
|
@ -210,7 +210,7 @@ void COM_LoadCacheFile (char *path, struct cache_user_s *cu);
|
|||
void COM_CreatePath (char *path);
|
||||
void COM_Gamedir (char *dir);
|
||||
|
||||
extern struct cvar_s registered;
|
||||
extern struct cvar_s *registered;
|
||||
extern qboolean standard_quake, rogue, hipnotic;
|
||||
|
||||
char *Info_ValueForKey (char *s, char *key);
|
||||
|
|
127
include/cvar.h
127
include/cvar.h
|
@ -1,78 +1,89 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
cvar.h
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
(description)
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
Copyright (C) 1999,2000 contributors of the QuakeForge project
|
||||
Please see the file "AUTHORS" for a list of contributors
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA
|
||||
|
||||
$Id$
|
||||
*/
|
||||
// cvar.h
|
||||
|
||||
/*
|
||||
#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.
|
||||
*/
|
||||
|
||||
typedef struct cvar_s
|
||||
{
|
||||
char *name;
|
||||
char *string;
|
||||
qboolean archive; // set to true to cause it to be saved to vars.rc
|
||||
qboolean info; // added to serverinfo or userinfo 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);
|
||||
#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 4906 // can be set even when cheats are
|
||||
// disabled, but is not archived
|
||||
|
||||
// Zoid| A good CVAR_ROM example is basepath. The code should read "cvar_t
|
||||
// *fs_basepath = CvarGet("fs_basepath", ".", CVAR_ROM); The user can
|
||||
// override that with +set fs_basepath <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.
|
||||
|
||||
cvar_t *Cvar_Get (char *name, char *value, int cvarflags, char *description);
|
||||
|
||||
void Cvar_Alias_Get (char *name, cvar_t *cvar);
|
||||
|
||||
void Cvar_Set (char *var, char *value);
|
||||
// equivelant to "<name> <variable>" typed at the console
|
||||
|
||||
void Cvar_SetValue (char *var_name, float value);
|
||||
// expands value to a string and calls Cvar_Set
|
||||
|
||||
float Cvar_VariableValue (char *var_name);
|
||||
// returns 0 if not defined or non numeric
|
||||
|
||||
|
@ -94,4 +105,8 @@ void Cvar_WriteVariables (FILE *f);
|
|||
|
||||
cvar_t *Cvar_FindVar (char *var_name);
|
||||
|
||||
void Cvar_Init();
|
||||
|
||||
void Cvar_Shutdown();
|
||||
extern cvar_t *cvar_vars;
|
||||
#endif // _CVAR_H
|
||||
|
|
|
@ -108,7 +108,9 @@ typedef struct
|
|||
int color;
|
||||
} zpointdesc_t;
|
||||
|
||||
extern cvar_t r_drawflat;
|
||||
/* extern cvar_t r_drawflat;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_drawflat;
|
||||
extern int d_spanpixcount;
|
||||
extern int r_framecount; // sequence # of current frame since Quake
|
||||
// started
|
||||
|
|
|
@ -54,7 +54,9 @@ typedef struct sspan_s
|
|||
int u, v, count;
|
||||
} sspan_t;
|
||||
|
||||
extern cvar_t d_subdiv16;
|
||||
/* extern cvar_t d_subdiv16;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *d_subdiv16;
|
||||
|
||||
extern float scale_for_mip;
|
||||
|
||||
|
|
|
@ -163,40 +163,96 @@ 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_netgraph;
|
||||
/* extern cvar_t r_norefresh;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_norefresh;
|
||||
/* extern cvar_t r_drawentities;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_drawentities;
|
||||
/* extern cvar_t r_drawworld;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_drawworld;
|
||||
/* extern cvar_t r_drawviewmodel;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_drawviewmodel;
|
||||
/* extern cvar_t r_speeds;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_speeds;
|
||||
/* extern cvar_t r_waterwarp;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_waterwarp;
|
||||
/* extern cvar_t r_fullbright;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_fullbright;
|
||||
/* extern cvar_t r_lightmap;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_lightmap;
|
||||
/* extern cvar_t r_shadows;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_shadows;
|
||||
/* extern cvar_t r_mirroralpha;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_mirroralpha;
|
||||
/* extern cvar_t r_wateralpha;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_wateralpha;
|
||||
/* extern cvar_t r_dynamic;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_dynamic;
|
||||
/* extern cvar_t r_novis;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_novis;
|
||||
/* extern cvar_t r_netgraph;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_netgraph;
|
||||
|
||||
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_finish;
|
||||
/* extern cvar_t gl_clear;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_clear;
|
||||
/* extern cvar_t gl_cull;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_cull;
|
||||
/* extern cvar_t gl_poly;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_poly;
|
||||
/* extern cvar_t gl_texsort;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_texsort;
|
||||
/* extern cvar_t gl_smoothmodels;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_smoothmodels;
|
||||
/* extern cvar_t gl_affinemodels;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_affinemodels;
|
||||
/* extern cvar_t gl_polyblend;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_polyblend;
|
||||
/* extern cvar_t gl_keeptjunctions;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_keeptjunctions;
|
||||
/* extern cvar_t gl_reporttjunctions;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_reporttjunctions;
|
||||
/* extern cvar_t gl_flashblend;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_flashblend;
|
||||
/* extern cvar_t gl_nocolors;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_nocolors;
|
||||
/* extern cvar_t gl_finish;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_finish;
|
||||
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_max_size;
|
||||
/* extern cvar_t gl_playermip;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_playermip;
|
||||
|
||||
extern int mirrortexturenum; // quake texturenum, not gltexturenum
|
||||
extern qboolean mirror;
|
||||
|
|
|
@ -161,26 +161,64 @@ 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;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_drawentities;
|
||||
/* extern cvar_t r_drawworld;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_drawworld;
|
||||
/* extern cvar_t r_drawviewmodel;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_drawviewmodel;
|
||||
/* extern cvar_t r_speeds;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_speeds;
|
||||
/* extern cvar_t r_waterwarp;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_waterwarp;
|
||||
/* extern cvar_t r_fullbright;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_fullbright;
|
||||
/* extern cvar_t r_lightmap;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_lightmap;
|
||||
/* extern cvar_t r_shadows;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_shadows;
|
||||
/* extern cvar_t r_dynamic;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_clear;
|
||||
/* extern cvar_t gl_cull;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_cull;
|
||||
/* extern cvar_t gl_poly;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_poly;
|
||||
/* extern cvar_t gl_texsort;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_texsort;
|
||||
/* extern cvar_t gl_smoothmodels;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_smoothmodels;
|
||||
/* extern cvar_t gl_affinemodels;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_affinemodels;
|
||||
/* extern cvar_t gl_fogblend;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_fogblend;
|
||||
/* extern cvar_t gl_polyblend;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_polyblend;
|
||||
/* extern cvar_t gl_keeptjunctions;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_keeptjunctions;
|
||||
/* extern cvar_t gl_reporttjunctions;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_reporttjunctions;
|
||||
|
||||
extern int gl_lightmap_format;
|
||||
extern int gl_solid_format;
|
||||
|
|
|
@ -32,7 +32,9 @@ extern netadr_t net_local_adr;
|
|||
extern netadr_t net_from; // address of who sent the packet
|
||||
extern sizebuf_t net_message;
|
||||
|
||||
extern cvar_t hostname;
|
||||
/* extern cvar_t hostname;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *hostname;
|
||||
|
||||
extern int net_socket;
|
||||
|
||||
|
|
|
@ -110,11 +110,19 @@ 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;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sys_ticrate;
|
||||
/* extern cvar_t sys_nostdout;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sys_nostdout;
|
||||
/* extern cvar_t developer;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *developer;
|
||||
|
||||
extern cvar_t password;
|
||||
/* extern cvar_t password;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *password;
|
||||
|
||||
extern qboolean host_initialized; // true if into command execution
|
||||
extern double host_frametime;
|
||||
|
|
|
@ -91,8 +91,12 @@ typedef struct
|
|||
//
|
||||
extern quakeparms_t host_parms;
|
||||
|
||||
extern cvar_t sys_nostdout;
|
||||
extern cvar_t developer;
|
||||
/* extern cvar_t sys_nostdout;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sys_nostdout;
|
||||
/* extern cvar_t developer;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *developer;
|
||||
|
||||
extern qboolean host_initialized; // true if into command execution
|
||||
extern double host_frametime;
|
||||
|
|
|
@ -53,24 +53,60 @@ 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;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_draworder;
|
||||
/* extern cvar_t r_speeds;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_speeds;
|
||||
/* extern cvar_t r_timegraph;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_timegraph;
|
||||
/* extern cvar_t r_graphheight;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_graphheight;
|
||||
/* extern cvar_t r_clearcolor;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_clearcolor;
|
||||
/* extern cvar_t r_waterwarp;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_waterwarp;
|
||||
/* extern cvar_t r_fullbright;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_fullbright;
|
||||
/* extern cvar_t r_drawentities;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_drawentities;
|
||||
/* extern cvar_t r_aliasstats;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_aliasstats;
|
||||
/* extern cvar_t r_dspeeds;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_dspeeds;
|
||||
/* extern cvar_t r_drawflat;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_drawflat;
|
||||
/* extern cvar_t r_ambient;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_ambient;
|
||||
/* extern cvar_t r_reportsurfout;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_reportsurfout;
|
||||
/* extern cvar_t r_maxsurfs;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_maxsurfs;
|
||||
/* extern cvar_t r_numsurfs;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_numsurfs;
|
||||
/* extern cvar_t r_reportedgeout;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_reportedgeout;
|
||||
/* extern cvar_t r_maxedges;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_maxedges;
|
||||
/* extern cvar_t r_numedges;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_numedges;
|
||||
|
||||
#define XCENTERING (1.0 / 2.0)
|
||||
#define YCENTERING (1.0 / 2.0)
|
||||
|
|
|
@ -49,7 +49,9 @@ extern float pixelAspect;
|
|||
|
||||
extern int r_drawnpolycount;
|
||||
|
||||
extern cvar_t r_clearcolor;
|
||||
/* extern cvar_t r_clearcolor;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *r_clearcolor;
|
||||
|
||||
extern int sintable[1280];
|
||||
extern int intsintable[1280];
|
||||
|
|
|
@ -40,9 +40,13 @@ extern int sb_lines;
|
|||
extern int clearnotify; // set to 0 whenever notify text is drawn
|
||||
extern qboolean scr_disabled_for_loading;
|
||||
|
||||
extern cvar_t scr_viewsize;
|
||||
/* extern cvar_t scr_viewsize;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *scr_viewsize;
|
||||
|
||||
extern cvar_t scr_viewsize;
|
||||
/* extern cvar_t scr_viewsize;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *scr_viewsize;
|
||||
|
||||
// only the refresh window will be updated unless these variables are flagged
|
||||
extern int scr_copytop;
|
||||
|
|
|
@ -195,7 +195,9 @@ typedef struct client_s
|
|||
|
||||
// a client can leave the server in one of four ways:
|
||||
// dropping properly by quiting or disconnecting
|
||||
// timing out if no valid messages are received for timeout.value seconds
|
||||
/* // timing out if no valid messages are received for timeout.value seconds
|
||||
CVAR_FIXME */
|
||||
// timing out if no valid messages are received for timeout->value seconds
|
||||
// getting kicked off by the server operator
|
||||
// a program error, like an overflowed reliable buffer
|
||||
|
||||
|
@ -319,16 +321,30 @@ extern client_state_t cls;
|
|||
|
||||
//============================================================================
|
||||
|
||||
extern cvar_t sv_mintic, sv_maxtic;
|
||||
extern cvar_t sv_maxspeed;
|
||||
/* extern cvar_t sv_mintic, sv_maxtic;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_mintic, *sv_maxtic;
|
||||
/* extern cvar_t sv_maxspeed;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_maxspeed;
|
||||
|
||||
extern netadr_t master_adr[MAX_MASTERS]; // address of the master server
|
||||
|
||||
extern cvar_t spawn;
|
||||
extern cvar_t teamplay;
|
||||
extern cvar_t deathmatch;
|
||||
extern cvar_t fraglimit;
|
||||
extern cvar_t timelimit;
|
||||
/* extern cvar_t spawn;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *spawn;
|
||||
/* extern cvar_t teamplay;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *teamplay;
|
||||
/* extern cvar_t deathmatch;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *deathmatch;
|
||||
/* extern cvar_t fraglimit;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *fraglimit;
|
||||
/* extern cvar_t timelimit;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *timelimit;
|
||||
|
||||
extern server_static_t svs; // persistant server info
|
||||
extern server_t sv; // local server
|
||||
|
|
|
@ -152,9 +152,15 @@ 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;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *loadas8bit;
|
||||
/* extern cvar_t bgmvolume;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *bgmvolume;
|
||||
/* extern cvar_t volume;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *volume;
|
||||
|
||||
extern qboolean snd_initialized;
|
||||
|
||||
|
|
|
@ -19,8 +19,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
// view.h
|
||||
|
||||
extern cvar_t v_gamma;
|
||||
extern cvar_t lcd_x;
|
||||
/* extern cvar_t v_gamma;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *v_gamma;
|
||||
/* extern cvar_t lcd_x;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *lcd_x;
|
||||
|
||||
void V_Init (void);
|
||||
void V_RenderView (void);
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
#include "quakedef.h"
|
||||
#include "dosisms.h"
|
||||
|
||||
extern cvar_t bgmvolume;
|
||||
/* extern cvar_t bgmvolume;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *bgmvolume;
|
||||
|
||||
#define ADDRESS_MODE_HSG 0
|
||||
#define ADDRESS_MODE_RED_BOOK 1
|
||||
|
@ -754,7 +756,9 @@ void CDAudio_Update(void)
|
|||
}
|
||||
}
|
||||
|
||||
newVolume = (int)(bgmvolume.value * 255.0);
|
||||
/* newVolume = (int)(bgmvolume.value * 255.0);
|
||||
CVAR_FIXME */
|
||||
newVolume = (int)(bgmvolume->value * 255.0);
|
||||
if (newVolume < 0)
|
||||
{
|
||||
Cvar_SetValue ("bgmvolume", 0.0);
|
||||
|
|
|
@ -339,18 +339,24 @@ void CDAudio_Update(void)
|
|||
if (!enabled)
|
||||
return;
|
||||
|
||||
if (bgmvolume.value != cdvolume)
|
||||
/* if (bgmvolume.value != cdvolume)
|
||||
CVAR_FIXME */
|
||||
if (bgmvolume->value != cdvolume)
|
||||
{
|
||||
if (cdvolume)
|
||||
{
|
||||
Cvar_SetValue ("bgmvolume", 0.0);
|
||||
cdvolume = bgmvolume.value;
|
||||
bgmvolume->value = 0.0;
|
||||
/* cdvolume = bgmvolume.value;
|
||||
CVAR_FIXME */
|
||||
cdvolume = bgmvolume->value;
|
||||
CDAudio_Pause ();
|
||||
}
|
||||
else
|
||||
{
|
||||
Cvar_SetValue ("bgmvolume", 1.0);
|
||||
cdvolume = bgmvolume.value;
|
||||
bgmvolume->value = 1.0;
|
||||
/* cdvolume = bgmvolume.value;
|
||||
CVAR_FIXME */
|
||||
cdvolume = bgmvolume->value;
|
||||
CDAudio_Resume ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
#include "quakedef.h"
|
||||
|
||||
extern HWND mainwindow;
|
||||
extern cvar_t bgmvolume;
|
||||
/* extern cvar_t bgmvolume;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *bgmvolume;
|
||||
|
||||
static qboolean cdValid = false;
|
||||
static qboolean playing = false;
|
||||
|
@ -406,18 +408,24 @@ void CDAudio_Update(void)
|
|||
if (!enabled)
|
||||
return;
|
||||
|
||||
if (bgmvolume.value != cdvolume)
|
||||
/* if (bgmvolume.value != cdvolume)
|
||||
CVAR_FIXME */
|
||||
if (bgmvolume->value != cdvolume)
|
||||
{
|
||||
if (cdvolume)
|
||||
{
|
||||
Cvar_SetValue ("bgmvolume", 0.0);
|
||||
cdvolume = bgmvolume.value;
|
||||
/* cdvolume = bgmvolume.value;
|
||||
CVAR_FIXME */
|
||||
cdvolume = bgmvolume->value;
|
||||
CDAudio_Pause ();
|
||||
}
|
||||
else
|
||||
{
|
||||
Cvar_SetValue ("bgmvolume", 1.0);
|
||||
cdvolume = bgmvolume.value;
|
||||
/* cdvolume = bgmvolume.value;
|
||||
CVAR_FIXME */
|
||||
cdvolume = bgmvolume->value;
|
||||
CDAudio_Resume ();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,12 +49,20 @@ static qboolean locked = false;
|
|||
static int oldbuttons;
|
||||
|
||||
// track high fragger
|
||||
cvar_t cl_hightrack = {"cl_hightrack", "0" };
|
||||
/* cvar_t cl_hightrack = {"cl_hightrack", "0" };
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_hightrack;
|
||||
|
||||
cvar_t cl_chasecam = {"cl_chasecam", "0"};
|
||||
/* cvar_t cl_chasecam = {"cl_chasecam", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_chasecam;
|
||||
|
||||
//cvar_t cl_camera_maxpitch = {"cl_camera_maxpitch", "10" };
|
||||
//cvar_t cl_camera_maxyaw = {"cl_camera_maxyaw", "30" };
|
||||
/* //cvar_t cl_camera_maxpitch = {"cl_camera_maxpitch", "10" };
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_camera_maxpitch;
|
||||
/* //cvar_t cl_camera_maxyaw = {"cl_camera_maxyaw", "30" };
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_camera_maxyaw;
|
||||
|
||||
qboolean cam_forceview;
|
||||
vec3_t cam_viewangles;
|
||||
|
@ -104,7 +112,9 @@ qboolean Cam_DrawViewModel(void)
|
|||
if (!cl.spectator)
|
||||
return true;
|
||||
|
||||
if (autocam && locked && cl_chasecam.value)
|
||||
/* if (autocam && locked && cl_chasecam.value)
|
||||
CVAR_FIXME */
|
||||
if (autocam && locked && cl_chasecam->value)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -112,7 +122,9 @@ qboolean Cam_DrawViewModel(void)
|
|||
// returns true if we should draw this player, we don't if we are chase camming
|
||||
qboolean Cam_DrawPlayer(int playernum)
|
||||
{
|
||||
if (cl.spectator && autocam && locked && cl_chasecam.value &&
|
||||
/* if (cl.spectator && autocam && locked && cl_chasecam.value &&
|
||||
CVAR_FIXME */
|
||||
if (cl.spectator && autocam && locked && cl_chasecam->value &&
|
||||
spec_track == playernum)
|
||||
return false;
|
||||
return true;
|
||||
|
@ -331,7 +343,9 @@ void Cam_Track(usercmd_t *cmd)
|
|||
if (!cl.spectator)
|
||||
return;
|
||||
|
||||
if (cl_hightrack.value && !locked)
|
||||
/* if (cl_hightrack.value && !locked)
|
||||
CVAR_FIXME */
|
||||
if (cl_hightrack->value && !locked)
|
||||
Cam_CheckHighTarget();
|
||||
|
||||
if (!autocam || cls.state != ca_active)
|
||||
|
@ -339,7 +353,9 @@ void Cam_Track(usercmd_t *cmd)
|
|||
|
||||
if (locked && (!cl.players[spec_track].name[0] || cl.players[spec_track].spectator)) {
|
||||
locked = false;
|
||||
if (cl_hightrack.value)
|
||||
/* if (cl_hightrack.value)
|
||||
CVAR_FIXME */
|
||||
if (cl_hightrack->value)
|
||||
Cam_CheckHighTarget();
|
||||
else
|
||||
Cam_Unlock();
|
||||
|
@ -363,7 +379,9 @@ void Cam_Track(usercmd_t *cmd)
|
|||
if (!locked || !autocam)
|
||||
return;
|
||||
|
||||
if (cl_chasecam.value) {
|
||||
/* if (cl_chasecam.value) {
|
||||
CVAR_FIXME */
|
||||
if (cl_chasecam->value) {
|
||||
cmd->forwardmove = cmd->sidemove = cmd->upmove = 0;
|
||||
|
||||
VectorCopy(player->viewangles, cl.viewangles);
|
||||
|
@ -463,8 +481,12 @@ void Cam_SetView(void)
|
|||
vectoangles(vec, vec2);
|
||||
vec2[PITCH] = -vec2[PITCH];
|
||||
|
||||
cam_viewangles[PITCH] = adjustang(cam_viewangles[PITCH], vec2[PITCH], cl_camera_maxpitch.value);
|
||||
cam_viewangles[YAW] = adjustang(cam_viewangles[YAW], vec2[YAW], cl_camera_maxyaw.value);
|
||||
/* cam_viewangles[PITCH] = adjustang(cam_viewangles[PITCH], vec2[PITCH], cl_camera_maxpitch.value);
|
||||
CVAR_FIXME */
|
||||
cam_viewangles[PITCH] = adjustang(cam_viewangles[PITCH], vec2[PITCH], cl_camera_maxpitch->value);
|
||||
/* cam_viewangles[YAW] = adjustang(cam_viewangles[YAW], vec2[YAW], cl_camera_maxyaw.value);
|
||||
CVAR_FIXME */
|
||||
cam_viewangles[YAW] = adjustang(cam_viewangles[YAW], vec2[YAW], cl_camera_maxyaw->value);
|
||||
}
|
||||
VectorCopy(cam_viewangles, cl.viewangles);
|
||||
VectorCopy(cl.viewangles, cl.simangles);
|
||||
|
@ -498,8 +520,12 @@ void Cam_FinishMove(usercmd_t *cmd)
|
|||
vectoangles(vec, vec2);
|
||||
vec2[PITCH] = -vec2[PITCH];
|
||||
|
||||
cam_viewangles[PITCH] = adjustang(cam_viewangles[PITCH], vec2[PITCH], cl_camera_maxpitch.value);
|
||||
cam_viewangles[YAW] = adjustang(cam_viewangles[YAW], vec2[YAW], cl_camera_maxyaw.value);
|
||||
/* cam_viewangles[PITCH] = adjustang(cam_viewangles[PITCH], vec2[PITCH], cl_camera_maxpitch.value);
|
||||
CVAR_FIXME */
|
||||
cam_viewangles[PITCH] = adjustang(cam_viewangles[PITCH], vec2[PITCH], cl_camera_maxpitch->value);
|
||||
/* cam_viewangles[YAW] = adjustang(cam_viewangles[YAW], vec2[YAW], cl_camera_maxyaw.value);
|
||||
CVAR_FIXME */
|
||||
cam_viewangles[YAW] = adjustang(cam_viewangles[YAW], vec2[YAW], cl_camera_maxyaw->value);
|
||||
}
|
||||
VectorCopy(cam_viewangles, cl.viewangles);
|
||||
}
|
||||
|
@ -524,7 +550,9 @@ void Cam_FinishMove(usercmd_t *cmd)
|
|||
return;
|
||||
}
|
||||
|
||||
if (autocam && cl_hightrack.value) {
|
||||
/* if (autocam && cl_hightrack.value) {
|
||||
CVAR_FIXME */
|
||||
if (autocam && cl_hightrack->value) {
|
||||
Cam_CheckHighTarget();
|
||||
return;
|
||||
}
|
||||
|
@ -574,10 +602,18 @@ void Cam_Reset(void)
|
|||
|
||||
void CL_InitCam(void)
|
||||
{
|
||||
Cvar_RegisterVariable (&cl_hightrack);
|
||||
Cvar_RegisterVariable (&cl_chasecam);
|
||||
// Cvar_RegisterVariable (&cl_camera_maxpitch);
|
||||
// Cvar_RegisterVariable (&cl_camera_maxyaw);
|
||||
/* Cvar_RegisterVariable (&cl_hightrack);
|
||||
CVAR_FIXME */
|
||||
cl_hightrack = Cvar_Get("cl_hightrack", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_chasecam);
|
||||
CVAR_FIXME */
|
||||
cl_chasecam = Cvar_Get("cl_chasecam", "0", CVAR_NONE, "None");
|
||||
/* // Cvar_RegisterVariable (&cl_camera_maxpitch);
|
||||
CVAR_FIXME */
|
||||
cl_camera_maxpitch = Cvar_Get("cl_camera_maxpitch", "10", CVAR_NONE, "None");
|
||||
/* // Cvar_RegisterVariable (&cl_camera_maxyaw);
|
||||
CVAR_FIXME */
|
||||
cl_camera_maxyaw = Cvar_Get("cl_camera_maxyaw", "30", CVAR_NONE, "None");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -31,13 +31,13 @@
|
|||
void
|
||||
Cvar_Info(cvar_t *var)
|
||||
{
|
||||
if (var->info)
|
||||
{
|
||||
Info_SetValueForKey (cls.userinfo, var->name, var->string, MAX_INFO_STRING);
|
||||
if (cls.state >= ca_connected)
|
||||
{
|
||||
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
|
||||
SZ_Print (&cls.netchan.message, va("setinfo \"%s\" \"%s\"\n", var->name, var->string));
|
||||
}
|
||||
}
|
||||
if (var->flags & CVAR_USERINFO)
|
||||
{
|
||||
Info_SetValueForKey (cls.userinfo, var->name, var->string, MAX_INFO_STRING);
|
||||
if (cls.state >= ca_connected)
|
||||
{
|
||||
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
|
||||
SZ_Print (&cls.netchan.message, va("setinfo \"%s\" \"%s\"\n", var->name, var->string));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,11 +30,19 @@
|
|||
#include "sys.h"
|
||||
#include "quakedef.h"
|
||||
|
||||
extern cvar_t cl_predict_players;
|
||||
extern cvar_t cl_predict_players2;
|
||||
extern cvar_t cl_solid_players;
|
||||
/* extern cvar_t cl_predict_players;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_predict_players;
|
||||
/* extern cvar_t cl_predict_players2;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_predict_players2;
|
||||
/* extern cvar_t cl_solid_players;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_solid_players;
|
||||
|
||||
extern cvar_t gl_flashblend;
|
||||
/* extern cvar_t gl_flashblend;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_flashblend;
|
||||
|
||||
static struct predicted_player {
|
||||
int flags;
|
||||
|
@ -825,7 +833,9 @@ void CL_LinkPlayers (void)
|
|||
|
||||
// FIXME: Use a findvar or something for gl_flashblend --KB
|
||||
// spawn light flashes, even ones coming from invisible objects
|
||||
if (!gl_flashblend.value || j != cl.playernum) {
|
||||
/* if (!gl_flashblend.value || j != cl.playernum) {
|
||||
CVAR_FIXME */
|
||||
if (!gl_flashblend->value || j != cl.playernum) {
|
||||
if ((state->effects & (EF_BLUE | EF_RED)) == (EF_BLUE | EF_RED))
|
||||
CL_NewDlight (j, state->origin[0], state->origin[1], state->origin[2], 200 + (rand()&31), 0.1, 3);
|
||||
else if (state->effects & EF_BLUE)
|
||||
|
@ -874,7 +884,9 @@ void CL_LinkPlayers (void)
|
|||
|
||||
// only predict half the move to minimize overruns
|
||||
msec = 500*(playertime - state->state_time);
|
||||
if (msec <= 0 || (!cl_predict_players.value && !cl_predict_players2.value))
|
||||
/* if (msec <= 0 || (!cl_predict_players.value && !cl_predict_players2.value))
|
||||
CVAR_FIXME */
|
||||
if (msec <= 0 || (!cl_predict_players->value && !cl_predict_players2->value))
|
||||
{
|
||||
VectorCopy (state->origin, ent->origin);
|
||||
//Con_DPrintf ("nopredict\n");
|
||||
|
@ -995,7 +1007,9 @@ void CL_SetUpPlayerPrediction(qboolean dopred)
|
|||
// only predict half the move to minimize overruns
|
||||
msec = 500*(playertime - state->state_time);
|
||||
if (msec <= 0 ||
|
||||
(!cl_predict_players.value && !cl_predict_players2.value) ||
|
||||
/* (!cl_predict_players.value && !cl_predict_players2.value) ||
|
||||
CVAR_FIXME */
|
||||
(!cl_predict_players->value && !cl_predict_players2->value) ||
|
||||
!dopred)
|
||||
{
|
||||
VectorCopy (state->origin, pplayer->origin);
|
||||
|
@ -1034,7 +1048,9 @@ void CL_SetSolidPlayers (int playernum)
|
|||
struct predicted_player *pplayer;
|
||||
physent_t *pent;
|
||||
|
||||
if (!cl_solid_players.value)
|
||||
/* if (!cl_solid_players.value)
|
||||
CVAR_FIXME */
|
||||
if (!cl_solid_players->value)
|
||||
return;
|
||||
|
||||
pent = pmove.physents + pmove.numphysent;
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
#include "quakedef.h"
|
||||
#include "in_win.h"
|
||||
|
||||
cvar_t cl_nodelta = {"cl_nodelta","0"};
|
||||
/* cvar_t cl_nodelta = {"cl_nodelta","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_nodelta;
|
||||
|
||||
/*
|
||||
===============================================================================
|
||||
|
@ -127,7 +129,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if ( !(in_mlook.state&1) && lookspring->value)
|
||||
V_StartPitchDrift();
|
||||
}
|
||||
void IN_UpDown(void) {KeyDown(&in_up);}
|
||||
|
@ -221,17 +225,33 @@ 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 = {"cl_upspeed","200"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_upspeed;
|
||||
/* cvar_t cl_forwardspeed = {"cl_forwardspeed","200", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_forwardspeed;
|
||||
/* cvar_t cl_backspeed = {"cl_backspeed","200", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_backspeed;
|
||||
/* cvar_t cl_sidespeed = {"cl_sidespeed","350"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_sidespeed;
|
||||
|
||||
cvar_t cl_movespeedkey = {"cl_movespeedkey","2.0"};
|
||||
/* cvar_t cl_movespeedkey = {"cl_movespeedkey","2.0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_movespeedkey;
|
||||
|
||||
cvar_t cl_yawspeed = {"cl_yawspeed","140"};
|
||||
cvar_t cl_pitchspeed = {"cl_pitchspeed","150"};
|
||||
/* cvar_t cl_yawspeed = {"cl_yawspeed","140"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_yawspeed;
|
||||
/* cvar_t cl_pitchspeed = {"cl_pitchspeed","150"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_pitchspeed;
|
||||
|
||||
cvar_t cl_anglespeedkey = {"cl_anglespeedkey","1.5"};
|
||||
/* cvar_t cl_anglespeedkey = {"cl_anglespeedkey","1.5"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_anglespeedkey;
|
||||
|
||||
|
||||
/*
|
||||
|
@ -247,28 +267,42 @@ void CL_AdjustAngles (void)
|
|||
float up, down;
|
||||
|
||||
if (in_speed.state & 1)
|
||||
speed = host_frametime * cl_anglespeedkey.value;
|
||||
/* speed = host_frametime * cl_anglespeedkey.value;
|
||||
CVAR_FIXME */
|
||||
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);
|
||||
CVAR_FIXME */
|
||||
cl.viewangles[YAW] -= speed*cl_yawspeed->value*CL_KeyState (&in_right);
|
||||
/* cl.viewangles[YAW] += speed*cl_yawspeed.value*CL_KeyState (&in_left);
|
||||
CVAR_FIXME */
|
||||
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);
|
||||
CVAR_FIXME */
|
||||
cl.viewangles[PITCH] -= speed*cl_pitchspeed->value * CL_KeyState (&in_forward);
|
||||
/* cl.viewangles[PITCH] += speed*cl_pitchspeed.value * CL_KeyState (&in_back);
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
cl.viewangles[PITCH] -= speed*cl_pitchspeed->value * up;
|
||||
/* cl.viewangles[PITCH] += speed*cl_pitchspeed.value * down;
|
||||
CVAR_FIXME */
|
||||
cl.viewangles[PITCH] += speed*cl_pitchspeed->value * down;
|
||||
|
||||
if (up || down)
|
||||
V_StopPitchDrift ();
|
||||
|
@ -301,20 +335,36 @@ void CL_BaseMove (usercmd_t *cmd)
|
|||
VectorCopy (cl.viewangles, cmd->angles);
|
||||
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);
|
||||
CVAR_FIXME */
|
||||
cmd->sidemove += cl_sidespeed->value * CL_KeyState (&in_right);
|
||||
/* cmd->sidemove -= cl_sidespeed.value * CL_KeyState (&in_left);
|
||||
CVAR_FIXME */
|
||||
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);
|
||||
CVAR_FIXME */
|
||||
cmd->sidemove += cl_sidespeed->value * CL_KeyState (&in_moveright);
|
||||
/* cmd->sidemove -= cl_sidespeed.value * CL_KeyState (&in_moveleft);
|
||||
CVAR_FIXME */
|
||||
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);
|
||||
CVAR_FIXME */
|
||||
cmd->upmove += cl_upspeed->value * CL_KeyState (&in_up);
|
||||
/* cmd->upmove -= cl_upspeed.value * CL_KeyState (&in_down);
|
||||
CVAR_FIXME */
|
||||
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);
|
||||
CVAR_FIXME */
|
||||
cmd->forwardmove += cl_forwardspeed->value * CL_KeyState (&in_forward);
|
||||
/* cmd->forwardmove -= cl_backspeed.value * CL_KeyState (&in_back);
|
||||
CVAR_FIXME */
|
||||
cmd->forwardmove -= cl_backspeed->value * CL_KeyState (&in_back);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -322,9 +372,15 @@ 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;
|
||||
CVAR_FIXME */
|
||||
cmd->forwardmove *= cl_movespeedkey->value;
|
||||
/* cmd->sidemove *= cl_movespeedkey.value;
|
||||
CVAR_FIXME */
|
||||
cmd->sidemove *= cl_movespeedkey->value;
|
||||
/* cmd->upmove *= cl_movespeedkey.value;
|
||||
CVAR_FIXME */
|
||||
cmd->upmove *= cl_movespeedkey->value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -468,7 +524,9 @@ void CL_SendCmd (void)
|
|||
if (cls.netchan.outgoing_sequence - cl.validsequence >= UPDATE_BACKUP-1)
|
||||
cl.validsequence = 0;
|
||||
|
||||
if (cl.validsequence && !cl_nodelta.value && cls.state == ca_active &&
|
||||
/* if (cl.validsequence && !cl_nodelta.value && cls.state == ca_active &&
|
||||
CVAR_FIXME */
|
||||
if (cl.validsequence && !cl_nodelta->value && cls.state == ca_active &&
|
||||
!cls.demorecording)
|
||||
{
|
||||
cl.frames[cls.netchan.outgoing_sequence&UPDATE_MASK].delta_sequence = cl.validsequence;
|
||||
|
@ -532,7 +590,9 @@ void CL_InitInput (void)
|
|||
Cmd_AddCommand ("+mlook", IN_MLookDown);
|
||||
Cmd_AddCommand ("-mlook", IN_MLookUp);
|
||||
|
||||
Cvar_RegisterVariable (&cl_nodelta);
|
||||
/* Cvar_RegisterVariable (&cl_nodelta);
|
||||
CVAR_FIXME */
|
||||
cl_nodelta = Cvar_Get("cl_nodelta", "0", CVAR_NONE, "None");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
366
source/cl_main.c
366
source/cl_main.c
|
@ -46,51 +46,111 @@
|
|||
qboolean noclip_anglehack; // remnant from old quake
|
||||
|
||||
|
||||
cvar_t rcon_password = {"rcon_password", "", false};
|
||||
/* cvar_t rcon_password = {"rcon_password", "", false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *rcon_password;
|
||||
|
||||
cvar_t rcon_address = {"rcon_address", ""};
|
||||
/* cvar_t rcon_address = {"rcon_address", ""};
|
||||
CVAR_FIXME */
|
||||
cvar_t *rcon_address;
|
||||
|
||||
cvar_t cl_timeout = {"cl_timeout", "60"};
|
||||
/* cvar_t cl_timeout = {"cl_timeout", "60"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_timeout;
|
||||
|
||||
cvar_t cl_shownet = {"cl_shownet","0"}; // can be 0, 1, or 2
|
||||
/* cvar_t cl_shownet = {"cl_shownet","0"}; // can be 0, 1, or 2
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_shownet; // can be 0, 1, or 2
|
||||
|
||||
cvar_t cl_sbar = {"cl_sbar", "0", true};
|
||||
cvar_t cl_hudswap = {"cl_hudswap", "0", true};
|
||||
cvar_t cl_maxfps = {"cl_maxfps", "0", true};
|
||||
/* cvar_t cl_sbar = {"cl_sbar", "0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_sbar;
|
||||
/* cvar_t cl_hudswap = {"cl_hudswap", "0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_hudswap;
|
||||
/* cvar_t cl_maxfps = {"cl_maxfps", "0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_maxfps;
|
||||
|
||||
cvar_t lookspring = {"lookspring","0", true};
|
||||
cvar_t lookstrafe = {"lookstrafe","0", true};
|
||||
cvar_t sensitivity = {"sensitivity","3", true};
|
||||
/* cvar_t lookspring = {"lookspring","0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *lookspring;
|
||||
/* cvar_t lookstrafe = {"lookstrafe","0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *lookstrafe;
|
||||
/* cvar_t sensitivity = {"sensitivity","3", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sensitivity;
|
||||
|
||||
cvar_t m_pitch = {"m_pitch","0.022", true};
|
||||
cvar_t m_yaw = {"m_yaw","0.022"};
|
||||
cvar_t m_forward = {"m_forward","1"};
|
||||
cvar_t m_side = {"m_side","0.8"};
|
||||
/* cvar_t m_pitch = {"m_pitch","0.022", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *m_pitch;
|
||||
/* cvar_t m_yaw = {"m_yaw","0.022"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *m_yaw;
|
||||
/* cvar_t m_forward = {"m_forward","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *m_forward;
|
||||
/* cvar_t m_side = {"m_side","0.8"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *m_side;
|
||||
|
||||
cvar_t entlatency = {"entlatency", "20"};
|
||||
cvar_t cl_predict_players = {"cl_predict_players", "1"};
|
||||
cvar_t cl_predict_players2 = {"cl_predict_players2", "1"};
|
||||
cvar_t cl_solid_players = {"cl_solid_players", "1"};
|
||||
/* cvar_t entlatency = {"entlatency", "20"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *entlatency;
|
||||
/* cvar_t cl_predict_players = {"cl_predict_players", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_predict_players;
|
||||
/* cvar_t cl_predict_players2 = {"cl_predict_players2", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_predict_players2;
|
||||
/* cvar_t cl_solid_players = {"cl_solid_players", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_solid_players;
|
||||
|
||||
cvar_t localid = {"localid", ""};
|
||||
/* cvar_t localid = {"localid", ""};
|
||||
CVAR_FIXME */
|
||||
cvar_t *localid;
|
||||
|
||||
static qboolean allowremotecmd = true;
|
||||
|
||||
//
|
||||
// info mirrors
|
||||
//
|
||||
cvar_t password = {"password", "", false, true};
|
||||
cvar_t spectator = {"spectator", "", false, true};
|
||||
cvar_t name = {"name","unnamed", true, true};
|
||||
cvar_t team = {"team","", true, true};
|
||||
cvar_t skin = {"skin","", true, true};
|
||||
cvar_t topcolor = {"topcolor","0", true, true};
|
||||
cvar_t bottomcolor = {"bottomcolor","0", true, true};
|
||||
cvar_t rate = {"rate","2500", true, true};
|
||||
cvar_t noaim = {"noaim","0", true, true};
|
||||
cvar_t msg = {"msg","1", true, true};
|
||||
/* cvar_t password = {"password", "", false, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *password;
|
||||
/* cvar_t spectator = {"spectator", "", false, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *spectator;
|
||||
/* cvar_t name = {"name","unnamed", true, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *name;
|
||||
/* cvar_t team = {"team","", true, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *team;
|
||||
/* cvar_t skin = {"skin","", true, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *skin;
|
||||
/* cvar_t topcolor = {"topcolor","0", true, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *topcolor;
|
||||
/* cvar_t bottomcolor = {"bottomcolor","0", true, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *bottomcolor;
|
||||
/* cvar_t rate = {"rate","2500", true, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *rate;
|
||||
/* cvar_t noaim = {"noaim","0", true, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *noaim;
|
||||
/* cvar_t msg = {"msg","1", true, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *msg;
|
||||
|
||||
extern cvar_t cl_hightrack;
|
||||
/* extern cvar_t cl_hightrack;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_hightrack;
|
||||
|
||||
client_static_t cls;
|
||||
client_state_t cl;
|
||||
|
@ -127,9 +187,15 @@ byte *host_colormap;
|
|||
|
||||
netadr_t master_adr; // address of the master server
|
||||
|
||||
cvar_t host_speeds = {"host_speeds","0"}; // set for running times
|
||||
cvar_t show_fps = {"show_fps","0"}; // set for running times
|
||||
cvar_t developer = {"developer","0"};
|
||||
/* cvar_t host_speeds = {"host_speeds","0"}; // set for running times
|
||||
CVAR_FIXME */
|
||||
cvar_t *host_speeds; // set for running times
|
||||
/* cvar_t show_fps = {"show_fps","0"}; // set for running times
|
||||
CVAR_FIXME */
|
||||
cvar_t *show_fps; // set for running times
|
||||
/* cvar_t developer = {"developer","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *developer;
|
||||
|
||||
int fps_count;
|
||||
|
||||
|
@ -327,7 +393,7 @@ void CL_Rcon_f (void)
|
|||
int i;
|
||||
netadr_t to;
|
||||
|
||||
if (!rcon_password.string)
|
||||
if (!rcon_password->string)
|
||||
{
|
||||
Con_Printf ("You must set 'rcon_password' before\n"
|
||||
"issuing an rcon command.\n");
|
||||
|
@ -342,7 +408,7 @@ void CL_Rcon_f (void)
|
|||
|
||||
strcat (message, "rcon ");
|
||||
|
||||
strcat (message, rcon_password.string);
|
||||
strcat (message, rcon_password->string);
|
||||
strcat (message, " ");
|
||||
|
||||
for (i=1 ; i<Cmd_Argc() ; i++)
|
||||
|
@ -355,7 +421,7 @@ void CL_Rcon_f (void)
|
|||
to = cls.netchan.remote_address;
|
||||
else
|
||||
{
|
||||
if (!strlen(rcon_address.string))
|
||||
if (!strlen(rcon_address->string))
|
||||
{
|
||||
Con_Printf ("You must either be connected,\n"
|
||||
"or set the 'rcon_address' cvar\n"
|
||||
|
@ -363,7 +429,7 @@ void CL_Rcon_f (void)
|
|||
|
||||
return;
|
||||
}
|
||||
NET_StringToAdr (rcon_address.string, &to);
|
||||
NET_StringToAdr (rcon_address->string, &to);
|
||||
}
|
||||
|
||||
NET_SendPacket (strlen(message)+1, message
|
||||
|
@ -869,8 +935,8 @@ void CL_ConnectionlessPacket (void)
|
|||
while (*s && isspace((int)(s[strlen(s) - 1])))
|
||||
s[strlen(s) - 1] = 0;
|
||||
|
||||
if (!allowremotecmd && (!*localid.string || strcmp(localid.string, s))) {
|
||||
if (!*localid.string) {
|
||||
if (!allowremotecmd && (!*localid->string || strcmp(localid->string, s))) {
|
||||
if (!*localid->string) {
|
||||
Con_Printf("===========================\n");
|
||||
Con_Printf("Command packet received from local host, but no "
|
||||
"localid has been set. You may need to upgrade your server "
|
||||
|
@ -882,7 +948,7 @@ void CL_ConnectionlessPacket (void)
|
|||
Con_Printf("Invalid localid on command packet received from local host. "
|
||||
"\n|%s| != |%s|\n"
|
||||
"You may need to reload your server browser and QuakeForge.\n",
|
||||
s, localid.string);
|
||||
s, localid->string);
|
||||
Con_Printf("===========================\n");
|
||||
Cvar_Set("localid", "");
|
||||
return;
|
||||
|
@ -989,7 +1055,9 @@ void CL_ReadPackets (void)
|
|||
// check timeout
|
||||
//
|
||||
if (cls.state >= ca_connected
|
||||
&& realtime - cls.netchan.last_received > cl_timeout.value)
|
||||
/* && realtime - cls.netchan.last_received > cl_timeout.value)
|
||||
CVAR_FIXME */
|
||||
&& realtime - cls.netchan.last_received > cl_timeout->value)
|
||||
{
|
||||
Con_Printf ("\nServer connection timed out.\n");
|
||||
CL_Disconnect ();
|
||||
|
@ -1064,8 +1132,12 @@ CL_Init
|
|||
*/
|
||||
void CL_Init (void)
|
||||
{
|
||||
extern cvar_t baseskin;
|
||||
extern cvar_t noskins;
|
||||
/* extern cvar_t baseskin;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *baseskin;
|
||||
/* extern cvar_t noskins;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *noskins;
|
||||
char st[80];
|
||||
|
||||
cls.state = ca_disconnected;
|
||||
|
@ -1088,59 +1160,145 @@ void CL_Init (void)
|
|||
//
|
||||
// register our commands
|
||||
//
|
||||
Cvar_RegisterVariable (&show_fps);
|
||||
Cvar_RegisterVariable (&host_speeds);
|
||||
Cvar_RegisterVariable (&developer);
|
||||
/* Cvar_RegisterVariable (&show_fps);
|
||||
CVAR_FIXME */
|
||||
show_fps = Cvar_Get("show_fps", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&host_speeds);
|
||||
CVAR_FIXME */
|
||||
host_speeds = Cvar_Get("host_speeds", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&developer);
|
||||
CVAR_FIXME */
|
||||
developer = Cvar_Get("developer", "0", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&cl_warncmd);
|
||||
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_sbar);
|
||||
Cvar_RegisterVariable (&cl_hudswap);
|
||||
Cvar_RegisterVariable (&cl_maxfps);
|
||||
Cvar_RegisterVariable (&cl_timeout);
|
||||
Cvar_RegisterVariable (&lookspring);
|
||||
Cvar_RegisterVariable (&lookstrafe);
|
||||
Cvar_RegisterVariable (&sensitivity);
|
||||
/* Cvar_RegisterVariable (&cl_warncmd);
|
||||
CVAR_FIXME */
|
||||
cl_warncmd = Cvar_Get("cl_warncmd", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_upspeed);
|
||||
CVAR_FIXME */
|
||||
cl_upspeed = Cvar_Get("cl_upspeed", "200", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_forwardspeed);
|
||||
CVAR_FIXME */
|
||||
cl_forwardspeed = Cvar_Get("cl_forwardspeed", "200", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_backspeed);
|
||||
CVAR_FIXME */
|
||||
cl_backspeed = Cvar_Get("cl_backspeed", "200", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_sidespeed);
|
||||
CVAR_FIXME */
|
||||
cl_sidespeed = Cvar_Get("cl_sidespeed", "350", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_movespeedkey);
|
||||
CVAR_FIXME */
|
||||
cl_movespeedkey = Cvar_Get("cl_movespeedkey", "2.0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_yawspeed);
|
||||
CVAR_FIXME */
|
||||
cl_yawspeed = Cvar_Get("cl_yawspeed", "140", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_pitchspeed);
|
||||
CVAR_FIXME */
|
||||
cl_pitchspeed = Cvar_Get("cl_pitchspeed", "150", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_anglespeedkey);
|
||||
CVAR_FIXME */
|
||||
cl_anglespeedkey = Cvar_Get("cl_anglespeedkey", "1.5", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_shownet);
|
||||
CVAR_FIXME */
|
||||
cl_shownet = Cvar_Get("cl_shownet", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_sbar);
|
||||
CVAR_FIXME */
|
||||
cl_sbar = Cvar_Get("cl_sbar", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_hudswap);
|
||||
CVAR_FIXME */
|
||||
cl_hudswap = Cvar_Get("cl_hudswap", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_maxfps);
|
||||
CVAR_FIXME */
|
||||
cl_maxfps = Cvar_Get("cl_maxfps", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_timeout);
|
||||
CVAR_FIXME */
|
||||
cl_timeout = Cvar_Get("cl_timeout", "60", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&lookspring);
|
||||
CVAR_FIXME */
|
||||
lookspring = Cvar_Get("lookspring", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&lookstrafe);
|
||||
CVAR_FIXME */
|
||||
lookstrafe = Cvar_Get("lookstrafe", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sensitivity);
|
||||
CVAR_FIXME */
|
||||
sensitivity = Cvar_Get("sensitivity", "3", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&m_pitch);
|
||||
Cvar_RegisterVariable (&m_yaw);
|
||||
Cvar_RegisterVariable (&m_forward);
|
||||
Cvar_RegisterVariable (&m_side);
|
||||
/* Cvar_RegisterVariable (&m_pitch);
|
||||
CVAR_FIXME */
|
||||
m_pitch = Cvar_Get("m_pitch", "0.022", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&m_yaw);
|
||||
CVAR_FIXME */
|
||||
m_yaw = Cvar_Get("m_yaw", "0.022", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&m_forward);
|
||||
CVAR_FIXME */
|
||||
m_forward = Cvar_Get("m_forward", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&m_side);
|
||||
CVAR_FIXME */
|
||||
m_side = Cvar_Get("m_side", "0.8", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&rcon_password);
|
||||
Cvar_RegisterVariable (&rcon_address);
|
||||
/* Cvar_RegisterVariable (&rcon_password);
|
||||
CVAR_FIXME */
|
||||
rcon_password = Cvar_Get("rcon_password", "", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&rcon_address);
|
||||
CVAR_FIXME */
|
||||
rcon_address = Cvar_Get("rcon_address", "", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&entlatency);
|
||||
Cvar_RegisterVariable (&cl_predict_players2);
|
||||
Cvar_RegisterVariable (&cl_predict_players);
|
||||
Cvar_RegisterVariable (&cl_solid_players);
|
||||
/* Cvar_RegisterVariable (&entlatency);
|
||||
CVAR_FIXME */
|
||||
entlatency = Cvar_Get("entlatency", "20", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_predict_players2);
|
||||
CVAR_FIXME */
|
||||
cl_predict_players2 = Cvar_Get("cl_predict_players2", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_predict_players);
|
||||
CVAR_FIXME */
|
||||
cl_predict_players = Cvar_Get("cl_predict_players", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_solid_players);
|
||||
CVAR_FIXME */
|
||||
cl_solid_players = Cvar_Get("cl_solid_players", "1", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&localid);
|
||||
/* Cvar_RegisterVariable (&localid);
|
||||
CVAR_FIXME */
|
||||
localid = Cvar_Get("localid", "", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&baseskin);
|
||||
Cvar_RegisterVariable (&noskins);
|
||||
/* Cvar_RegisterVariable (&baseskin);
|
||||
CVAR_FIXME */
|
||||
baseskin = Cvar_Get("baseskin", "base", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&noskins);
|
||||
CVAR_FIXME */
|
||||
noskins = Cvar_Get("noskins", "0", CVAR_NONE, "None");
|
||||
|
||||
//
|
||||
// info mirrors
|
||||
//
|
||||
Cvar_RegisterVariable (&name);
|
||||
Cvar_RegisterVariable (&password);
|
||||
Cvar_RegisterVariable (&spectator);
|
||||
Cvar_RegisterVariable (&skin);
|
||||
Cvar_RegisterVariable (&team);
|
||||
Cvar_RegisterVariable (&topcolor);
|
||||
Cvar_RegisterVariable (&bottomcolor);
|
||||
Cvar_RegisterVariable (&rate);
|
||||
Cvar_RegisterVariable (&msg);
|
||||
Cvar_RegisterVariable (&noaim);
|
||||
/* Cvar_RegisterVariable (&name);
|
||||
CVAR_FIXME */
|
||||
name = Cvar_Get("name", "unnamed", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&password);
|
||||
CVAR_FIXME */
|
||||
password = Cvar_Get("password", "", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&spectator);
|
||||
CVAR_FIXME */
|
||||
spectator = Cvar_Get("spectator", "", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&skin);
|
||||
CVAR_FIXME */
|
||||
skin = Cvar_Get("skin", "", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&team);
|
||||
CVAR_FIXME */
|
||||
team = Cvar_Get("team", "", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&topcolor);
|
||||
CVAR_FIXME */
|
||||
topcolor = Cvar_Get("topcolor", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&bottomcolor);
|
||||
CVAR_FIXME */
|
||||
bottomcolor = Cvar_Get("bottomcolor", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&rate);
|
||||
CVAR_FIXME */
|
||||
rate = Cvar_Get("rate", "2500", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&msg);
|
||||
CVAR_FIXME */
|
||||
msg = Cvar_Get("msg", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&noaim);
|
||||
CVAR_FIXME */
|
||||
noaim = Cvar_Get("noaim", "0", CVAR_NONE, "None");
|
||||
|
||||
|
||||
Cmd_AddCommand ("version", CL_Version_f);
|
||||
|
@ -1295,10 +1453,16 @@ qboolean Host_SimulationTime(float time)
|
|||
if (oldrealtime > realtime)
|
||||
oldrealtime = 0;
|
||||
|
||||
if (cl_maxfps.value)
|
||||
fps = max(30.0, min(cl_maxfps.value, 72.0));
|
||||
/* if (cl_maxfps.value)
|
||||
CVAR_FIXME */
|
||||
if (cl_maxfps->value)
|
||||
/* fps = max(30.0, min(cl_maxfps.value, 72.0));
|
||||
CVAR_FIXME */
|
||||
fps = max(30.0, min(cl_maxfps->value, 72.0));
|
||||
else
|
||||
fps = max(30.0, min(rate.value/80.0, 72.0));
|
||||
/* fps = max(30.0, min(rate.value/80.0, 72.0));
|
||||
CVAR_FIXME */
|
||||
fps = max(30.0, min(rate->value/80.0, 72.0));
|
||||
|
||||
if (!cls.timedemo && (realtime + time) - oldrealtime < 1.0/fps)
|
||||
return false; // framerate is too high
|
||||
|
@ -1330,10 +1494,16 @@ void Host_Frame (float time)
|
|||
if (oldrealtime > realtime)
|
||||
oldrealtime = 0;
|
||||
|
||||
if (cl_maxfps.value)
|
||||
fps = max(30.0, min(cl_maxfps.value, 72.0));
|
||||
/* if (cl_maxfps.value)
|
||||
CVAR_FIXME */
|
||||
if (cl_maxfps->value)
|
||||
/* fps = max(30.0, min(cl_maxfps.value, 72.0));
|
||||
CVAR_FIXME */
|
||||
fps = max(30.0, min(cl_maxfps->value, 72.0));
|
||||
else
|
||||
fps = max(30.0, min(rate.value/80.0, 72.0));
|
||||
/* fps = max(30.0, min(rate.value/80.0, 72.0));
|
||||
CVAR_FIXME */
|
||||
fps = max(30.0, min(rate->value/80.0, 72.0));
|
||||
|
||||
if (!cls.timedemo && realtime - oldrealtime < 1.0/fps)
|
||||
return; // framerate is too high
|
||||
|
@ -1375,12 +1545,16 @@ void Host_Frame (float time)
|
|||
CL_EmitEntities ();
|
||||
|
||||
// update video
|
||||
if (host_speeds.value)
|
||||
/* if (host_speeds.value)
|
||||
CVAR_FIXME */
|
||||
if (host_speeds->value)
|
||||
time1 = Sys_DoubleTime ();
|
||||
|
||||
SCR_UpdateScreen ();
|
||||
|
||||
if (host_speeds.value)
|
||||
/* if (host_speeds.value)
|
||||
CVAR_FIXME */
|
||||
if (host_speeds->value)
|
||||
time2 = Sys_DoubleTime ();
|
||||
|
||||
// update audio
|
||||
|
@ -1394,7 +1568,9 @@ void Host_Frame (float time)
|
|||
|
||||
CDAudio_Update();
|
||||
|
||||
if (host_speeds.value)
|
||||
/* if (host_speeds.value)
|
||||
CVAR_FIXME */
|
||||
if (host_speeds->value)
|
||||
{
|
||||
pass1 = (time1 - time3)*1000;
|
||||
time3 = Sys_DoubleTime ();
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
#include "sys.h"
|
||||
#include "quakedef.h"
|
||||
|
||||
extern cvar_t gl_flashblend;
|
||||
/* extern cvar_t gl_flashblend;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_flashblend;
|
||||
|
||||
char *svc_strings[] =
|
||||
{
|
||||
|
@ -1008,7 +1010,9 @@ void CL_MuzzleFlash (void)
|
|||
return;
|
||||
|
||||
// don't draw our own muzzle flash in gl if flashblending
|
||||
if (i-1 == cl.playernum && gl_flashblend.value)
|
||||
/* if (i-1 == cl.playernum && gl_flashblend.value)
|
||||
CVAR_FIXME */
|
||||
if (i-1 == cl.playernum && gl_flashblend->value)
|
||||
return;
|
||||
|
||||
pl = &cl.frames[parsecountmod].playerstate[i-1];
|
||||
|
@ -1028,7 +1032,9 @@ void CL_MuzzleFlash (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);
|
||||
CVAR_FIXME */
|
||||
#define SHOWNET(x) if(cl_shownet->value==2)Con_Printf ("%3i:%s\n", msg_readcount-1, x);
|
||||
/*
|
||||
=====================
|
||||
CL_ParseServerMessage
|
||||
|
@ -1048,9 +1054,13 @@ void CL_ParseServerMessage (void)
|
|||
//
|
||||
// if recording demos, copy the message out
|
||||
//
|
||||
if (cl_shownet.value == 1)
|
||||
/* if (cl_shownet.value == 1)
|
||||
CVAR_FIXME */
|
||||
if (cl_shownet->value == 1)
|
||||
Con_Printf ("%i ",net_message.cursize);
|
||||
else if (cl_shownet.value == 2)
|
||||
/* else if (cl_shownet.value == 2)
|
||||
CVAR_FIXME */
|
||||
else if (cl_shownet->value == 2)
|
||||
Con_Printf ("------------------\n");
|
||||
|
||||
|
||||
|
|
|
@ -29,8 +29,12 @@
|
|||
#include "quakedef.h"
|
||||
#include "winquake.h"
|
||||
|
||||
cvar_t cl_nopred = {"cl_nopred","0"};
|
||||
cvar_t cl_pushlatency = {"pushlatency","-999"};
|
||||
/* cvar_t cl_nopred = {"cl_nopred","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_nopred;
|
||||
/* cvar_t cl_pushlatency = {"pushlatency","-999"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_pushlatency;
|
||||
|
||||
extern frame_t *view_frame;
|
||||
|
||||
|
@ -126,13 +130,17 @@ void CL_PredictMove (void)
|
|||
frame_t *from, *to = NULL;
|
||||
int oldphysent;
|
||||
|
||||
if (cl_pushlatency.value > 0)
|
||||
/* if (cl_pushlatency.value > 0)
|
||||
CVAR_FIXME */
|
||||
if (cl_pushlatency->value > 0)
|
||||
Cvar_Set ("pushlatency", "0");
|
||||
|
||||
if (cl.paused)
|
||||
return;
|
||||
|
||||
cl.time = realtime - cls.latency - cl_pushlatency.value*0.001;
|
||||
/* cl.time = realtime - cls.latency - cl_pushlatency.value*0.001;
|
||||
CVAR_FIXME */
|
||||
cl.time = realtime - cls.latency - cl_pushlatency->value*0.001;
|
||||
if (cl.time > realtime)
|
||||
cl.time = realtime;
|
||||
|
||||
|
@ -162,7 +170,9 @@ void CL_PredictMove (void)
|
|||
#endif
|
||||
}
|
||||
|
||||
if (cl_nopred.value)
|
||||
/* if (cl_nopred.value)
|
||||
CVAR_FIXME */
|
||||
if (cl_nopred->value)
|
||||
{
|
||||
VectorCopy (from->playerstate[cl.playernum].velocity, cl.simvel);
|
||||
VectorCopy (from->playerstate[cl.playernum].origin, cl.simorg);
|
||||
|
@ -229,7 +239,11 @@ CL_InitPrediction
|
|||
*/
|
||||
void CL_InitPrediction (void)
|
||||
{
|
||||
Cvar_RegisterVariable (&cl_pushlatency);
|
||||
Cvar_RegisterVariable (&cl_nopred);
|
||||
/* Cvar_RegisterVariable (&cl_pushlatency);
|
||||
CVAR_FIXME */
|
||||
cl_pushlatency = Cvar_Get("pushlatency", "-999", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_nopred);
|
||||
CVAR_FIXME */
|
||||
cl_nopred = Cvar_Get("cl_nopred", "0", CVAR_NONE, "None");
|
||||
}
|
||||
|
||||
|
|
12
source/cmd.c
12
source/cmd.c
|
@ -45,7 +45,9 @@ cmdalias_t *cmd_alias;
|
|||
|
||||
qboolean cmd_wait;
|
||||
|
||||
cvar_t cl_warncmd = {"cl_warncmd", "0"};
|
||||
/* cvar_t cl_warncmd = {"cl_warncmd", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_warncmd;
|
||||
|
||||
//=============================================================================
|
||||
|
||||
|
@ -301,7 +303,9 @@ void Cmd_Exec_f (void)
|
|||
Con_Printf ("couldn't exec %s\n",Cmd_Argv(1));
|
||||
return;
|
||||
}
|
||||
if (!Cvar_Command () && (cl_warncmd.value || developer.value))
|
||||
/* if (!Cvar_Command () && (cl_warncmd.value || developer.value))
|
||||
CVAR_FIXME */
|
||||
if (!Cvar_Command () && (cl_warncmd->value || developer->value))
|
||||
Con_Printf ("execing %s\n",Cmd_Argv(1));
|
||||
|
||||
Cbuf_InsertText (f);
|
||||
|
@ -647,7 +651,9 @@ void Cmd_ExecuteString (char *text)
|
|||
}
|
||||
|
||||
// check cvars
|
||||
if (!Cvar_Command () && (cl_warncmd.value || developer.value))
|
||||
/* if (!Cvar_Command () && (cl_warncmd.value || developer.value))
|
||||
CVAR_FIXME */
|
||||
if (!Cvar_Command () && (cl_warncmd->value || developer->value))
|
||||
Con_Printf ("Unknown command \"%s\"\n", Cmd_Argv(0));
|
||||
|
||||
}
|
||||
|
|
|
@ -43,7 +43,9 @@ static char *argvdummy = " ";
|
|||
static char *safeargvs[NUM_SAFE_ARGVS] =
|
||||
{"-stdvid", "-nolan", "-nosound", "-nocdaudio", "-nojoy", "-nomouse"};
|
||||
|
||||
cvar_t registered = {"registered","0"};
|
||||
/* cvar_t registered = {"registered","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *registered;
|
||||
|
||||
qboolean com_modified; // set true if using non-id files
|
||||
|
||||
|
@ -1193,7 +1195,9 @@ void COM_Init (void)
|
|||
LittleFloat = FloatSwap;
|
||||
}
|
||||
|
||||
Cvar_RegisterVariable (®istered);
|
||||
/* Cvar_RegisterVariable (®istered);
|
||||
CVAR_FIXME */
|
||||
registered = Cvar_Get("registered", "0", CVAR_NONE, "None");
|
||||
Cmd_AddCommand ("path", COM_Path_f);
|
||||
|
||||
COM_InitFilesystem ();
|
||||
|
@ -1468,7 +1472,9 @@ int COM_FOpenFile (char *filename, FILE **file)
|
|||
for (i=0 ; i<pak->numfiles ; i++)
|
||||
if (!strcmp (pak->files[i].name, filename))
|
||||
{ // found it!
|
||||
if(developer.value)
|
||||
/* if(developer.value)
|
||||
CVAR_FIXME */
|
||||
if(developer->value)
|
||||
Sys_Printf ("PackFile: %s : %s\n",pak->filename, filename);
|
||||
// open a new file on the pakfile
|
||||
*file = fopen (pak->filename, "rb");
|
||||
|
|
|
@ -40,7 +40,9 @@ int con_totallines; // total lines in console scrollback
|
|||
float con_cursorspeed = 4;
|
||||
|
||||
|
||||
cvar_t con_notifytime = {"con_notifytime","3"}; //seconds
|
||||
/* cvar_t con_notifytime = {"con_notifytime","3"}; //seconds
|
||||
CVAR_FIXME */
|
||||
cvar_t *con_notifytime; //seconds
|
||||
|
||||
#define NUM_CON_TIMES 4
|
||||
float con_times[NUM_CON_TIMES]; // realtime time the line was generated
|
||||
|
@ -246,7 +248,9 @@ void Con_Init (void)
|
|||
//
|
||||
// register our commands
|
||||
//
|
||||
Cvar_RegisterVariable (&con_notifytime);
|
||||
/* Cvar_RegisterVariable (&con_notifytime);
|
||||
CVAR_FIXME */
|
||||
con_notifytime = Cvar_Get("con_notifytime", "3", CVAR_NONE, "None");
|
||||
|
||||
Cmd_AddCommand ("toggleconsole", Con_ToggleConsole_f);
|
||||
Cmd_AddCommand ("togglechat", Con_ToggleChat_f);
|
||||
|
@ -407,7 +411,9 @@ void Con_DPrintf (char *fmt, ...)
|
|||
va_list argptr;
|
||||
char msg[MAXPRINTMSG];
|
||||
|
||||
if (!developer.value)
|
||||
/* if (!developer.value)
|
||||
CVAR_FIXME */
|
||||
if (!developer->value)
|
||||
return; // don't confuse non-developers with techie stuff...
|
||||
|
||||
va_start (argptr, fmt);
|
||||
|
@ -491,7 +497,9 @@ void Con_DrawNotify (void)
|
|||
if (time == 0)
|
||||
continue;
|
||||
time = realtime - time;
|
||||
if (time > con_notifytime.value)
|
||||
/* if (time > con_notifytime.value)
|
||||
CVAR_FIXME */
|
||||
if (time > con_notifytime->value)
|
||||
continue;
|
||||
text = con->text + (i % con_totallines)*con_linewidth;
|
||||
|
||||
|
|
332
source/cvar.c
332
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
|
||||
|
@ -25,12 +28,17 @@
|
|||
|
||||
$Id$
|
||||
*/
|
||||
// cvar.c -- dynamic variable tracking
|
||||
|
||||
#include "quakedef.h"
|
||||
|
||||
#if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF)
|
||||
# define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
cvar_t *cvar_vars;
|
||||
char *cvar_null_string = "";
|
||||
cvar_t *developer;
|
||||
cvar_alias_t *calias_vars;
|
||||
|
||||
/*
|
||||
============
|
||||
|
@ -40,7 +48,7 @@ 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))
|
||||
return var;
|
||||
|
@ -48,6 +56,42 @@ cvar_t *Cvar_FindVar (char *var_name)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
cvar_t *Cvar_FindAlias (char *alias_name)
|
||||
{
|
||||
cvar_alias_t *alias;
|
||||
|
||||
for (alias = calias_vars ; alias ; alias=alias->next)
|
||||
if (!Q_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 *) malloc(sizeof(cvar_alias_t));
|
||||
alias->next = calias_vars;
|
||||
calias_vars = alias;
|
||||
alias->name = strdup(name);
|
||||
alias->cvar = cvar;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
Cvar_VariableValue
|
||||
|
@ -56,8 +100,10 @@ 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);
|
||||
|
@ -72,8 +118,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;
|
||||
|
@ -88,105 +136,64 @@ Cvar_CompleteVariable
|
|||
char *Cvar_CompleteVariable (char *partial)
|
||||
{
|
||||
cvar_t *cvar;
|
||||
int len;
|
||||
|
||||
cvar_alias_t *alias;
|
||||
int len;
|
||||
|
||||
len = Q_strlen(partial);
|
||||
|
||||
|
||||
if (!len)
|
||||
return NULL;
|
||||
|
||||
|
||||
// check exact match
|
||||
for (cvar=cvar_vars ; cvar ; cvar=cvar->next)
|
||||
if (!strcmp (partial,cvar->name))
|
||||
return cvar->name;
|
||||
|
||||
// check aliases too :)
|
||||
for (alias=calias_vars ; alias ; alias=alias->next)
|
||||
if (!strcmp (partial, alias->name))
|
||||
return alias->name;
|
||||
|
||||
// check partial match
|
||||
for (cvar=cvar_vars ; cvar ; cvar=cvar->next)
|
||||
if (!Q_strncmp (partial,cvar->name, len))
|
||||
return cvar->name;
|
||||
|
||||
// check aliases too :)
|
||||
for (alias=calias_vars ; alias ; alias=alias->next)
|
||||
if (!Q_strncmp (partial, alias->name, len))
|
||||
return alias->name;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void Cvar_Info (cvar_t *var);
|
||||
|
||||
/*
|
||||
============
|
||||
Cvar_Set
|
||||
============
|
||||
*/
|
||||
|
||||
void Cvar_Info (cvar_t *var);
|
||||
|
||||
void Cvar_Set (char *var_name, char *value)
|
||||
{
|
||||
cvar_t *var;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
cvar_t *var;
|
||||
|
||||
Cvar_Info(var);
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
Cvar_Info(var);
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
Cvar_SetValue
|
||||
============
|
||||
*/
|
||||
void Cvar_SetValue (char *var_name, float value)
|
||||
{
|
||||
char val[32];
|
||||
|
||||
sprintf (val, "%f",value);
|
||||
Cvar_Set (var_name, val);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
============
|
||||
Cvar_RegisterVariable
|
||||
|
||||
Adds a freestanding variable to the variable list.
|
||||
============
|
||||
*/
|
||||
void Cvar_RegisterVariable (cvar_t *variable)
|
||||
{
|
||||
char value[512];
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
// link the variable in
|
||||
variable->next = cvar_vars;
|
||||
cvar_vars = variable;
|
||||
|
||||
// copy the value off, because future sets will Z_Free it
|
||||
strcpy (value, variable->string);
|
||||
variable->string = Z_Malloc (1);
|
||||
|
||||
// set it through the function to be consistant
|
||||
Cvar_Set (variable->name, value);
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
Cvar_Command
|
||||
|
@ -200,9 +207,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)
|
||||
{
|
||||
|
@ -226,9 +235,168 @@ 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->name, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
var = Cvar_Get (var_name, value, CVAR_USER_CREATED|CVAR_HEAP,
|
||||
"User created cvar");
|
||||
}
|
||||
}
|
||||
|
||||
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->name, 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 ("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);
|
||||
Z_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 *) malloc(sizeof(cvar_t));
|
||||
// Cvar doesn't exist, so we create it
|
||||
v->next = cvar_vars;
|
||||
cvar_vars = v;
|
||||
v->name = strdup(name);
|
||||
v->string = Z_Malloc (Q_strlen(string)+1);
|
||||
Q_strcpy (v->string, string);
|
||||
v->flags = cvarflags;
|
||||
v->description = strdup(description);
|
||||
v->value = Q_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 (!Q_strcmp (v->description,"User created cvar"))
|
||||
{
|
||||
// Set with the real description
|
||||
free(v->description);
|
||||
v->description = strdup (description);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
|
|
@ -191,7 +191,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (r_drawflat->value)
|
||||
{
|
||||
for (s = &surfaces[1] ; s<surface_p ; s++)
|
||||
{
|
||||
|
@ -237,7 +239,9 @@ 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);
|
||||
CVAR_FIXME */
|
||||
D_DrawSolidSurface (s, (int)r_clearcolor->value & 0xFF);
|
||||
D_DrawZSpans (s->spans);
|
||||
}
|
||||
else if (s->flags & SURF_DRAWTURB)
|
||||
|
|
|
@ -32,9 +32,15 @@
|
|||
|
||||
#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 = {"d_subdiv16", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *d_subdiv16;
|
||||
/* cvar_t d_mipcap = {"d_mipcap", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *d_mipcap;
|
||||
/* cvar_t d_mipscale = {"d_mipscale", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *d_mipscale;
|
||||
|
||||
surfcache_t *d_initial_rover;
|
||||
qboolean d_roverwrapped;
|
||||
|
@ -58,9 +64,15 @@ void D_Init (void)
|
|||
|
||||
r_skydirect = 1;
|
||||
|
||||
Cvar_RegisterVariable (&d_subdiv16);
|
||||
Cvar_RegisterVariable (&d_mipcap);
|
||||
Cvar_RegisterVariable (&d_mipscale);
|
||||
/* Cvar_RegisterVariable (&d_subdiv16);
|
||||
CVAR_FIXME */
|
||||
d_subdiv16 = Cvar_Get("d_subdiv16", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&d_mipcap);
|
||||
CVAR_FIXME */
|
||||
d_mipcap = Cvar_Get("d_mipcap", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&d_mipscale);
|
||||
CVAR_FIXME */
|
||||
d_mipscale = Cvar_Get("d_mipscale", "1", CVAR_NONE, "None");
|
||||
|
||||
r_drawpolys = false;
|
||||
r_worldpolysbacktofront = false;
|
||||
|
@ -145,17 +157,23 @@ void D_SetupFrame (void)
|
|||
d_roverwrapped = false;
|
||||
d_initial_rover = sc_rover;
|
||||
|
||||
d_minmip = d_mipcap.value;
|
||||
/* d_minmip = d_mipcap.value;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
d_scalemip[i] = basemip[i] * d_mipscale->value;
|
||||
|
||||
#if id386
|
||||
if (d_subdiv16.value)
|
||||
/* if (d_subdiv16.value)
|
||||
CVAR_FIXME */
|
||||
if (d_subdiv16->value)
|
||||
d_drawspans = D_DrawSpans16;
|
||||
else
|
||||
d_drawspans = D_DrawSpans8;
|
||||
|
|
|
@ -45,7 +45,9 @@ byte *draw_chars; // 8*8 graphic characters
|
|||
qpic_t *draw_disc;
|
||||
qpic_t *draw_backtile;
|
||||
|
||||
cvar_t cl_verstring = {"cl_verstring", "QuakeForge " QF_VERSION};
|
||||
/* cvar_t cl_verstring = {"cl_verstring", "QuakeForge " QF_VERSION};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_verstring;
|
||||
|
||||
//=============================================================================
|
||||
/* Support Routines */
|
||||
|
@ -128,7 +130,9 @@ void Draw_Init (void)
|
|||
r_rectdesc.ptexbytes = draw_backtile->data;
|
||||
r_rectdesc.rowbytes = draw_backtile->width;
|
||||
|
||||
Cvar_RegisterVariable (&cl_verstring);
|
||||
/* Cvar_RegisterVariable (&cl_verstring);
|
||||
CVAR_FIXME */
|
||||
cl_verstring = Cvar_Get("cl_verstring", "QuakeForge " QF_VERSION, CVAR_NONE, "None");
|
||||
}
|
||||
|
||||
|
||||
|
@ -283,13 +287,23 @@ void Draw_Pixel(int x, int y, byte color)
|
|||
void Draw_Crosshair(void)
|
||||
{
|
||||
int x, y;
|
||||
extern cvar_t crosshair, cl_crossx, cl_crossy, crosshaircolor;
|
||||
/* extern cvar_t crosshair, cl_crossx, cl_crossy, crosshaircolor;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *crosshair, *cl_crossx, *cl_crossy, *crosshaircolor;
|
||||
extern vrect_t scr_vrect;
|
||||
byte c = (byte)crosshaircolor.value;
|
||||
/* byte c = (byte)crosshaircolor.value;
|
||||
CVAR_FIXME */
|
||||
byte c = (byte)crosshaircolor->value;
|
||||
|
||||
if (crosshair.value == 2) {
|
||||
x = scr_vrect.x + scr_vrect.width/2 + cl_crossx.value;
|
||||
y = scr_vrect.y + scr_vrect.height/2 + cl_crossy.value;
|
||||
/* if (crosshair.value == 2) {
|
||||
CVAR_FIXME */
|
||||
if (crosshair->value == 2) {
|
||||
/* x = scr_vrect.x + scr_vrect.width/2 + cl_crossx.value;
|
||||
CVAR_FIXME */
|
||||
x = scr_vrect.x + scr_vrect.width/2 + cl_crossx->value;
|
||||
/* y = scr_vrect.y + scr_vrect.height/2 + cl_crossy.value;
|
||||
CVAR_FIXME */
|
||||
y = scr_vrect.y + scr_vrect.height/2 + cl_crossy->value;
|
||||
Draw_Pixel(x - 1, y, c);
|
||||
Draw_Pixel(x - 3, y, c);
|
||||
Draw_Pixel(x + 1, y, c);
|
||||
|
@ -298,10 +312,16 @@ void Draw_Crosshair(void)
|
|||
Draw_Pixel(x, y - 3, c);
|
||||
Draw_Pixel(x, y + 1, c);
|
||||
Draw_Pixel(x, y + 3, c);
|
||||
} else if (crosshair.value)
|
||||
/* } else if (crosshair.value)
|
||||
CVAR_FIXME */
|
||||
} else if (crosshair->value)
|
||||
Draw_Character (
|
||||
scr_vrect.x + scr_vrect.width/2-4 + cl_crossx.value,
|
||||
scr_vrect.y + scr_vrect.height/2-4 + cl_crossy.value,
|
||||
/* scr_vrect.x + scr_vrect.width/2-4 + cl_crossx.value,
|
||||
CVAR_FIXME */
|
||||
scr_vrect.x + scr_vrect.width/2-4 + cl_crossx->value,
|
||||
/* scr_vrect.y + scr_vrect.height/2-4 + cl_crossy.value,
|
||||
CVAR_FIXME */
|
||||
scr_vrect.y + scr_vrect.height/2-4 + cl_crossy->value,
|
||||
'+');
|
||||
}
|
||||
|
||||
|
@ -695,8 +715,8 @@ void Draw_ConsoleBackground (int lines)
|
|||
}
|
||||
}
|
||||
|
||||
Draw_Alt_String (vid.conwidth - strlen(cl_verstring.string)*8 - 11,
|
||||
lines-14, cl_verstring.string);
|
||||
Draw_Alt_String (vid.conwidth - strlen(cl_verstring->string)*8 - 11,
|
||||
lines-14, cl_verstring->string);
|
||||
|
||||
}
|
||||
|
||||
|
|
120
source/gl_draw.c
120
source/gl_draw.c
|
@ -53,13 +53,23 @@
|
|||
|
||||
extern byte *host_basepal;
|
||||
extern unsigned char d_15to8table[65536];
|
||||
extern cvar_t crosshair, cl_crossx, cl_crossy, crosshaircolor;
|
||||
/* extern cvar_t crosshair, cl_crossx, cl_crossy, crosshaircolor;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *crosshair, *cl_crossx, *cl_crossy, *crosshaircolor;
|
||||
|
||||
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 = {"gl_nobind", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_nobind;
|
||||
/* cvar_t gl_max_size = {"gl_max_size", "1024"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_max_size;
|
||||
/* cvar_t gl_picmip = {"gl_picmip", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_picmip;
|
||||
|
||||
cvar_t cl_verstring = {"cl_verstring", "QuakeForge " QF_VERSION};
|
||||
/* cvar_t cl_verstring = {"cl_verstring", "QuakeForge " QF_VERSION};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_verstring;
|
||||
|
||||
extern byte *draw_chars; // 8*8 graphic characters
|
||||
qpic_t *draw_disc;
|
||||
|
@ -114,7 +124,9 @@ int numgltextures;
|
|||
|
||||
void GL_Bind (int texnum)
|
||||
{
|
||||
if (gl_nobind.value)
|
||||
/* if (gl_nobind.value)
|
||||
CVAR_FIXME */
|
||||
if (gl_nobind->value)
|
||||
texnum = char_texture;
|
||||
if (currenttexture == texnum)
|
||||
return;
|
||||
|
@ -410,11 +422,19 @@ void Draw_Init (void)
|
|||
int start;
|
||||
byte *ncdata;
|
||||
|
||||
Cvar_RegisterVariable (&gl_nobind);
|
||||
Cvar_RegisterVariable (&gl_max_size);
|
||||
Cvar_RegisterVariable (&gl_picmip);
|
||||
/* Cvar_RegisterVariable (&gl_nobind);
|
||||
CVAR_FIXME */
|
||||
gl_nobind = Cvar_Get("gl_nobind", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_max_size);
|
||||
CVAR_FIXME */
|
||||
gl_max_size = Cvar_Get("gl_max_size", "1024", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_picmip);
|
||||
CVAR_FIXME */
|
||||
gl_picmip = Cvar_Get("gl_picmip", "0", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&cl_verstring);
|
||||
/* Cvar_RegisterVariable (&cl_verstring);
|
||||
CVAR_FIXME */
|
||||
cl_verstring = Cvar_Get("cl_verstring", "QuakeForge " QF_VERSION, CVAR_NONE, "None");
|
||||
|
||||
// 3dfx can only handle 256 wide textures
|
||||
if (!Q_strncasecmp ((char *)gl_renderer, "3dfx",4) ||
|
||||
|
@ -589,12 +609,20 @@ void Draw_Crosshair(void)
|
|||
extern vrect_t scr_vrect;
|
||||
unsigned char *pColor;
|
||||
|
||||
if (crosshair.value == 2) {
|
||||
x = scr_vrect.x + scr_vrect.width/2 - 3 + cl_crossx.value;
|
||||
y = scr_vrect.y + scr_vrect.height/2 - 3 + cl_crossy.value;
|
||||
/* if (crosshair.value == 2) {
|
||||
CVAR_FIXME */
|
||||
if (crosshair->value == 2) {
|
||||
/* x = scr_vrect.x + scr_vrect.width/2 - 3 + cl_crossx.value;
|
||||
CVAR_FIXME */
|
||||
x = scr_vrect.x + scr_vrect.width/2 - 3 + cl_crossx->value;
|
||||
/* y = scr_vrect.y + scr_vrect.height/2 - 3 + cl_crossy.value;
|
||||
CVAR_FIXME */
|
||||
y = scr_vrect.y + scr_vrect.height/2 - 3 + cl_crossy->value;
|
||||
|
||||
glTexEnvf ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
|
||||
pColor = (unsigned char *) &d_8to24table[(byte) crosshaircolor.value];
|
||||
/* pColor = (unsigned char *) &d_8to24table[(byte) crosshaircolor.value];
|
||||
CVAR_FIXME */
|
||||
pColor = (unsigned char *) &d_8to24table[(byte) crosshaircolor->value];
|
||||
glColor4ubv ( pColor );
|
||||
GL_Bind (cs_texture);
|
||||
|
||||
|
@ -610,9 +638,15 @@ void Draw_Crosshair(void)
|
|||
glEnd ();
|
||||
|
||||
glTexEnvf ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
|
||||
} else if (crosshair.value)
|
||||
Draw_Character (scr_vrect.x + scr_vrect.width/2-4 + cl_crossx.value,
|
||||
scr_vrect.y + scr_vrect.height/2-4 + cl_crossy.value,
|
||||
/* } else if (crosshair.value)
|
||||
CVAR_FIXME */
|
||||
} else if (crosshair->value)
|
||||
/* Draw_Character (scr_vrect.x + scr_vrect.width/2-4 + cl_crossx.value,
|
||||
CVAR_FIXME */
|
||||
Draw_Character (scr_vrect.x + scr_vrect.width/2-4 + cl_crossx->value,
|
||||
/* scr_vrect.y + scr_vrect.height/2-4 + cl_crossy.value,
|
||||
CVAR_FIXME */
|
||||
scr_vrect.y + scr_vrect.height/2-4 + cl_crossy->value,
|
||||
'+');
|
||||
}
|
||||
|
||||
|
@ -807,8 +841,8 @@ void Draw_ConsoleBackground (int lines)
|
|||
else
|
||||
Draw_AlphaPic (0, lines - vid.height, conback, (float)(1.2 * lines)/y);
|
||||
|
||||
Draw_Alt_String (vid.conwidth - strlen(cl_verstring.string)*8 - 11,
|
||||
lines-14, cl_verstring.string);
|
||||
Draw_Alt_String (vid.conwidth - strlen(cl_verstring->string)*8 - 11,
|
||||
lines-14, cl_verstring->string);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1105,13 +1139,25 @@ 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;
|
||||
CVAR_FIXME */
|
||||
scaled_width >>= (int)gl_picmip->value;
|
||||
/* scaled_height >>= (int)gl_picmip.value;
|
||||
CVAR_FIXME */
|
||||
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)
|
||||
CVAR_FIXME */
|
||||
if (scaled_width > gl_max_size->value)
|
||||
/* scaled_width = gl_max_size.value;
|
||||
CVAR_FIXME */
|
||||
scaled_width = gl_max_size->value;
|
||||
/* if (scaled_height > gl_max_size.value)
|
||||
CVAR_FIXME */
|
||||
if (scaled_height > gl_max_size->value)
|
||||
/* scaled_height = gl_max_size.value;
|
||||
CVAR_FIXME */
|
||||
scaled_height = gl_max_size->value;
|
||||
|
||||
if (scaled_width * scaled_height > sizeof(scaled)/4)
|
||||
Sys_Error ("GL_LoadTexture: too big");
|
||||
|
@ -1207,13 +1253,25 @@ 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;
|
||||
CVAR_FIXME */
|
||||
scaled_width >>= (int)gl_picmip->value;
|
||||
/* scaled_height >>= (int)gl_picmip.value;
|
||||
CVAR_FIXME */
|
||||
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)
|
||||
CVAR_FIXME */
|
||||
if (scaled_width > gl_max_size->value)
|
||||
/* scaled_width = gl_max_size.value;
|
||||
CVAR_FIXME */
|
||||
scaled_width = gl_max_size->value;
|
||||
/* if (scaled_height > gl_max_size.value)
|
||||
CVAR_FIXME */
|
||||
if (scaled_height > gl_max_size->value)
|
||||
/* scaled_height = gl_max_size.value;
|
||||
CVAR_FIXME */
|
||||
scaled_height = gl_max_size->value;
|
||||
|
||||
if (scaled_width * scaled_height > sizeof(scaled))
|
||||
Sys_Error ("GL_LoadTexture: too big");
|
||||
|
|
|
@ -172,7 +172,9 @@ void R_RenderDlights (void)
|
|||
int i;
|
||||
dlight_t *l;
|
||||
|
||||
if (!gl_flashblend.value)
|
||||
/* if (!gl_flashblend.value)
|
||||
CVAR_FIXME */
|
||||
if (!gl_flashblend->value)
|
||||
return;
|
||||
|
||||
r_dlightframecount = r_framecount + 1; // because the count hasn't
|
||||
|
@ -263,7 +265,9 @@ void R_PushDlights (void)
|
|||
int i;
|
||||
dlight_t *l;
|
||||
|
||||
if (gl_flashblend.value)
|
||||
/* if (gl_flashblend.value)
|
||||
CVAR_FIXME */
|
||||
if (gl_flashblend->value)
|
||||
return;
|
||||
|
||||
r_dlightframecount = r_framecount + 1; // because the count hasn't
|
||||
|
|
|
@ -104,34 +104,86 @@ 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_netgraph = {"r_netgraph","0"};
|
||||
/* cvar_t r_norefresh = {"r_norefresh","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_norefresh;
|
||||
/* cvar_t r_drawentities = {"r_drawentities","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_drawentities;
|
||||
/* cvar_t r_drawviewmodel = {"r_drawviewmodel","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_drawviewmodel;
|
||||
/* cvar_t r_speeds = {"r_speeds","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_speeds;
|
||||
/* cvar_t r_fullbright = {"r_fullbright","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_fullbright;
|
||||
/* cvar_t r_lightmap = {"r_lightmap","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_lightmap;
|
||||
/* cvar_t r_shadows = {"r_shadows","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_shadows;
|
||||
/* cvar_t r_mirroralpha = {"r_mirroralpha","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_mirroralpha;
|
||||
/* cvar_t r_wateralpha = {"r_wateralpha","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_wateralpha;
|
||||
/* cvar_t r_dynamic = {"r_dynamic","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_dynamic;
|
||||
/* cvar_t r_novis = {"r_novis","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_novis;
|
||||
/* cvar_t r_netgraph = {"r_netgraph","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_netgraph;
|
||||
|
||||
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","1"};
|
||||
cvar_t gl_reporttjunctions = {"gl_reporttjunctions","0"};
|
||||
cvar_t gl_finish = {"gl_finish","0"};
|
||||
/* cvar_t gl_clear = {"gl_clear","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_clear;
|
||||
/* cvar_t gl_cull = {"gl_cull","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_cull;
|
||||
/* cvar_t gl_texsort = {"gl_texsort","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_texsort;
|
||||
/* cvar_t gl_smoothmodels = {"gl_smoothmodels","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_smoothmodels;
|
||||
/* cvar_t gl_affinemodels = {"gl_affinemodels","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_affinemodels;
|
||||
/* cvar_t gl_polyblend = {"gl_polyblend","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_polyblend;
|
||||
/* cvar_t gl_flashblend = {"gl_flashblend","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_flashblend;
|
||||
/* cvar_t gl_playermip = {"gl_playermip","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_playermip;
|
||||
/* cvar_t gl_nocolors = {"gl_nocolors","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_nocolors;
|
||||
/* cvar_t gl_keeptjunctions = {"gl_keeptjunctions","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_keeptjunctions;
|
||||
/* cvar_t gl_reporttjunctions = {"gl_reporttjunctions","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_reporttjunctions;
|
||||
/* cvar_t gl_finish = {"gl_finish","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_finish;
|
||||
|
||||
extern cvar_t gl_ztrick;
|
||||
extern cvar_t scr_fov;
|
||||
/* extern cvar_t gl_ztrick;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_ztrick;
|
||||
/* extern cvar_t scr_fov;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *scr_fov;
|
||||
/*
|
||||
=================
|
||||
R_CullBox
|
||||
|
@ -573,7 +625,9 @@ 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->scoreboard && !gl_nocolors.value)
|
||||
/* if (currententity->scoreboard && !gl_nocolors.value)
|
||||
CVAR_FIXME */
|
||||
if (currententity->scoreboard && !gl_nocolors->value)
|
||||
{
|
||||
i = currententity->scoreboard - cl.players;
|
||||
if (!currententity->scoreboard->skin) {
|
||||
|
@ -584,11 +638,15 @@ void R_DrawAliasModel (entity_t *e)
|
|||
GL_Bind(playertextures + i);
|
||||
}
|
||||
|
||||
if (gl_smoothmodels.value)
|
||||
/* if (gl_smoothmodels.value)
|
||||
CVAR_FIXME */
|
||||
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)
|
||||
CVAR_FIXME */
|
||||
if (gl_affinemodels->value)
|
||||
glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
|
||||
|
||||
R_SetupAliasFrame (currententity->frame, paliashdr);
|
||||
|
@ -596,12 +654,16 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (gl_affinemodels->value)
|
||||
glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
|
||||
|
||||
glPopMatrix ();
|
||||
|
||||
if (r_shadows.value)
|
||||
/* if (r_shadows.value)
|
||||
CVAR_FIXME */
|
||||
if (r_shadows->value)
|
||||
{
|
||||
glPushMatrix ();
|
||||
R_RotateForEntity (e);
|
||||
|
@ -628,7 +690,9 @@ void R_DrawEntitiesOnList (void)
|
|||
{
|
||||
int i;
|
||||
|
||||
if (!r_drawentities.value)
|
||||
/* if (!r_drawentities.value)
|
||||
CVAR_FIXME */
|
||||
if (!r_drawentities->value)
|
||||
return;
|
||||
|
||||
// draw sprites seperately, because of alpha blending
|
||||
|
@ -682,13 +746,17 @@ void R_DrawViewModel (void)
|
|||
dlight_t *dl;
|
||||
int ambientlight, shadelight;
|
||||
|
||||
if (!r_drawviewmodel.value || !Cam_DrawViewModel())
|
||||
/* if (!r_drawviewmodel.value || !Cam_DrawViewModel())
|
||||
CVAR_FIXME */
|
||||
if (!r_drawviewmodel->value || !Cam_DrawViewModel())
|
||||
return;
|
||||
|
||||
if (envmap)
|
||||
return;
|
||||
|
||||
if (!r_drawentities.value)
|
||||
/* if (!r_drawentities.value)
|
||||
CVAR_FIXME */
|
||||
if (!r_drawentities->value)
|
||||
return;
|
||||
|
||||
if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
|
||||
|
@ -742,7 +810,9 @@ R_PolyBlend
|
|||
*/
|
||||
void R_PolyBlend (void)
|
||||
{
|
||||
if (!gl_polyblend.value)
|
||||
/* if (!gl_polyblend.value)
|
||||
CVAR_FIXME */
|
||||
if (!gl_polyblend->value)
|
||||
return;
|
||||
if (!v_blend[3])
|
||||
return;
|
||||
|
@ -838,10 +908,16 @@ R_SetupFrame
|
|||
void R_SetupFrame (void)
|
||||
{
|
||||
// don't allow cheats in multiplayer
|
||||
r_fullbright.value = 0;
|
||||
r_lightmap.value = 0;
|
||||
/* r_fullbright.value = 0;
|
||||
CVAR_FIXME */
|
||||
r_fullbright->value = 0;
|
||||
/* r_lightmap.value = 0;
|
||||
CVAR_FIXME */
|
||||
r_lightmap->value = 0;
|
||||
if (!atoi(Info_ValueForKey(cl.serverinfo, "watervis")))
|
||||
r_wateralpha.value = 1;
|
||||
/* r_wateralpha.value = 1;
|
||||
CVAR_FIXME */
|
||||
r_wateralpha->value = 1;
|
||||
|
||||
R_AnimateLight ();
|
||||
|
||||
|
@ -925,8 +1001,12 @@ void R_SetupGL (void)
|
|||
glViewport (glx + x, gly + y2, w, h);
|
||||
screenaspect = (float)r_refdef.vrect.width/r_refdef.vrect.height;
|
||||
// yfov = 2*atan((float)r_refdef.vrect.height/r_refdef.vrect.width)*180/M_PI;
|
||||
// yfov = (2.0 * tan (scr_fov.value/360*M_PI)) / screenaspect;
|
||||
// yfov = 2*atan((float)r_refdef.vrect.height/r_refdef.vrect.width)*(scr_fov.value*2)/M_PI;
|
||||
/* // yfov = (2.0 * tan (scr_fov.value/360*M_PI)) / screenaspect;
|
||||
CVAR_FIXME */
|
||||
// yfov = (2.0 * tan (scr_fov->value/360*M_PI)) / screenaspect;
|
||||
/* // yfov = 2*atan((float)r_refdef.vrect.height/r_refdef.vrect.width)*(scr_fov.value*2)/M_PI;
|
||||
CVAR_FIXME */
|
||||
// yfov = 2*atan((float)r_refdef.vrect.height/r_refdef.vrect.width)*(scr_fov->value*2)/M_PI;
|
||||
// MYgluPerspective (yfov, screenaspect, 4, 4096);
|
||||
MYgluPerspective (r_refdef.fov_y, screenaspect, 4, 4096);
|
||||
|
||||
|
@ -956,7 +1036,9 @@ void R_SetupGL (void)
|
|||
//
|
||||
// set drawing parms
|
||||
//
|
||||
if (gl_cull.value)
|
||||
/* if (gl_cull.value)
|
||||
CVAR_FIXME */
|
||||
if (gl_cull->value)
|
||||
glEnable(GL_CULL_FACE);
|
||||
else
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
@ -1009,9 +1091,13 @@ R_Clear
|
|||
*/
|
||||
void R_Clear (void)
|
||||
{
|
||||
if (r_mirroralpha.value != 1.0)
|
||||
/* if (r_mirroralpha.value != 1.0)
|
||||
CVAR_FIXME */
|
||||
if (r_mirroralpha->value != 1.0)
|
||||
{
|
||||
if (gl_clear.value)
|
||||
/* if (gl_clear.value)
|
||||
CVAR_FIXME */
|
||||
if (gl_clear->value)
|
||||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
else
|
||||
glClear (GL_DEPTH_BUFFER_BIT);
|
||||
|
@ -1019,11 +1105,15 @@ void R_Clear (void)
|
|||
gldepthmax = 0.5;
|
||||
glDepthFunc (GL_LEQUAL);
|
||||
}
|
||||
else if (gl_ztrick.value)
|
||||
/* else if (gl_ztrick.value)
|
||||
CVAR_FIXME */
|
||||
else if (gl_ztrick->value)
|
||||
{
|
||||
static int trickframe;
|
||||
|
||||
if (gl_clear.value)
|
||||
/* if (gl_clear.value)
|
||||
CVAR_FIXME */
|
||||
if (gl_clear->value)
|
||||
glClear (GL_COLOR_BUFFER_BIT);
|
||||
|
||||
trickframe++;
|
||||
|
@ -1042,7 +1132,9 @@ void R_Clear (void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (gl_clear.value)
|
||||
/* if (gl_clear.value)
|
||||
CVAR_FIXME */
|
||||
if (gl_clear->value)
|
||||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
else
|
||||
glClear (GL_DEPTH_BUFFER_BIT);
|
||||
|
@ -1114,7 +1206,9 @@ void R_Mirror (void)
|
|||
|
||||
glLoadMatrixf (r_base_world_matrix);
|
||||
|
||||
glColor4f (1,1,1,r_mirroralpha.value);
|
||||
/* glColor4f (1,1,1,r_mirroralpha.value);
|
||||
CVAR_FIXME */
|
||||
glColor4f (1,1,1,r_mirroralpha->value);
|
||||
s = cl.worldmodel->textures[mirrortexturenum]->texturechain;
|
||||
for ( ; s ; s=s->texturechain)
|
||||
R_RenderBrushPoly (s);
|
||||
|
@ -1135,13 +1229,17 @@ void R_RenderView (void)
|
|||
{
|
||||
double time1 = 0, time2;
|
||||
|
||||
if (r_norefresh.value)
|
||||
/* if (r_norefresh.value)
|
||||
CVAR_FIXME */
|
||||
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)
|
||||
CVAR_FIXME */
|
||||
if (r_speeds->value)
|
||||
{
|
||||
glFinish ();
|
||||
time1 = Sys_DoubleTime ();
|
||||
|
@ -1151,7 +1249,9 @@ void R_RenderView (void)
|
|||
|
||||
mirror = false;
|
||||
|
||||
if (gl_finish.value)
|
||||
/* if (gl_finish.value)
|
||||
CVAR_FIXME */
|
||||
if (gl_finish->value)
|
||||
glFinish ();
|
||||
|
||||
R_Clear ();
|
||||
|
@ -1166,7 +1266,9 @@ void R_RenderView (void)
|
|||
|
||||
R_PolyBlend ();
|
||||
|
||||
if (r_speeds.value)
|
||||
/* if (r_speeds.value)
|
||||
CVAR_FIXME */
|
||||
if (r_speeds->value)
|
||||
{
|
||||
// glFinish ();
|
||||
time2 = Sys_DoubleTime ();
|
||||
|
|
|
@ -203,36 +203,84 @@ void R_Init (void)
|
|||
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);
|
||||
Cvar_RegisterVariable (&r_netgraph);
|
||||
/* Cvar_RegisterVariable (&r_norefresh);
|
||||
CVAR_FIXME */
|
||||
r_norefresh = Cvar_Get("r_norefresh", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_lightmap);
|
||||
CVAR_FIXME */
|
||||
r_lightmap = Cvar_Get("r_lightmap", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_fullbright);
|
||||
CVAR_FIXME */
|
||||
r_fullbright = Cvar_Get("r_fullbright", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_drawentities);
|
||||
CVAR_FIXME */
|
||||
r_drawentities = Cvar_Get("r_drawentities", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_drawviewmodel);
|
||||
CVAR_FIXME */
|
||||
r_drawviewmodel = Cvar_Get("r_drawviewmodel", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_shadows);
|
||||
CVAR_FIXME */
|
||||
r_shadows = Cvar_Get("r_shadows", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_mirroralpha);
|
||||
CVAR_FIXME */
|
||||
r_mirroralpha = Cvar_Get("r_mirroralpha", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_wateralpha);
|
||||
CVAR_FIXME */
|
||||
r_wateralpha = Cvar_Get("r_wateralpha", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_dynamic);
|
||||
CVAR_FIXME */
|
||||
r_dynamic = Cvar_Get("r_dynamic", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_novis);
|
||||
CVAR_FIXME */
|
||||
r_novis = Cvar_Get("r_novis", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_speeds);
|
||||
CVAR_FIXME */
|
||||
r_speeds = Cvar_Get("r_speeds", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_netgraph);
|
||||
CVAR_FIXME */
|
||||
r_netgraph = Cvar_Get("r_netgraph", "0", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&gl_clear);
|
||||
Cvar_RegisterVariable (&gl_texsort);
|
||||
/* Cvar_RegisterVariable (&gl_clear);
|
||||
CVAR_FIXME */
|
||||
gl_clear = Cvar_Get("gl_clear", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_texsort);
|
||||
CVAR_FIXME */
|
||||
gl_texsort = Cvar_Get("gl_texsort", "1", CVAR_NONE, "None");
|
||||
|
||||
if (gl_mtexable)
|
||||
Cvar_SetValue ("gl_texsort", 0.0);
|
||||
gl_texsort->value = 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);
|
||||
Cvar_RegisterVariable (&gl_finish);
|
||||
/* Cvar_RegisterVariable (&gl_cull);
|
||||
CVAR_FIXME */
|
||||
gl_cull = Cvar_Get("gl_cull", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_smoothmodels);
|
||||
CVAR_FIXME */
|
||||
gl_smoothmodels = Cvar_Get("gl_smoothmodels", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_affinemodels);
|
||||
CVAR_FIXME */
|
||||
gl_affinemodels = Cvar_Get("gl_affinemodels", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_polyblend);
|
||||
CVAR_FIXME */
|
||||
gl_polyblend = Cvar_Get("gl_polyblend", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_flashblend);
|
||||
CVAR_FIXME */
|
||||
gl_flashblend = Cvar_Get("gl_flashblend", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_playermip);
|
||||
CVAR_FIXME */
|
||||
gl_playermip = Cvar_Get("gl_playermip", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_nocolors);
|
||||
CVAR_FIXME */
|
||||
gl_nocolors = Cvar_Get("gl_nocolors", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_finish);
|
||||
CVAR_FIXME */
|
||||
gl_finish = Cvar_Get("gl_finish", "0", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&gl_keeptjunctions);
|
||||
Cvar_RegisterVariable (&gl_reporttjunctions);
|
||||
/* Cvar_RegisterVariable (&gl_keeptjunctions);
|
||||
CVAR_FIXME */
|
||||
gl_keeptjunctions = Cvar_Get("gl_keeptjunctions", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_reporttjunctions);
|
||||
CVAR_FIXME */
|
||||
gl_reporttjunctions = Cvar_Get("gl_reporttjunctions", "0", CVAR_NONE, "None");
|
||||
|
||||
R_InitBubble();
|
||||
|
||||
|
@ -355,11 +403,19 @@ void R_TranslatePlayerSkin (int playernum)
|
|||
false, false, true);
|
||||
#endif
|
||||
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
scaled_width = gl_max_size->value < 512 ? gl_max_size->value : 512;
|
||||
/* scaled_height = gl_max_size->value < 256 ? gl_max_size.value : 256;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
scaled_width >>= (int)gl_playermip->value;
|
||||
/* scaled_height >>= (int)gl_playermip.value;
|
||||
CVAR_FIXME */
|
||||
scaled_height >>= (int)gl_playermip->value;
|
||||
|
||||
if (VID_Is8bit()) { // 8bit texture upload
|
||||
byte *out2;
|
||||
|
|
|
@ -185,7 +185,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (/* r_fullbright->value || */ !cl.worldmodel->lightdata)
|
||||
{
|
||||
for (i=0 ; i<size ; i++)
|
||||
blocklights[i] = 255*256;
|
||||
|
@ -706,10 +708,14 @@ void R_BlendLightmaps (void)
|
|||
glRect_t *theRect;
|
||||
|
||||
#if 0
|
||||
if (r_fullbright.value)
|
||||
/* if (r_fullbright.value)
|
||||
CVAR_FIXME */
|
||||
if (r_fullbright->value)
|
||||
return;
|
||||
#endif
|
||||
if (!gl_texsort.value)
|
||||
/* if (!gl_texsort.value)
|
||||
CVAR_FIXME */
|
||||
if (!gl_texsort->value)
|
||||
return;
|
||||
|
||||
glDepthMask (0); // don't bother writing Z
|
||||
|
@ -723,7 +729,9 @@ void R_BlendLightmaps (void)
|
|||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
||||
if (!r_lightmap.value)
|
||||
/* if (!r_lightmap.value)
|
||||
CVAR_FIXME */
|
||||
if (!r_lightmap->value)
|
||||
{
|
||||
glEnable (GL_BLEND);
|
||||
}
|
||||
|
@ -842,7 +850,9 @@ void R_RenderBrushPoly (msurface_t *fa)
|
|||
|| fa->cached_dlight) // dynamic previously
|
||||
{
|
||||
dynamic:
|
||||
if (r_dynamic.value)
|
||||
/* if (r_dynamic.value)
|
||||
CVAR_FIXME */
|
||||
if (r_dynamic->value)
|
||||
{
|
||||
lightmap_modified[fa->lightmaptexturenum] = true;
|
||||
theRect = &lightmap_rectchange[fa->lightmaptexturenum];
|
||||
|
@ -900,7 +910,9 @@ void R_RenderDynamicLightmaps (msurface_t *fa)
|
|||
|| fa->cached_dlight) // dynamic previously
|
||||
{
|
||||
dynamic:
|
||||
if (r_dynamic.value)
|
||||
/* if (r_dynamic.value)
|
||||
CVAR_FIXME */
|
||||
if (r_dynamic->value)
|
||||
{
|
||||
lightmap_modified[fa->lightmaptexturenum] = true;
|
||||
theRect = &lightmap_rectchange[fa->lightmaptexturenum];
|
||||
|
@ -953,7 +965,9 @@ void R_DrawWaterSurfaces (void)
|
|||
msurface_t *s;
|
||||
texture_t *t;
|
||||
|
||||
if (r_wateralpha.value == 1.0)
|
||||
/* if (r_wateralpha.value == 1.0)
|
||||
CVAR_FIXME */
|
||||
if (r_wateralpha->value == 1.0)
|
||||
return;
|
||||
|
||||
//
|
||||
|
@ -962,7 +976,9 @@ 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);
|
||||
CVAR_FIXME */
|
||||
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++)
|
||||
|
@ -1002,7 +1018,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (r_wateralpha->value == 1.0 && gl_texsort->value)
|
||||
return;
|
||||
|
||||
//
|
||||
|
@ -1011,13 +1029,19 @@ void R_DrawWaterSurfaces (void)
|
|||
|
||||
glLoadMatrixf (r_world_matrix);
|
||||
|
||||
if (r_wateralpha.value < 1.0) {
|
||||
/* if (r_wateralpha.value < 1.0) {
|
||||
CVAR_FIXME */
|
||||
if (r_wateralpha->value < 1.0) {
|
||||
glEnable (GL_BLEND);
|
||||
glColor4f (1,1,1,r_wateralpha.value);
|
||||
/* glColor4f (1,1,1,r_wateralpha.value);
|
||||
CVAR_FIXME */
|
||||
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) {
|
||||
CVAR_FIXME */
|
||||
if (!gl_texsort->value) {
|
||||
if (!waterchain)
|
||||
return;
|
||||
|
||||
|
@ -1052,7 +1076,9 @@ void R_DrawWaterSurfaces (void)
|
|||
|
||||
}
|
||||
|
||||
if (r_wateralpha.value < 1.0) {
|
||||
/* if (r_wateralpha.value < 1.0) {
|
||||
CVAR_FIXME */
|
||||
if (r_wateralpha->value < 1.0) {
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
|
||||
glColor4f (1,1,1,1);
|
||||
|
@ -1074,7 +1100,9 @@ void DrawTextureChains (void)
|
|||
msurface_t *s;
|
||||
texture_t *t;
|
||||
|
||||
if (!gl_texsort.value) {
|
||||
/* if (!gl_texsort.value) {
|
||||
CVAR_FIXME */
|
||||
if (!gl_texsort->value) {
|
||||
GL_DisableMultitexture();
|
||||
|
||||
if (skychain) {
|
||||
|
@ -1095,14 +1123,18 @@ 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)
|
||||
CVAR_FIXME */
|
||||
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)
|
||||
CVAR_FIXME */
|
||||
if ((s->flags & SURF_DRAWTURB) && r_wateralpha->value != 1.0)
|
||||
continue; // draw translucent water later
|
||||
for ( ; s ; s=s->texturechain)
|
||||
R_RenderBrushPoly (s);
|
||||
|
@ -1172,7 +1204,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (clmodel->firstmodelsurface != 0 && !gl_flashblend->value)
|
||||
{
|
||||
for (k=0 ; k<MAX_DLIGHTS ; k++)
|
||||
{
|
||||
|
@ -1204,7 +1238,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (gl_texsort->value)
|
||||
R_RenderBrushPoly (psurf);
|
||||
else
|
||||
R_DrawSequentialPoly (psurf);
|
||||
|
@ -1324,7 +1360,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (gl_texsort->value)
|
||||
{
|
||||
if (!mirror
|
||||
|| surf->texinfo->texture != cl.worldmodel->textures[mirrortexturenum])
|
||||
|
@ -1399,7 +1437,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (r_oldviewleaf == r_viewleaf && !r_novis->value)
|
||||
return;
|
||||
|
||||
if (mirror)
|
||||
|
@ -1408,7 +1448,9 @@ void R_MarkLeaves (void)
|
|||
r_visframecount++;
|
||||
r_oldviewleaf = r_viewleaf;
|
||||
|
||||
if (r_novis.value)
|
||||
/* if (r_novis.value)
|
||||
CVAR_FIXME */
|
||||
if (r_novis->value)
|
||||
{
|
||||
vis = solid;
|
||||
memset (solid, 0xff, (cl.worldmodel->numleafs+7)>>3);
|
||||
|
@ -1564,7 +1606,9 @@ 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) )
|
||||
CVAR_FIXME */
|
||||
if (!gl_keeptjunctions->value && !(fa->flags & SURF_UNDERWATER) )
|
||||
{
|
||||
for (i = 0 ; i < lnumverts ; ++i)
|
||||
{
|
||||
|
@ -1699,7 +1743,9 @@ void GL_BuildLightmaps (void)
|
|||
}
|
||||
}
|
||||
|
||||
if (!gl_texsort.value)
|
||||
/* if (!gl_texsort.value)
|
||||
CVAR_FIXME */
|
||||
if (!gl_texsort->value)
|
||||
GL_SelectTexture(TEXTURE1_SGIS);
|
||||
|
||||
//
|
||||
|
@ -1722,7 +1768,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (!gl_texsort->value)
|
||||
GL_SelectTexture(TEXTURE0_SGIS);
|
||||
|
||||
}
|
||||
|
|
|
@ -124,17 +124,39 @@ 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_allowsnap = {"scr_allowsnap", "1"};
|
||||
cvar_t gl_triplebuffer = {"gl_triplebuffer", "1", true };
|
||||
extern cvar_t crosshair;
|
||||
/* cvar_t scr_viewsize = {"viewsize","100", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_viewsize;
|
||||
/* cvar_t scr_fov = {"fov","90"}; // 10 - 170
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_fov; // 10 - 170
|
||||
/* cvar_t scr_conspeed = {"scr_conspeed","300"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_conspeed;
|
||||
/* cvar_t scr_centertime = {"scr_centertime","2"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_centertime;
|
||||
/* cvar_t scr_showram = {"showram","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_showram;
|
||||
/* cvar_t scr_showturtle = {"showturtle","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_showturtle;
|
||||
/* cvar_t scr_showpause = {"showpause","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_showpause;
|
||||
/* cvar_t scr_printspeed = {"scr_printspeed","8"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_printspeed;
|
||||
/* cvar_t scr_allowsnap = {"scr_allowsnap", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_allowsnap;
|
||||
/* cvar_t gl_triplebuffer = {"gl_triplebuffer", "1", true };
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_triplebuffer;
|
||||
/* extern cvar_t crosshair;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *crosshair;
|
||||
|
||||
qboolean scr_initialized; // ready to draw
|
||||
|
||||
|
@ -188,7 +210,9 @@ 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;
|
||||
CVAR_FIXME */
|
||||
scr_centertime_off = scr_centertime->value;
|
||||
scr_centertime_start = cl.time;
|
||||
|
||||
// count the number of lines for centering
|
||||
|
@ -212,7 +236,9 @@ 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);
|
||||
CVAR_FIXME */
|
||||
remaining = scr_printspeed->value * (cl.time - scr_centertime_start);
|
||||
else
|
||||
remaining = 9999;
|
||||
|
||||
|
@ -313,22 +339,32 @@ static void SCR_CalcRefdef (void)
|
|||
//========================================
|
||||
|
||||
// bound viewsize
|
||||
if (scr_viewsize.value < 30)
|
||||
/* if (scr_viewsize.value < 30)
|
||||
CVAR_FIXME */
|
||||
if (scr_viewsize->value < 30)
|
||||
Cvar_Set ("viewsize","30");
|
||||
if (scr_viewsize.value > 120)
|
||||
/* if (scr_viewsize.value > 120)
|
||||
CVAR_FIXME */
|
||||
if (scr_viewsize->value > 120)
|
||||
Cvar_Set ("viewsize","120");
|
||||
|
||||
// bound field of view
|
||||
if (scr_fov.value < 10)
|
||||
/* if (scr_fov.value < 10)
|
||||
CVAR_FIXME */
|
||||
if (scr_fov->value < 10)
|
||||
Cvar_Set ("fov","10");
|
||||
if (scr_fov.value > 170)
|
||||
/* if (scr_fov.value > 170)
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
size = scr_viewsize->value;
|
||||
|
||||
if (size >= 120)
|
||||
sb_lines = 0; // no status bar at all
|
||||
|
@ -337,11 +373,15 @@ static void SCR_CalcRefdef (void)
|
|||
else
|
||||
sb_lines = 24+16+8;
|
||||
|
||||
if (scr_viewsize.value >= 100.0) {
|
||||
/* if (scr_viewsize.value >= 100.0) {
|
||||
CVAR_FIXME */
|
||||
if (scr_viewsize->value >= 100.0) {
|
||||
full = true;
|
||||
size = 100.0;
|
||||
} else
|
||||
size = scr_viewsize.value;
|
||||
/* size = scr_viewsize.value;
|
||||
CVAR_FIXME */
|
||||
size = scr_viewsize->value;
|
||||
if (cl.intermission)
|
||||
{
|
||||
full = true;
|
||||
|
@ -350,7 +390,9 @@ static void SCR_CalcRefdef (void)
|
|||
}
|
||||
size /= 100.0;
|
||||
|
||||
if (!cl_sbar.value && full)
|
||||
/* if (!cl_sbar.value && full)
|
||||
CVAR_FIXME */
|
||||
if (!cl_sbar->value && full)
|
||||
h = vid.height;
|
||||
else
|
||||
h = vid.height - sb_lines;
|
||||
|
@ -363,7 +405,9 @@ static void SCR_CalcRefdef (void)
|
|||
}
|
||||
|
||||
r_refdef.vrect.height = vid.height * size;
|
||||
if (cl_sbar.value || !full) {
|
||||
/* if (cl_sbar.value || !full) {
|
||||
CVAR_FIXME */
|
||||
if (cl_sbar->value || !full) {
|
||||
if (r_refdef.vrect.height > vid.height - sb_lines)
|
||||
r_refdef.vrect.height = vid.height - sb_lines;
|
||||
} else if (r_refdef.vrect.height > vid.height)
|
||||
|
@ -374,7 +418,9 @@ 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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
|
@ -390,7 +436,10 @@ Keybinding command
|
|||
*/
|
||||
void SCR_SizeUp_f (void)
|
||||
{
|
||||
Cvar_SetValue ("viewsize",scr_viewsize.value+10);
|
||||
/* Cvar_SetValue ("viewsize",scr_viewsize.value+10);
|
||||
CVAR_FIXME */
|
||||
scr_viewsize->value = scr_viewsize->value+10;
|
||||
|
||||
vid.recalc_refdef = 1;
|
||||
}
|
||||
|
||||
|
@ -404,7 +453,9 @@ Keybinding command
|
|||
*/
|
||||
void SCR_SizeDown_f (void)
|
||||
{
|
||||
Cvar_SetValue ("viewsize",scr_viewsize.value-10);
|
||||
/* Cvar_SetValue ("viewsize",scr_viewsize.value-10);
|
||||
CVAR_FIXME */
|
||||
scr_viewsize->value = scr_viewsize->value-10;
|
||||
vid.recalc_refdef = 1;
|
||||
}
|
||||
|
||||
|
@ -417,16 +468,36 @@ 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 (&scr_allowsnap);
|
||||
Cvar_RegisterVariable (&gl_triplebuffer);
|
||||
/* Cvar_RegisterVariable (&scr_fov);
|
||||
CVAR_FIXME */
|
||||
scr_fov = Cvar_Get("fov", "90", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_viewsize);
|
||||
CVAR_FIXME */
|
||||
scr_viewsize = Cvar_Get("viewsize", "100", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_conspeed);
|
||||
CVAR_FIXME */
|
||||
scr_conspeed = Cvar_Get("scr_conspeed", "300", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_showram);
|
||||
CVAR_FIXME */
|
||||
scr_showram = Cvar_Get("showram", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_showturtle);
|
||||
CVAR_FIXME */
|
||||
scr_showturtle = Cvar_Get("showturtle", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_showpause);
|
||||
CVAR_FIXME */
|
||||
scr_showpause = Cvar_Get("showpause", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_centertime);
|
||||
CVAR_FIXME */
|
||||
scr_centertime = Cvar_Get("scr_centertime", "2", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_printspeed);
|
||||
CVAR_FIXME */
|
||||
scr_printspeed = Cvar_Get("scr_printspeed", "8", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_allowsnap);
|
||||
CVAR_FIXME */
|
||||
scr_allowsnap = Cvar_Get("scr_allowsnap", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_triplebuffer);
|
||||
CVAR_FIXME */
|
||||
gl_triplebuffer = Cvar_Get("gl_triplebuffer", "1", CVAR_NONE, "None");
|
||||
|
||||
//
|
||||
// register our commands
|
||||
|
@ -452,7 +523,9 @@ SCR_DrawRam
|
|||
*/
|
||||
void SCR_DrawRam (void)
|
||||
{
|
||||
if (!scr_showram.value)
|
||||
/* if (!scr_showram.value)
|
||||
CVAR_FIXME */
|
||||
if (!scr_showram->value)
|
||||
return;
|
||||
|
||||
if (!r_cache_thrash)
|
||||
|
@ -470,7 +543,9 @@ void SCR_DrawTurtle (void)
|
|||
{
|
||||
static int count;
|
||||
|
||||
if (!scr_showturtle.value)
|
||||
/* if (!scr_showturtle.value)
|
||||
CVAR_FIXME */
|
||||
if (!scr_showturtle->value)
|
||||
return;
|
||||
|
||||
if (host_frametime < 0.1)
|
||||
|
@ -503,7 +578,9 @@ void SCR_DrawNet (void)
|
|||
|
||||
void SCR_DrawFPS (void)
|
||||
{
|
||||
extern cvar_t show_fps;
|
||||
/* extern cvar_t show_fps;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *show_fps;
|
||||
static double lastframetime;
|
||||
double t;
|
||||
extern int fps_count;
|
||||
|
@ -511,7 +588,9 @@ void SCR_DrawFPS (void)
|
|||
int x, y;
|
||||
char st[80];
|
||||
|
||||
if (!show_fps.value)
|
||||
/* if (!show_fps.value)
|
||||
CVAR_FIXME */
|
||||
if (!show_fps->value)
|
||||
return;
|
||||
|
||||
t = Sys_DoubleTime();
|
||||
|
@ -538,7 +617,9 @@ void SCR_DrawPause (void)
|
|||
{
|
||||
qpic_t *pic;
|
||||
|
||||
if (!scr_showpause.value) // turn off for screenshots
|
||||
/* if (!scr_showpause.value) // turn off for screenshots
|
||||
CVAR_FIXME */
|
||||
if (!scr_showpause->value) // turn off for screenshots
|
||||
return;
|
||||
|
||||
if (!cl.paused)
|
||||
|
@ -598,14 +679,18 @@ 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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
scr_con_current += scr_conspeed->value*host_frametime;
|
||||
if (scr_conlines < scr_con_current)
|
||||
scr_con_current = scr_conlines;
|
||||
}
|
||||
|
@ -978,7 +1063,7 @@ void SCR_RSShot_f (void)
|
|||
st[sizeof(st) - 1] = 0;
|
||||
SCR_DrawStringToSnap (st, newbuf, w - strlen(st)*8, h - 11, w);
|
||||
|
||||
strncpy(st, name.string, sizeof(st));
|
||||
strncpy(st, name->string, sizeof(st));
|
||||
st[sizeof(st) - 1] = 0;
|
||||
SCR_DrawStringToSnap (st, newbuf, w - strlen(st)*8, h - 21, w);
|
||||
|
||||
|
@ -1129,7 +1214,9 @@ void SCR_UpdateScreen (void)
|
|||
if (block_drawing)
|
||||
return;
|
||||
|
||||
vid.numpages = 2 + gl_triplebuffer.value;
|
||||
/* vid.numpages = 2 + gl_triplebuffer.value;
|
||||
CVAR_FIXME */
|
||||
vid.numpages = 2 + gl_triplebuffer->value;
|
||||
|
||||
scr_copytop = 0;
|
||||
scr_copyeverything = 0;
|
||||
|
@ -1149,8 +1236,12 @@ void SCR_UpdateScreen (void)
|
|||
return; // not initialized yet
|
||||
|
||||
|
||||
if (oldsbar != cl_sbar.value) {
|
||||
oldsbar = cl_sbar.value;
|
||||
/* if (oldsbar != cl_sbar.value) {
|
||||
CVAR_FIXME */
|
||||
if (oldsbar != cl_sbar->value) {
|
||||
/* oldsbar = cl_sbar.value;
|
||||
CVAR_FIXME */
|
||||
oldsbar = cl_sbar->value;
|
||||
vid.recalc_refdef = true;
|
||||
}
|
||||
|
||||
|
@ -1159,9 +1250,13 @@ void SCR_UpdateScreen (void)
|
|||
//
|
||||
// determine size of refresh window
|
||||
//
|
||||
if (oldfov != scr_fov.value)
|
||||
/* if (oldfov != scr_fov.value)
|
||||
CVAR_FIXME */
|
||||
if (oldfov != scr_fov->value)
|
||||
{
|
||||
oldfov = scr_fov.value;
|
||||
/* oldfov = scr_fov.value;
|
||||
CVAR_FIXME */
|
||||
oldfov = scr_fov->value;
|
||||
vid.recalc_refdef = true;
|
||||
}
|
||||
|
||||
|
@ -1182,7 +1277,9 @@ void SCR_UpdateScreen (void)
|
|||
//
|
||||
SCR_TileClear ();
|
||||
|
||||
if (r_netgraph.value)
|
||||
/* if (r_netgraph.value)
|
||||
CVAR_FIXME */
|
||||
if (r_netgraph->value)
|
||||
R_NetGraph ();
|
||||
|
||||
if (scr_drawdialog)
|
||||
|
@ -1208,7 +1305,9 @@ void SCR_UpdateScreen (void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (crosshair.value)
|
||||
/* if (crosshair.value)
|
||||
CVAR_FIXME */
|
||||
if (crosshair->value)
|
||||
Draw_Crosshair();
|
||||
|
||||
SCR_DrawRam ();
|
||||
|
|
|
@ -81,11 +81,19 @@ int UseKeyboard = 1;
|
|||
|
||||
int mouserate = MOUSE_DEFAULTSAMPLERATE;
|
||||
|
||||
cvar_t _windowed_mouse = {"_windowed_mouse","0", true};
|
||||
/* cvar_t _windowed_mouse = {"_windowed_mouse","0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *_windowed_mouse;
|
||||
|
||||
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 = {"vid_mode","5",false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_mode;
|
||||
/* cvar_t vid_redrawfull = {"vid_redrawfull","0",false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_redrawfull;
|
||||
/* cvar_t vid_waitforrefresh = {"vid_waitforrefresh","0",true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_waitforrefresh;
|
||||
|
||||
char *framebuffer_ptr;
|
||||
|
||||
|
@ -103,7 +111,9 @@ 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 = {"m_filter","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *m_filter;
|
||||
|
||||
int scr_width, scr_height;
|
||||
|
||||
|
@ -120,7 +130,9 @@ int texture_extension_number = 1;
|
|||
|
||||
float gldepthmin, gldepthmax;
|
||||
|
||||
cvar_t gl_ztrick = {"gl_ztrick","1"};
|
||||
/* cvar_t gl_ztrick = {"gl_ztrick","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_ztrick;
|
||||
|
||||
const char *gl_vendor;
|
||||
const char *gl_renderer;
|
||||
|
@ -343,7 +355,9 @@ GL_BeginRendering
|
|||
*/
|
||||
void GL_BeginRendering (int *x, int *y, int *width, int *height)
|
||||
{
|
||||
extern cvar_t gl_clear;
|
||||
/* extern cvar_t gl_clear;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_clear;
|
||||
|
||||
*x = *y = 0;
|
||||
*width = scr_width;
|
||||
|
@ -572,10 +586,18 @@ void VID_Init(unsigned char *palette)
|
|||
|
||||
Init_KBD();
|
||||
|
||||
Cvar_RegisterVariable (&vid_mode);
|
||||
Cvar_RegisterVariable (&vid_redrawfull);
|
||||
Cvar_RegisterVariable (&vid_waitforrefresh);
|
||||
Cvar_RegisterVariable (&gl_ztrick);
|
||||
/* Cvar_RegisterVariable (&vid_mode);
|
||||
CVAR_FIXME */
|
||||
vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_redrawfull);
|
||||
CVAR_FIXME */
|
||||
vid_redrawfull = Cvar_Get("vid_redrawfull", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_waitforrefresh);
|
||||
CVAR_FIXME */
|
||||
vid_waitforrefresh = Cvar_Get("vid_waitforrefresh", "0", CVAR_NONE|CVAR_ARCHIVE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_ztrick);
|
||||
CVAR_FIXME */
|
||||
gl_ztrick = Cvar_Get("gl_ztrick", "1", CVAR_NONE, "None");
|
||||
|
||||
vid.maxwarpwidth = WARP_WIDTH;
|
||||
vid.maxwarpheight = WARP_HEIGHT;
|
||||
|
@ -772,7 +794,9 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
while (mouse_update())
|
||||
;
|
||||
|
||||
if (m_filter.value)
|
||||
/* if (m_filter.value)
|
||||
CVAR_FIXME */
|
||||
if (m_filter->value)
|
||||
{
|
||||
mouse_x = (mx + old_mouse_x) * 0.5;
|
||||
mouse_y = (my + old_mouse_y) * 0.5;
|
||||
|
@ -786,21 +810,33 @@ 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;
|
||||
CVAR_FIXME */
|
||||
mouse_x *= sensitivity->value;
|
||||
/* mouse_y *= sensitivity.value;
|
||||
CVAR_FIXME */
|
||||
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) ))
|
||||
CVAR_FIXME */
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
/* cmd->sidemove += m_side.value * mouse_x;
|
||||
CVAR_FIXME */
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
/* cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70)
|
||||
|
@ -809,9 +845,13 @@ 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;
|
||||
CVAR_FIXME */
|
||||
cmd->upmove -= m_forward->value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
/* cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
CVAR_FIXME */
|
||||
cmd->forwardmove -= m_forward->value * mouse_y;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -81,9 +81,15 @@ 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 = {"vid_mode","5",false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_mode;
|
||||
/* cvar_t vid_redrawfull = {"vid_redrawfull","0",false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_redrawfull;
|
||||
/* cvar_t vid_waitforrefresh = {"vid_waitforrefresh","0",true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_waitforrefresh;
|
||||
|
||||
char *framebuffer_ptr;
|
||||
|
||||
|
@ -101,8 +107,12 @@ float mouse_x, mouse_y;
|
|||
float old_mouse_x, old_mouse_y;
|
||||
int mx, my;
|
||||
|
||||
cvar_t _windowed_mouse = {"_windowed_mouse", "1", true};
|
||||
cvar_t m_filter = {"m_filter","0"};
|
||||
/* cvar_t _windowed_mouse = {"_windowed_mouse", "1", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *_windowed_mouse;
|
||||
/* cvar_t m_filter = {"m_filter","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *m_filter;
|
||||
|
||||
int scr_width, scr_height;
|
||||
|
||||
|
@ -119,7 +129,9 @@ int texture_extension_number = 1;
|
|||
|
||||
float gldepthmin, gldepthmax;
|
||||
|
||||
cvar_t gl_ztrick = {"gl_ztrick","1"};
|
||||
/* cvar_t gl_ztrick = {"gl_ztrick","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_ztrick;
|
||||
|
||||
const char *gl_vendor;
|
||||
const char *gl_renderer;
|
||||
|
@ -373,7 +385,9 @@ GL_BeginRendering
|
|||
*/
|
||||
void GL_BeginRendering (int *x, int *y, int *width, int *height)
|
||||
{
|
||||
extern cvar_t gl_clear;
|
||||
/* extern cvar_t gl_clear;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_clear;
|
||||
|
||||
*x = *y = 0;
|
||||
*width = scr_width;
|
||||
|
@ -610,10 +624,18 @@ void VID_Init(unsigned char *palette)
|
|||
|
||||
Init_KBD();
|
||||
|
||||
Cvar_RegisterVariable (&vid_mode);
|
||||
Cvar_RegisterVariable (&vid_redrawfull);
|
||||
Cvar_RegisterVariable (&vid_waitforrefresh);
|
||||
Cvar_RegisterVariable (&gl_ztrick);
|
||||
/* Cvar_RegisterVariable (&vid_mode);
|
||||
CVAR_FIXME */
|
||||
vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_redrawfull);
|
||||
CVAR_FIXME */
|
||||
vid_redrawfull = Cvar_Get("vid_redrawfull", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_waitforrefresh);
|
||||
CVAR_FIXME */
|
||||
vid_waitforrefresh = Cvar_Get("vid_waitforrefresh", "0", CVAR_NONE|CVAR_ARCHIVE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_ztrick);
|
||||
CVAR_FIXME */
|
||||
gl_ztrick = Cvar_Get("gl_ztrick", "1", CVAR_NONE, "None");
|
||||
|
||||
vid.maxwarpwidth = WARP_WIDTH;
|
||||
vid.maxwarpheight = WARP_HEIGHT;
|
||||
|
@ -810,7 +832,9 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
while (mouse_update())
|
||||
;
|
||||
|
||||
if (m_filter.value)
|
||||
/* if (m_filter.value)
|
||||
CVAR_FIXME */
|
||||
if (m_filter->value)
|
||||
{
|
||||
mouse_x = (mx + old_mouse_x) * 0.5;
|
||||
mouse_y = (my + old_mouse_y) * 0.5;
|
||||
|
@ -824,21 +848,33 @@ 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;
|
||||
CVAR_FIXME */
|
||||
mouse_x *= sensitivity->value;
|
||||
/* mouse_y *= sensitivity.value;
|
||||
CVAR_FIXME */
|
||||
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) ))
|
||||
CVAR_FIXME */
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
/* cmd->sidemove += m_side.value * mouse_x;
|
||||
CVAR_FIXME */
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
/* cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70)
|
||||
|
@ -847,9 +883,13 @@ 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;
|
||||
CVAR_FIXME */
|
||||
cmd->upmove -= m_forward->value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
/* cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
CVAR_FIXME */
|
||||
cmd->forwardmove -= m_forward->value * mouse_y;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,9 @@ static qboolean usedga = false;
|
|||
|
||||
#define stringify(m) { #m, m }
|
||||
|
||||
cvar_t vid_mode = {"vid_mode","0",false};
|
||||
/* cvar_t vid_mode = {"vid_mode","0",false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_mode;
|
||||
|
||||
cvar_t mouse_button_commands[3] =
|
||||
{
|
||||
|
@ -77,8 +79,12 @@ static float mouse_x, mouse_y;
|
|||
static float p_mouse_x, p_mouse_y;
|
||||
static float old_mouse_x, old_mouse_y;
|
||||
|
||||
cvar_t _windowed_mouse = {"_windowed_mouse", "1", true};
|
||||
cvar_t m_filter = {"m_filter","0"};
|
||||
/* cvar_t _windowed_mouse = {"_windowed_mouse", "1", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *_windowed_mouse;
|
||||
/* cvar_t m_filter = {"m_filter","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *m_filter;
|
||||
static float old_windowed_mouse;
|
||||
|
||||
static int scr_width, scr_height;
|
||||
|
@ -100,7 +106,9 @@ int texture_extension_number = 1;
|
|||
|
||||
float gldepthmin, gldepthmax;
|
||||
|
||||
cvar_t gl_ztrick = {"gl_ztrick","1"};
|
||||
/* cvar_t gl_ztrick = {"gl_ztrick","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_ztrick;
|
||||
|
||||
const char *gl_vendor;
|
||||
const char *gl_renderer;
|
||||
|
@ -349,7 +357,9 @@ qboolean Mouse_Update(void)
|
|||
if (usedga) {
|
||||
mouse_x += x_event.xmotion.x_root;
|
||||
mouse_y += x_event.xmotion.y_root;
|
||||
} else if (_windowed_mouse.value) {
|
||||
/* } else if (_windowed_mouse.value) {
|
||||
CVAR_FIXME */
|
||||
} else if (_windowed_mouse->value) {
|
||||
mouse_x += (float) ((int)x_event.xmotion.x - (int)(scr_width/2));
|
||||
mouse_y += (float) ((int)x_event.xmotion.y - (int)(scr_height/2));
|
||||
|
||||
|
@ -390,10 +400,16 @@ qboolean Mouse_Update(void)
|
|||
break;
|
||||
}
|
||||
|
||||
if (old_windowed_mouse != _windowed_mouse.value) {
|
||||
old_windowed_mouse = _windowed_mouse.value;
|
||||
/* if (old_windowed_mouse != _windowed_mouse.value) {
|
||||
CVAR_FIXME */
|
||||
if (old_windowed_mouse != _windowed_mouse->value) {
|
||||
/* old_windowed_mouse = _windowed_mouse.value;
|
||||
CVAR_FIXME */
|
||||
old_windowed_mouse = _windowed_mouse->value;
|
||||
|
||||
if (!_windowed_mouse.value) {
|
||||
/* if (!_windowed_mouse.value) {
|
||||
CVAR_FIXME */
|
||||
if (!_windowed_mouse->value) {
|
||||
/* ungrab the pointer */
|
||||
Con_Printf("Releasing mouse.\n");
|
||||
|
||||
|
@ -567,7 +583,9 @@ GL_BeginRendering
|
|||
*/
|
||||
void GL_BeginRendering (int *x, int *y, int *width, int *height)
|
||||
{
|
||||
extern cvar_t gl_clear;
|
||||
/* extern cvar_t gl_clear;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_clear;
|
||||
|
||||
*x = *y = 0;
|
||||
*width = scr_width;
|
||||
|
@ -665,8 +683,12 @@ void VID_Init(unsigned char *palette)
|
|||
|
||||
// S_Init();
|
||||
|
||||
Cvar_RegisterVariable (&vid_mode);
|
||||
Cvar_RegisterVariable (&gl_ztrick);
|
||||
/* Cvar_RegisterVariable (&vid_mode);
|
||||
CVAR_FIXME */
|
||||
vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_ztrick);
|
||||
CVAR_FIXME */
|
||||
gl_ztrick = Cvar_Get("gl_ztrick", "1", CVAR_NONE, "None");
|
||||
|
||||
vid.maxwarpwidth = WARP_WIDTH;
|
||||
vid.maxwarpheight = WARP_HEIGHT;
|
||||
|
@ -798,8 +820,12 @@ void Force_CenterView_f (void)
|
|||
|
||||
void IN_Init(void)
|
||||
{
|
||||
Cvar_RegisterVariable (&_windowed_mouse);
|
||||
Cvar_RegisterVariable (&m_filter);
|
||||
/* Cvar_RegisterVariable (&_windowed_mouse);
|
||||
CVAR_FIXME */
|
||||
_windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&m_filter);
|
||||
CVAR_FIXME */
|
||||
m_filter = Cvar_Get("m_filter", "0", CVAR_NONE, "None");
|
||||
Cvar_RegisterVariable (&mouse_button_commands[0]);
|
||||
Cvar_RegisterVariable (&mouse_button_commands[1]);
|
||||
Cvar_RegisterVariable (&mouse_button_commands[2]);
|
||||
|
@ -840,7 +866,9 @@ void IN_Move (usercmd_t *cmd)
|
|||
while (Mouse_Update())
|
||||
;
|
||||
|
||||
if (m_filter.value) {
|
||||
/* if (m_filter.value) {
|
||||
CVAR_FIXME */
|
||||
if (m_filter->value) {
|
||||
mouse_x = (mouse_x + old_mouse_x) * 0.5;
|
||||
mouse_y = (mouse_y + old_mouse_y) * 0.5;
|
||||
}
|
||||
|
@ -848,27 +876,43 @@ 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;
|
||||
CVAR_FIXME */
|
||||
mouse_x *= sensitivity->value;
|
||||
/* mouse_y *= sensitivity.value;
|
||||
CVAR_FIXME */
|
||||
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) ))
|
||||
CVAR_FIXME */
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
/* cmd->sidemove += m_side.value * mouse_x;
|
||||
CVAR_FIXME */
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
/* cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
cmd->upmove -= m_forward->value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
/* cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
CVAR_FIXME */
|
||||
cmd->forwardmove -= m_forward->value * mouse_y;
|
||||
}
|
||||
mouse_x = mouse_y = 0.0;
|
||||
}
|
||||
|
|
|
@ -113,7 +113,9 @@ HDC maindc;
|
|||
|
||||
glvert_t glv;
|
||||
|
||||
cvar_t gl_ztrick = {"gl_ztrick","1"};
|
||||
/* cvar_t gl_ztrick = {"gl_ztrick","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_ztrick;
|
||||
|
||||
HWND WINAPI InitializeWindow (HINSTANCE hInstance, int nCmdShow);
|
||||
|
||||
|
@ -150,18 +152,38 @@ qboolean gl_mtexable = false;
|
|||
|
||||
//====================================
|
||||
|
||||
cvar_t vid_mode = {"vid_mode","0", false};
|
||||
/* cvar_t vid_mode = {"vid_mode","0", false};
|
||||
CVAR_FIXME */
|
||||
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 = {"_vid_default_mode","0", true};
|
||||
CVAR_FIXME */
|
||||
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 = {"_vid_default_mode_win","3", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *_vid_default_mode_win;
|
||||
/* cvar_t vid_wait = {"vid_wait","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_wait;
|
||||
/* cvar_t vid_nopageflip = {"vid_nopageflip","0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_nopageflip;
|
||||
/* cvar_t _vid_wait_override = {"_vid_wait_override", "0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *_vid_wait_override;
|
||||
/* cvar_t vid_config_x = {"vid_config_x","800", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_config_x;
|
||||
/* cvar_t vid_config_y = {"vid_config_y","600", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_config_y;
|
||||
/* cvar_t vid_stretch_by_2 = {"vid_stretch_by_2","1", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_stretch_by_2;
|
||||
/* cvar_t _windowed_mouse = {"_windowed_mouse","1", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *_windowed_mouse;
|
||||
|
||||
int window_center_x, window_center_y, window_x, window_y, window_width, window_height;
|
||||
RECT window_rect;
|
||||
|
@ -408,7 +430,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (_windowed_mouse->value && key_dest == key_game)
|
||||
{
|
||||
stat = VID_SetWindowedMode(modenum);
|
||||
IN_ActivateMouse ();
|
||||
|
@ -668,7 +692,9 @@ GL_BeginRendering
|
|||
*/
|
||||
void GL_BeginRendering (int *x, int *y, int *width, int *height)
|
||||
{
|
||||
extern cvar_t gl_clear;
|
||||
/* extern cvar_t gl_clear;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_clear;
|
||||
|
||||
*x = *y = 0;
|
||||
*width = WindowRect.right - WindowRect.left;
|
||||
|
@ -689,7 +715,9 @@ 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) {
|
||||
CVAR_FIXME */
|
||||
if (!_windowed_mouse->value) {
|
||||
if (windowed_mouse) {
|
||||
IN_DeactivateMouse ();
|
||||
IN_ShowMouse ();
|
||||
|
@ -995,7 +1023,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
else if ((modestate == MS_WINDOWED) && _windowed_mouse->value && key_dest == key_game)
|
||||
{
|
||||
IN_ActivateMouse ();
|
||||
IN_HideMouse ();
|
||||
|
@ -1013,7 +1043,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
else if ((modestate == MS_WINDOWED) && _windowed_mouse->value)
|
||||
{
|
||||
IN_DeactivateMouse ();
|
||||
IN_ShowMouse ();
|
||||
|
@ -1591,17 +1623,39 @@ 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);
|
||||
/* Cvar_RegisterVariable (&vid_mode);
|
||||
CVAR_FIXME */
|
||||
vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_wait);
|
||||
CVAR_FIXME */
|
||||
vid_wait = Cvar_Get("vid_wait", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_nopageflip);
|
||||
CVAR_FIXME */
|
||||
vid_nopageflip = Cvar_Get("vid_nopageflip", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&_vid_wait_override);
|
||||
CVAR_FIXME */
|
||||
_vid_wait_override = Cvar_Get("_vid_wait_override", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&_vid_default_mode);
|
||||
CVAR_FIXME */
|
||||
_vid_default_mode = Cvar_Get("_vid_default_mode", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&_vid_default_mode_win);
|
||||
CVAR_FIXME */
|
||||
_vid_default_mode_win = Cvar_Get("_vid_default_mode_win", "3", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_config_x);
|
||||
CVAR_FIXME */
|
||||
vid_config_x = Cvar_Get("vid_config_x", "800", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_config_y);
|
||||
CVAR_FIXME */
|
||||
vid_config_y = Cvar_Get("vid_config_y", "600", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_stretch_by_2);
|
||||
CVAR_FIXME */
|
||||
vid_stretch_by_2 = Cvar_Get("vid_stretch_by_2", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&_windowed_mouse);
|
||||
CVAR_FIXME */
|
||||
_windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_ztrick);
|
||||
CVAR_FIXME */
|
||||
gl_ztrick = Cvar_Get("gl_ztrick", "1", CVAR_NONE, "None");
|
||||
|
||||
Cmd_AddCommand ("vid_nummodes", VID_NumModes_f);
|
||||
Cmd_AddCommand ("vid_describecurrentmode", VID_DescribeCurrentMode_f);
|
||||
|
|
|
@ -51,7 +51,9 @@ extern double host_frametime;
|
|||
extern int onground;
|
||||
extern byte gammatable[256];
|
||||
|
||||
cvar_t gl_cshiftpercent = {"gl_cshiftpercent", "100", false};
|
||||
/* cvar_t gl_cshiftpercent = {"gl_cshiftpercent", "100", false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_cshiftpercent;
|
||||
|
||||
byte ramps[3][256];
|
||||
float v_blend[4];
|
||||
|
@ -76,10 +78,14 @@ void V_CalcBlend (void)
|
|||
|
||||
for (j=0 ; j<NUM_CSHIFTS ; j++)
|
||||
{
|
||||
if (!gl_cshiftpercent.value)
|
||||
/* if (!gl_cshiftpercent.value)
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
a2 = ((cl.cshifts[j].percent * gl_cshiftpercent->value) / 100.0) / 255.0;
|
||||
|
||||
// a2 = (cl.cshifts[j].percent/2)/255.0;
|
||||
if (!a2)
|
||||
|
|
|
@ -62,7 +62,9 @@ float speedscale; // for top sky and bottom sky
|
|||
|
||||
msurface_t *warpface;
|
||||
|
||||
extern cvar_t gl_subdivide_size;
|
||||
/* extern cvar_t gl_subdivide_size;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *gl_subdivide_size;
|
||||
|
||||
void BoundPoly (int numverts, float *verts, vec3_t mins, vec3_t maxs)
|
||||
{
|
||||
|
@ -103,7 +105,9 @@ 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);
|
||||
CVAR_FIXME */
|
||||
m = gl_subdivide_size->value * floor (m/gl_subdivide_size->value + 0.5);
|
||||
if (maxs[i] - m < 8)
|
||||
continue;
|
||||
if (m - mins[i] < 8)
|
||||
|
|
320
source/in_win.c
320
source/in_win.c
|
@ -52,7 +52,9 @@ static int mouse_oldbuttonstate;
|
|||
static POINT current_pos;
|
||||
static float old_mouse_x, old_mouse_y, mx_accum, my_accum;
|
||||
static qboolean mouseinitialized;
|
||||
static cvar_t m_filter = {"m_filter","0"};
|
||||
/* static cvar_t m_filter = {"m_filter","0"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *m_filter;
|
||||
static qboolean restore_spi;
|
||||
static int originalmouseparms[3], newmouseparms[3] = {0, 0, 1};
|
||||
static qboolean mouseparmsvalid, mouseactivatetoggle;
|
||||
|
@ -92,25 +94,63 @@ static 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.
|
||||
static cvar_t in_joystick = {"joystick","0", true};
|
||||
static cvar_t joy_name = {"joyname", "joystick"};
|
||||
static cvar_t joy_advanced = {"joyadvanced", "0"};
|
||||
static cvar_t joy_advaxisx = {"joyadvaxisx", "0"};
|
||||
static cvar_t joy_advaxisy = {"joyadvaxisy", "0"};
|
||||
static cvar_t joy_advaxisz = {"joyadvaxisz", "0"};
|
||||
static cvar_t joy_advaxisr = {"joyadvaxisr", "0"};
|
||||
static cvar_t joy_advaxisu = {"joyadvaxisu", "0"};
|
||||
static cvar_t joy_advaxisv = {"joyadvaxisv", "0"};
|
||||
static cvar_t joy_forwardthreshold = {"joyforwardthreshold", "0.15"};
|
||||
static cvar_t joy_sidethreshold = {"joysidethreshold", "0.15"};
|
||||
static cvar_t joy_pitchthreshold = {"joypitchthreshold", "0.15"};
|
||||
static cvar_t joy_yawthreshold = {"joyyawthreshold", "0.15"};
|
||||
static cvar_t joy_forwardsensitivity = {"joyforwardsensitivity", "-1.0"};
|
||||
static cvar_t joy_sidesensitivity = {"joysidesensitivity", "-1.0"};
|
||||
static cvar_t joy_pitchsensitivity = {"joypitchsensitivity", "1.0"};
|
||||
static cvar_t joy_yawsensitivity = {"joyyawsensitivity", "-1.0"};
|
||||
static cvar_t joy_wwhack1 = {"joywwhack1", "0.0"};
|
||||
static cvar_t joy_wwhack2 = {"joywwhack2", "0.0"};
|
||||
/* static cvar_t in_joystick = {"joystick","0", true};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *in_joystick;
|
||||
/* static cvar_t joy_name = {"joyname", "joystick"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_name;
|
||||
/* static cvar_t joy_advanced = {"joyadvanced", "0"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_advanced;
|
||||
/* static cvar_t joy_advaxisx = {"joyadvaxisx", "0"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_advaxisx;
|
||||
/* static cvar_t joy_advaxisy = {"joyadvaxisy", "0"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_advaxisy;
|
||||
/* static cvar_t joy_advaxisz = {"joyadvaxisz", "0"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_advaxisz;
|
||||
/* static cvar_t joy_advaxisr = {"joyadvaxisr", "0"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_advaxisr;
|
||||
/* static cvar_t joy_advaxisu = {"joyadvaxisu", "0"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_advaxisu;
|
||||
/* static cvar_t joy_advaxisv = {"joyadvaxisv", "0"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_advaxisv;
|
||||
/* static cvar_t joy_forwardthreshold = {"joyforwardthreshold", "0.15"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_forwardthreshold;
|
||||
/* static cvar_t joy_sidethreshold = {"joysidethreshold", "0.15"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_sidethreshold;
|
||||
/* static cvar_t joy_pitchthreshold = {"joypitchthreshold", "0.15"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_pitchthreshold;
|
||||
/* static cvar_t joy_yawthreshold = {"joyyawthreshold", "0.15"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_yawthreshold;
|
||||
/* static cvar_t joy_forwardsensitivity = {"joyforwardsensitivity", "-1.0"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_forwardsensitivity;
|
||||
/* static cvar_t joy_sidesensitivity = {"joysidesensitivity", "-1.0"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_sidesensitivity;
|
||||
/* static cvar_t joy_pitchsensitivity = {"joypitchsensitivity", "1.0"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_pitchsensitivity;
|
||||
/* static cvar_t joy_yawsensitivity = {"joyyawsensitivity", "-1.0"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_yawsensitivity;
|
||||
/* static cvar_t joy_wwhack1 = {"joywwhack1", "0.0"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_wwhack1;
|
||||
/* static cvar_t joy_wwhack2 = {"joywwhack2", "0.0"};
|
||||
CVAR_FIXME */
|
||||
static cvar_t *joy_wwhack2;
|
||||
|
||||
static qboolean joy_avail, joy_advancedinit, joy_haspov;
|
||||
static DWORD joy_oldbuttonstate, joy_oldpovstate;
|
||||
|
@ -494,28 +534,68 @@ IN_Init
|
|||
void IN_Init (void)
|
||||
{
|
||||
// mouse variables
|
||||
Cvar_RegisterVariable (&m_filter);
|
||||
/* Cvar_RegisterVariable (&m_filter);
|
||||
CVAR_FIXME */
|
||||
m_filter = Cvar_Get("m_filter", "0", CVAR_NONE, "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);
|
||||
/* Cvar_RegisterVariable (&in_joystick);
|
||||
CVAR_FIXME */
|
||||
in_joystick = Cvar_Get("joystick", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_name);
|
||||
CVAR_FIXME */
|
||||
joy_name = Cvar_Get("joyname", "joystick", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_advanced);
|
||||
CVAR_FIXME */
|
||||
joy_advanced = Cvar_Get("joyadvanced", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_advaxisx);
|
||||
CVAR_FIXME */
|
||||
joy_advaxisx = Cvar_Get("joyadvaxisx", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_advaxisy);
|
||||
CVAR_FIXME */
|
||||
joy_advaxisy = Cvar_Get("joyadvaxisy", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_advaxisz);
|
||||
CVAR_FIXME */
|
||||
joy_advaxisz = Cvar_Get("joyadvaxisz", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_advaxisr);
|
||||
CVAR_FIXME */
|
||||
joy_advaxisr = Cvar_Get("joyadvaxisr", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_advaxisu);
|
||||
CVAR_FIXME */
|
||||
joy_advaxisu = Cvar_Get("joyadvaxisu", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_advaxisv);
|
||||
CVAR_FIXME */
|
||||
joy_advaxisv = Cvar_Get("joyadvaxisv", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_forwardthreshold);
|
||||
CVAR_FIXME */
|
||||
joy_forwardthreshold = Cvar_Get("joyforwardthreshold", "0.15", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_sidethreshold);
|
||||
CVAR_FIXME */
|
||||
joy_sidethreshold = Cvar_Get("joysidethreshold", "0.15", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_pitchthreshold);
|
||||
CVAR_FIXME */
|
||||
joy_pitchthreshold = Cvar_Get("joypitchthreshold", "0.15", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_yawthreshold);
|
||||
CVAR_FIXME */
|
||||
joy_yawthreshold = Cvar_Get("joyyawthreshold", "0.15", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_forwardsensitivity);
|
||||
CVAR_FIXME */
|
||||
joy_forwardsensitivity = Cvar_Get("joyforwardsensitivity", "-1.0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_sidesensitivity);
|
||||
CVAR_FIXME */
|
||||
joy_sidesensitivity = Cvar_Get("joysidesensitivity", "-1.0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_pitchsensitivity);
|
||||
CVAR_FIXME */
|
||||
joy_pitchsensitivity = Cvar_Get("joypitchsensitivity", "1.0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_yawsensitivity);
|
||||
CVAR_FIXME */
|
||||
joy_yawsensitivity = Cvar_Get("joyyawsensitivity", "-1.0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_wwhack1);
|
||||
CVAR_FIXME */
|
||||
joy_wwhack1 = Cvar_Get("joywwhack1", "0.0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&joy_wwhack2);
|
||||
CVAR_FIXME */
|
||||
joy_wwhack2 = Cvar_Get("joywwhack2", "0.0", CVAR_NONE, "None");
|
||||
|
||||
Cmd_AddCommand ("force_centerview", Force_CenterView_f);
|
||||
Cmd_AddCommand ("joyadvancedupdate", Joy_AdvancedUpdate_f);
|
||||
|
@ -687,7 +767,9 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
my_accum = 0;
|
||||
}
|
||||
|
||||
if (m_filter.value)
|
||||
/* if (m_filter.value)
|
||||
CVAR_FIXME */
|
||||
if (m_filter->value)
|
||||
{
|
||||
mouse_x = (mx + old_mouse_x) * 0.5;
|
||||
mouse_y = (my + old_mouse_y) * 0.5;
|
||||
|
@ -701,21 +783,33 @@ 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;
|
||||
CVAR_FIXME */
|
||||
mouse_x *= sensitivity->value;
|
||||
/* mouse_y *= sensitivity.value;
|
||||
CVAR_FIXME */
|
||||
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) ))
|
||||
CVAR_FIXME */
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
/* cmd->sidemove += m_side.value * mouse_x;
|
||||
CVAR_FIXME */
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
/* cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70)
|
||||
|
@ -724,9 +818,13 @@ 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;
|
||||
CVAR_FIXME */
|
||||
cmd->upmove -= m_forward->value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
/* cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
CVAR_FIXME */
|
||||
cmd->forwardmove -= m_forward->value * mouse_y;
|
||||
}
|
||||
|
||||
// if the mouse has moved, force it to the center, so there's room to move
|
||||
|
@ -908,7 +1006,9 @@ static void Joy_AdvancedUpdate_f (void)
|
|||
pdwRawValue[i] = RawValuePointer(i);
|
||||
}
|
||||
|
||||
if( joy_advanced.value == 0.0)
|
||||
/* if( joy_advanced.value == 0.0)
|
||||
CVAR_FIXME */
|
||||
if( joy_advanced->value == 0.0)
|
||||
{
|
||||
// default joystick initialization
|
||||
// 2 axes only with joystick control
|
||||
|
@ -927,22 +1027,34 @@ static void Joy_AdvancedUpdate_f (void)
|
|||
|
||||
// advanced initialization here
|
||||
// data supplied by user via joy_axisn cvars
|
||||
dwTemp = (DWORD) joy_advaxisx.value;
|
||||
/* dwTemp = (DWORD) joy_advaxisx.value;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
dwTemp = (DWORD) joy_advaxisv->value;
|
||||
dwAxisMap[JOY_AXIS_V] = dwTemp & 0x0000000f;
|
||||
dwControlMap[JOY_AXIS_V] = dwTemp & JOY_RELATIVE_AXIS;
|
||||
}
|
||||
|
@ -1046,7 +1158,9 @@ static 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)
|
||||
CVAR_FIXME */
|
||||
if (joy_wwhack1->value != 0.0)
|
||||
{
|
||||
ji.dwUpos += 100;
|
||||
}
|
||||
|
@ -1084,7 +1198,9 @@ static 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)
|
||||
CVAR_FIXME */
|
||||
if (!joy_avail || !in_joystick->value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1096,7 +1212,9 @@ static void IN_JoyMove (usercmd_t *cmd)
|
|||
}
|
||||
|
||||
if (in_speed.state & 1)
|
||||
speed = cl_movespeedkey.value;
|
||||
/* speed = cl_movespeedkey.value;
|
||||
CVAR_FIXME */
|
||||
speed = cl_movespeedkey->value;
|
||||
else
|
||||
speed = 1;
|
||||
aspeed = speed * host_frametime;
|
||||
|
@ -1109,7 +1227,9 @@ static 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)
|
||||
CVAR_FIXME */
|
||||
if (joy_wwhack2->value != 0.0)
|
||||
{
|
||||
if (dwAxisMap[i] == AxisTurn)
|
||||
{
|
||||
|
@ -1131,20 +1251,30 @@ static 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))
|
||||
CVAR_FIXME */
|
||||
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)
|
||||
CVAR_FIXME */
|
||||
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)
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity.value) * aspeed * cl_pitchspeed->value;
|
||||
}
|
||||
V_StopPitchDrift();
|
||||
}
|
||||
|
@ -1154,48 +1284,70 @@ static 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)
|
||||
CVAR_FIXME */
|
||||
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)
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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)
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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)))
|
||||
CVAR_FIXME */
|
||||
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)
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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)
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
cl.viewangles[YAW] += (fAxisValue * joy_yawsensitivity->value) * speed * 180.0;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1205,16 +1357,22 @@ static 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)
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
cl.viewangles[PITCH] += (fAxisValue * joy_pitchsensitivity->value) * speed * 180.0;
|
||||
}
|
||||
V_StopPitchDrift();
|
||||
}
|
||||
|
@ -1224,7 +1382,9 @@ static 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)
|
||||
CVAR_FIXME */
|
||||
if(lookspring->value == 0.0)
|
||||
V_StopPitchDrift();
|
||||
}
|
||||
}
|
||||
|
|
202
source/menu.c
202
source/menu.c
|
@ -393,84 +393,154 @@ 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;
|
||||
CVAR_FIXME */
|
||||
scr_viewsize->value += dir * 10;
|
||||
/* if (scr_viewsize.value < 30)
|
||||
CVAR_FIXME */
|
||||
if (scr_viewsize->value < 30)
|
||||
/* scr_viewsize.value = 30;
|
||||
CVAR_FIXME */
|
||||
scr_viewsize->value = 30;
|
||||
/* if (scr_viewsize.value > 120)
|
||||
CVAR_FIXME */
|
||||
if (scr_viewsize->value > 120)
|
||||
/* scr_viewsize.value = 120;
|
||||
CVAR_FIXME */
|
||||
scr_viewsize->value = 120;
|
||||
/* Cvar_SetValue ("viewsize", scr_viewsize.value);
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
v_gamma->value -= dir * 0.05;
|
||||
/* if (v_gamma.value < 0.5)
|
||||
CVAR_FIXME */
|
||||
if (v_gamma->value < 0.5)
|
||||
/* v_gamma.value = 0.5;
|
||||
CVAR_FIXME */
|
||||
v_gamma->value = 0.5;
|
||||
/* if (v_gamma.value > 1)
|
||||
CVAR_FIXME */
|
||||
if (v_gamma->value > 1)
|
||||
/* v_gamma.value = 1;
|
||||
CVAR_FIXME */
|
||||
v_gamma->value = 1;
|
||||
/* Cvar_SetValue ("gamma", v_gamma.value);
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
sensitivity->value += dir * 0.5;
|
||||
/* if (sensitivity.value < 1)
|
||||
CVAR_FIXME */
|
||||
if (sensitivity->value < 1)
|
||||
/* sensitivity.value = 1;
|
||||
CVAR_FIXME */
|
||||
sensitivity->value = 1;
|
||||
/* if (sensitivity.value > 11)
|
||||
CVAR_FIXME */
|
||||
if (sensitivity->value > 11)
|
||||
/* sensitivity.value = 11;
|
||||
CVAR_FIXME */
|
||||
sensitivity->value = 11;
|
||||
/* Cvar_SetValue ("sensitivity", sensitivity.value);
|
||||
CVAR_FIXME */
|
||||
break;
|
||||
case 6: // music volume
|
||||
#ifdef _WIN32
|
||||
bgmvolume.value += dir * 1.0;
|
||||
/* bgmvolume.value += dir * 1.0;
|
||||
CVAR_FIXME */
|
||||
bgmvolume->value += dir * 1.0;
|
||||
#else
|
||||
bgmvolume.value += dir * 0.1;
|
||||
/* bgmvolume.value += dir * 0.1;
|
||||
CVAR_FIXME */
|
||||
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)
|
||||
CVAR_FIXME */
|
||||
if (bgmvolume->value < 0)
|
||||
/* bgmvolume.value = 0;
|
||||
CVAR_FIXME */
|
||||
bgmvolume->value = 0;
|
||||
/* if (bgmvolume.value > 1)
|
||||
CVAR_FIXME */
|
||||
if (bgmvolume->value > 1)
|
||||
/* bgmvolume.value = 1;
|
||||
CVAR_FIXME */
|
||||
bgmvolume->value = 1;
|
||||
/* Cvar_SetValue ("bgmvolume", bgmvolume.value);
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
volume->value += dir * 0.1;
|
||||
/* if (volume.value < 0)
|
||||
CVAR_FIXME */
|
||||
if (volume->value < 0)
|
||||
/* volume.value = 0;
|
||||
CVAR_FIXME */
|
||||
volume->value = 0;
|
||||
/* if (volume.value > 1)
|
||||
CVAR_FIXME */
|
||||
if (volume->value > 1)
|
||||
/* volume.value = 1;
|
||||
CVAR_FIXME */
|
||||
volume->value = 1;
|
||||
/*CVAR_FIXME */
|
||||
break;
|
||||
|
||||
case 8: // allways run
|
||||
if (cl_forwardspeed.value > 200)
|
||||
/* if (cl_forwardspeed.value > 200)
|
||||
CVAR_FIXME */
|
||||
if (cl_forwardspeed->value > 200)
|
||||
{
|
||||
Cvar_SetValue ("cl_forwardspeed", 200);
|
||||
Cvar_SetValue ("cl_backspeed", 200);
|
||||
cl_forwardspeed->value = 200;
|
||||
cl_backspeed->value = 200;
|
||||
}
|
||||
else
|
||||
{
|
||||
Cvar_SetValue ("cl_forwardspeed", 400);
|
||||
Cvar_SetValue ("cl_backspeed", 400);
|
||||
cl_forwardspeed->value = 400;
|
||||
cl_backspeed->value = 400;
|
||||
}
|
||||
break;
|
||||
|
||||
case 9: // invert mouse
|
||||
Cvar_SetValue ("m_pitch", -m_pitch.value);
|
||||
/* m_pitch- -m_pitch.value);
|
||||
CVAR_FIXME */
|
||||
m_pitch->value = -m_pitch->value;
|
||||
break;
|
||||
|
||||
case 10: // lookspring
|
||||
Cvar_SetValue ("lookspring", !lookspring.value);
|
||||
/* Cvar_SetValue ("lookspring", !lookspring.value);
|
||||
CVAR_FIXME */
|
||||
lookspring->value = !lookspring->value;
|
||||
break;
|
||||
|
||||
case 11: // lookstrafe
|
||||
Cvar_SetValue ("lookstrafe", !lookstrafe.value);
|
||||
/* Cvar_SetValue ("lookstrafe", !lookstrafe.value);
|
||||
CVAR_FIXME */
|
||||
lookstrafe->value = !lookstrafe->value;
|
||||
break;
|
||||
|
||||
case 12:
|
||||
Cvar_SetValue ("cl_sbar", !cl_sbar.value);
|
||||
/* Cvar_SetValue ("cl_sbar", !cl_sbar.value);
|
||||
CVAR_FIXME */
|
||||
cl_sbar->value = !cl_sbar->value;
|
||||
break;
|
||||
|
||||
case 13:
|
||||
Cvar_SetValue ("cl_hudswap", !cl_hudswap.value);
|
||||
/* Cvar_SetValue ("cl_hudswap", !cl_hudswap.value);
|
||||
CVAR_FIXME */
|
||||
cl_hudswap->value = !cl_hudswap->value;
|
||||
|
||||
case 15: // _windowed_mouse
|
||||
Cvar_SetValue ("_windowed_mouse", !_windowed_mouse.value);
|
||||
/* Cvar_SetValue ("_windowed_mouse", !_windowed_mouse.value);
|
||||
CVAR_FIXME */
|
||||
_windowed_mouse->value = !_windowed_mouse->value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -519,42 +589,64 @@ 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);
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
r = (sensitivity->value - 1)/10;
|
||||
M_DrawSlider (220, 72, r);
|
||||
|
||||
M_Print (16, 80, " CD Music Volume");
|
||||
r = bgmvolume.value;
|
||||
/* r = bgmvolume.value;
|
||||
CVAR_FIXME */
|
||||
r = bgmvolume->value;
|
||||
M_DrawSlider (220, 80, r);
|
||||
|
||||
M_Print (16, 88, " Sound Volume");
|
||||
r = volume.value;
|
||||
/* r = volume.value;
|
||||
CVAR_FIXME */
|
||||
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);
|
||||
CVAR_FIXME */
|
||||
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);
|
||||
CVAR_FIXME */
|
||||
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);
|
||||
CVAR_FIXME */
|
||||
M_DrawCheckbox (220, 112, lookspring->value);
|
||||
|
||||
M_Print (16, 120, " Lookstrafe");
|
||||
M_DrawCheckbox (220, 120, lookstrafe.value);
|
||||
/* M_DrawCheckbox (220, 120, lookstrafe.value);
|
||||
CVAR_FIXME */
|
||||
M_DrawCheckbox (220, 120, lookstrafe->value);
|
||||
|
||||
M_Print (16, 128, " Use old status bar");
|
||||
M_DrawCheckbox (220, 128, cl_sbar.value);
|
||||
/* M_DrawCheckbox (220, 128, cl_sbar.value);
|
||||
CVAR_FIXME */
|
||||
M_DrawCheckbox (220, 128, cl_sbar->value);
|
||||
|
||||
M_Print (16, 136, " HUD on left side");
|
||||
M_DrawCheckbox (220, 136, cl_hudswap.value);
|
||||
/* M_DrawCheckbox (220, 136, cl_hudswap.value);
|
||||
CVAR_FIXME */
|
||||
M_DrawCheckbox (220, 136, cl_hudswap->value);
|
||||
|
||||
if (vid_menudrawfn)
|
||||
M_Print (16, 144, " Video Options");
|
||||
|
@ -564,7 +656,9 @@ void M_Options_Draw (void)
|
|||
{
|
||||
#endif
|
||||
M_Print (16, 152, " Use Mouse");
|
||||
M_DrawCheckbox (220, 152, _windowed_mouse.value);
|
||||
/* M_DrawCheckbox (220, 152, _windowed_mouse.value);
|
||||
CVAR_FIXME */
|
||||
M_DrawCheckbox (220, 152, _windowed_mouse->value);
|
||||
#ifdef _WIN32
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -53,7 +53,9 @@ int mod_numknown;
|
|||
|
||||
unsigned *model_checksum;
|
||||
texture_t *r_notexture_mip;
|
||||
cvar_t gl_subdivide_size = {"gl_subdivide_size", "128", true};
|
||||
/* cvar_t gl_subdivide_size = {"gl_subdivide_size", "128", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_subdivide_size;
|
||||
|
||||
/*
|
||||
===============
|
||||
|
@ -62,7 +64,9 @@ Mod_Init
|
|||
*/
|
||||
void Mod_Init (void)
|
||||
{
|
||||
Cvar_RegisterVariable (&gl_subdivide_size);
|
||||
/* Cvar_RegisterVariable (&gl_subdivide_size);
|
||||
CVAR_FIXME */
|
||||
gl_subdivide_size = Cvar_Get("gl_subdivide_size", "128", CVAR_NONE, "None");
|
||||
memset (mod_novis, 0xff, sizeof(mod_novis));
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
#include "quakedef.h"
|
||||
|
||||
|
||||
#define PACKET_HEADER 8
|
||||
|
||||
/*
|
||||
|
@ -87,9 +86,15 @@ to the new value before sending out any replies.
|
|||
*/
|
||||
|
||||
int net_drop;
|
||||
cvar_t showpackets = {"showpackets", "0"};
|
||||
cvar_t showdrop = {"showdrop", "0"};
|
||||
cvar_t qport = {"qport", "0"};
|
||||
/* cvar_t showpackets = {"showpackets", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *showpackets;
|
||||
/* cvar_t showdrop = {"showdrop", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *showdrop;
|
||||
/* cvar_t qport = {"qport", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *qport;
|
||||
extern qboolean is_server;
|
||||
|
||||
/*
|
||||
|
@ -109,10 +114,16 @@ void Netchan_Init (void)
|
|||
port = ((int)(getpid()+getuid()*1000) * time(NULL)) & 0xffff;
|
||||
#endif
|
||||
|
||||
Cvar_RegisterVariable (&showpackets);
|
||||
Cvar_RegisterVariable (&showdrop);
|
||||
Cvar_RegisterVariable (&qport);
|
||||
Cvar_SetValue("qport", port);
|
||||
/* Cvar_RegisterVariable (&showpackets);
|
||||
CVAR_FIXME */
|
||||
showpackets = Cvar_Get("showpackets", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&showdrop);
|
||||
CVAR_FIXME */
|
||||
showdrop = Cvar_Get("showdrop", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&qport);
|
||||
CVAR_FIXME */
|
||||
qport = Cvar_Get("qport", "0", CVAR_NONE, "None");
|
||||
qport->value = port;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -317,7 +328,9 @@ void Netchan_Transmit (netchan_t *chan, int length, byte *data)
|
|||
if (ServerPaused())
|
||||
chan->cleartime = realtime;
|
||||
|
||||
if (showpackets.value)
|
||||
/* if (showpackets.value)
|
||||
CVAR_FIXME */
|
||||
if (showpackets->value)
|
||||
Con_Printf ("--> s=%i(%i) a=%i(%i) %i\n"
|
||||
, chan->outgoing_sequence
|
||||
, send_reliable
|
||||
|
@ -368,7 +381,9 @@ qboolean Netchan_Process (netchan_t *chan)
|
|||
sequence &= ~(1<<31);
|
||||
sequence_ack &= ~(1<<31);
|
||||
|
||||
if (showpackets.value)
|
||||
/* if (showpackets.value)
|
||||
CVAR_FIXME */
|
||||
if (showpackets->value)
|
||||
Con_Printf ("<-- s=%i(%i) a=%i(%i) %i\n"
|
||||
, sequence
|
||||
, reliable_message
|
||||
|
@ -411,7 +426,9 @@ qboolean Netchan_Process (netchan_t *chan)
|
|||
//
|
||||
if (sequence <= (unsigned)chan->incoming_sequence)
|
||||
{
|
||||
if (showdrop.value)
|
||||
/* if (showdrop.value)
|
||||
CVAR_FIXME */
|
||||
if (showdrop->value)
|
||||
Con_Printf ("%s:Out of order packet %i at %i\n"
|
||||
, NET_AdrToString (chan->remote_address)
|
||||
, sequence
|
||||
|
@ -427,7 +444,9 @@ qboolean Netchan_Process (netchan_t *chan)
|
|||
{
|
||||
chan->drop_count += 1;
|
||||
|
||||
if (showdrop.value)
|
||||
/* if (showdrop.value)
|
||||
CVAR_FIXME */
|
||||
if (showdrop->value)
|
||||
Con_Printf ("%s:Dropped %i packets at %i\n"
|
||||
, NET_AdrToString (chan->remote_address)
|
||||
, sequence-(chan->incoming_sequence+1)
|
||||
|
|
|
@ -1161,8 +1161,12 @@ 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 = {"sv_aim", "2"};
|
||||
/* //cvar_t sv_aim = {"sv_aim", "0.93"};
|
||||
CVAR_FIXME */
|
||||
//cvar_t *sv_aim;
|
||||
/* cvar_t sv_aim = {"sv_aim", "2"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_aim;
|
||||
void PF_aim (void)
|
||||
{
|
||||
edict_t *ent, *check, *bestent;
|
||||
|
@ -1196,7 +1200,9 @@ 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) )
|
||||
CVAR_FIXME */
|
||||
&& (!teamplay->value || ent->v.team <=0 || ent->v.team != tr.ent->v.team) )
|
||||
{
|
||||
VectorCopy (pr_global_struct->v_forward, G_VECTOR(OFS_RETURN));
|
||||
return;
|
||||
|
@ -1205,7 +1211,9 @@ void PF_aim (void)
|
|||
|
||||
// try all possible entities
|
||||
VectorCopy (dir, bestdir);
|
||||
bestdist = sv_aim.value;
|
||||
/* bestdist = sv_aim.value;
|
||||
CVAR_FIXME */
|
||||
bestdist = sv_aim->value;
|
||||
bestent = NULL;
|
||||
|
||||
check = NEXT_EDICT(sv.edicts);
|
||||
|
@ -1215,7 +1223,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
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]
|
||||
|
|
|
@ -144,7 +144,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (r_draworder->value)
|
||||
{
|
||||
pdrawfunc = R_GenerateSpansBackward;
|
||||
surfaces[1].key = 0;
|
||||
|
|
328
source/r_main.c
328
source/r_main.c
|
@ -119,33 +119,83 @@ 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_netgraph = {"r_netgraph","0"};
|
||||
cvar_t r_zgraph = {"r_zgraph","0"};
|
||||
cvar_t r_graphheight = {"r_graphheight","15"};
|
||||
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"};
|
||||
/* cvar_t r_draworder = {"r_draworder","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_draworder;
|
||||
/* cvar_t r_speeds = {"r_speeds","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_speeds;
|
||||
/* cvar_t r_timegraph = {"r_timegraph","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_timegraph;
|
||||
/* cvar_t r_netgraph = {"r_netgraph","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_netgraph;
|
||||
/* cvar_t r_zgraph = {"r_zgraph","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_zgraph;
|
||||
/* cvar_t r_graphheight = {"r_graphheight","15"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_graphheight;
|
||||
/* cvar_t r_clearcolor = {"r_clearcolor","2"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_clearcolor;
|
||||
/* cvar_t r_waterwarp = {"r_waterwarp","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_waterwarp;
|
||||
/* cvar_t r_fullbright = {"r_fullbright","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_fullbright;
|
||||
/* cvar_t r_drawentities = {"r_drawentities","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_drawentities;
|
||||
/* cvar_t r_drawviewmodel = {"r_drawviewmodel","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_drawviewmodel;
|
||||
/* cvar_t r_aliasstats = {"r_polymodelstats","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_aliasstats;
|
||||
/* cvar_t r_dspeeds = {"r_dspeeds","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_dspeeds;
|
||||
/* cvar_t r_drawflat = {"r_drawflat", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_drawflat;
|
||||
/* cvar_t r_ambient = {"r_ambient", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_ambient;
|
||||
/* cvar_t r_reportsurfout = {"r_reportsurfout", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_reportsurfout;
|
||||
/* cvar_t r_maxsurfs = {"r_maxsurfs", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_maxsurfs;
|
||||
/* cvar_t r_numsurfs = {"r_numsurfs", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_numsurfs;
|
||||
/* cvar_t r_reportedgeout = {"r_reportedgeout", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_reportedgeout;
|
||||
/* cvar_t r_maxedges = {"r_maxedges", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_maxedges;
|
||||
/* cvar_t r_numedges = {"r_numedges", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_numedges;
|
||||
/* cvar_t r_aliastransbase = {"r_aliastransbase", "200"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_aliastransbase;
|
||||
/* cvar_t r_aliastransadj = {"r_aliastransadj", "100"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *r_aliastransadj;
|
||||
|
||||
cvar_t gl_flashblend = {"gl_flashblend", "0"};
|
||||
/* cvar_t gl_flashblend = {"gl_flashblend", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_flashblend;
|
||||
|
||||
extern cvar_t scr_fov;
|
||||
/* extern cvar_t scr_fov;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *scr_fov;
|
||||
|
||||
void CreatePassages (void);
|
||||
void SetVisibilityByPassages (void);
|
||||
|
@ -203,33 +253,81 @@ 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_netgraph);
|
||||
Cvar_RegisterVariable (&r_zgraph);
|
||||
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);
|
||||
Cvar_RegisterVariable (&gl_flashblend); // FIXME: remove this! --KB
|
||||
/* Cvar_RegisterVariable (&r_draworder);
|
||||
CVAR_FIXME */
|
||||
r_draworder = Cvar_Get("r_draworder", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_speeds);
|
||||
CVAR_FIXME */
|
||||
r_speeds = Cvar_Get("r_speeds", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_timegraph);
|
||||
CVAR_FIXME */
|
||||
r_timegraph = Cvar_Get("r_timegraph", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_netgraph);
|
||||
CVAR_FIXME */
|
||||
r_netgraph = Cvar_Get("r_netgraph", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_zgraph);
|
||||
CVAR_FIXME */
|
||||
r_zgraph = Cvar_Get("r_zgraph", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_graphheight);
|
||||
CVAR_FIXME */
|
||||
r_graphheight = Cvar_Get("r_graphheight", "15", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_drawflat);
|
||||
CVAR_FIXME */
|
||||
r_drawflat = Cvar_Get("r_drawflat", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_ambient);
|
||||
CVAR_FIXME */
|
||||
r_ambient = Cvar_Get("r_ambient", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_clearcolor);
|
||||
CVAR_FIXME */
|
||||
r_clearcolor = Cvar_Get("r_clearcolor", "2", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_waterwarp);
|
||||
CVAR_FIXME */
|
||||
r_waterwarp = Cvar_Get("r_waterwarp", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_fullbright);
|
||||
CVAR_FIXME */
|
||||
r_fullbright = Cvar_Get("r_fullbright", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_drawentities);
|
||||
CVAR_FIXME */
|
||||
r_drawentities = Cvar_Get("r_drawentities", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_drawviewmodel);
|
||||
CVAR_FIXME */
|
||||
r_drawviewmodel = Cvar_Get("r_drawviewmodel", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_aliasstats);
|
||||
CVAR_FIXME */
|
||||
r_aliasstats = Cvar_Get("r_polymodelstats", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_dspeeds);
|
||||
CVAR_FIXME */
|
||||
r_dspeeds = Cvar_Get("r_dspeeds", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_reportsurfout);
|
||||
CVAR_FIXME */
|
||||
r_reportsurfout = Cvar_Get("r_reportsurfout", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_maxsurfs);
|
||||
CVAR_FIXME */
|
||||
r_maxsurfs = Cvar_Get("r_maxsurfs", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_numsurfs);
|
||||
CVAR_FIXME */
|
||||
r_numsurfs = Cvar_Get("r_numsurfs", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_reportedgeout);
|
||||
CVAR_FIXME */
|
||||
r_reportedgeout = Cvar_Get("r_reportedgeout", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_maxedges);
|
||||
CVAR_FIXME */
|
||||
r_maxedges = Cvar_Get("r_maxedges", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_numedges);
|
||||
CVAR_FIXME */
|
||||
r_numedges = Cvar_Get("r_numedges", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_aliastransbase);
|
||||
CVAR_FIXME */
|
||||
r_aliastransbase = Cvar_Get("r_aliastransbase", "200", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&r_aliastransadj);
|
||||
CVAR_FIXME */
|
||||
r_aliastransadj = Cvar_Get("r_aliastransadj", "100", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_flashblend); // FIXME: remove this! --KB
|
||||
CVAR_FIXME */
|
||||
gl_flashblend = Cvar_Get("gl_flashblend", "0", CVAR_NONE, "None"); // FIXME: remove this! --KB
|
||||
|
||||
Cvar_SetValue ("r_maxedges", (float)NUMSTACKEDGES);
|
||||
Cvar_SetValue ("r_maxsurfs", (float)NUMSTACKSURFACES);
|
||||
r_maxedges->value = (float)NUMSTACKEDGES;
|
||||
r_maxsurfs->value = (float)NUMSTACKSURFACES;
|
||||
|
||||
view_clipplanes[0].leftedge = true;
|
||||
view_clipplanes[1].rightedge = true;
|
||||
|
@ -272,7 +370,9 @@ void R_NewMap (void)
|
|||
r_viewleaf = NULL;
|
||||
R_ClearParticles ();
|
||||
|
||||
r_cnumsurfs = r_maxsurfs.value;
|
||||
/* r_cnumsurfs = r_maxsurfs.value;
|
||||
CVAR_FIXME */
|
||||
r_cnumsurfs = r_maxsurfs->value;
|
||||
|
||||
if (r_cnumsurfs <= MINSURFACES)
|
||||
r_cnumsurfs = MINSURFACES;
|
||||
|
@ -296,7 +396,9 @@ void R_NewMap (void)
|
|||
r_maxedgesseen = 0;
|
||||
r_maxsurfsseen = 0;
|
||||
|
||||
r_numallocatededges = r_maxedges.value;
|
||||
/* r_numallocatededges = r_maxedges.value;
|
||||
CVAR_FIXME */
|
||||
r_numallocatededges = r_maxedges->value;
|
||||
|
||||
if (r_numallocatededges < MINEDGES)
|
||||
r_numallocatededges = MINEDGES;
|
||||
|
@ -327,11 +429,15 @@ void R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
|
|||
float size;
|
||||
qboolean full = false;
|
||||
|
||||
if (scr_viewsize.value >= 100.0) {
|
||||
/* if (scr_viewsize.value >= 100.0) {
|
||||
CVAR_FIXME */
|
||||
if (scr_viewsize->value >= 100.0) {
|
||||
size = 100.0;
|
||||
full = true;
|
||||
} else
|
||||
size = scr_viewsize.value;
|
||||
/* size = scr_viewsize.value;
|
||||
CVAR_FIXME */
|
||||
size = scr_viewsize->value;
|
||||
|
||||
if (cl.intermission)
|
||||
{
|
||||
|
@ -341,12 +447,16 @@ void R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
|
|||
}
|
||||
size /= 100.0;
|
||||
|
||||
if (!cl_sbar.value && full)
|
||||
/* if (!cl_sbar.value && full)
|
||||
CVAR_FIXME */
|
||||
if (!cl_sbar->value && full)
|
||||
h = pvrectin->height;
|
||||
else
|
||||
h = pvrectin->height - lineadj;
|
||||
|
||||
// h = (!cl_sbar.value && size==1.0) ? pvrectin->height : (pvrectin->height - lineadj);
|
||||
/* // h = (!cl_sbar.value && size==1.0) ? pvrectin->height : (pvrectin->height - lineadj);
|
||||
CVAR_FIXME */
|
||||
// h = (!cl_sbar->value && size==1.0) ? pvrectin->height : (pvrectin->height - lineadj);
|
||||
// h = pvrectin->height - lineadj;
|
||||
if (full)
|
||||
pvrect->width = pvrectin->width;
|
||||
|
@ -359,7 +469,9 @@ void R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
|
|||
}
|
||||
pvrect->width &= ~7;
|
||||
pvrect->height = pvrectin->height * size;
|
||||
if (cl_sbar.value || !full) {
|
||||
/* if (cl_sbar.value || !full) {
|
||||
CVAR_FIXME */
|
||||
if (cl_sbar->value || !full) {
|
||||
if (pvrect->height > pvrectin->height - lineadj)
|
||||
pvrect->height = pvrectin->height - lineadj;
|
||||
} else
|
||||
|
@ -482,10 +594,16 @@ 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;
|
||||
CVAR_FIXME */
|
||||
r_aliastransition = r_aliastransbase->value * res_scale;
|
||||
/* r_resfudge = r_aliastransadj.value * res_scale;
|
||||
CVAR_FIXME */
|
||||
r_resfudge = r_aliastransadj->value * res_scale;
|
||||
|
||||
if (scr_fov.value <= 90.0)
|
||||
/* if (scr_fov.value <= 90.0)
|
||||
CVAR_FIXME */
|
||||
if (scr_fov->value <= 90.0)
|
||||
r_fov_greater_than_90 = false;
|
||||
else
|
||||
r_fov_greater_than_90 = true;
|
||||
|
@ -563,7 +681,9 @@ void R_DrawEntitiesOnList (void)
|
|||
vec3_t dist;
|
||||
float add;
|
||||
|
||||
if (!r_drawentities.value)
|
||||
/* if (!r_drawentities.value)
|
||||
CVAR_FIXME */
|
||||
if (!r_drawentities->value)
|
||||
return;
|
||||
|
||||
for (i=0 ; i<cl_numvisedicts ; i++)
|
||||
|
@ -639,7 +759,9 @@ void R_DrawViewModel (void)
|
|||
float add;
|
||||
dlight_t *dl;
|
||||
|
||||
if (!r_drawviewmodel.value || r_fov_greater_than_90 || !Cam_DrawViewModel())
|
||||
/* if (!r_drawviewmodel.value || r_fov_greater_than_90 || !Cam_DrawViewModel())
|
||||
CVAR_FIXME */
|
||||
if (!r_drawviewmodel->value || r_fov_greater_than_90 || !Cam_DrawViewModel())
|
||||
return;
|
||||
|
||||
if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
|
||||
|
@ -770,7 +892,9 @@ void R_DrawBEntitiesOnList (void)
|
|||
model_t *clmodel;
|
||||
float minmaxs[6];
|
||||
|
||||
if (!r_drawentities.value)
|
||||
/* if (!r_drawentities.value)
|
||||
CVAR_FIXME */
|
||||
if (!r_drawentities->value)
|
||||
return;
|
||||
|
||||
VectorCopy (modelorg, oldorigin);
|
||||
|
@ -925,7 +1049,9 @@ void R_EdgeDrawing (void)
|
|||
|
||||
R_BeginEdgeFrame ();
|
||||
|
||||
if (r_dspeeds.value)
|
||||
/* if (r_dspeeds.value)
|
||||
CVAR_FIXME */
|
||||
if (r_dspeeds->value)
|
||||
{
|
||||
rw_time1 = Sys_DoubleTime ();
|
||||
}
|
||||
|
@ -939,7 +1065,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (r_dspeeds->value)
|
||||
{
|
||||
rw_time2 = Sys_DoubleTime ();
|
||||
db_time1 = rw_time2;
|
||||
|
@ -947,13 +1075,17 @@ void R_EdgeDrawing (void)
|
|||
|
||||
R_DrawBEntitiesOnList ();
|
||||
|
||||
if (r_dspeeds.value)
|
||||
/* if (r_dspeeds.value)
|
||||
CVAR_FIXME */
|
||||
if (r_dspeeds->value)
|
||||
{
|
||||
db_time2 = Sys_DoubleTime ();
|
||||
se_time1 = db_time2;
|
||||
}
|
||||
|
||||
if (!r_dspeeds.value)
|
||||
/* if (!r_dspeeds.value)
|
||||
CVAR_FIXME */
|
||||
if (!r_dspeeds->value)
|
||||
{
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if going slow
|
||||
|
@ -978,7 +1110,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (r_timegraph->value || r_speeds->value || r_dspeeds->value)
|
||||
r_time1 = Sys_DoubleTime ();
|
||||
|
||||
R_SetupFrame ();
|
||||
|
@ -998,7 +1132,9 @@ SetVisibilityByPassages ();
|
|||
if (!r_worldentity.model || !cl.worldmodel)
|
||||
Sys_Error ("R_RenderView: NULL worldmodel");
|
||||
|
||||
if (!r_dspeeds.value)
|
||||
/* if (!r_dspeeds.value)
|
||||
CVAR_FIXME */
|
||||
if (!r_dspeeds->value)
|
||||
{
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if going slow
|
||||
|
@ -1007,14 +1143,18 @@ SetVisibilityByPassages ();
|
|||
|
||||
R_EdgeDrawing ();
|
||||
|
||||
if (!r_dspeeds.value)
|
||||
/* if (!r_dspeeds.value)
|
||||
CVAR_FIXME */
|
||||
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)
|
||||
CVAR_FIXME */
|
||||
if (r_dspeeds->value)
|
||||
{
|
||||
se_time2 = Sys_DoubleTime ();
|
||||
de_time1 = se_time2;
|
||||
|
@ -1022,7 +1162,9 @@ SetVisibilityByPassages ();
|
|||
|
||||
R_DrawEntitiesOnList ();
|
||||
|
||||
if (r_dspeeds.value)
|
||||
/* if (r_dspeeds.value)
|
||||
CVAR_FIXME */
|
||||
if (r_dspeeds->value)
|
||||
{
|
||||
de_time2 = Sys_DoubleTime ();
|
||||
dv_time1 = de_time2;
|
||||
|
@ -1030,7 +1172,9 @@ SetVisibilityByPassages ();
|
|||
|
||||
R_DrawViewModel ();
|
||||
|
||||
if (r_dspeeds.value)
|
||||
/* if (r_dspeeds.value)
|
||||
CVAR_FIXME */
|
||||
if (r_dspeeds->value)
|
||||
{
|
||||
dv_time2 = Sys_DoubleTime ();
|
||||
dp_time1 = Sys_DoubleTime ();
|
||||
|
@ -1038,7 +1182,9 @@ SetVisibilityByPassages ();
|
|||
|
||||
R_DrawParticles ();
|
||||
|
||||
if (r_dspeeds.value)
|
||||
/* if (r_dspeeds.value)
|
||||
CVAR_FIXME */
|
||||
if (r_dspeeds->value)
|
||||
dp_time2 = Sys_DoubleTime ();
|
||||
|
||||
if (r_dowarp)
|
||||
|
@ -1046,28 +1192,44 @@ SetVisibilityByPassages ();
|
|||
|
||||
V_SetContentsColor (r_viewleaf->contents);
|
||||
|
||||
if (r_timegraph.value)
|
||||
/* if (r_timegraph.value)
|
||||
CVAR_FIXME */
|
||||
if (r_timegraph->value)
|
||||
R_TimeGraph ();
|
||||
|
||||
if (r_netgraph.value)
|
||||
/* if (r_netgraph.value)
|
||||
CVAR_FIXME */
|
||||
if (r_netgraph->value)
|
||||
R_NetGraph ();
|
||||
|
||||
if (r_zgraph.value)
|
||||
/* if (r_zgraph.value)
|
||||
CVAR_FIXME */
|
||||
if (r_zgraph->value)
|
||||
R_ZGraph ();
|
||||
|
||||
if (r_aliasstats.value)
|
||||
/* if (r_aliasstats.value)
|
||||
CVAR_FIXME */
|
||||
if (r_aliasstats->value)
|
||||
R_PrintAliasStats ();
|
||||
|
||||
if (r_speeds.value)
|
||||
/* if (r_speeds.value)
|
||||
CVAR_FIXME */
|
||||
if (r_speeds->value)
|
||||
R_PrintTimes ();
|
||||
|
||||
if (r_dspeeds.value)
|
||||
/* if (r_dspeeds.value)
|
||||
CVAR_FIXME */
|
||||
if (r_dspeeds->value)
|
||||
R_PrintDSpeeds ();
|
||||
|
||||
if (r_reportsurfout.value && r_outofsurfaces)
|
||||
/* if (r_reportsurfout.value && r_outofsurfaces)
|
||||
CVAR_FIXME */
|
||||
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)
|
||||
CVAR_FIXME */
|
||||
if (r_reportedgeout->value && r_outofedges)
|
||||
Con_Printf ("Short roughly %d edges\n", r_outofedges * 2 / 3);
|
||||
|
||||
// back to high floating-point precision
|
||||
|
|
|
@ -41,9 +41,13 @@ void R_CheckVariables (void)
|
|||
#if 0
|
||||
static float oldbright;
|
||||
|
||||
if (r_fullbright.value != oldbright)
|
||||
/* if (r_fullbright.value != oldbright)
|
||||
CVAR_FIXME */
|
||||
if (r_fullbright->value != oldbright)
|
||||
{
|
||||
oldbright = r_fullbright.value;
|
||||
/* oldbright = r_fullbright.value;
|
||||
CVAR_FIXME */
|
||||
oldbright = r_fullbright->value;
|
||||
D_FlushCaches (); // so all lighting changes
|
||||
}
|
||||
#endif
|
||||
|
@ -130,7 +134,9 @@ void R_LineGraph (int x, int y, int h)
|
|||
|
||||
dest = vid.buffer + vid.rowbytes*y + x;
|
||||
|
||||
s = r_graphheight.value;
|
||||
/* s = r_graphheight.value;
|
||||
CVAR_FIXME */
|
||||
s = r_graphheight->value;
|
||||
|
||||
if (h == 10000)
|
||||
color = 0x6f; // yellow
|
||||
|
@ -180,7 +186,9 @@ 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;
|
||||
CVAR_FIXME */
|
||||
//a = (int)((r_refdef.vieworg[2] + 1024)/1)%(int)r_graphheight->value;
|
||||
//a = (int)((pmove.velocity[2] + 500)/10);
|
||||
//a = fabs(velocity[0])/20;
|
||||
//a = ((int)fabs(origin[0])/8)%20;
|
||||
|
@ -227,9 +235,13 @@ void R_NetGraph (void)
|
|||
w = NET_TIMINGS;
|
||||
|
||||
x = w - ((vid.width - 320)>>1);
|
||||
y = vid.height - sb_lines - 24 - (int)r_graphheight.value*2 - 2;
|
||||
/* y = vid.height - sb_lines - 24 - (int)r_graphheight.value*2 - 2;
|
||||
CVAR_FIXME */
|
||||
y = vid.height - sb_lines - 24 - (int)r_graphheight->value*2 - 2;
|
||||
|
||||
M_DrawTextBox (x, y, (w+7)/8, ((int)r_graphheight.value*2+7)/8 + 1);
|
||||
/* M_DrawTextBox (x, y, (w+7)/8, ((int)r_graphheight.value*2+7)/8 + 1);
|
||||
CVAR_FIXME */
|
||||
M_DrawTextBox (x, y, (w+7)/8, ((int)r_graphheight->value*2+7)/8 + 1);
|
||||
y2 = y + 8;
|
||||
y = vid.height - sb_lines - 8 - 2;
|
||||
|
||||
|
@ -454,12 +466,22 @@ void R_SetupFrame (void)
|
|||
float w, h;
|
||||
|
||||
// don't allow cheats in multiplayer
|
||||
r_draworder.value = 0;
|
||||
r_fullbright.value = 0;
|
||||
r_ambient.value = 0;
|
||||
r_drawflat.value = 0;
|
||||
/* r_draworder.value = 0;
|
||||
CVAR_FIXME */
|
||||
r_draworder->value = 0;
|
||||
/* r_fullbright.value = 0;
|
||||
CVAR_FIXME */
|
||||
r_fullbright->value = 0;
|
||||
/* r_ambient.value = 0;
|
||||
CVAR_FIXME */
|
||||
r_ambient->value = 0;
|
||||
/* r_drawflat.value = 0;
|
||||
CVAR_FIXME */
|
||||
r_drawflat->value = 0;
|
||||
|
||||
if (r_numsurfs.value)
|
||||
/* if (r_numsurfs.value)
|
||||
CVAR_FIXME */
|
||||
if (r_numsurfs->value)
|
||||
{
|
||||
if ((surface_p - surfaces) > r_maxsurfsseen)
|
||||
r_maxsurfsseen = surface_p - surfaces;
|
||||
|
@ -468,7 +490,9 @@ r_drawflat.value = 0;
|
|||
surf_max - surfaces, r_maxsurfsseen);
|
||||
}
|
||||
|
||||
if (r_numedges.value)
|
||||
/* if (r_numedges.value)
|
||||
CVAR_FIXME */
|
||||
if (r_numedges->value)
|
||||
{
|
||||
edgecount = edge_p - r_edges;
|
||||
|
||||
|
@ -479,13 +503,17 @@ r_drawflat.value = 0;
|
|||
r_numallocatededges, r_maxedgesseen);
|
||||
}
|
||||
|
||||
r_refdef.ambientlight = r_ambient.value;
|
||||
/* r_refdef.ambientlight = r_ambient.value;
|
||||
CVAR_FIXME */
|
||||
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
|
||||
CVAR_FIXME */
|
||||
r_draworder->value = 0; // don't let cheaters look behind walls
|
||||
|
||||
R_CheckVariables ();
|
||||
|
||||
|
@ -516,7 +544,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);
|
||||
CVAR_FIXME */
|
||||
r_dowarp = r_waterwarp->value && (r_viewleaf->contents <= CONTENTS_WATER);
|
||||
|
||||
if ((r_dowarp != r_dowarpold) || r_viewchanged)
|
||||
{
|
||||
|
|
|
@ -155,7 +155,9 @@ void R_BuildLightMap (void)
|
|||
size = smax*tmax;
|
||||
lightmap = surf->samples;
|
||||
|
||||
if (/* r_fullbright.value || */ !cl.worldmodel->lightdata)
|
||||
/* if ( r_fullbright.value || !cl.worldmodel->lightdata)
|
||||
CVAR_FIXME */
|
||||
if (/* r_fullbright->value || */ !cl.worldmodel->lightdata)
|
||||
{
|
||||
for (i=0 ; i<size ; i++)
|
||||
blocklights[i] = 0;
|
||||
|
|
328
source/r_view.c
328
source/r_view.c
|
@ -39,35 +39,77 @@ when crossing a water boudnary.
|
|||
|
||||
*/
|
||||
|
||||
cvar_t lcd_x = {"lcd_x", "0"}; // FIXME: make this work sometime...
|
||||
/* cvar_t lcd_x = {"lcd_x", "0"}; // FIXME: make this work sometime...
|
||||
CVAR_FIXME */
|
||||
cvar_t *lcd_x; // FIXME: make this work sometime...
|
||||
|
||||
cvar_t cl_rollspeed = {"cl_rollspeed", "200"};
|
||||
cvar_t cl_rollangle = {"cl_rollangle", "2.0"};
|
||||
/* cvar_t cl_rollspeed = {"cl_rollspeed", "200"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_rollspeed;
|
||||
/* cvar_t cl_rollangle = {"cl_rollangle", "2.0"};
|
||||
CVAR_FIXME */
|
||||
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 = {"cl_bob","0.02", false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_bob;
|
||||
/* cvar_t cl_bobcycle = {"cl_bobcycle","0.6", false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_bobcycle;
|
||||
/* cvar_t cl_bobup = {"cl_bobup","0.5", false};
|
||||
CVAR_FIXME */
|
||||
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 = {"v_kicktime", "0.5", false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *v_kicktime;
|
||||
/* cvar_t v_kickroll = {"v_kickroll", "0.6", false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *v_kickroll;
|
||||
/* cvar_t v_kickpitch = {"v_kickpitch", "0.6", false};
|
||||
CVAR_FIXME */
|
||||
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 = {"v_iyaw_cycle", "2", false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *v_iyaw_cycle;
|
||||
/* cvar_t v_iroll_cycle = {"v_iroll_cycle", "0.5", false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *v_iroll_cycle;
|
||||
/* cvar_t v_ipitch_cycle = {"v_ipitch_cycle", "1", false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *v_ipitch_cycle;
|
||||
/* cvar_t v_iyaw_level = {"v_iyaw_level", "0.3", false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *v_iyaw_level;
|
||||
/* cvar_t v_iroll_level = {"v_iroll_level", "0.1", false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *v_iroll_level;
|
||||
/* cvar_t v_ipitch_level = {"v_ipitch_level", "0.3", false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *v_ipitch_level;
|
||||
|
||||
cvar_t v_idlescale = {"v_idlescale", "0", false};
|
||||
/* cvar_t v_idlescale = {"v_idlescale", "0", false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *v_idlescale;
|
||||
|
||||
cvar_t crosshair = {"crosshair", "0", true};
|
||||
cvar_t crosshaircolor = {"crosshaircolor", "79", true};
|
||||
/* cvar_t crosshair = {"crosshair", "0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *crosshair;
|
||||
/* cvar_t crosshaircolor = {"crosshaircolor", "79", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *crosshaircolor;
|
||||
|
||||
cvar_t cl_crossx = {"cl_crossx", "0", true};
|
||||
cvar_t cl_crossy = {"cl_crossy", "0", true};
|
||||
/* cvar_t cl_crossx = {"cl_crossx", "0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_crossx;
|
||||
/* cvar_t cl_crossy = {"cl_crossy", "0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_crossy;
|
||||
|
||||
cvar_t v_contentblend = {"v_contentblend", "1", false};
|
||||
/* cvar_t v_contentblend = {"v_contentblend", "1", false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *v_contentblend;
|
||||
|
||||
float v_dmg_time, v_dmg_roll, v_dmg_pitch;
|
||||
|
||||
|
@ -94,10 +136,16 @@ 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;
|
||||
CVAR_FIXME */
|
||||
value = cl_rollangle->value;
|
||||
|
||||
if (side < cl_rollspeed.value)
|
||||
side = side * value / cl_rollspeed.value;
|
||||
/* if (side < cl_rollspeed.value)
|
||||
CVAR_FIXME */
|
||||
if (side < cl_rollspeed->value)
|
||||
/* side = side * value / cl_rollspeed.value;
|
||||
CVAR_FIXME */
|
||||
side = side * value / cl_rollspeed->value;
|
||||
else
|
||||
side = value;
|
||||
|
||||
|
@ -125,17 +173,29 @@ float V_CalcBob (void)
|
|||
return bob; // just use old value
|
||||
|
||||
bobtime += host_frametime;
|
||||
cycle = bobtime - (int)(bobtime/cl_bobcycle.value)*cl_bobcycle.value;
|
||||
cycle /= cl_bobcycle.value;
|
||||
if (cycle < cl_bobup.value)
|
||||
cycle = M_PI * cycle / cl_bobup.value;
|
||||
/* cycle = bobtime - (int)(bobtime/cl_bobcycle.value)*cl_bobcycle.value;
|
||||
CVAR_FIXME */
|
||||
cycle = bobtime - (int)(bobtime/cl_bobcycle->value)*cl_bobcycle->value;
|
||||
/* cycle /= cl_bobcycle.value;
|
||||
CVAR_FIXME */
|
||||
cycle /= cl_bobcycle->value;
|
||||
/* if (cycle < cl_bobup.value)
|
||||
CVAR_FIXME */
|
||||
if (cycle < cl_bobup->value)
|
||||
/* cycle = M_PI * cycle / cl_bobup.value;
|
||||
CVAR_FIXME */
|
||||
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);
|
||||
CVAR_FIXME */
|
||||
cycle = M_PI + M_PI*(cycle-cl_bobup->value)/(1.0 - cl_bobup->value);
|
||||
|
||||
// bob is proportional to simulated velocity in the xy plane
|
||||
// (don't count Z, or jumping messes it up)
|
||||
|
||||
bob = sqrt(cl.simvel[0]*cl.simvel[0] + cl.simvel[1]*cl.simvel[1]) * cl_bob.value;
|
||||
/* bob = sqrt(cl.simvel[0]*cl.simvel[0] + cl.simvel[1]*cl.simvel[1]) * cl_bob.value;
|
||||
CVAR_FIXME */
|
||||
bob = sqrt(cl.simvel[0]*cl.simvel[0] + cl.simvel[1]*cl.simvel[1]) * cl_bob->value;
|
||||
bob = bob*0.3 + bob*0.7*sin(cycle);
|
||||
if (bob > 4)
|
||||
bob = 4;
|
||||
|
@ -149,8 +209,12 @@ float V_CalcBob (void)
|
|||
//=============================================================================
|
||||
|
||||
|
||||
cvar_t v_centermove = {"v_centermove", "0.15", false};
|
||||
cvar_t v_centerspeed = {"v_centerspeed","500"};
|
||||
/* cvar_t v_centermove = {"v_centermove", "0.15", false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *v_centermove;
|
||||
/* cvar_t v_centerspeed = {"v_centerspeed","500"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *v_centerspeed;
|
||||
|
||||
|
||||
void V_StartPitchDrift (void)
|
||||
|
@ -163,7 +227,9 @@ void V_StartPitchDrift (void)
|
|||
#endif
|
||||
if (cl.nodrift || !cl.pitchvel)
|
||||
{
|
||||
cl.pitchvel = v_centerspeed.value;
|
||||
/* cl.pitchvel = v_centerspeed.value;
|
||||
CVAR_FIXME */
|
||||
cl.pitchvel = v_centerspeed->value;
|
||||
cl.nodrift = false;
|
||||
cl.driftmove = 0;
|
||||
}
|
||||
|
@ -208,7 +274,9 @@ void V_DriftPitch (void)
|
|||
else
|
||||
cl.driftmove += host_frametime;
|
||||
|
||||
if ( cl.driftmove > v_centermove.value)
|
||||
/* if ( cl.driftmove > v_centermove.value)
|
||||
CVAR_FIXME */
|
||||
if ( cl.driftmove > v_centermove->value)
|
||||
{
|
||||
V_StartPitchDrift ();
|
||||
}
|
||||
|
@ -224,7 +292,9 @@ void V_DriftPitch (void)
|
|||
}
|
||||
|
||||
move = host_frametime * cl.pitchvel;
|
||||
cl.pitchvel += host_frametime * v_centerspeed.value;
|
||||
/* cl.pitchvel += host_frametime * v_centerspeed.value;
|
||||
CVAR_FIXME */
|
||||
cl.pitchvel += host_frametime * v_centerspeed->value;
|
||||
|
||||
//Con_Printf ("move: %f (%f)\n", move, host_frametime);
|
||||
|
||||
|
@ -266,7 +336,9 @@ 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 = {"gamma", "1", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *v_gamma;
|
||||
|
||||
byte gammatable[256]; // palette is sent through this
|
||||
|
||||
|
@ -302,11 +374,17 @@ qboolean V_CheckGamma (void)
|
|||
{
|
||||
static float oldgammavalue;
|
||||
|
||||
if (v_gamma.value == oldgammavalue)
|
||||
/* if (v_gamma.value == oldgammavalue)
|
||||
CVAR_FIXME */
|
||||
if (v_gamma->value == oldgammavalue)
|
||||
return false;
|
||||
oldgammavalue = v_gamma.value;
|
||||
/* oldgammavalue = v_gamma.value;
|
||||
CVAR_FIXME */
|
||||
oldgammavalue = v_gamma->value;
|
||||
|
||||
BuildGammaTable (v_gamma.value);
|
||||
/* BuildGammaTable (v_gamma.value);
|
||||
CVAR_FIXME */
|
||||
BuildGammaTable (v_gamma->value);
|
||||
vid.recalc_refdef = 1; // force a surface cache flush
|
||||
|
||||
return true;
|
||||
|
@ -373,12 +451,18 @@ void V_ParseDamage (void)
|
|||
AngleVectors (cl.simangles, forward, right, up);
|
||||
|
||||
side = DotProduct (from, right);
|
||||
v_dmg_roll = count*side*v_kickroll.value;
|
||||
/* v_dmg_roll = count*side*v_kickroll.value;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
v_dmg_pitch = count*side*v_kickpitch->value;
|
||||
|
||||
v_dmg_time = v_kicktime.value;
|
||||
/* v_dmg_time = v_kicktime.value;
|
||||
CVAR_FIXME */
|
||||
v_dmg_time = v_kicktime->value;
|
||||
}
|
||||
|
||||
|
||||
|
@ -420,7 +504,9 @@ Underwater, lava, etc each has a color shift
|
|||
*/
|
||||
void V_SetContentsColor (int contents)
|
||||
{
|
||||
if (!v_contentblend.value) {
|
||||
/* if (!v_contentblend.value) {
|
||||
CVAR_FIXME */
|
||||
if (!v_contentblend->value) {
|
||||
cl.cshifts[CSHIFT_CONTENTS] = cshift_empty;
|
||||
return;
|
||||
}
|
||||
|
@ -584,13 +670,25 @@ 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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
r_refdef.viewangles[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;
|
||||
/* cl.viewent.angles[ROLL] -= v_idlescale.value * sin(cl.time*v_iroll_cycle.value) * v_iroll_level.value;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
cl.viewent.angles[YAW] -= v_idlescale->value * sin(cl.time*v_iyaw_cycle->value) * v_iyaw_level->value;
|
||||
}
|
||||
|
||||
|
||||
|
@ -610,8 +708,12 @@ 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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
r_refdef.viewangles[PITCH] += v_dmg_time/v_kicktime->value*v_dmg_pitch;
|
||||
v_dmg_time -= host_frametime;
|
||||
}
|
||||
|
||||
|
@ -637,10 +739,16 @@ void V_CalcIntermissionRefdef (void)
|
|||
view->model = NULL;
|
||||
|
||||
// allways idle in intermission
|
||||
old = v_idlescale.value;
|
||||
v_idlescale.value = 1;
|
||||
/* old = v_idlescale.value;
|
||||
CVAR_FIXME */
|
||||
old = v_idlescale->value;
|
||||
/* v_idlescale.value = 1;
|
||||
CVAR_FIXME */
|
||||
v_idlescale->value = 1;
|
||||
V_AddIdle ();
|
||||
v_idlescale.value = old;
|
||||
/* v_idlescale.value = old;
|
||||
CVAR_FIXME */
|
||||
v_idlescale->value = old;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -712,13 +820,21 @@ void V_CalcRefdef (void)
|
|||
|
||||
// fudge position around to keep amount of weapon visible
|
||||
// roughly equal with different FOV
|
||||
if (scr_viewsize.value == 110)
|
||||
/* if (scr_viewsize.value == 110)
|
||||
CVAR_FIXME */
|
||||
if (scr_viewsize->value == 110)
|
||||
view->origin[2] += 1;
|
||||
else if (scr_viewsize.value == 100)
|
||||
/* else if (scr_viewsize.value == 100)
|
||||
CVAR_FIXME */
|
||||
else if (scr_viewsize->value == 100)
|
||||
view->origin[2] += 2;
|
||||
else if (scr_viewsize.value == 90)
|
||||
/* else if (scr_viewsize.value == 90)
|
||||
CVAR_FIXME */
|
||||
else if (scr_viewsize->value == 90)
|
||||
view->origin[2] += 1;
|
||||
else if (scr_viewsize.value == 80)
|
||||
/* else if (scr_viewsize.value == 80)
|
||||
CVAR_FIXME */
|
||||
else if (scr_viewsize->value == 80)
|
||||
view->origin[2] += 0.5;
|
||||
|
||||
if (view_message->flags & (PF_GIB|PF_DEAD) )
|
||||
|
@ -797,7 +913,9 @@ cl.simangles[ROLL] = 0; // FIXME @@@
|
|||
R_PushDlights ();
|
||||
R_RenderView ();
|
||||
|
||||
if (crosshair.value)
|
||||
/* if (crosshair.value)
|
||||
CVAR_FIXME */
|
||||
if (crosshair->value)
|
||||
Draw_Crosshair ();
|
||||
}
|
||||
|
||||
|
@ -814,36 +932,82 @@ void V_Init (void)
|
|||
Cmd_AddCommand ("bf", V_BonusFlash_f);
|
||||
Cmd_AddCommand ("centerview", V_StartPitchDrift);
|
||||
|
||||
Cvar_RegisterVariable (&v_centermove);
|
||||
Cvar_RegisterVariable (&v_centerspeed);
|
||||
/* Cvar_RegisterVariable (&v_centermove);
|
||||
CVAR_FIXME */
|
||||
v_centermove = Cvar_Get("v_centermove", "0.15", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&v_centerspeed);
|
||||
CVAR_FIXME */
|
||||
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);
|
||||
/* Cvar_RegisterVariable (&v_iyaw_cycle);
|
||||
CVAR_FIXME */
|
||||
v_iyaw_cycle = Cvar_Get("v_iyaw_cycle", "2", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&v_iroll_cycle);
|
||||
CVAR_FIXME */
|
||||
v_iroll_cycle = Cvar_Get("v_iroll_cycle", "0.5", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&v_ipitch_cycle);
|
||||
CVAR_FIXME */
|
||||
v_ipitch_cycle = Cvar_Get("v_ipitch_cycle", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&v_iyaw_level);
|
||||
CVAR_FIXME */
|
||||
v_iyaw_level = Cvar_Get("v_iyaw_level", "0.3", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&v_iroll_level);
|
||||
CVAR_FIXME */
|
||||
v_iroll_level = Cvar_Get("v_iroll_level", "0.1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&v_ipitch_level);
|
||||
CVAR_FIXME */
|
||||
v_ipitch_level = Cvar_Get("v_ipitch_level", "0.3", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&v_contentblend);
|
||||
/* Cvar_RegisterVariable (&v_contentblend);
|
||||
CVAR_FIXME */
|
||||
v_contentblend = Cvar_Get("v_contentblend", "1", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&v_idlescale);
|
||||
Cvar_RegisterVariable (&crosshaircolor);
|
||||
Cvar_RegisterVariable (&crosshair);
|
||||
Cvar_RegisterVariable (&cl_crossx);
|
||||
Cvar_RegisterVariable (&cl_crossy);
|
||||
/* Cvar_RegisterVariable (&v_idlescale);
|
||||
CVAR_FIXME */
|
||||
v_idlescale = Cvar_Get("v_idlescale", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&crosshaircolor);
|
||||
CVAR_FIXME */
|
||||
crosshaircolor = Cvar_Get("crosshaircolor", "79", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&crosshair);
|
||||
CVAR_FIXME */
|
||||
crosshair = Cvar_Get("crosshair", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_crossx);
|
||||
CVAR_FIXME */
|
||||
cl_crossx = Cvar_Get("cl_crossx", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_crossy);
|
||||
CVAR_FIXME */
|
||||
cl_crossy = Cvar_Get("cl_crossy", "0", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&cl_rollspeed);
|
||||
Cvar_RegisterVariable (&cl_rollangle);
|
||||
Cvar_RegisterVariable (&cl_bob);
|
||||
Cvar_RegisterVariable (&cl_bobcycle);
|
||||
Cvar_RegisterVariable (&cl_bobup);
|
||||
/* Cvar_RegisterVariable (&cl_rollspeed);
|
||||
CVAR_FIXME */
|
||||
cl_rollspeed = Cvar_Get("cl_rollspeed", "200", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_rollangle);
|
||||
CVAR_FIXME */
|
||||
cl_rollangle = Cvar_Get("cl_rollangle", "2.0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_bob);
|
||||
CVAR_FIXME */
|
||||
cl_bob = Cvar_Get("cl_bob", "0.02", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_bobcycle);
|
||||
CVAR_FIXME */
|
||||
cl_bobcycle = Cvar_Get("cl_bobcycle", "0.6", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_bobup);
|
||||
CVAR_FIXME */
|
||||
cl_bobup = Cvar_Get("cl_bobup", "0.5", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&v_kicktime);
|
||||
Cvar_RegisterVariable (&v_kickroll);
|
||||
Cvar_RegisterVariable (&v_kickpitch);
|
||||
/* Cvar_RegisterVariable (&v_kicktime);
|
||||
CVAR_FIXME */
|
||||
v_kicktime = Cvar_Get("v_kicktime", "0.5", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&v_kickroll);
|
||||
CVAR_FIXME */
|
||||
v_kickroll = Cvar_Get("v_kickroll", "0.6", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&v_kickpitch);
|
||||
CVAR_FIXME */
|
||||
v_kickpitch = Cvar_Get("v_kickpitch", "0.6", CVAR_NONE, "None");
|
||||
|
||||
BuildGammaTable (1.0); // no gamma yet
|
||||
Cvar_RegisterVariable (&v_gamma);
|
||||
/* Cvar_RegisterVariable (&v_gamma);
|
||||
CVAR_FIXME */
|
||||
v_gamma = Cvar_Get("gamma", "1", CVAR_NONE, "None");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -514,8 +514,12 @@ void Sbar_DrawInventory (void)
|
|||
qboolean headsup;
|
||||
qboolean hudswap;
|
||||
|
||||
headsup = !(cl_sbar.value || scr_viewsize.value<100);
|
||||
hudswap = cl_hudswap.value; // Get that nasty float out :)
|
||||
/* headsup = !(cl_sbar.value || scr_viewsize.value<100);
|
||||
CVAR_FIXME */
|
||||
headsup = !(cl_sbar->value || scr_viewsize->value<100);
|
||||
/* hudswap = cl_hudswap.value; // Get that nasty float out :)
|
||||
CVAR_FIXME */
|
||||
hudswap = cl_hudswap->value; // Get that nasty float out :)
|
||||
|
||||
if (!headsup)
|
||||
Sbar_DrawPic (0, -24, sb_ibar);
|
||||
|
@ -726,7 +730,9 @@ Sbar_DrawNormal
|
|||
*/
|
||||
void Sbar_DrawNormal (void)
|
||||
{
|
||||
if (cl_sbar.value || scr_viewsize.value<100)
|
||||
/* if (cl_sbar.value || scr_viewsize.value<100)
|
||||
CVAR_FIXME */
|
||||
if (cl_sbar->value || scr_viewsize->value<100)
|
||||
Sbar_DrawPic (0, 0, sb_sbar);
|
||||
|
||||
// armor
|
||||
|
@ -778,7 +784,9 @@ void Sbar_Draw (void)
|
|||
qboolean headsup;
|
||||
char st[512];
|
||||
|
||||
headsup = !(cl_sbar.value || scr_viewsize.value<100);
|
||||
/* headsup = !(cl_sbar.value || scr_viewsize.value<100);
|
||||
CVAR_FIXME */
|
||||
headsup = !(cl_sbar->value || scr_viewsize->value<100);
|
||||
if ((sb_updates >= vid.numpages) && !headsup)
|
||||
return;
|
||||
|
||||
|
|
182
source/screen.c
182
source/screen.c
|
@ -90,15 +90,33 @@ float scr_conlines; // lines of console to display
|
|||
|
||||
float oldscreensize, oldfov;
|
||||
float oldsbar;
|
||||
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_allowsnap = {"scr_allowsnap", "1"};
|
||||
/* cvar_t scr_viewsize = {"viewsize","100", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_viewsize;
|
||||
/* cvar_t scr_fov = {"fov","90"}; // 10 - 170
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_fov; // 10 - 170
|
||||
/* cvar_t scr_conspeed = {"scr_conspeed","300"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_conspeed;
|
||||
/* cvar_t scr_centertime = {"scr_centertime","2"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_centertime;
|
||||
/* cvar_t scr_showram = {"showram","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_showram;
|
||||
/* cvar_t scr_showturtle = {"showturtle","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_showturtle;
|
||||
/* cvar_t scr_showpause = {"showpause","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_showpause;
|
||||
/* cvar_t scr_printspeed = {"scr_printspeed","8"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_printspeed;
|
||||
/* cvar_t scr_allowsnap = {"scr_allowsnap", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *scr_allowsnap;
|
||||
|
||||
qboolean scr_initialized; // ready to draw
|
||||
|
||||
|
@ -153,7 +171,9 @@ 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;
|
||||
CVAR_FIXME */
|
||||
scr_centertime_off = scr_centertime->value;
|
||||
scr_centertime_start = cl.time;
|
||||
|
||||
// count the number of lines for centering
|
||||
|
@ -195,7 +215,9 @@ 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);
|
||||
CVAR_FIXME */
|
||||
remaining = scr_printspeed->value * (cl.time - scr_centertime_start);
|
||||
else
|
||||
remaining = 9999;
|
||||
|
||||
|
@ -294,25 +316,37 @@ static void SCR_CalcRefdef (void)
|
|||
//========================================
|
||||
|
||||
// bound viewsize
|
||||
if (scr_viewsize.value < 30)
|
||||
/* if (scr_viewsize.value < 30)
|
||||
CVAR_FIXME */
|
||||
if (scr_viewsize->value < 30)
|
||||
Cvar_Set ("viewsize","30");
|
||||
if (scr_viewsize.value > 120)
|
||||
/* if (scr_viewsize.value > 120)
|
||||
CVAR_FIXME */
|
||||
if (scr_viewsize->value > 120)
|
||||
Cvar_Set ("viewsize","120");
|
||||
|
||||
// bound field of view
|
||||
if (scr_fov.value < 10)
|
||||
/* if (scr_fov.value < 10)
|
||||
CVAR_FIXME */
|
||||
if (scr_fov->value < 10)
|
||||
Cvar_Set ("fov","10");
|
||||
if (scr_fov.value > 170)
|
||||
/* if (scr_fov.value > 170)
|
||||
CVAR_FIXME */
|
||||
if (scr_fov->value > 170)
|
||||
Cvar_Set ("fov","170");
|
||||
|
||||
r_refdef.fov_x = scr_fov.value;
|
||||
/* r_refdef.fov_x = scr_fov.value;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
size = scr_viewsize->value;
|
||||
|
||||
if (size >= 120)
|
||||
sb_lines = 0; // no status bar at all
|
||||
|
@ -349,8 +383,12 @@ Keybinding command
|
|||
*/
|
||||
void SCR_SizeUp_f (void)
|
||||
{
|
||||
if (scr_viewsize.value < 120) {
|
||||
Cvar_SetValue ("viewsize",scr_viewsize.value+10);
|
||||
/* if (scr_viewsize.value < 120) {
|
||||
CVAR_FIXME */
|
||||
if (scr_viewsize->value < 120) {
|
||||
/* Cvar_SetValue ("viewsize",scr_viewsize.value+10);
|
||||
CVAR_FIXME */
|
||||
scr_viewsize->value = scr_viewsize->value+10;
|
||||
vid.recalc_refdef = 1;
|
||||
}
|
||||
}
|
||||
|
@ -365,7 +403,9 @@ Keybinding command
|
|||
*/
|
||||
void SCR_SizeDown_f (void)
|
||||
{
|
||||
Cvar_SetValue ("viewsize",scr_viewsize.value-10);
|
||||
/* Cvar_SetValue ("viewsize",scr_viewsize.value-10);
|
||||
CVAR_FIXME */
|
||||
scr_viewsize->value = scr_viewsize->value-10;
|
||||
vid.recalc_refdef = 1;
|
||||
}
|
||||
|
||||
|
@ -378,15 +418,33 @@ 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 (&scr_allowsnap);
|
||||
/* Cvar_RegisterVariable (&scr_fov);
|
||||
CVAR_FIXME */
|
||||
scr_fov = Cvar_Get("fov", "90", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_viewsize);
|
||||
CVAR_FIXME */
|
||||
scr_viewsize = Cvar_Get("viewsize", "100", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_conspeed);
|
||||
CVAR_FIXME */
|
||||
scr_conspeed = Cvar_Get("scr_conspeed", "300", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_showram);
|
||||
CVAR_FIXME */
|
||||
scr_showram = Cvar_Get("showram", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_showturtle);
|
||||
CVAR_FIXME */
|
||||
scr_showturtle = Cvar_Get("showturtle", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_showpause);
|
||||
CVAR_FIXME */
|
||||
scr_showpause = Cvar_Get("showpause", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_centertime);
|
||||
CVAR_FIXME */
|
||||
scr_centertime = Cvar_Get("scr_centertime", "2", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_printspeed);
|
||||
CVAR_FIXME */
|
||||
scr_printspeed = Cvar_Get("scr_printspeed", "8", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&scr_allowsnap);
|
||||
CVAR_FIXME */
|
||||
scr_allowsnap = Cvar_Get("scr_allowsnap", "1", CVAR_NONE, "None");
|
||||
|
||||
//
|
||||
// register our commands
|
||||
|
@ -412,7 +470,9 @@ SCR_DrawRam
|
|||
*/
|
||||
void SCR_DrawRam (void)
|
||||
{
|
||||
if (!scr_showram.value)
|
||||
/* if (!scr_showram.value)
|
||||
CVAR_FIXME */
|
||||
if (!scr_showram->value)
|
||||
return;
|
||||
|
||||
if (!r_cache_thrash)
|
||||
|
@ -430,7 +490,9 @@ void SCR_DrawTurtle (void)
|
|||
{
|
||||
static int count;
|
||||
|
||||
if (!scr_showturtle.value)
|
||||
/* if (!scr_showturtle.value)
|
||||
CVAR_FIXME */
|
||||
if (!scr_showturtle->value)
|
||||
return;
|
||||
|
||||
if (host_frametime < 0.1)
|
||||
|
@ -463,7 +525,9 @@ void SCR_DrawNet (void)
|
|||
|
||||
void SCR_DrawFPS (void)
|
||||
{
|
||||
extern cvar_t show_fps;
|
||||
/* extern cvar_t show_fps;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *show_fps;
|
||||
static double lastframetime;
|
||||
double t;
|
||||
extern int fps_count;
|
||||
|
@ -471,7 +535,9 @@ void SCR_DrawFPS (void)
|
|||
int x, y;
|
||||
char st[80];
|
||||
|
||||
if (!show_fps.value)
|
||||
/* if (!show_fps.value)
|
||||
CVAR_FIXME */
|
||||
if (!show_fps->value)
|
||||
return;
|
||||
|
||||
t = Sys_DoubleTime();
|
||||
|
@ -497,7 +563,9 @@ void SCR_DrawPause (void)
|
|||
{
|
||||
qpic_t *pic;
|
||||
|
||||
if (!scr_showpause.value) // turn off for screenshots
|
||||
/* if (!scr_showpause.value) // turn off for screenshots
|
||||
CVAR_FIXME */
|
||||
if (!scr_showpause->value) // turn off for screenshots
|
||||
return;
|
||||
|
||||
if (!cl.paused)
|
||||
|
@ -534,14 +602,18 @@ 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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
scr_con_current += scr_conspeed->value*host_frametime;
|
||||
if (scr_conlines < scr_con_current)
|
||||
scr_con_current = scr_conlines;
|
||||
}
|
||||
|
@ -807,7 +879,9 @@ void SCR_RSShot_f (void)
|
|||
if (cls.state < ca_onserver)
|
||||
return; // gotta be connected
|
||||
|
||||
if (!scr_allowsnap.value) {
|
||||
/* if (!scr_allowsnap.value) {
|
||||
CVAR_FIXME */
|
||||
if (!scr_allowsnap->value) {
|
||||
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
|
||||
SZ_Print (&cls.netchan.message, "snap\n");
|
||||
Con_Printf("Refusing remote screen shot request.\n");
|
||||
|
@ -891,7 +965,7 @@ void SCR_RSShot_f (void)
|
|||
st[sizeof(st) - 1] = 0;
|
||||
SCR_DrawStringToSnap (st, newbuf, w - strlen(st)*8, 10, w);
|
||||
|
||||
strncpy(st, name.string, sizeof(st));
|
||||
strncpy(st, name->string, sizeof(st));
|
||||
st[sizeof(st) - 1] = 0;
|
||||
SCR_DrawStringToSnap (st, newbuf, w - strlen(st)*8, 20, w);
|
||||
|
||||
|
@ -1037,30 +1111,46 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (scr_viewsize->value != oldscr_viewsize)
|
||||
{
|
||||
oldscr_viewsize = scr_viewsize.value;
|
||||
/* oldscr_viewsize = scr_viewsize.value;
|
||||
CVAR_FIXME */
|
||||
oldscr_viewsize = scr_viewsize->value;
|
||||
vid.recalc_refdef = 1;
|
||||
}
|
||||
|
||||
//
|
||||
// check for vid changes
|
||||
//
|
||||
if (oldfov != scr_fov.value)
|
||||
/* if (oldfov != scr_fov.value)
|
||||
CVAR_FIXME */
|
||||
if (oldfov != scr_fov->value)
|
||||
{
|
||||
oldfov = scr_fov.value;
|
||||
/* oldfov = scr_fov.value;
|
||||
CVAR_FIXME */
|
||||
oldfov = scr_fov->value;
|
||||
vid.recalc_refdef = true;
|
||||
}
|
||||
|
||||
if (oldscreensize != scr_viewsize.value)
|
||||
/* if (oldscreensize != scr_viewsize.value)
|
||||
CVAR_FIXME */
|
||||
if (oldscreensize != scr_viewsize->value)
|
||||
{
|
||||
oldscreensize = scr_viewsize.value;
|
||||
/* oldscreensize = scr_viewsize.value;
|
||||
CVAR_FIXME */
|
||||
oldscreensize = scr_viewsize->value;
|
||||
vid.recalc_refdef = true;
|
||||
}
|
||||
|
||||
if (oldsbar != cl_sbar.value)
|
||||
/* if (oldsbar != cl_sbar.value)
|
||||
CVAR_FIXME */
|
||||
if (oldsbar != cl_sbar->value)
|
||||
{
|
||||
oldsbar = cl_sbar.value;
|
||||
/* oldsbar = cl_sbar.value;
|
||||
CVAR_FIXME */
|
||||
oldsbar = cl_sbar->value;
|
||||
vid.recalc_refdef = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,8 +29,12 @@
|
|||
#include "sys.h"
|
||||
#include "quakedef.h"
|
||||
|
||||
cvar_t baseskin = {"baseskin", "base"};
|
||||
cvar_t noskins = {"noskins", "0"};
|
||||
/* cvar_t baseskin = {"baseskin", "base"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *baseskin;
|
||||
/* cvar_t noskins = {"noskins", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *noskins;
|
||||
|
||||
char allskins[128];
|
||||
#define MAX_CACHED_SKINS 128
|
||||
|
@ -60,7 +64,7 @@ void Skin_Find (player_info_t *sc)
|
|||
if (s && s[0])
|
||||
strcpy (name, s);
|
||||
else
|
||||
strcpy (name, baseskin.string);
|
||||
strcpy (name, baseskin->string);
|
||||
}
|
||||
|
||||
if (strstr (name, "..") || *name == '.')
|
||||
|
@ -113,7 +117,9 @@ byte *Skin_Cache (skin_t *skin)
|
|||
if (cls.downloadtype == dl_skin)
|
||||
return NULL; // use base until downloaded
|
||||
|
||||
if (noskins.value==1) // JACK: So NOSKINS > 1 will show skins, but
|
||||
/* if (noskins.value==1) // JACK: So NOSKINS > 1 will show skins, but
|
||||
CVAR_FIXME */
|
||||
if (noskins->value==1) // JACK: So NOSKINS > 1 will show skins, but
|
||||
return NULL; // not download new ones.
|
||||
|
||||
if (skin->failedload)
|
||||
|
@ -131,7 +137,7 @@ byte *Skin_Cache (skin_t *skin)
|
|||
if (!raw)
|
||||
{
|
||||
Con_Printf ("Couldn't load skin %s\n", name);
|
||||
snprintf (name, sizeof(name), "skins/%s.pcx", baseskin.string);
|
||||
snprintf (name, sizeof(name), "skins/%s.pcx", baseskin->string);
|
||||
raw = COM_LoadTempFile (name);
|
||||
if (!raw)
|
||||
{
|
||||
|
@ -242,7 +248,9 @@ void Skin_NextDownload (void)
|
|||
if (!sc->name[0])
|
||||
continue;
|
||||
Skin_Find (sc);
|
||||
if (noskins.value)
|
||||
/* if (noskins.value)
|
||||
CVAR_FIXME */
|
||||
if (noskins->value)
|
||||
continue;
|
||||
if (!CL_CheckOrDownloadFile(va("skins/%s.pcx", sc->skin->name)))
|
||||
return; // started a download
|
||||
|
|
132
source/snd_dma.c
132
source/snd_dma.c
|
@ -81,18 +81,40 @@ int desired_bits = 16;
|
|||
|
||||
int sound_started=0;
|
||||
|
||||
cvar_t bgmvolume = {"bgmvolume", "1", true};
|
||||
cvar_t volume = {"volume", "0.7", true};
|
||||
/* cvar_t bgmvolume = {"bgmvolume", "1", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *bgmvolume;
|
||||
/* cvar_t volume = {"volume", "0.7", true};
|
||||
CVAR_FIXME */
|
||||
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 = {"nosound", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *nosound;
|
||||
/* cvar_t precache = {"precache", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *precache;
|
||||
/* cvar_t loadas8bit = {"loadas8bit", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *loadas8bit;
|
||||
/* cvar_t bgmbuffer = {"bgmbuffer", "4096"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *bgmbuffer;
|
||||
/* cvar_t ambient_level = {"ambient_level", "0.3"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *ambient_level;
|
||||
/* cvar_t ambient_fade = {"ambient_fade", "100"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *ambient_fade;
|
||||
/* cvar_t snd_noextraupdate = {"snd_noextraupdate", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *snd_noextraupdate;
|
||||
/* cvar_t snd_show = {"snd_show", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *snd_show;
|
||||
/* cvar_t _snd_mixahead = {"_snd_mixahead", "0.1", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *_snd_mixahead;
|
||||
|
||||
|
||||
// ====================================================================
|
||||
|
@ -194,17 +216,39 @@ 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);
|
||||
/* Cvar_RegisterVariable(&nosound);
|
||||
CVAR_FIXME */
|
||||
nosound = Cvar_Get("nosound", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable(&volume);
|
||||
CVAR_FIXME */
|
||||
volume = Cvar_Get("volume", "0.7", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable(&precache);
|
||||
CVAR_FIXME */
|
||||
precache = Cvar_Get("precache", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable(&loadas8bit);
|
||||
CVAR_FIXME */
|
||||
loadas8bit = Cvar_Get("loadas8bit", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable(&bgmvolume);
|
||||
CVAR_FIXME */
|
||||
bgmvolume = Cvar_Get("bgmvolume", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable(&bgmbuffer);
|
||||
CVAR_FIXME */
|
||||
bgmbuffer = Cvar_Get("bgmbuffer", "4096", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable(&ambient_level);
|
||||
CVAR_FIXME */
|
||||
ambient_level = Cvar_Get("ambient_level", "0.3", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable(&ambient_fade);
|
||||
CVAR_FIXME */
|
||||
ambient_fade = Cvar_Get("ambient_fade", "100", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable(&snd_noextraupdate);
|
||||
CVAR_FIXME */
|
||||
snd_noextraupdate = Cvar_Get("snd_noextraupdate", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable(&snd_show);
|
||||
CVAR_FIXME */
|
||||
snd_show = Cvar_Get("snd_show", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable(&_snd_mixahead);
|
||||
CVAR_FIXME */
|
||||
_snd_mixahead = Cvar_Get("_snd_mixahead", "0.1", CVAR_NONE, "None");
|
||||
|
||||
if (host_parms.memsize < 0x800000)
|
||||
{
|
||||
|
@ -344,13 +388,17 @@ sfx_t *S_PrecacheSound (char *name)
|
|||
{
|
||||
sfx_t *sfx;
|
||||
|
||||
if (!sound_started || nosound.value)
|
||||
/* if (!sound_started || nosound.value)
|
||||
CVAR_FIXME */
|
||||
if (!sound_started || nosound->value)
|
||||
return NULL;
|
||||
|
||||
sfx = S_FindName (name);
|
||||
|
||||
// cache it in
|
||||
if (precache.value)
|
||||
/* if (precache.value)
|
||||
CVAR_FIXME */
|
||||
if (precache->value)
|
||||
S_LoadSound (sfx);
|
||||
|
||||
return sfx;
|
||||
|
@ -475,7 +523,9 @@ void S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float f
|
|||
if (!sfx)
|
||||
return;
|
||||
|
||||
if (nosound.value)
|
||||
/* if (nosound.value)
|
||||
CVAR_FIXME */
|
||||
if (nosound->value)
|
||||
return;
|
||||
|
||||
vol = fvol*255;
|
||||
|
@ -689,7 +739,9 @@ void S_UpdateAmbientSounds (void)
|
|||
return;
|
||||
|
||||
l = Mod_PointInLeaf (listener_origin, cl.worldmodel);
|
||||
if (!l || !ambient_level.value)
|
||||
/* if (!l || !ambient_level.value)
|
||||
CVAR_FIXME */
|
||||
if (!l || !ambient_level->value)
|
||||
{
|
||||
for (ambient_channel = 0 ; ambient_channel< NUM_AMBIENTS ; ambient_channel++)
|
||||
channels[ambient_channel].sfx = NULL;
|
||||
|
@ -701,20 +753,26 @@ 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];
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
chan->master_vol -= host_frametime * ambient_fade->value;
|
||||
if (chan->master_vol < vol)
|
||||
chan->master_vol = vol;
|
||||
}
|
||||
|
@ -802,7 +860,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (snd_show->value)
|
||||
{
|
||||
total = 0;
|
||||
ch = channels;
|
||||
|
@ -856,7 +916,9 @@ void S_ExtraUpdate (void)
|
|||
IN_Accumulate ();
|
||||
#endif
|
||||
|
||||
if (snd_noextraupdate.value)
|
||||
/* if (snd_noextraupdate.value)
|
||||
CVAR_FIXME */
|
||||
if (snd_noextraupdate->value)
|
||||
return; // don't pollute timings
|
||||
S_Update_();
|
||||
}
|
||||
|
@ -882,7 +944,9 @@ void S_Update_(void)
|
|||
}
|
||||
|
||||
// mix ahead of current position
|
||||
endtime = soundtime + _snd_mixahead.value * shm->speed;
|
||||
/* endtime = soundtime + _snd_mixahead.value * shm->speed;
|
||||
CVAR_FIXME */
|
||||
endtime = soundtime + _snd_mixahead->value * shm->speed;
|
||||
samps = shm->samples >> (shm->channels-1);
|
||||
if (endtime - soundtime > samps)
|
||||
endtime = soundtime + samps;
|
||||
|
@ -996,7 +1060,9 @@ void S_LocalSound (char *sound)
|
|||
{
|
||||
sfx_t *sfx;
|
||||
|
||||
if (nosound.value)
|
||||
/* if (nosound.value)
|
||||
CVAR_FIXME */
|
||||
if (nosound->value)
|
||||
return;
|
||||
if (!sound_started)
|
||||
return;
|
||||
|
|
|
@ -60,7 +60,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (loadas8bit->value)
|
||||
sc->width = 1;
|
||||
else
|
||||
sc->width = inwidth;
|
||||
|
|
|
@ -82,7 +82,9 @@ void S_TransferStereo16 (int endtime)
|
|||
HRESULT hresult;
|
||||
#endif
|
||||
|
||||
snd_vol = volume.value*256;
|
||||
/* snd_vol = volume.value*256;
|
||||
CVAR_FIXME */
|
||||
snd_vol = volume->value*256;
|
||||
|
||||
snd_p = (int *) paintbuffer;
|
||||
lpaintedtime = paintedtime;
|
||||
|
@ -172,7 +174,9 @@ 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;
|
||||
CVAR_FIXME */
|
||||
snd_vol = volume->value*256;
|
||||
|
||||
#ifdef _WIN32
|
||||
if (pDSBuf)
|
||||
|
|
|
@ -32,7 +32,9 @@ qboolean sv_allow_cheats;
|
|||
|
||||
int fp_messages=4, fp_persecond=4, fp_secondsdead=10;
|
||||
char fp_msg[255] = { 0 };
|
||||
extern cvar_t cl_warncmd;
|
||||
/* extern cvar_t cl_warncmd;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *cl_warncmd;
|
||||
extern redirect_t sv_redirected;
|
||||
|
||||
|
||||
|
@ -896,5 +898,7 @@ void SV_InitOperatorCommands (void)
|
|||
Cmd_AddCommand ("floodprot", SV_Floodprot_f);
|
||||
Cmd_AddCommand ("floodprotmsg", SV_Floodprotmsg_f);
|
||||
|
||||
cl_warncmd.value = 1;
|
||||
/* cl_warncmd.value = 1;
|
||||
CVAR_FIXME */
|
||||
cl_warncmd->value = 1;
|
||||
}
|
||||
|
|
|
@ -29,27 +29,29 @@
|
|||
#include "qwsvdef.h"
|
||||
|
||||
void SV_SendServerInfoChange(char *key, char *value);
|
||||
extern cvar_t sv_highchars;
|
||||
/* extern cvar_t sv_highchars;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_highchars;
|
||||
|
||||
void
|
||||
Cvar_Info(cvar_t *var)
|
||||
{
|
||||
if (var->info)
|
||||
{
|
||||
unsigned char info[1024],*p, *c;
|
||||
if (var->flags & CVAR_SERVERINFO)
|
||||
{
|
||||
unsigned char info[1024],*p, *c;
|
||||
|
||||
for (p=info, c=var->string; *c && (p-info<sizeof(info)-1); c++, p++) {
|
||||
if (!sv_highchars.value) {
|
||||
*c &= 127;
|
||||
if (*c < 32 || *c > 127)
|
||||
continue;
|
||||
*p = *c;
|
||||
}
|
||||
}
|
||||
*p=0;
|
||||
for (p=info, c=var->string; *c && (p-info<sizeof(info)-1); c++, p++) {
|
||||
if (!sv_highchars->value) {
|
||||
*c &= 127;
|
||||
if (*c < 32 || *c > 127)
|
||||
continue;
|
||||
*p = *c;
|
||||
}
|
||||
}
|
||||
*p=0;
|
||||
|
||||
Info_SetValueForKey (svs.info, var->name, info, MAX_SERVERINFO_STRING);
|
||||
SV_SendServerInfoChange(var->name, var->string);
|
||||
// SV_BroadcastCommand ("fullserverinfo \"%s\"\n", svs.info);
|
||||
}
|
||||
Info_SetValueForKey (svs.info, var->name, info, MAX_SERVERINFO_STRING);
|
||||
SV_SendServerInfoChange(var->name, var->string);
|
||||
// SV_BroadcastCommand ("fullserverinfo \"%s\"\n", svs.info);
|
||||
}
|
||||
}
|
||||
|
|
394
source/sv_main.c
394
source/sv_main.c
|
@ -41,49 +41,107 @@ netadr_t master_adr[MAX_MASTERS]; // address of group servers
|
|||
|
||||
client_t *host_client; // current client
|
||||
|
||||
cvar_t sv_mintic = {"sv_mintic","0.03"}; // bound the size of the
|
||||
cvar_t sv_maxtic = {"sv_maxtic","0.1"}; // physics time tic
|
||||
/* cvar_t sv_mintic = {"sv_mintic","0.03"}; // bound the size of the
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_mintic; // bound the size of the
|
||||
/* cvar_t sv_maxtic = {"sv_maxtic","0.1"}; // physics time tic
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_maxtic; // physics time tic
|
||||
|
||||
cvar_t developer = {"developer","0"}; // show extra messages
|
||||
/* cvar_t developer = {"developer","0"}; // show extra messages
|
||||
CVAR_FIXME */
|
||||
cvar_t *developer; // show extra messages
|
||||
|
||||
cvar_t timeout = {"timeout","65"}; // seconds without any message
|
||||
cvar_t zombietime = {"zombietime", "2"}; // seconds to sink messages
|
||||
/* cvar_t timeout = {"timeout","65"}; // seconds without any message
|
||||
CVAR_FIXME */
|
||||
cvar_t *timeout; // seconds without any message
|
||||
/* cvar_t zombietime = {"zombietime", "2"}; // seconds to sink messages
|
||||
CVAR_FIXME */
|
||||
cvar_t *zombietime; // seconds to sink messages
|
||||
// after disconnect
|
||||
|
||||
cvar_t rcon_password = {"rcon_password", ""}; // password for remote server commands
|
||||
cvar_t password = {"password", ""}; // password for entering the game
|
||||
cvar_t spectator_password = {"spectator_password", ""}; // password for entering as a sepctator
|
||||
/* cvar_t rcon_password = {"rcon_password", ""}; // password for remote server commands
|
||||
CVAR_FIXME */
|
||||
cvar_t *rcon_password; // password for remote server commands
|
||||
/* cvar_t password = {"password", ""}; // password for entering the game
|
||||
CVAR_FIXME */
|
||||
cvar_t *password; // password for entering the game
|
||||
/* cvar_t spectator_password = {"spectator_password", ""}; // password for entering as a sepctator
|
||||
CVAR_FIXME */
|
||||
cvar_t *spectator_password; // password for entering as a sepctator
|
||||
|
||||
cvar_t allow_download = {"allow_download", "1"};
|
||||
cvar_t allow_download_skins = {"allow_download_skins", "1"};
|
||||
cvar_t allow_download_models = {"allow_download_models", "1"};
|
||||
cvar_t allow_download_sounds = {"allow_download_sounds", "1"};
|
||||
cvar_t allow_download_maps = {"allow_download_maps", "1"};
|
||||
/* cvar_t allow_download = {"allow_download", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *allow_download;
|
||||
/* cvar_t allow_download_skins = {"allow_download_skins", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *allow_download_skins;
|
||||
/* cvar_t allow_download_models = {"allow_download_models", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *allow_download_models;
|
||||
/* cvar_t allow_download_sounds = {"allow_download_sounds", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *allow_download_sounds;
|
||||
/* cvar_t allow_download_maps = {"allow_download_maps", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *allow_download_maps;
|
||||
|
||||
cvar_t sv_highchars = {"sv_highchars", "1"};
|
||||
/* cvar_t sv_highchars = {"sv_highchars", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_highchars;
|
||||
|
||||
cvar_t sv_phs = {"sv_phs", "1"};
|
||||
/* cvar_t sv_phs = {"sv_phs", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_phs;
|
||||
|
||||
cvar_t pausable = {"pausable", "1"};
|
||||
/* cvar_t pausable = {"pausable", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *pausable;
|
||||
|
||||
extern cvar_t sv_timekick;
|
||||
extern cvar_t sv_timekick_fuzz;
|
||||
extern cvar_t sv_timekick_interval;
|
||||
/* extern cvar_t sv_timekick;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_timekick;
|
||||
/* extern cvar_t sv_timekick_fuzz;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_timekick_fuzz;
|
||||
/* extern cvar_t sv_timekick_interval;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_timekick_interval;
|
||||
|
||||
//
|
||||
// game rules mirrored in svs.info
|
||||
//
|
||||
cvar_t fraglimit = {"fraglimit","0",false,true};
|
||||
cvar_t timelimit = {"timelimit","0",false,true};
|
||||
cvar_t teamplay = {"teamplay","0",false,true};
|
||||
cvar_t samelevel = {"samelevel","0", false, true};
|
||||
cvar_t maxclients = {"maxclients","8", false, true};
|
||||
cvar_t maxspectators = {"maxspectators","8", false, true};
|
||||
cvar_t deathmatch = {"deathmatch","1", false, true}; // 0, 1, or 2
|
||||
cvar_t spawn = {"spawn","0", false, true};
|
||||
cvar_t watervis = {"watervis", "0", false, true};
|
||||
/* cvar_t fraglimit = {"fraglimit","0",false,true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *fraglimit;
|
||||
/* cvar_t timelimit = {"timelimit","0",false,true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *timelimit;
|
||||
/* cvar_t teamplay = {"teamplay","0",false,true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *teamplay;
|
||||
/* cvar_t samelevel = {"samelevel","0", false, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *samelevel;
|
||||
/* cvar_t maxclients = {"maxclients","8", false, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *maxclients;
|
||||
/* cvar_t maxspectators = {"maxspectators","8", false, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *maxspectators;
|
||||
/* cvar_t deathmatch = {"deathmatch","1", false, true}; // 0, 1, or 2
|
||||
CVAR_FIXME */
|
||||
cvar_t *deathmatch; // 0, 1, or 2
|
||||
/* cvar_t spawn = {"spawn","0", false, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *spawn;
|
||||
/* cvar_t watervis = {"watervis", "0", false, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *watervis;
|
||||
|
||||
cvar_t hostname = {"hostname","unnamed", false, true};
|
||||
/* cvar_t hostname = {"hostname","unnamed", false, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *hostname;
|
||||
|
||||
FILE *sv_logfile;
|
||||
FILE *sv_fraglogfile;
|
||||
|
@ -568,9 +626,9 @@ void SVC_DirectConnect (void)
|
|||
s = Info_ValueForKey (userinfo, "spectator");
|
||||
if (s[0] && strcmp(s, "0"))
|
||||
{
|
||||
if (spectator_password.string[0] &&
|
||||
stricmp(spectator_password.string, "none") &&
|
||||
strcmp(spectator_password.string, s) )
|
||||
if (spectator_password->string[0] &&
|
||||
stricmp(spectator_password->string, "none") &&
|
||||
strcmp(spectator_password->string, s) )
|
||||
{ // failed
|
||||
Con_Printf ("%s:spectator password failed\n", NET_AdrToString (net_from));
|
||||
Netchan_OutOfBandPrint (net_from, "%c\nrequires a spectator password\n\n", A2C_PRINT);
|
||||
|
@ -583,9 +641,9 @@ void SVC_DirectConnect (void)
|
|||
else
|
||||
{
|
||||
s = Info_ValueForKey (userinfo, "password");
|
||||
if (password.string[0] &&
|
||||
stricmp(password.string, "none") &&
|
||||
strcmp(password.string, s) )
|
||||
if (password->string[0] &&
|
||||
stricmp(password->string, "none") &&
|
||||
strcmp(password->string, s) )
|
||||
{
|
||||
Con_Printf ("%s:password failed\n", NET_AdrToString (net_from));
|
||||
Netchan_OutOfBandPrint (net_from, "%c\nserver requires a password\n\n", A2C_PRINT);
|
||||
|
@ -604,7 +662,9 @@ void SVC_DirectConnect (void)
|
|||
newcl->userid = userid;
|
||||
|
||||
// works properly
|
||||
if (!sv_highchars.value) {
|
||||
/* if (!sv_highchars.value) {
|
||||
CVAR_FIXME */
|
||||
if (!sv_highchars->value) {
|
||||
byte *p, *q;
|
||||
|
||||
for (p = (byte *)newcl->userinfo, q = (byte *)userinfo;
|
||||
|
@ -649,14 +709,26 @@ void SVC_DirectConnect (void)
|
|||
}
|
||||
|
||||
// if at server limits, refuse connection
|
||||
if ( maxclients.value > MAX_CLIENTS )
|
||||
Cvar_SetValue ("maxclients", MAX_CLIENTS);
|
||||
if (maxspectators.value > MAX_CLIENTS)
|
||||
Cvar_SetValue ("maxspectators", MAX_CLIENTS);
|
||||
if (maxspectators.value + maxclients.value > MAX_CLIENTS)
|
||||
Cvar_SetValue ("maxspectators", MAX_CLIENTS - maxspectators.value + maxclients.value);
|
||||
if ( (spectator && spectators >= (int)maxspectators.value)
|
||||
|| (!spectator && clients >= (int)maxclients.value) )
|
||||
/* if ( maxclients.value > MAX_CLIENTS )
|
||||
CVAR_FIXME */
|
||||
if ( maxclients->value > MAX_CLIENTS )
|
||||
maxclients->value = MAX_CLIENTS;
|
||||
/* if (maxspectators.value > MAX_CLIENTS)
|
||||
CVAR_FIXME */
|
||||
if (maxspectators->value > MAX_CLIENTS)
|
||||
maxspectators->value = MAX_CLIENTS;
|
||||
/* if (maxspectators.value + maxclients.value > MAX_CLIENTS)
|
||||
CVAR_FIXME */
|
||||
if (maxspectators->value + maxclients->value > MAX_CLIENTS)
|
||||
/* Cvar_SetValue ("maxspectators", MAX_CLIENTS - maxspectators.value + maxclients.value);
|
||||
CVAR_FIXME */
|
||||
maxspectators->value = MAX_CLIENTS - maxspectators->value + maxclients->value;
|
||||
/* if ( (spectator && spectators >= (int)maxspectators.value)
|
||||
CVAR_FIXME */
|
||||
if ( (spectator && spectators >= (int)maxspectators->value)
|
||||
/* || (!spectator && clients >= (int)maxclients.value) )
|
||||
CVAR_FIXME */
|
||||
|| (!spectator && clients >= (int)maxclients->value) )
|
||||
{
|
||||
Con_Printf ("%s:full connect\n", NET_AdrToString (adr));
|
||||
Netchan_OutOfBandPrint (adr, "%c\nserver is full\n\n", A2C_PRINT);
|
||||
|
@ -732,10 +804,10 @@ void SVC_DirectConnect (void)
|
|||
|
||||
int Rcon_Validate (void)
|
||||
{
|
||||
if (!strlen (rcon_password.string))
|
||||
if (!strlen (rcon_password->string))
|
||||
return 0;
|
||||
|
||||
if (strcmp (Cmd_Argv(1), rcon_password.string) )
|
||||
if (strcmp (Cmd_Argv(1), rcon_password->string) )
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
|
@ -891,7 +963,9 @@ typedef struct
|
|||
ipfilter_t ipfilters[MAX_IPFILTERS];
|
||||
int numipfilters;
|
||||
|
||||
cvar_t filterban = {"filterban", "1"};
|
||||
/* cvar_t filterban = {"filterban", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *filterban;
|
||||
|
||||
/*
|
||||
=================
|
||||
|
@ -1072,9 +1146,13 @@ qboolean SV_FilterPacket (void)
|
|||
|
||||
for (i=0 ; i<numipfilters ; i++)
|
||||
if ( (in & ipfilters[i].mask) == ipfilters[i].compare)
|
||||
return filterban.value;
|
||||
/* return filterban.value;
|
||||
CVAR_FIXME */
|
||||
return filterban->value;
|
||||
|
||||
return !filterban.value;
|
||||
/* return !filterban.value;
|
||||
CVAR_FIXME */
|
||||
return !filterban->value;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
@ -1167,7 +1245,9 @@ void SV_CheckTimeouts (void)
|
|||
float droptime;
|
||||
int nclients;
|
||||
|
||||
droptime = realtime - timeout.value;
|
||||
/* droptime = realtime - timeout.value;
|
||||
CVAR_FIXME */
|
||||
droptime = realtime - timeout->value;
|
||||
nclients = 0;
|
||||
|
||||
for (i=0,cl=svs.clients ; i<MAX_CLIENTS ; i++,cl++)
|
||||
|
@ -1182,7 +1262,9 @@ void SV_CheckTimeouts (void)
|
|||
}
|
||||
}
|
||||
if (cl->state == cs_zombie &&
|
||||
realtime - cl->connection_started > zombietime.value)
|
||||
/* realtime - cl->connection_started > zombietime.value)
|
||||
CVAR_FIXME */
|
||||
realtime - cl->connection_started > zombietime->value)
|
||||
{
|
||||
cl->state = cs_free; // can now be reused
|
||||
}
|
||||
|
@ -1224,10 +1306,10 @@ void SV_CheckVars (void)
|
|||
static char *pw, *spw;
|
||||
int v;
|
||||
|
||||
if (password.string == pw && spectator_password.string == spw)
|
||||
if (password->string == pw && spectator_password->string == spw)
|
||||
return;
|
||||
pw = password.string;
|
||||
spw = spectator_password.string;
|
||||
pw = password->string;
|
||||
spw = spectator_password->string;
|
||||
|
||||
v = 0;
|
||||
if (pw && pw[0] && strcmp(pw, "none"))
|
||||
|
@ -1314,73 +1396,175 @@ SV_InitLocal
|
|||
void SV_InitLocal (void)
|
||||
{
|
||||
int i;
|
||||
extern cvar_t sv_maxvelocity;
|
||||
extern cvar_t sv_gravity;
|
||||
extern cvar_t sv_aim;
|
||||
extern cvar_t sv_stopspeed;
|
||||
extern cvar_t sv_spectatormaxspeed;
|
||||
extern cvar_t sv_accelerate;
|
||||
extern cvar_t sv_airaccelerate;
|
||||
extern cvar_t sv_wateraccelerate;
|
||||
extern cvar_t sv_friction;
|
||||
extern cvar_t sv_waterfriction;
|
||||
/* extern cvar_t sv_maxvelocity;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_maxvelocity;
|
||||
/* extern cvar_t sv_gravity;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_gravity;
|
||||
/* extern cvar_t sv_aim;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_aim;
|
||||
/* extern cvar_t sv_stopspeed;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_stopspeed;
|
||||
/* extern cvar_t sv_spectatormaxspeed;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_spectatormaxspeed;
|
||||
/* extern cvar_t sv_accelerate;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_accelerate;
|
||||
/* extern cvar_t sv_airaccelerate;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_airaccelerate;
|
||||
/* extern cvar_t sv_wateraccelerate;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_wateraccelerate;
|
||||
/* extern cvar_t sv_friction;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_friction;
|
||||
/* extern cvar_t sv_waterfriction;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_waterfriction;
|
||||
|
||||
SV_InitOperatorCommands ();
|
||||
SV_UserInit ();
|
||||
|
||||
Cvar_RegisterVariable (&rcon_password);
|
||||
Cvar_RegisterVariable (&password);
|
||||
Cvar_RegisterVariable (&spectator_password);
|
||||
/* Cvar_RegisterVariable (&rcon_password);
|
||||
CVAR_FIXME */
|
||||
rcon_password = Cvar_Get("rcon_password", "", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&password);
|
||||
CVAR_FIXME */
|
||||
password = Cvar_Get("password", "", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&spectator_password);
|
||||
CVAR_FIXME */
|
||||
spectator_password = Cvar_Get("spectator_password", "", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&sv_mintic);
|
||||
Cvar_RegisterVariable (&sv_maxtic);
|
||||
/* Cvar_RegisterVariable (&sv_mintic);
|
||||
CVAR_FIXME */
|
||||
sv_mintic = Cvar_Get("sv_mintic", "0.03", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sv_maxtic);
|
||||
CVAR_FIXME */
|
||||
sv_maxtic = Cvar_Get("sv_maxtic", "0.1", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&fraglimit);
|
||||
Cvar_RegisterVariable (&timelimit);
|
||||
Cvar_RegisterVariable (&teamplay);
|
||||
Cvar_RegisterVariable (&samelevel);
|
||||
Cvar_RegisterVariable (&maxclients);
|
||||
Cvar_RegisterVariable (&maxspectators);
|
||||
Cvar_RegisterVariable (&hostname);
|
||||
Cvar_RegisterVariable (&deathmatch);
|
||||
Cvar_RegisterVariable (&spawn);
|
||||
Cvar_RegisterVariable (&watervis);
|
||||
/* Cvar_RegisterVariable (&fraglimit);
|
||||
CVAR_FIXME */
|
||||
fraglimit = Cvar_Get("fraglimit", "0", CVAR_NONE|CVAR_USERINFO|CVAR_SERVERINFO, "None");
|
||||
/* Cvar_RegisterVariable (&timelimit);
|
||||
CVAR_FIXME */
|
||||
timelimit = Cvar_Get("timelimit", "0", CVAR_NONE|CVAR_USERINFO|CVAR_SERVERINFO, "None");
|
||||
/* Cvar_RegisterVariable (&teamplay);
|
||||
CVAR_FIXME */
|
||||
teamplay = Cvar_Get("teamplay", "0", CVAR_NONE|CVAR_USERINFO|CVAR_SERVERINFO, "None");
|
||||
/* Cvar_RegisterVariable (&samelevel);
|
||||
CVAR_FIXME */
|
||||
samelevel = Cvar_Get("samelevel", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&maxclients);
|
||||
CVAR_FIXME */
|
||||
maxclients = Cvar_Get("maxclients", "8", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&maxspectators);
|
||||
CVAR_FIXME */
|
||||
maxspectators = Cvar_Get("maxspectators", "8", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&hostname);
|
||||
CVAR_FIXME */
|
||||
hostname = Cvar_Get("hostname", "unnamed", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&deathmatch);
|
||||
CVAR_FIXME */
|
||||
deathmatch = Cvar_Get("deathmatch", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&spawn);
|
||||
CVAR_FIXME */
|
||||
spawn = Cvar_Get("spawn", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&watervis);
|
||||
CVAR_FIXME */
|
||||
watervis = Cvar_Get("watervis", "0", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&developer);
|
||||
/* Cvar_RegisterVariable (&developer);
|
||||
CVAR_FIXME */
|
||||
developer = Cvar_Get("developer", "0", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&timeout);
|
||||
Cvar_RegisterVariable (&zombietime);
|
||||
/* Cvar_RegisterVariable (&timeout);
|
||||
CVAR_FIXME */
|
||||
timeout = Cvar_Get("timeout", "65", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&zombietime);
|
||||
CVAR_FIXME */
|
||||
zombietime = Cvar_Get("zombietime", "2", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&sv_maxvelocity);
|
||||
Cvar_RegisterVariable (&sv_gravity);
|
||||
Cvar_RegisterVariable (&sv_stopspeed);
|
||||
Cvar_RegisterVariable (&sv_maxspeed);
|
||||
Cvar_RegisterVariable (&sv_spectatormaxspeed);
|
||||
Cvar_RegisterVariable (&sv_accelerate);
|
||||
Cvar_RegisterVariable (&sv_airaccelerate);
|
||||
Cvar_RegisterVariable (&sv_wateraccelerate);
|
||||
Cvar_RegisterVariable (&sv_friction);
|
||||
Cvar_RegisterVariable (&sv_waterfriction);
|
||||
/* Cvar_RegisterVariable (&sv_maxvelocity);
|
||||
CVAR_FIXME */
|
||||
sv_maxvelocity = Cvar_Get("sv_maxvelocity", "2000", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sv_gravity);
|
||||
CVAR_FIXME */
|
||||
sv_gravity = Cvar_Get("sv_gravity", "800", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sv_stopspeed);
|
||||
CVAR_FIXME */
|
||||
sv_stopspeed = Cvar_Get("sv_stopspeed", "100", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sv_maxspeed);
|
||||
CVAR_FIXME */
|
||||
sv_maxspeed = Cvar_Get("sv_maxspeed", "320", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sv_spectatormaxspeed);
|
||||
CVAR_FIXME */
|
||||
sv_spectatormaxspeed = Cvar_Get("sv_spectatormaxspeed", "500", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sv_accelerate);
|
||||
CVAR_FIXME */
|
||||
sv_accelerate = Cvar_Get("sv_accelerate", "10", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sv_airaccelerate);
|
||||
CVAR_FIXME */
|
||||
sv_airaccelerate = Cvar_Get("sv_airaccelerate", "0.7", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sv_wateraccelerate);
|
||||
CVAR_FIXME */
|
||||
sv_wateraccelerate = Cvar_Get("sv_wateraccelerate", "10", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sv_friction);
|
||||
CVAR_FIXME */
|
||||
sv_friction = Cvar_Get("sv_friction", "4", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sv_waterfriction);
|
||||
CVAR_FIXME */
|
||||
sv_waterfriction = Cvar_Get("sv_waterfriction", "4", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&sv_aim);
|
||||
/* Cvar_RegisterVariable (&sv_aim);
|
||||
CVAR_FIXME */
|
||||
sv_aim = Cvar_Get("sv_aim", "2", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&sv_timekick);
|
||||
Cvar_RegisterVariable (&sv_timekick_fuzz);
|
||||
Cvar_RegisterVariable (&sv_timekick_interval);
|
||||
/* Cvar_RegisterVariable (&sv_timekick);
|
||||
CVAR_FIXME */
|
||||
sv_timekick = Cvar_Get("sv_timekick", "3", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sv_timekick_fuzz);
|
||||
CVAR_FIXME */
|
||||
sv_timekick_fuzz = Cvar_Get("sv_timekick_fuzz", "10", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sv_timekick_interval);
|
||||
CVAR_FIXME */
|
||||
sv_timekick_interval = Cvar_Get("sv_timekick_interval", "30", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&filterban);
|
||||
/* Cvar_RegisterVariable (&filterban);
|
||||
CVAR_FIXME */
|
||||
filterban = Cvar_Get("filterban", "1", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&allow_download);
|
||||
Cvar_RegisterVariable (&allow_download_skins);
|
||||
Cvar_RegisterVariable (&allow_download_models);
|
||||
Cvar_RegisterVariable (&allow_download_sounds);
|
||||
Cvar_RegisterVariable (&allow_download_maps);
|
||||
/* Cvar_RegisterVariable (&allow_download);
|
||||
CVAR_FIXME */
|
||||
allow_download = Cvar_Get("allow_download", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&allow_download_skins);
|
||||
CVAR_FIXME */
|
||||
allow_download_skins = Cvar_Get("allow_download_skins", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&allow_download_models);
|
||||
CVAR_FIXME */
|
||||
allow_download_models = Cvar_Get("allow_download_models", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&allow_download_sounds);
|
||||
CVAR_FIXME */
|
||||
allow_download_sounds = Cvar_Get("allow_download_sounds", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&allow_download_maps);
|
||||
CVAR_FIXME */
|
||||
allow_download_maps = Cvar_Get("allow_download_maps", "1", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&sv_highchars);
|
||||
/* Cvar_RegisterVariable (&sv_highchars);
|
||||
CVAR_FIXME */
|
||||
sv_highchars = Cvar_Get("sv_highchars", "1", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&sv_phs);
|
||||
/* Cvar_RegisterVariable (&sv_phs);
|
||||
CVAR_FIXME */
|
||||
sv_phs = Cvar_Get("sv_phs", "1", CVAR_NONE, "None");
|
||||
|
||||
Cvar_RegisterVariable (&pausable);
|
||||
/* Cvar_RegisterVariable (&pausable);
|
||||
CVAR_FIXME */
|
||||
pausable = Cvar_Get("pausable", "1", CVAR_NONE, "None");
|
||||
|
||||
Cmd_AddCommand ("addip", SV_AddIP_f);
|
||||
Cmd_AddCommand ("removeip", SV_RemoveIP_f);
|
||||
|
|
104
source/sv_phys.c
104
source/sv_phys.c
|
@ -46,17 +46,37 @@ solid_edge items only clip against bsp models.
|
|||
|
||||
*/
|
||||
|
||||
cvar_t sv_maxvelocity = {"sv_maxvelocity","2000"};
|
||||
/* cvar_t sv_maxvelocity = {"sv_maxvelocity","2000"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_maxvelocity;
|
||||
|
||||
cvar_t sv_gravity = { "sv_gravity", "800"};
|
||||
cvar_t sv_stopspeed = { "sv_stopspeed", "100"};
|
||||
cvar_t sv_maxspeed = { "sv_maxspeed", "320"};
|
||||
cvar_t sv_spectatormaxspeed = { "sv_spectatormaxspeed", "500"};
|
||||
cvar_t sv_accelerate = { "sv_accelerate", "10"};
|
||||
cvar_t sv_airaccelerate = { "sv_airaccelerate", "0.7"};
|
||||
cvar_t sv_wateraccelerate = { "sv_wateraccelerate", "10"};
|
||||
cvar_t sv_friction = { "sv_friction", "4"};
|
||||
cvar_t sv_waterfriction = { "sv_waterfriction", "4"};
|
||||
/* cvar_t sv_gravity = { "sv_gravity", "800"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_gravity;
|
||||
/* cvar_t sv_stopspeed = { "sv_stopspeed", "100"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_stopspeed;
|
||||
/* cvar_t sv_maxspeed = { "sv_maxspeed", "320"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_maxspeed;
|
||||
/* cvar_t sv_spectatormaxspeed = { "sv_spectatormaxspeed", "500"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_spectatormaxspeed;
|
||||
/* cvar_t sv_accelerate = { "sv_accelerate", "10"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_accelerate;
|
||||
/* cvar_t sv_airaccelerate = { "sv_airaccelerate", "0.7"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_airaccelerate;
|
||||
/* cvar_t sv_wateraccelerate = { "sv_wateraccelerate", "10"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_wateraccelerate;
|
||||
/* cvar_t sv_friction = { "sv_friction", "4"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_friction;
|
||||
/* cvar_t sv_waterfriction = { "sv_waterfriction", "4"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_waterfriction;
|
||||
|
||||
|
||||
#define MOVE_EPSILON 0.01
|
||||
|
@ -113,10 +133,18 @@ void SV_CheckVelocity (edict_t *ent)
|
|||
Con_Printf ("Got a NaN origin on %s\n", PR_GetString(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)
|
||||
CVAR_FIXME */
|
||||
if (ent->v.velocity[i] > sv_maxvelocity->value)
|
||||
/* ent->v.velocity[i] = sv_maxvelocity.value;
|
||||
CVAR_FIXME */
|
||||
ent->v.velocity[i] = sv_maxvelocity->value;
|
||||
/* else if (ent->v.velocity[i] < -sv_maxvelocity.value)
|
||||
CVAR_FIXME */
|
||||
else if (ent->v.velocity[i] < -sv_maxvelocity->value)
|
||||
/* ent->v.velocity[i] = -sv_maxvelocity.value;
|
||||
CVAR_FIXME */
|
||||
ent->v.velocity[i] = -sv_maxvelocity->value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -905,10 +933,16 @@ void SV_Physics (void)
|
|||
|
||||
// don't bother running a frame if sys_ticrate seconds haven't passed
|
||||
host_frametime = realtime - old_time;
|
||||
if (host_frametime < sv_mintic.value)
|
||||
/* if (host_frametime < sv_mintic.value)
|
||||
CVAR_FIXME */
|
||||
if (host_frametime < sv_mintic->value)
|
||||
return;
|
||||
if (host_frametime > sv_maxtic.value)
|
||||
host_frametime = sv_maxtic.value;
|
||||
/* if (host_frametime > sv_maxtic.value)
|
||||
CVAR_FIXME */
|
||||
if (host_frametime > sv_maxtic->value)
|
||||
/* host_frametime = sv_maxtic.value;
|
||||
CVAR_FIXME */
|
||||
host_frametime = sv_maxtic->value;
|
||||
old_time = realtime;
|
||||
|
||||
pr_global_struct->frametime = host_frametime;
|
||||
|
@ -941,14 +975,32 @@ void SV_Physics (void)
|
|||
|
||||
void SV_SetMoveVars(void)
|
||||
{
|
||||
movevars.gravity = sv_gravity.value;
|
||||
movevars.stopspeed = sv_stopspeed.value;
|
||||
movevars.maxspeed = sv_maxspeed.value;
|
||||
movevars.spectatormaxspeed = sv_spectatormaxspeed.value;
|
||||
movevars.accelerate = sv_accelerate.value;
|
||||
movevars.airaccelerate = sv_airaccelerate.value;
|
||||
movevars.wateraccelerate = sv_wateraccelerate.value;
|
||||
movevars.friction = sv_friction.value;
|
||||
movevars.waterfriction = sv_waterfriction.value;
|
||||
/* movevars.gravity = sv_gravity.value;
|
||||
CVAR_FIXME */
|
||||
movevars.gravity = sv_gravity->value;
|
||||
/* movevars.stopspeed = sv_stopspeed.value;
|
||||
CVAR_FIXME */
|
||||
movevars.stopspeed = sv_stopspeed->value;
|
||||
/* movevars.maxspeed = sv_maxspeed.value;
|
||||
CVAR_FIXME */
|
||||
movevars.maxspeed = sv_maxspeed->value;
|
||||
/* movevars.spectatormaxspeed = sv_spectatormaxspeed.value;
|
||||
CVAR_FIXME */
|
||||
movevars.spectatormaxspeed = sv_spectatormaxspeed->value;
|
||||
/* movevars.accelerate = sv_accelerate.value;
|
||||
CVAR_FIXME */
|
||||
movevars.accelerate = sv_accelerate->value;
|
||||
/* movevars.airaccelerate = sv_airaccelerate.value;
|
||||
CVAR_FIXME */
|
||||
movevars.airaccelerate = sv_airaccelerate->value;
|
||||
/* movevars.wateraccelerate = sv_wateraccelerate.value;
|
||||
CVAR_FIXME */
|
||||
movevars.wateraccelerate = sv_wateraccelerate->value;
|
||||
/* movevars.friction = sv_friction.value;
|
||||
CVAR_FIXME */
|
||||
movevars.friction = sv_friction->value;
|
||||
/* movevars.waterfriction = sv_waterfriction.value;
|
||||
CVAR_FIXME */
|
||||
movevars.waterfriction = sv_waterfriction->value;
|
||||
movevars.entgravity = 1.0;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,9 @@ char outputbuf[8000];
|
|||
|
||||
redirect_t sv_redirected;
|
||||
|
||||
extern cvar_t sv_phs;
|
||||
/* extern cvar_t sv_phs;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *sv_phs;
|
||||
|
||||
/*
|
||||
==================
|
||||
|
@ -145,7 +147,9 @@ void Con_DPrintf (char *fmt, ...)
|
|||
va_list argptr;
|
||||
char msg[MAXPRINTMSG];
|
||||
|
||||
if (!developer.value)
|
||||
/* if (!developer.value)
|
||||
CVAR_FIXME */
|
||||
if (!developer->value)
|
||||
return;
|
||||
|
||||
va_start (argptr, fmt);
|
||||
|
@ -387,7 +391,9 @@ void SV_StartSound (edict_t *entity, int channel, char *sample, int volume,
|
|||
|
||||
ent = NUM_FOR_EDICT(entity);
|
||||
|
||||
if ((channel & 8) || !sv_phs.value) // no PHS flag
|
||||
/* if ((channel & 8) || !sv_phs.value) // no PHS flag
|
||||
CVAR_FIXME */
|
||||
if ((channel & 8) || !sv_phs->value) // no PHS flag
|
||||
{
|
||||
if (channel & 8)
|
||||
reliable = true; // sounds that break the phs are reliable
|
||||
|
|
|
@ -34,8 +34,12 @@
|
|||
qboolean is_server = true;
|
||||
qboolean WinNT;
|
||||
|
||||
cvar_t sys_nostdout = {"sys_nostdout","0"};
|
||||
cvar_t sys_sleep = {"sys_sleep","1"};
|
||||
/* cvar_t sys_nostdout = {"sys_nostdout","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sys_nostdout;
|
||||
/* cvar_t sys_sleep = {"sys_sleep","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sys_sleep;
|
||||
|
||||
/*
|
||||
================
|
||||
|
@ -132,7 +136,9 @@ void Sys_Printf (char *fmt, ...)
|
|||
{
|
||||
va_list argptr;
|
||||
|
||||
if (sys_nostdout.value)
|
||||
/* if (sys_nostdout.value)
|
||||
CVAR_FIXME */
|
||||
if (sys_nostdout->value)
|
||||
return;
|
||||
|
||||
va_start (argptr,fmt);
|
||||
|
@ -163,8 +169,12 @@ void Sys_Init (void)
|
|||
{
|
||||
OSVERSIONINFO vinfo;
|
||||
|
||||
Cvar_RegisterVariable (&sys_nostdout);
|
||||
Cvar_RegisterVariable (&sys_sleep);
|
||||
/* Cvar_RegisterVariable (&sys_nostdout);
|
||||
CVAR_FIXME */
|
||||
sys_nostdout = Cvar_Get("sys_nostdout", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sys_sleep);
|
||||
CVAR_FIXME */
|
||||
sys_sleep = Cvar_Get("sys_sleep", "1", CVAR_NONE, "None");
|
||||
|
||||
// make sure the timer is high precision, otherwise
|
||||
// NT gets 18ms resolution
|
||||
|
@ -257,7 +267,9 @@ int main (int argc, char **argv)
|
|||
{
|
||||
// Now we want to give some processing time to other applications,
|
||||
// such as qw_client, running on this machine.
|
||||
sleep_msec = sys_sleep.value;
|
||||
/* sleep_msec = sys_sleep.value;
|
||||
CVAR_FIXME */
|
||||
sleep_msec = sys_sleep->value;
|
||||
if (sleep_msec > 0)
|
||||
{
|
||||
if (sleep_msec > 13)
|
||||
|
|
144
source/sv_user.c
144
source/sv_user.c
|
@ -33,21 +33,37 @@ edict_t *sv_player;
|
|||
|
||||
usercmd_t cmd;
|
||||
|
||||
cvar_t cl_rollspeed = {"cl_rollspeed", "200"};
|
||||
cvar_t cl_rollangle = {"cl_rollangle", "2.0"};
|
||||
cvar_t sv_spectalk = {"sv_spectalk", "1"};
|
||||
/* cvar_t cl_rollspeed = {"cl_rollspeed", "200"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_rollspeed;
|
||||
/* cvar_t cl_rollangle = {"cl_rollangle", "2.0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *cl_rollangle;
|
||||
/* cvar_t sv_spectalk = {"sv_spectalk", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_spectalk;
|
||||
|
||||
cvar_t sv_mapcheck = {"sv_mapcheck", "1"};
|
||||
/* cvar_t sv_mapcheck = {"sv_mapcheck", "1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_mapcheck;
|
||||
|
||||
cvar_t sv_timekick = {"sv_timekick", "3", false, true};
|
||||
cvar_t sv_timekick_fuzz = {"sv_timekick_fuzz", "10"};
|
||||
cvar_t sv_timekick_interval = {"sv_timekick_interval", "30"};
|
||||
/* cvar_t sv_timekick = {"sv_timekick", "3", false, true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_timekick;
|
||||
/* cvar_t sv_timekick_fuzz = {"sv_timekick_fuzz", "10"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_timekick_fuzz;
|
||||
/* cvar_t sv_timekick_interval = {"sv_timekick_interval", "30"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sv_timekick_interval;
|
||||
|
||||
extern vec3_t player_mins;
|
||||
|
||||
extern int fp_messages, fp_persecond, fp_secondsdead;
|
||||
extern char fp_msg[];
|
||||
extern cvar_t pausable;
|
||||
/* extern cvar_t pausable;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *pausable;
|
||||
|
||||
void SV_FullClientUpdateToClient (client_t *client, client_t *cl);
|
||||
|
||||
|
@ -263,7 +279,9 @@ void SV_PreSpawn_f (void)
|
|||
|
||||
// Con_DPrintf("Client check = %d\n", check);
|
||||
|
||||
if (sv_mapcheck.value && check != sv.worldmodel->checksum &&
|
||||
/* if (sv_mapcheck.value && check != sv.worldmodel->checksum &&
|
||||
CVAR_FIXME */
|
||||
if (sv_mapcheck->value && check != sv.worldmodel->checksum &&
|
||||
check != sv.worldmodel->checksum2) {
|
||||
SV_ClientPrintf (host_client, PRINT_HIGH,
|
||||
"Map model file does not match (%s), %i != %i/%i.\n"
|
||||
|
@ -371,10 +389,14 @@ void SV_Spawn_f (void)
|
|||
val = GetEdictFieldValue(ent, "gravity");
|
||||
if (val)
|
||||
val->_float = 1.0;
|
||||
host_client->maxspeed = sv_maxspeed.value;
|
||||
/* host_client->maxspeed = sv_maxspeed.value;
|
||||
CVAR_FIXME */
|
||||
host_client->maxspeed = sv_maxspeed->value;
|
||||
val = GetEdictFieldValue(ent, "maxspeed");
|
||||
if (val)
|
||||
val->_float = sv_maxspeed.value;
|
||||
/* val->_float = sv_maxspeed.value;
|
||||
CVAR_FIXME */
|
||||
val->_float = sv_maxspeed->value;
|
||||
|
||||
//
|
||||
// force stats to be updated
|
||||
|
@ -655,29 +677,49 @@ SV_BeginDownload_f
|
|||
void SV_BeginDownload_f(void)
|
||||
{
|
||||
char *name;
|
||||
extern cvar_t allow_download;
|
||||
extern cvar_t allow_download_skins;
|
||||
extern cvar_t allow_download_models;
|
||||
extern cvar_t allow_download_sounds;
|
||||
extern cvar_t allow_download_maps;
|
||||
/* extern cvar_t allow_download;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *allow_download;
|
||||
/* extern cvar_t allow_download_skins;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *allow_download_skins;
|
||||
/* extern cvar_t allow_download_models;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *allow_download_models;
|
||||
/* extern cvar_t allow_download_sounds;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *allow_download_sounds;
|
||||
/* extern cvar_t allow_download_maps;
|
||||
CVAR_FIXME */
|
||||
extern cvar_t *allow_download_maps;
|
||||
extern int file_from_pak; // ZOID did file come from pak?
|
||||
|
||||
name = Cmd_Argv(1);
|
||||
// hacked by zoid to allow more conrol over download
|
||||
// first off, no .. or global allow check
|
||||
if (strstr (name, "..") || !allow_download.value
|
||||
/* if (strstr (name, "..") || !allow_download.value
|
||||
CVAR_FIXME */
|
||||
if (strstr (name, "..") || !allow_download->value
|
||||
// leading dot is no good
|
||||
|| *name == '.'
|
||||
// leading slash bad as well, must be in subdir
|
||||
|| *name == '/'
|
||||
// next up, skin check
|
||||
|| (strncmp(name, "skins/", 6) == 0 && !allow_download_skins.value)
|
||||
/* || (strncmp(name, "skins/", 6) == 0 && !allow_download_skins.value)
|
||||
CVAR_FIXME */
|
||||
|| (strncmp(name, "skins/", 6) == 0 && !allow_download_skins->value)
|
||||
// now models
|
||||
|| (strncmp(name, "progs/", 6) == 0 && !allow_download_models.value)
|
||||
/* || (strncmp(name, "progs/", 6) == 0 && !allow_download_models.value)
|
||||
CVAR_FIXME */
|
||||
|| (strncmp(name, "progs/", 6) == 0 && !allow_download_models->value)
|
||||
// now sounds
|
||||
|| (strncmp(name, "sound/", 6) == 0 && !allow_download_sounds.value)
|
||||
/* || (strncmp(name, "sound/", 6) == 0 && !allow_download_sounds.value)
|
||||
CVAR_FIXME */
|
||||
|| (strncmp(name, "sound/", 6) == 0 && !allow_download_sounds->value)
|
||||
// now maps (note special case for maps, must not be in pak)
|
||||
|| (strncmp(name, "maps/", 6) == 0 && !allow_download_maps.value)
|
||||
/* || (strncmp(name, "maps/", 6) == 0 && !allow_download_maps.value)
|
||||
CVAR_FIXME */
|
||||
|| (strncmp(name, "maps/", 6) == 0 && !allow_download_maps->value)
|
||||
// MUST be in a subdirectory
|
||||
|| !strstr (name, "/") )
|
||||
{ // don't allow anything with .. path
|
||||
|
@ -749,7 +791,9 @@ void SV_Say (qboolean team)
|
|||
t1[31] = 0;
|
||||
}
|
||||
|
||||
if (host_client->spectator && (!sv_spectalk.value || team))
|
||||
/* if (host_client->spectator && (!sv_spectalk.value || team))
|
||||
CVAR_FIXME */
|
||||
if (host_client->spectator && (!sv_spectalk->value || team))
|
||||
snprintf (text, sizeof(text), "[SPEC] %s: ", host_client->name);
|
||||
else if (team)
|
||||
snprintf (text, sizeof(text), "(%s): ", host_client->name);
|
||||
|
@ -801,7 +845,9 @@ void SV_Say (qboolean team)
|
|||
{
|
||||
if (client->state != cs_spawned)
|
||||
continue;
|
||||
if (host_client->spectator && !sv_spectalk.value)
|
||||
/* if (host_client->spectator && !sv_spectalk.value)
|
||||
CVAR_FIXME */
|
||||
if (host_client->spectator && !sv_spectalk->value)
|
||||
if (!client->spectator)
|
||||
continue;
|
||||
|
||||
|
@ -927,7 +973,9 @@ void SV_Pause_f (void)
|
|||
{
|
||||
char st[sizeof(host_client->name) + 32];
|
||||
|
||||
if (!pausable.value) {
|
||||
/* if (!pausable.value) {
|
||||
CVAR_FIXME */
|
||||
if (!pausable->value) {
|
||||
SV_ClientPrintf (host_client, PRINT_HIGH, "Pause not allowed.\n");
|
||||
return;
|
||||
}
|
||||
|
@ -1220,10 +1268,16 @@ 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;
|
||||
CVAR_FIXME */
|
||||
value = cl_rollangle->value;
|
||||
|
||||
if (side < cl_rollspeed.value)
|
||||
side = side * value / cl_rollspeed.value;
|
||||
/* if (side < cl_rollspeed.value)
|
||||
CVAR_FIXME */
|
||||
if (side < cl_rollspeed->value)
|
||||
/* side = side * value / cl_rollspeed.value;
|
||||
CVAR_FIXME */
|
||||
side = side * value / cl_rollspeed->value;
|
||||
else
|
||||
side = value;
|
||||
|
||||
|
@ -1387,17 +1441,27 @@ void SV_RunCmd (usercmd_t *ucmd, qboolean inside)
|
|||
if (!inside) {
|
||||
host_client->msecs += ucmd->msec;
|
||||
|
||||
if ((sv_timekick.value >= 1) &&
|
||||
(tmp_time = realtime - host_client->last_check) >= sv_timekick_interval.value) {
|
||||
tmp_time *= (1000 + sv_timekick_fuzz.value);
|
||||
/* if ((sv_timekick.value >= 1) &&
|
||||
CVAR_FIXME */
|
||||
if ((sv_timekick->value >= 1) &&
|
||||
/* (tmp_time = realtime - host_client->last_check) >= sv_timekick_interval.value) {
|
||||
CVAR_FIXME */
|
||||
(tmp_time = realtime - host_client->last_check) >= sv_timekick_interval->value) {
|
||||
/* tmp_time *= (1000 + sv_timekick_fuzz.value);
|
||||
CVAR_FIXME */
|
||||
tmp_time *= (1000 + sv_timekick_fuzz->value);
|
||||
if (host_client->msecs > (int) tmp_time) {
|
||||
host_client->msec_cheating++;
|
||||
SV_BroadcastPrintf( PRINT_HIGH,
|
||||
va("%s thinks %d msecs pass in %f msecs. (Strike %d/%d)\n",
|
||||
host_client->name, host_client->msecs, tmp_time,
|
||||
host_client->msec_cheating, (int)sv_timekick.value));
|
||||
/* host_client->msec_cheating, (int)sv_timekick.value));
|
||||
CVAR_FIXME */
|
||||
host_client->msec_cheating, (int)sv_timekick->value));
|
||||
|
||||
if (host_client->msec_cheating >= sv_timekick.value) {
|
||||
/* if (host_client->msec_cheating >= sv_timekick.value) {
|
||||
CVAR_FIXME */
|
||||
if (host_client->msec_cheating >= sv_timekick->value) {
|
||||
SV_BroadcastPrintf(PRINT_HIGH, va("Strike %d for %s!!\n",
|
||||
host_client->msec_cheating, host_client->name));
|
||||
SV_BroadcastPrintf(PRINT_HIGH, "Please see http://www.quakeforge.net/speed_cheat.php for infomation on QuakeForge's time cheat protection, and to explain how some may be cheating without knowing it.\n"
|
||||
|
@ -1726,10 +1790,18 @@ SV_UserInit
|
|||
*/
|
||||
void SV_UserInit (void)
|
||||
{
|
||||
Cvar_RegisterVariable (&cl_rollspeed);
|
||||
Cvar_RegisterVariable (&cl_rollangle);
|
||||
Cvar_RegisterVariable (&sv_spectalk);
|
||||
Cvar_RegisterVariable (&sv_mapcheck);
|
||||
/* Cvar_RegisterVariable (&cl_rollspeed);
|
||||
CVAR_FIXME */
|
||||
cl_rollspeed = Cvar_Get("cl_rollspeed", "200", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&cl_rollangle);
|
||||
CVAR_FIXME */
|
||||
cl_rollangle = Cvar_Get("cl_rollangle", "2.0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sv_spectalk);
|
||||
CVAR_FIXME */
|
||||
sv_spectalk = Cvar_Get("sv_spectalk", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sv_mapcheck);
|
||||
CVAR_FIXME */
|
||||
sv_mapcheck = Cvar_Get("sv_mapcheck", "1", CVAR_NONE, "None");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -55,7 +55,9 @@ char *basedir = ".";
|
|||
char *cachedir = "/tmp";
|
||||
qboolean is_server = false;
|
||||
|
||||
cvar_t sys_linerefresh = {"sys_linerefresh","0"};// set for entity display
|
||||
/* cvar_t sys_linerefresh = {"sys_linerefresh","0"};// set for entity display
|
||||
CVAR_FIXME */
|
||||
cvar_t *sys_linerefresh;// set for entity display
|
||||
|
||||
// The translation table between the graphical font and plain ASCII --KB
|
||||
char qfont_table[256] =
|
||||
|
|
|
@ -42,8 +42,12 @@
|
|||
# include <sys/dir.h>
|
||||
#endif
|
||||
|
||||
cvar_t sys_nostdout = {"sys_nostdout","0"};
|
||||
cvar_t sys_extrasleep = {"sys_extrasleep","0"};
|
||||
/* cvar_t sys_nostdout = {"sys_nostdout","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sys_nostdout;
|
||||
/* cvar_t sys_extrasleep = {"sys_extrasleep","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *sys_extrasleep;
|
||||
|
||||
qboolean stdin_ready;
|
||||
qboolean is_server = true;
|
||||
|
@ -144,7 +148,9 @@ void Sys_Printf (char *fmt, ...)
|
|||
vsnprintf (text, sizeof(text), fmt, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
if (sys_nostdout.value)
|
||||
/* if (sys_nostdout.value)
|
||||
CVAR_FIXME */
|
||||
if (sys_nostdout->value)
|
||||
return;
|
||||
|
||||
for (p = (unsigned char *)text; *p; p++) {
|
||||
|
@ -210,8 +216,12 @@ is marked
|
|||
*/
|
||||
void Sys_Init (void)
|
||||
{
|
||||
Cvar_RegisterVariable (&sys_nostdout);
|
||||
Cvar_RegisterVariable (&sys_extrasleep);
|
||||
/* Cvar_RegisterVariable (&sys_nostdout);
|
||||
CVAR_FIXME */
|
||||
sys_nostdout = Cvar_Get("sys_nostdout", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&sys_extrasleep);
|
||||
CVAR_FIXME */
|
||||
sys_extrasleep = Cvar_Get("sys_extrasleep", "0", CVAR_NONE, "None");
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -283,8 +293,12 @@ int main(int argc, char *argv[])
|
|||
SV_Frame (time);
|
||||
|
||||
// extrasleep is just a way to generate a fucked up connection on purpose
|
||||
if (sys_extrasleep.value)
|
||||
usleep (sys_extrasleep.value);
|
||||
/* if (sys_extrasleep.value)
|
||||
CVAR_FIXME */
|
||||
if (sys_extrasleep->value)
|
||||
/* usleep (sys_extrasleep.value);
|
||||
CVAR_FIXME */
|
||||
usleep (sys_extrasleep->value);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -89,13 +89,19 @@ unsigned short d_8to16table[256];
|
|||
unsigned d_8to24table[256];
|
||||
unsigned char d_15to8table[65536];
|
||||
|
||||
cvar_t _windowed_mouse = {"_windowed_mouse","0", true};
|
||||
cvar_t vid_mode = {"vid_mode","0",false};
|
||||
/* cvar_t _windowed_mouse = {"_windowed_mouse","0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *_windowed_mouse;
|
||||
/* cvar_t vid_mode = {"vid_mode","0",false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_mode;
|
||||
|
||||
static float mouse_x, mouse_y;
|
||||
static float old_mouse_x, old_mouse_y;
|
||||
|
||||
cvar_t m_filter = {"m_filter", "0"};
|
||||
/* cvar_t m_filter = {"m_filter", "0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *m_filter;
|
||||
|
||||
static int scr_width, scr_height;
|
||||
|
||||
|
@ -112,7 +118,9 @@ int texture_extension_number = 1;
|
|||
|
||||
float gldepthmin, gldepthmax;
|
||||
|
||||
cvar_t gl_ztrick = {"gl_ztrick","1"};
|
||||
/* cvar_t gl_ztrick = {"gl_ztrick","1"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *gl_ztrick;
|
||||
|
||||
const char *gl_vendor;
|
||||
const char *gl_renderer;
|
||||
|
@ -353,13 +361,17 @@ static void GetEvent(void)
|
|||
|
||||
case MotionNotify:
|
||||
#ifdef USE_DGA
|
||||
if (dgamouse && _windowed_mouse.value) {
|
||||
/* if (dgamouse && _windowed_mouse.value) {
|
||||
CVAR_FIXME */
|
||||
if (dgamouse && _windowed_mouse->value) {
|
||||
mouse_x = event.xmotion.x_root;
|
||||
mouse_y = event.xmotion.y_root;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
if (_windowed_mouse.value) {
|
||||
/* if (_windowed_mouse.value) {
|
||||
CVAR_FIXME */
|
||||
if (_windowed_mouse->value) {
|
||||
mouse_x = (float) ((int)event.xmotion.x - (int)(vid.width/2));
|
||||
mouse_y = (float) ((int)event.xmotion.y - (int)(vid.height/2));
|
||||
|
||||
|
@ -397,10 +409,16 @@ static void GetEvent(void)
|
|||
break;
|
||||
}
|
||||
|
||||
if (old_windowed_mouse != _windowed_mouse.value) {
|
||||
old_windowed_mouse = _windowed_mouse.value;
|
||||
/* if (old_windowed_mouse != _windowed_mouse.value) {
|
||||
CVAR_FIXME */
|
||||
if (old_windowed_mouse != _windowed_mouse->value) {
|
||||
/* old_windowed_mouse = _windowed_mouse.value;
|
||||
CVAR_FIXME */
|
||||
old_windowed_mouse = _windowed_mouse->value;
|
||||
|
||||
if (!_windowed_mouse.value) {
|
||||
/* if (!_windowed_mouse.value) {
|
||||
CVAR_FIXME */
|
||||
if (!_windowed_mouse->value) {
|
||||
/* ungrab the pointer */
|
||||
uninstall_grabs();
|
||||
} else {
|
||||
|
@ -674,9 +692,15 @@ void VID_Init(unsigned char *palette)
|
|||
|
||||
// S_Init();
|
||||
|
||||
Cvar_RegisterVariable (&vid_mode);
|
||||
Cvar_RegisterVariable (&gl_ztrick);
|
||||
Cvar_RegisterVariable (&_windowed_mouse);
|
||||
/* Cvar_RegisterVariable (&vid_mode);
|
||||
CVAR_FIXME */
|
||||
vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&gl_ztrick);
|
||||
CVAR_FIXME */
|
||||
gl_ztrick = Cvar_Get("gl_ztrick", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&_windowed_mouse);
|
||||
CVAR_FIXME */
|
||||
_windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_NONE, "None");
|
||||
|
||||
vid.maxwarpwidth = WARP_WIDTH;
|
||||
vid.maxwarpheight = WARP_HEIGHT;
|
||||
|
@ -813,7 +837,9 @@ IN_Move
|
|||
*/
|
||||
void IN_MouseMove (usercmd_t *cmd)
|
||||
{
|
||||
if (m_filter.value)
|
||||
/* if (m_filter.value)
|
||||
CVAR_FIXME */
|
||||
if (m_filter->value)
|
||||
{
|
||||
mouse_x = (mouse_x + old_mouse_x) * 0.5;
|
||||
mouse_y = (mouse_y + old_mouse_y) * 0.5;
|
||||
|
@ -821,21 +847,33 @@ void IN_MouseMove (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;
|
||||
CVAR_FIXME */
|
||||
mouse_x *= sensitivity->value;
|
||||
/* mouse_y *= sensitivity.value;
|
||||
CVAR_FIXME */
|
||||
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) ))
|
||||
CVAR_FIXME */
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
/* cmd->sidemove += m_side.value * mouse_x;
|
||||
CVAR_FIXME */
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
/* cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70)
|
||||
|
@ -844,9 +882,13 @@ 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;
|
||||
CVAR_FIXME */
|
||||
cmd->upmove -= m_forward->value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
/* cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
CVAR_FIXME */
|
||||
cmd->forwardmove -= m_forward->value * mouse_y;
|
||||
}
|
||||
mouse_x = mouse_y = 0.0;
|
||||
}
|
||||
|
|
|
@ -85,9 +85,15 @@ 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 = {"vid_mode","5",false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_mode;
|
||||
/* cvar_t vid_redrawfull = {"vid_redrawfull","0",false};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_redrawfull;
|
||||
/* cvar_t vid_waitforrefresh = {"vid_waitforrefresh","0",true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_waitforrefresh;
|
||||
|
||||
char *framebuffer_ptr;
|
||||
|
||||
|
@ -105,8 +111,12 @@ float mouse_x, mouse_y;
|
|||
float old_mouse_x, old_mouse_y;
|
||||
int mx, my;
|
||||
|
||||
cvar_t _windowed_mouse = {"_windowed_mouse", "1", true};
|
||||
cvar_t m_filter = {"m_filter","0"};
|
||||
/* cvar_t _windowed_mouse = {"_windowed_mouse", "1", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *_windowed_mouse;
|
||||
/* cvar_t m_filter = {"m_filter","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *m_filter;
|
||||
|
||||
static byte backingbuf[48*24];
|
||||
|
||||
|
@ -487,14 +497,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);
|
||||
vid_mode->value = (float)current_mode;
|
||||
|
||||
Con_Printf("No such video mode: %d\n",modenum);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Cvar_SetValue ("vid_mode", (float)modenum);
|
||||
vid_mode->value = (float)modenum;
|
||||
|
||||
current_mode=modenum;
|
||||
|
||||
|
@ -583,9 +593,15 @@ void VID_Init(unsigned char *palette)
|
|||
|
||||
VID_InitModes();
|
||||
|
||||
Cvar_RegisterVariable (&vid_mode);
|
||||
Cvar_RegisterVariable (&vid_redrawfull);
|
||||
Cvar_RegisterVariable (&vid_waitforrefresh);
|
||||
/* Cvar_RegisterVariable (&vid_mode);
|
||||
CVAR_FIXME */
|
||||
vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_redrawfull);
|
||||
CVAR_FIXME */
|
||||
vid_redrawfull = Cvar_Get("vid_redrawfull", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_waitforrefresh);
|
||||
CVAR_FIXME */
|
||||
vid_waitforrefresh = Cvar_Get("vid_waitforrefresh", "0", CVAR_NONE|CVAR_ARCHIVE, "None");
|
||||
|
||||
Cmd_AddCommand("vid_nummodes", VID_NumModes_f);
|
||||
Cmd_AddCommand("vid_describemode", VID_DescribeMode_f);
|
||||
|
@ -751,13 +767,17 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (vid_waitforrefresh->value)
|
||||
vga_waitretrace();
|
||||
|
||||
if (VGA_planar)
|
||||
VGA_UpdatePlanarScreen (vid.buffer);
|
||||
|
||||
else if (vid_redrawfull.value) {
|
||||
/* else if (vid_redrawfull.value) {
|
||||
CVAR_FIXME */
|
||||
else if (vid_redrawfull->value) {
|
||||
int total = vid.rowbytes * vid.height;
|
||||
int offset;
|
||||
|
||||
|
@ -805,8 +825,12 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (vid_mode->value != current_mode)
|
||||
/* VID_SetMode ((int)vid_mode.value, vid_current_palette);
|
||||
CVAR_FIXME */
|
||||
VID_SetMode ((int)vid_mode->value, vid_current_palette);
|
||||
}
|
||||
|
||||
static int dither;
|
||||
|
@ -858,13 +882,15 @@ void IN_Init(void)
|
|||
char *mousedev;
|
||||
int mouserate;
|
||||
|
||||
Cvar_RegisterVariable (&m_filter);
|
||||
/* Cvar_RegisterVariable (&m_filter);
|
||||
CVAR_FIXME */
|
||||
m_filter = Cvar_Get("m_filter", "0", CVAR_NONE, "None");
|
||||
|
||||
if (UseMouse)
|
||||
{
|
||||
Cvar_RegisterVariable (&mouse_button_commands[0]);
|
||||
Cvar_RegisterVariable (&mouse_button_commands[1]);
|
||||
Cvar_RegisterVariable (&mouse_button_commands[2]);
|
||||
// Cvar_RegisterVariable (&mouse_button_commands[0]);
|
||||
// Cvar_RegisterVariable (&mouse_button_commands[1]);
|
||||
// Cvar_RegisterVariable (&mouse_button_commands[2]);
|
||||
Cmd_AddCommand ("force_centerview", Force_CenterView_f);
|
||||
|
||||
mouse_buttons = 3;
|
||||
|
@ -954,7 +980,9 @@ void IN_MouseMove (usercmd_t *cmd)
|
|||
while (mouse_update())
|
||||
;
|
||||
|
||||
if (m_filter.value)
|
||||
/* if (m_filter.value)
|
||||
CVAR_FIXME */
|
||||
if (m_filter->value)
|
||||
{
|
||||
mouse_x = (mx + old_mouse_x) * 0.5;
|
||||
mouse_y = (my + old_mouse_y) * 0.5;
|
||||
|
@ -968,21 +996,33 @@ 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;
|
||||
CVAR_FIXME */
|
||||
mouse_x *= sensitivity->value;
|
||||
/* mouse_y *= sensitivity.value;
|
||||
CVAR_FIXME */
|
||||
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) ))
|
||||
CVAR_FIXME */
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
/* cmd->sidemove += m_side.value * mouse_x;
|
||||
CVAR_FIXME */
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
/* cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70)
|
||||
|
@ -991,9 +1031,13 @@ 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;
|
||||
CVAR_FIXME */
|
||||
cmd->upmove -= m_forward->value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
/* cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
CVAR_FIXME */
|
||||
cmd->forwardmove -= m_forward->value * mouse_y;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
264
source/vid_win.c
264
source/vid_win.c
|
@ -74,23 +74,53 @@ extern 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 = {"vid_mode","0", false};
|
||||
CVAR_FIXME */
|
||||
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 = {"_vid_default_mode","0", true};
|
||||
CVAR_FIXME */
|
||||
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 = {"_vid_default_mode_win","3", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *_vid_default_mode_win;
|
||||
/* cvar_t vid_wait = {"vid_wait","0"};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_wait;
|
||||
/* cvar_t vid_nopageflip = {"vid_nopageflip","0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_nopageflip;
|
||||
/* cvar_t _vid_wait_override = {"_vid_wait_override", "0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *_vid_wait_override;
|
||||
/* cvar_t vid_config_x = {"vid_config_x","800", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_config_x;
|
||||
/* cvar_t vid_config_y = {"vid_config_y","600", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_config_y;
|
||||
/* cvar_t vid_stretch_by_2 = {"vid_stretch_by_2","1", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_stretch_by_2;
|
||||
/* cvar_t _windowed_mouse = {"_windowed_mouse","0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *_windowed_mouse;
|
||||
/* cvar_t vid_fullscreen_mode = {"vid_fullscreen_mode","3", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_fullscreen_mode;
|
||||
/* cvar_t vid_windowed_mode = {"vid_windowed_mode","0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_windowed_mode;
|
||||
/* cvar_t block_switch = {"block_switch","0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *block_switch;
|
||||
/* cvar_t vid_window_x = {"vid_window_x", "0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_window_x;
|
||||
/* cvar_t vid_window_y = {"vid_window_y", "0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *vid_window_y;
|
||||
|
||||
typedef struct {
|
||||
int width;
|
||||
|
@ -189,10 +219,18 @@ 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)) ||
|
||||
CVAR_FIXME */
|
||||
if (((int)vid_window_x->value > (GetSystemMetrics (SM_CXSCREEN) - 160)) ||
|
||||
/* ((int)vid_window_y.value > (GetSystemMetrics (SM_CYSCREEN) - 120)) ||
|
||||
CVAR_FIXME */
|
||||
((int)vid_window_y->value > (GetSystemMetrics (SM_CYSCREEN) - 120)) ||
|
||||
/* ((int)vid_window_x.value < 0) ||
|
||||
CVAR_FIXME */
|
||||
((int)vid_window_x->value < 0) ||
|
||||
/* ((int)vid_window_y.value < 0))
|
||||
CVAR_FIXME */
|
||||
((int)vid_window_y->value < 0))
|
||||
{
|
||||
Cvar_SetValue ("vid_window_x", 0.0);
|
||||
Cvar_SetValue ("vid_window_y", 0.0 );
|
||||
|
@ -358,7 +396,9 @@ int VID_Suspend (MGLDC *dc, int flags)
|
|||
if (flags & MGL_DEACTIVATE)
|
||||
{
|
||||
// FIXME: this doesn't currently work on NT
|
||||
if (block_switch.value && !WinNT)
|
||||
/* if (block_switch.value && !WinNT)
|
||||
CVAR_FIXME */
|
||||
if (block_switch->value && !WinNT)
|
||||
{
|
||||
return MGL_NO_DEACTIVATE;
|
||||
}
|
||||
|
@ -1076,17 +1116,31 @@ 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;
|
||||
CVAR_FIXME */
|
||||
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))
|
||||
CVAR_FIXME */
|
||||
if (vid_config_x->value < (320 << stretch))
|
||||
/* vid_config_x.value = 320 << stretch;
|
||||
CVAR_FIXME */
|
||||
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))
|
||||
CVAR_FIXME */
|
||||
if (vid_config_y->value < (200 << stretch))
|
||||
/* vid_config_y.value = 200 << stretch;
|
||||
CVAR_FIXME */
|
||||
vid_config_y->value = 200 << stretch;
|
||||
|
||||
x = (int)vid_config_x.value;
|
||||
y = (int)vid_config_y.value;
|
||||
/* x = (int)vid_config_x.value;
|
||||
CVAR_FIXME */
|
||||
x = (int)vid_config_x->value;
|
||||
/* y = (int)vid_config_y.value;
|
||||
CVAR_FIXME */
|
||||
y = (int)vid_config_y->value;
|
||||
sprintf (modelist[mode].modedesc, "%dx%d", x, y);
|
||||
modelist[mode].width = x;
|
||||
modelist[mode].height = y;
|
||||
|
@ -1363,8 +1417,12 @@ 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,
|
||||
CVAR_FIXME */
|
||||
SetWindowPos (mainwindow, NULL, (int)vid_window_x->value,
|
||||
/* (int)vid_window_y.value, 0, 0,
|
||||
CVAR_FIXME */
|
||||
(int)vid_window_y->value, 0, 0,
|
||||
SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW | SWP_DRAWFRAME);
|
||||
|
||||
if (force_minimized)
|
||||
|
@ -1431,7 +1489,9 @@ qboolean VID_SetFullscreenMode (int modenum)
|
|||
mgldc = memdc = NULL;
|
||||
|
||||
if ((mgldc = createDisplayDC (modelist[modenum].stretched ||
|
||||
(int)vid_nopageflip.value)) == NULL)
|
||||
/* (int)vid_nopageflip.value)) == NULL)
|
||||
CVAR_FIXME */
|
||||
(int)vid_nopageflip->value)) == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -1655,7 +1715,9 @@ 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)
|
||||
CVAR_FIXME */
|
||||
if (_windowed_mouse->value && key_dest == key_game)
|
||||
{
|
||||
stat = VID_SetWindowedMode(modenum);
|
||||
IN_ActivateMouse ();
|
||||
|
@ -1796,7 +1858,9 @@ void VID_LockBuffer (void)
|
|||
else
|
||||
screenwidth = vid.rowbytes;
|
||||
|
||||
if (lcd_x.value)
|
||||
/* if (lcd_x.value)
|
||||
CVAR_FIXME */
|
||||
if (lcd_x->value)
|
||||
screenwidth <<= 1;
|
||||
}
|
||||
|
||||
|
@ -2047,7 +2111,9 @@ 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);
|
||||
CVAR_FIXME */
|
||||
VID_SetMode ((int)vid_windowed_mode->value, vid_curpal);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2059,7 +2125,9 @@ 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);
|
||||
CVAR_FIXME */
|
||||
VID_SetMode ((int)vid_fullscreen_mode->value, vid_curpal);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2105,21 +2173,51 @@ 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);
|
||||
/* Cvar_RegisterVariable (&vid_mode);
|
||||
CVAR_FIXME */
|
||||
vid_mode = Cvar_Get("vid_mode", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_wait);
|
||||
CVAR_FIXME */
|
||||
vid_wait = Cvar_Get("vid_wait", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_nopageflip);
|
||||
CVAR_FIXME */
|
||||
vid_nopageflip = Cvar_Get("vid_nopageflip", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&_vid_wait_override);
|
||||
CVAR_FIXME */
|
||||
_vid_wait_override = Cvar_Get("_vid_wait_override", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&_vid_default_mode);
|
||||
CVAR_FIXME */
|
||||
_vid_default_mode = Cvar_Get("_vid_default_mode", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&_vid_default_mode_win);
|
||||
CVAR_FIXME */
|
||||
_vid_default_mode_win = Cvar_Get("_vid_default_mode_win", "3", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_config_x);
|
||||
CVAR_FIXME */
|
||||
vid_config_x = Cvar_Get("vid_config_x", "800", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_config_y);
|
||||
CVAR_FIXME */
|
||||
vid_config_y = Cvar_Get("vid_config_y", "600", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_stretch_by_2);
|
||||
CVAR_FIXME */
|
||||
vid_stretch_by_2 = Cvar_Get("vid_stretch_by_2", "1", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&_windowed_mouse);
|
||||
CVAR_FIXME */
|
||||
_windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_fullscreen_mode);
|
||||
CVAR_FIXME */
|
||||
vid_fullscreen_mode = Cvar_Get("vid_fullscreen_mode", "3", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_windowed_mode);
|
||||
CVAR_FIXME */
|
||||
vid_windowed_mode = Cvar_Get("vid_windowed_mode", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&block_switch);
|
||||
CVAR_FIXME */
|
||||
block_switch = Cvar_Get("block_switch", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_window_x);
|
||||
CVAR_FIXME */
|
||||
vid_window_x = Cvar_Get("vid_window_x", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&vid_window_y);
|
||||
CVAR_FIXME */
|
||||
vid_window_y = Cvar_Get("vid_window_y", "0", CVAR_NONE, "None");
|
||||
|
||||
Cmd_AddCommand ("vid_testmode", VID_TestMode_f);
|
||||
Cmd_AddCommand ("vid_nummodes", VID_NumModes_f);
|
||||
|
@ -2368,8 +2466,12 @@ 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) ||
|
||||
CVAR_FIXME */
|
||||
if ((trect.left != (int)vid_window_x->value) ||
|
||||
/* (trect.top != (int)vid_window_y.value))
|
||||
CVAR_FIXME */
|
||||
(trect.top != (int)vid_window_y->value))
|
||||
{
|
||||
if (COM_CheckParm ("-resetwinpos"))
|
||||
{
|
||||
|
@ -2378,14 +2480,22 @@ void VID_Update (vrect_t *rects)
|
|||
}
|
||||
|
||||
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,
|
||||
CVAR_FIXME */
|
||||
SetWindowPos (mainwindow, NULL, (int)vid_window_x->value,
|
||||
/* (int)vid_window_y.value, 0, 0,
|
||||
CVAR_FIXME */
|
||||
(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) &&
|
||||
CVAR_FIXME */
|
||||
if ((_vid_default_mode_win->value != vid_default) &&
|
||||
/* (!startwindowed || (_vid_default_mode_win.value < MODE_FULLSCREEN_DEFAULT)))
|
||||
CVAR_FIXME */
|
||||
(!startwindowed || (_vid_default_mode_win->value < MODE_FULLSCREEN_DEFAULT)))
|
||||
{
|
||||
firstupdate = 0;
|
||||
|
||||
|
@ -2395,13 +2505,19 @@ void VID_Update (vrect_t *rects)
|
|||
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) ||
|
||||
CVAR_FIXME */
|
||||
if ((_vid_default_mode_win->value < 0) ||
|
||||
/* (_vid_default_mode_win.value >= nummodes))
|
||||
CVAR_FIXME */
|
||||
(_vid_default_mode_win->value >= nummodes))
|
||||
{
|
||||
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);
|
||||
CVAR_FIXME */
|
||||
Cvar_SetValue ("vid_mode", _vid_default_mode_win->value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2418,9 +2534,13 @@ void VID_Update (vrect_t *rects)
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((int)vid_mode.value != vid_realmode)
|
||||
/* if ((int)vid_mode.value != vid_realmode)
|
||||
CVAR_FIXME */
|
||||
if ((int)vid_mode->value != vid_realmode)
|
||||
{
|
||||
VID_SetMode ((int)vid_mode.value, vid_curpal);
|
||||
/* VID_SetMode ((int)vid_mode.value, vid_curpal);
|
||||
CVAR_FIXME */
|
||||
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
|
||||
|
@ -2431,7 +2551,9 @@ void VID_Update (vrect_t *rects)
|
|||
// handle the mouse state when windowed if that's changed
|
||||
if (modestate == MS_WINDOWED)
|
||||
{
|
||||
if (!_windowed_mouse.value) {
|
||||
/* if (!_windowed_mouse.value) {
|
||||
CVAR_FIXME */
|
||||
if (!_windowed_mouse->value) {
|
||||
if (windowed_mouse) {
|
||||
IN_DeactivateMouse ();
|
||||
IN_ShowMouse ();
|
||||
|
@ -2780,7 +2902,9 @@ void AppActivate(BOOL fActive, BOOL minimize)
|
|||
IN_ActivateMouse ();
|
||||
IN_HideMouse ();
|
||||
}
|
||||
else if ((modestate == MS_WINDOWED) && _windowed_mouse.value && key_dest == key_game)
|
||||
/* else if ((modestate == MS_WINDOWED) && _windowed_mouse.value && key_dest == key_game)
|
||||
CVAR_FIXME */
|
||||
else if ((modestate == MS_WINDOWED) && _windowed_mouse->value && key_dest == key_game)
|
||||
{
|
||||
IN_ActivateMouse ();
|
||||
IN_HideMouse ();
|
||||
|
@ -2812,7 +2936,9 @@ void AppActivate(BOOL fActive, BOOL minimize)
|
|||
IN_DeactivateMouse ();
|
||||
IN_ShowMouse ();
|
||||
}
|
||||
else if ((modestate == MS_WINDOWED) && _windowed_mouse.value /* && mouseactive */)
|
||||
/* else if ((modestate == MS_WINDOWED) && _windowed_mouse.value /* && mouseactive */)
|
||||
CVAR_FIXME */
|
||||
else if ((modestate == MS_WINDOWED) && _windowed_mouse->value /* && mouseactive */)
|
||||
{
|
||||
IN_DeactivateMouse ();
|
||||
IN_ShowMouse ();
|
||||
|
@ -2830,7 +2956,9 @@ VID_HandlePause
|
|||
void VID_HandlePause (qboolean pause)
|
||||
{
|
||||
#if 0
|
||||
if ((modestate == MS_WINDOWED) && _windowed_mouse.value)
|
||||
/* if ((modestate == MS_WINDOWED) && _windowed_mouse.value)
|
||||
CVAR_FIXME */
|
||||
if ((modestate == MS_WINDOWED) && _windowed_mouse->value)
|
||||
{
|
||||
if (pause)
|
||||
{
|
||||
|
@ -2897,7 +3025,9 @@ 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);
|
||||
CVAR_FIXME */
|
||||
VID_SetMode ((int)vid_fullscreen_mode->value, vid_curpal);
|
||||
break;
|
||||
|
||||
case SC_SCREENSAVE:
|
||||
|
@ -3277,7 +3407,9 @@ 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);
|
||||
CVAR_FIXME */
|
||||
ptr = VID_GetModeDescription2 ((int)_vid_default_mode_win->value);
|
||||
|
||||
if (ptr)
|
||||
{
|
||||
|
|
|
@ -51,8 +51,12 @@ typedef unsigned short PIXEL;
|
|||
#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 = {"_windowed_mouse","0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *_windowed_mouse;
|
||||
/* cvar_t m_filter = {"m_filter","0", true};
|
||||
CVAR_FIXME */
|
||||
cvar_t *m_filter;
|
||||
float old_windowed_mouse;
|
||||
|
||||
// not used
|
||||
|
@ -823,7 +827,9 @@ void GetEvent(void)
|
|||
break;
|
||||
|
||||
case MotionNotify:
|
||||
if (_windowed_mouse.value) {
|
||||
/* if (_windowed_mouse.value) {
|
||||
CVAR_FIXME */
|
||||
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",
|
||||
|
@ -884,10 +890,16 @@ 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) {
|
||||
CVAR_FIXME */
|
||||
if (old_windowed_mouse != _windowed_mouse->value) {
|
||||
/* old_windowed_mouse = _windowed_mouse.value;
|
||||
CVAR_FIXME */
|
||||
old_windowed_mouse = _windowed_mouse->value;
|
||||
|
||||
if (!_windowed_mouse.value) {
|
||||
/* if (!_windowed_mouse.value) {
|
||||
CVAR_FIXME */
|
||||
if (!_windowed_mouse->value) {
|
||||
/* ungrab the pointer */
|
||||
XUngrabPointer(x_disp,CurrentTime);
|
||||
} else {
|
||||
|
@ -1060,8 +1072,12 @@ void D_EndDirectRect (int x, int y, int width, int height)
|
|||
|
||||
void IN_Init (void)
|
||||
{
|
||||
Cvar_RegisterVariable (&_windowed_mouse);
|
||||
Cvar_RegisterVariable (&m_filter);
|
||||
/* Cvar_RegisterVariable (&_windowed_mouse);
|
||||
CVAR_FIXME */
|
||||
_windowed_mouse = Cvar_Get("_windowed_mouse", "0", CVAR_NONE, "None");
|
||||
/* Cvar_RegisterVariable (&m_filter);
|
||||
CVAR_FIXME */
|
||||
m_filter = Cvar_Get("m_filter", "0", CVAR_NONE, "None");
|
||||
if ( COM_CheckParm ("-nomouse") )
|
||||
return;
|
||||
mouse_x = mouse_y = 0.0;
|
||||
|
@ -1094,7 +1110,9 @@ void IN_Move (usercmd_t *cmd)
|
|||
if (!mouse_avail)
|
||||
return;
|
||||
|
||||
if (m_filter.value) {
|
||||
/* if (m_filter.value) {
|
||||
CVAR_FIXME */
|
||||
if (m_filter->value) {
|
||||
mouse_x = (mouse_x + old_mouse_x) * 0.5;
|
||||
mouse_y = (mouse_y + old_mouse_y) * 0.5;
|
||||
}
|
||||
|
@ -1102,27 +1120,43 @@ 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;
|
||||
CVAR_FIXME */
|
||||
mouse_x *= sensitivity->value;
|
||||
/* mouse_y *= sensitivity.value;
|
||||
CVAR_FIXME */
|
||||
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) ))
|
||||
CVAR_FIXME */
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && (in_mlook.state & 1) ))
|
||||
/* cmd->sidemove += m_side.value * mouse_x;
|
||||
CVAR_FIXME */
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
/* cl.viewangles[YAW] -= m_yaw.value * mouse_x;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
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;
|
||||
CVAR_FIXME */
|
||||
cmd->upmove -= m_forward->value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
/* cmd->forwardmove -= m_forward.value * mouse_y;
|
||||
CVAR_FIXME */
|
||||
cmd->forwardmove -= m_forward->value * mouse_y;
|
||||
}
|
||||
mouse_x = mouse_y = 0.0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue