From cc84e6291b1b354b82217ff51e14abd6e363443d Mon Sep 17 00:00:00 2001 From: Joseph Carter Date: Fri, 10 Mar 2000 23:18:46 +0000 Subject: [PATCH] I decided I liked having a smaller console so I cleaned up the debugging code for scr_consize a bit. I also made it work in software targets. If you set scr_consize outside the range of .2 to .9 it now assumes you're an idiot and ignores your setting, using the appropriate boundary value. A note about gl_conalpha for GL targets. It now works up to a consize of .9 rather than working just upto 2/3 of the screen. Works just as it did before. The only reason it matters is that the boundary for scr_consize does not apply to the decision of whether or not to use alpha--only to how big to make the console. That means if you set scr_consize to .91 or something it won't be bigger but you'll lose alpha. Don't even try to report that as a bug---I will tell you simply Don't Do That(TM). --- common/cl_cam.c | 16 +++-------- common/client.h | 29 ------------------- common/draw.c | 7 ++--- common/gl_draw.c | 9 ++---- common/gl_screen.c | 5 +++- common/r_part.c | 10 +++++-- common/screen.c | 23 ++++++++++------ qw_client/view.c | 69 ++++++---------------------------------------- 8 files changed, 42 insertions(+), 126 deletions(-) diff --git a/common/cl_cam.c b/common/cl_cam.c index bdda4dc..4baad85 100644 --- a/common/cl_cam.c +++ b/common/cl_cam.c @@ -55,12 +55,6 @@ double cam_lastviewtime; int spec_track = 0; // player# of who we are tracking int autocam = CAM_NONE; -/* -cvar_t cl_chasecam = {"cl_chasecam", "0", CVAR_ARCHIVE}; -cvar_t cl_chasecam_up = {"cl_chasecam_up", "16",CVAR_ARCHIVE}; -cvar_t cl_chasecam_back = {"cl_chasecam_back", "100", CVAR_ARCHIVE}; -cvar_t cl_chasecam_right = {"cl_chasecam_right", "0", CVAR_ARCHIVE}; -*/ cvar_t * cl_chasecam; cvar_t *cl_chasecam_up; @@ -75,13 +69,13 @@ vec3_t chase_dest_angles; void Chase_Init (void) { cl_chasecam = Cvar_Get ("cl_chasecam", "0", CVAR_ARCHIVE, - "None"); + "None"); cl_chasecam_up = Cvar_Get ("cl_chasecam_up","16",CVAR_ARCHIVE, - "None"); + "None"); cl_chasecam_back = Cvar_Get ("cl_chasecam_back","100",CVAR_ARCHIVE, - "None"); + "None"); cl_chasecam_right = Cvar_Get ("cl_chasecam_right","0", CVAR_ARCHIVE, - "None"); + "None"); } void Chase_Reset (void) { @@ -642,8 +636,6 @@ void Cam_Reset(void) void CL_InitCam(void) { cl_hightrack = Cvar_Get ("cl_hightrack","0",0,"None"); -// Cvar_RegisterVariable (&cl_camera_maxpitch); -// Cvar_RegisterVariable (&cl_camera_maxyaw); } diff --git a/common/client.h b/common/client.h index 7fe89c4..bdd2eb1 100644 --- a/common/client.h +++ b/common/client.h @@ -332,7 +332,6 @@ typedef struct scoreboard_t *scores; // [cl.maxclients] usercmd_t cmd; // last command sent to the server -// int items; // inventory bit flags vec3_t mviewangles[2]; // in demos, viewangles is lerped // between these vec3_t mvelocity[2]; // update by server, used for lean+bob @@ -345,18 +344,14 @@ extern client_state_t cl; // // cvars // -//#ifdef UQUAKE extern cvar_t *cl_name; extern cvar_t *cl_color; extern cvar_t *cl_autofire; extern cvar_t *cl_nolerp; -//#endif // UQUAKE extern cvar_t *cl_warncmd; -//#ifdef QUAKEWORLD extern cvar_t *name; extern cvar_t *topcolor; extern cvar_t *bottomcolor; -//#endif // QUAKEWORLD extern cvar_t *rate; extern cvar_t *host_speeds; extern cvar_t *cl_maxfps; @@ -394,10 +389,8 @@ extern cvar_t *_windowed_mouse; // FIXME, allocate dynamically extern entity_state_t cl_baselines[MAX_EDICTS]; -//#ifdef UQUAKE entity_t cl_entities[MAX_EDICTS]; entity_t cl_temp_entities[MAX_TEMP_ENTITIES]; -//#endif // UQUAKE extern efrag_t cl_efrags[MAX_EFRAGS]; extern entity_t cl_static_entities[MAX_STATIC_ENTITIES]; extern lightstyle_t cl_lightstyle[MAX_LIGHTSTYLES]; @@ -426,33 +419,25 @@ void SetPal (int i); void CL_RelinkEntities (void); void CL_ReadPackets (void); -//#ifdef UQUAKE void CL_Signon1 (void); void CL_Signon2 (void); void CL_Signon3 (void); void CL_Signon4 (void); -//#endif // UQUAKE void CL_Disconnect (void); void CL_Disconnect_f (void); void CL_NextDemo (void); -//#ifdef QUAKEWORLD qboolean CL_DemoBehind(void); void CL_BeginServerConnect(void); -//#endif // QUAKEWORLD #define MAX_VISEDICTS 256 extern int cl_numvisedicts, cl_oldnumvisedicts; -//#ifdef QUAKEWORLD extern entity_t *cl_visedicts, *cl_oldvisedicts; extern entity_t cl_visedicts_list[2][MAX_VISEDICTS]; extern char emodel_name[], pmodel_name[], prespawn_name[], modellist_name[], soundlist_name[]; -//#elif UQUAKE -//extern entity_t *cl_visedicts[MAX_VISEDICTS]; -//#endif // QUAKEWORLD else UQUAKE // @@ -477,9 +462,7 @@ void CL_UpdateTEnts (void); void CL_ClearState (void); -//#ifdef QUAKEWORLD void CL_ReadPackets (void); -//#endif // QUAKEWORLD int CL_ReadFromServer (void); void CL_WriteToServer (usercmd_t *cmd); @@ -494,17 +477,12 @@ char *Key_KeynumToString (int keynum); // void CL_StopPlayback (void); int CL_GetMessage (void); -//#ifdef QUAKEWORLD void CL_WriteDemoCmd (usercmd_t *pcmd); -//#elif defined(UQUAKE) void CL_SignonReply (void); -//#endif // QUAKEWORLD else UQUAKE void CL_Stop_f (void); void CL_Record_f (void); -//#ifdef QUAKEWORLD void CL_ReRecord_f (void); -//#endif // QUAKEWORLD void CL_PlayDemo_f (void); void CL_TimeDemo_f (void); @@ -513,7 +491,6 @@ void CL_TimeDemo_f (void); // void CL_ParseServerMessage (void); void CL_NewTranslation (int slot); -//#ifdef QUAKEWORLD #define NET_TIMINGS 256 #define NET_TIMINGSMASK 255 extern int packet_latency[NET_TIMINGS]; @@ -523,7 +500,6 @@ qboolean CL_IsUploading(void); void CL_NextUpload(void); void CL_StartUpload (byte *data, int size); void CL_StopUpload(void); -//#endif // QUAKEWORLD // // view.c @@ -544,11 +520,8 @@ void V_CalcBlend (void); // void CL_InitTEnts (void); void CL_ClearTEnts (void); -//#ifdef UQUAKE void CL_SignonReply (void); -//#endif -//#ifdef QUAKEWORLD // // cl_ents.c // @@ -597,6 +570,4 @@ void Skin_NextDownload (void); #define RSSHOT_WIDTH 320 #define RSSHOT_HEIGHT 200 -//#endif // QUAKEWORLD - #endif // _CLIENT_H diff --git a/common/draw.c b/common/draw.c index 84a0fc4..1f14891 100644 --- a/common/draw.c +++ b/common/draw.c @@ -629,7 +629,7 @@ Draw_ConsoleBackground */ void Draw_ConsoleBackground (int lines) { - int i, x, y, v; + int x, y, v; byte *src, *dest; unsigned short *pusdest; int f, fstep; @@ -704,10 +704,7 @@ void Draw_ConsoleBackground (int lines) // put it back memcpy(conback->data + 320*186, saveback, 320*8); - y = lines-14; - x = vid.conwidth - (strlen(ver)*8 + 11); - for (i=0 ; idata; - y = (vid.height * 3) >> 2; + y = vid.height * 0.9; if (lines > y) alpha = 1; else @@ -837,11 +836,7 @@ void Draw_ConsoleBackground (int lines) glPopMatrix (); } - // hack the version number directly into the pic - y = lines-14; - x = vid.conwidth - (strlen(ver)*8 + 11); - for (i=0 ; ivalue; + { + scr_conlines = vid.height * max(0.2, + min(scr_consize->value, 1)); + } else scr_conlines = 0; // none visible diff --git a/common/r_part.c b/common/r_part.c index 1406060..1805a60 100644 --- a/common/r_part.c +++ b/common/r_part.c @@ -574,13 +574,17 @@ void R_TeleportSplash (vec3_t org) } } -void R_RocketTrail (vec3_t start, vec3_t end, int type) +/* + R_RocketTrail +*/ +void +R_RocketTrail (vec3_t start, vec3_t end, int type) { vec3_t vec; float len; - int j; + int j; particle_t *p; - int dec; + int dec; VectorSubtract (end, start, vec); len = VectorNormalize (vec); diff --git a/common/screen.c b/common/screen.c index 5d8d3cf..9bc509a 100644 --- a/common/screen.c +++ b/common/screen.c @@ -112,6 +112,7 @@ cvar_t *scr_showturtle; cvar_t *scr_showpause; cvar_t *scr_printspeed; cvar_t *scr_allowsnap; +cvar_t *scr_consize; qboolean scr_initialized; // ready to draw @@ -388,15 +389,17 @@ void SCR_SizeDown_f (void) void SCR_InitCvars (void) { - scr_fov = Cvar_Get ("fov","90",0,"None"); + scr_fov = Cvar_Get ("fov","90",CVAR_NONE,"None"); scr_viewsize = Cvar_Get ("viewsize","100",CVAR_ARCHIVE,"None"); - scr_conspeed = Cvar_Get ("scr_conspeed","300",0,"None"); - scr_showram = Cvar_Get ("showram","1",0,"None"); - scr_showturtle = Cvar_Get ("showturtle","0",0,"None"); - scr_showpause = Cvar_Get ("showpause","1",0,"None"); - scr_centertime = Cvar_Get ("scr_centertime","2",0,"None"); - scr_printspeed = Cvar_Get ("scr_printspeed","8",0,"None"); - scr_allowsnap = Cvar_Get ("scr_allowsnap","1",0,"None"); + scr_conspeed = Cvar_Get ("scr_conspeed","300",CVAR_NONE,"None"); + scr_showram = Cvar_Get ("showram","1",CVAR_NONE,"None"); + scr_showturtle = Cvar_Get ("showturtle","0",CVAR_NONE,"None"); + scr_showpause = Cvar_Get ("showpause","1",CVAR_NONE,"None"); + scr_centertime = Cvar_Get ("scr_centertime","2",CVAR_NONE,"None"); + scr_printspeed = Cvar_Get ("scr_printspeed","8",CVAR_NONE,"None"); + scr_allowsnap = Cvar_Get ("scr_allowsnap","1",CVAR_NONE,"None"); + scr_consize = Cvar_Get ("scr_consize", "0.5",CVAR_NONE, + "sets console size (0.5 is half screen"); } /* @@ -581,7 +584,9 @@ void SCR_SetUpToDrawConsole (void) scr_con_current = scr_conlines; } else if (key_dest == key_console) - scr_conlines = vid.height/2; // half screen + scr_conlines = vid.height * max(0.2, + min(scr_consize->value, 1)); + else scr_conlines = 0; // none visible diff --git a/qw_client/view.c b/qw_client/view.c index 5ebf77c..cce5556 100644 --- a/qw_client/view.c +++ b/qw_client/view.c @@ -1,4 +1,5 @@ /* +view.c - player eye positioning 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 @@ -19,15 +20,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// view.c -- player eye positioning -#include "qtypes.h" -#include "quakedef.h" -#include "r_local.h" -#include "mathlib.h" -#include "draw.h" -#include "cvar.h" -#include "screen.h" +#include +#include +#include +#include +#include +#include +#include extern int onground; @@ -40,58 +40,36 @@ when crossing a water boudnary. */ -//cvar_t lcd_x = {"lcd_x", "0"}; // FIXME: make this work sometime... -cvar_t *lcd_x; +cvar_t *lcd_x; // FIXME: make this work sometime... -//cvar_t cl_rollspeed = {"cl_rollspeed", "200"}; cvar_t *cl_rollspeed; -//cvar_t cl_rollangle = {"cl_rollangle", "2.0"}; cvar_t *cl_rollangle; -//cvar_t cl_bob = {"cl_bob","0.02", CVAR_NONE}; cvar_t *cl_bob; -//cvar_t cl_bobcycle = {"cl_bobcycle","0.6", CVAR_NONE}; cvar_t *cl_bobcycle; -//cvar_t cl_bobup = {"cl_bobup","0.5", CVAR_NONE}; cvar_t *cl_bobup; -//cvar_t v_kicktime = {"v_kicktime", "0.5", CVAR_NONE}; cvar_t *v_kicktime; -//cvar_t v_kickroll = {"v_kickroll", "0.6", CVAR_NONE}; cvar_t *v_kickroll; -//cvar_t v_kickpitch = {"v_kickpitch", "0.6", CVAR_NONE}; cvar_t *v_kickpitch; -//cvar_t v_iyaw_cycle = {"v_iyaw_cycle", "2", CVAR_NONE}; cvar_t *v_iyaw_cycle; -//cvar_t v_iroll_cycle = {"v_iroll_cycle", "0.5", CVAR_NONE}; cvar_t *v_iroll_cycle; -//cvar_t v_ipitch_cycle = {"v_ipitch_cycle", "1", CVAR_NONE}; cvar_t *v_ipitch_cycle; -//cvar_t v_iyaw_level = {"v_iyaw_level", "0.3", CVAR_NONE}; cvar_t *v_iyaw_level; -//cvar_t v_iroll_level = {"v_iroll_level", "0.1", CVAR_NONE}; cvar_t *v_iroll_level; -//cvar_t v_ipitch_level = {"v_ipitch_level", "0.3", CVAR_NONE}; cvar_t *v_ipitch_level; -//cvar_t v_idlescale = {"v_idlescale", "0", CVAR_NONE}; cvar_t *v_idlescale; -//cvar_t crosshair = {"crosshair", "0", CVAR_ARCHIVE}; cvar_t *crosshair; -//cvar_t crosshaircolor = {"crosshaircolor", "79", CVAR_ARCHIVE}; cvar_t *crosshaircolor; -//cvar_t cl_crossx = {"cl_crossx", "0", CVAR_ARCHIVE}; cvar_t *cl_crossx; -//cvar_t cl_crossy = {"cl_crossy", "0", CVAR_ARCHIVE}; cvar_t *cl_crossy; -//cvar_t gl_cshiftpercent = {"gl_cshiftpercent", "100", CVAR_NONE}; cvar_t *gl_cshiftpercent; -// cvar_t v_contentblend = {"v_contentblend", "1", CVAR_NONE}; cvar_t *v_contentblend; float v_dmg_time, v_dmg_roll, v_dmg_pitch; @@ -174,9 +152,7 @@ float V_CalcBob (void) //============================================================================= -//cvar_t v_centermove = {"v_centermove", "0.15", CVAR_NONE}; cvar_t *v_centermove; -//cvar_t v_centerspeed = {"v_centerspeed","500"}; cvar_t *v_centerspeed; @@ -293,7 +269,6 @@ 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", CVAR_ARCHIVE}; cvar_t *v_gamma; byte gammatable[256]; // palette is sent through this @@ -889,65 +864,39 @@ void V_Init (void) Cmd_AddCommand ("bf", V_BonusFlash_f); Cmd_AddCommand ("centerview", V_StartPitchDrift); -// Cvar_RegisterVariable (&lcd_x); lcd_x = Cvar_Get ("lcd_x","0",0,"None"); -// Cvar_RegisterVariable (&lcd_yaw); //lcd_yaw = Cvar_Get ("lcd_yaw","0",0,"None"); -// Cvar_RegisterVariable (&v_centermove); v_centermove = Cvar_Get ("v_centermove","0.15",0,"None"); -// Cvar_RegisterVariable (&v_centerspeed); v_centerspeed = Cvar_Get ("v_centerspeed","500",0,"None"); -// Cvar_RegisterVariable (&v_iyaw_cycle); v_iyaw_cycle = Cvar_Get ("v_iyaw_cycle","2",0,"None"); -// Cvar_RegisterVariable (&v_iroll_cycle); v_iroll_cycle = Cvar_Get ("v_iroll_cycle","0.5",0,"None"); -// Cvar_RegisterVariable (&v_ipitch_cycle); v_ipitch_cycle = Cvar_Get ("v_ipitch_cycle","1",0,"None"); -// Cvar_RegisterVariable (&v_iyaw_level); v_iyaw_level = Cvar_Get ("v_iyaw_level","0.3",0,"None"); -// Cvar_RegisterVariable (&v_iroll_level); v_iroll_level = Cvar_Get ("v_iroll_level","0.1",0,"None"); -// Cvar_RegisterVariable (&v_ipitch_level); v_ipitch_level = Cvar_Get ("v_ipitch_level","0.3",0,"None"); -// Cvar_RegisterVariable (&v_contentblend); v_contentblend = Cvar_Get ("v_contentblend","1",0,"None"); -// Cvar_RegisterVariable (&v_idlescale); v_idlescale = Cvar_Get ("v_idlescale","0",0,"None"); -// Cvar_RegisterVariable (&crosshaircolor); crosshaircolor = Cvar_Get ("crosshaircolor","79",CVAR_ARCHIVE,"None"); -// Cvar_RegisterVariable (&crosshair); crosshair = Cvar_Get ("crosshair","0",CVAR_ARCHIVE,"None"); -// Cvar_RegisterVariable (&cl_crossx); cl_crossx = Cvar_Get ("cl_crossx","0",CVAR_ARCHIVE,"None"); -// Cvar_RegisterVariable (&cl_crossy); cl_crossy = Cvar_Get ("cl_crossy","0",CVAR_ARCHIVE,"None"); -// Cvar_RegisterVariable (&gl_cshiftpercent); gl_cshiftpercent = Cvar_Get ("gl_cshiftpercent","100",0,"None"); -// Cvar_RegisterVariable (&cl_rollspeed); cl_rollspeed = Cvar_Get ("cl_rollspeed","200",0,"None"); -// Cvar_RegisterVariable (&cl_rollangle); cl_rollangle = Cvar_Get ("cl_rollangle","2.0",0,"None"); -// Cvar_RegisterVariable (&cl_bob); cl_bob = Cvar_Get ("cl_bob","0.02",0,"None"); -// Cvar_RegisterVariable (&cl_bobcycle); cl_bobcycle = Cvar_Get ("cl_bobcycle","0.6",0,"None"); -// Cvar_RegisterVariable (&cl_bobup); cl_bobup = Cvar_Get ("cl_bobup","0.5",0,"None"); -// Cvar_RegisterVariable (&v_kicktime); v_kicktime = Cvar_Get ("v_kicktime","0.5",0,"None"); -// Cvar_RegisterVariable (&v_kickroll); v_kickroll = Cvar_Get ("v_kickroll","0.6",0,"None"); -// Cvar_RegisterVariable (&v_kickpitch); v_kickpitch = Cvar_Get ("v_kickpitch","0.6",0,"None"); BuildGammaTable (1.0); // no gamma yet -// Cvar_RegisterVariable (&v_gamma); v_gamma = Cvar_Get ("gamma","1",CVAR_ARCHIVE,"None"); }