Merges and cleanups...

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-05-13 22:57:27 +00:00
parent 87894c0d39
commit 048a80ce23
22 changed files with 334 additions and 481 deletions

View file

@ -38,9 +38,10 @@
#include <stdlib.h>
#include "cl_main.h"
#include "QF/cmd.h"
#include "QF/console.h"
#include "cl_main.h"
#include "glquake.h"
#define MAX_FIRES 128 // rocket flames
@ -49,13 +50,13 @@ static fire_t r_fires[MAX_FIRES];
extern cvar_t *gl_fires;
extern cvar_t *r_firecolor;
/*
R_AddFire
Nifty ball of fire GL effect. Kinda a meshing of the dlight and
particle engine code.
*/
void
R_AddFire (vec3_t start, vec3_t end, entity_t *ent)
{
@ -82,6 +83,7 @@ R_AddFire (vec3_t start, vec3_t end, entity_t *ent)
}
}
/*
R_AllocFire
@ -120,6 +122,7 @@ R_AllocFire (int key)
return f;
}
/*
R_DrawFire
@ -173,6 +176,7 @@ R_DrawFire (fire_t *f)
glColor3ubv (lighthalf_v);
}
/*
R_UpdateFires

View file

@ -65,6 +65,7 @@ extern int part_tex_smoke_ring[8];
int ramp[8] = { 0x6d, 0x6b, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01 };
inline particle_t *
particle_new (ptype_t type, int texnum, vec3_t org, float scale, vec3_t vel,
float die, byte color, byte alpha, vec3_t up, vec3_t right)
@ -93,6 +94,7 @@ particle_new (ptype_t type, int texnum, vec3_t org, float scale, vec3_t vel,
return part;
}
inline particle_t *
particle_new_random (ptype_t type, int texnum, vec3_t org, int org_fuzz,
float scale, int vel_fuzz, float die, byte color,
@ -110,6 +112,7 @@ particle_new_random (ptype_t type, int texnum, vec3_t org, int org_fuzz,
return particle_new (type, texnum, porg, scale, pvel, die, color, alpha, vec3_origin, vec3_origin);
}
/*
R_MaxParticlesCheck
@ -117,7 +120,6 @@ particle_new_random (ptype_t type, int texnum, vec3_t org, int org_fuzz,
Thanks to a LOT of help from Taniwha, Deek, Mercury, Lordhavoc, and
lots of others.
*/
void
R_MaxParticlesCheck (cvar_t *var)
{
@ -146,9 +148,6 @@ R_MaxParticlesCheck (cvar_t *var)
R_ClearParticles();
}
/*
R_Particles_Init_Cvars
*/
void
R_Particles_Init_Cvars (void)
@ -160,15 +159,14 @@ R_Particles_Init_Cvars (void)
"Maximum amount of particles to display. No maximum, minimum is 0, although it's best to use r_particles 0 instead.");
}
/*
R_ClearParticles
*/
void
R_ClearParticles (void)
{
numparticles = 0;
}
void
R_ReadPointFile_f (void)
{
@ -217,9 +215,7 @@ R_ReadPointFile_f (void)
Con_Printf ("%i points read\n", c);
}
/*
R_ParticleExplosion
*/
void
R_ParticleExplosion (vec3_t org)
{
@ -231,9 +227,7 @@ R_ParticleExplosion (vec3_t org)
128 + (rand () & 63));
}
/*
R_BlobExplosion
*/
void
R_BlobExplosion (vec3_t org)
{
@ -254,6 +248,7 @@ R_BlobExplosion (vec3_t org)
}
}
static void
R_RunSparkEffect (vec3_t org, int count, int ofuzz)
{
@ -269,6 +264,7 @@ R_RunSparkEffect (vec3_t org, int count, int ofuzz)
lhrandom (0, 255));
}
static void
R_RunGunshotEffect (vec3_t org, int count)
{
@ -286,6 +282,7 @@ R_RunGunshotEffect (vec3_t org, int count)
return;
}
static void
R_BloodPuff (vec3_t org, int count)
{
@ -297,9 +294,7 @@ R_BloodPuff (vec3_t org, int count)
vec3_origin, vec3_origin);
}
/*
R_RunPuffEffect
*/
void
R_RunPuffEffect (vec3_t org, byte type, byte count)
{
@ -319,9 +314,7 @@ R_RunPuffEffect (vec3_t org, byte type, byte count)
}
}
/*
R_RunParticleEffect
*/
void
R_RunParticleEffect (vec3_t org, int color, int count)
{
@ -348,6 +341,7 @@ R_RunParticleEffect (vec3_t org, int color, int count)
}
}
void
R_RunSpikeEffect (vec3_t org, byte type)
{
@ -367,9 +361,7 @@ R_RunSpikeEffect (vec3_t org, byte type)
}
}
/*
R_LavaSplash
*/
void
R_LavaSplash (vec3_t org)
{
@ -400,9 +392,7 @@ R_LavaSplash (vec3_t org)
}
}
/*
R_TeleportSplash
*/
void
R_TeleportSplash (vec3_t org)
{
@ -433,6 +423,7 @@ R_TeleportSplash (vec3_t org)
}
}
void
R_RocketTrail (int type, entity_t *ent)
{
@ -547,9 +538,6 @@ R_RocketTrail (int type, entity_t *ent)
}
/*
R_DrawParticles
*/
void
R_DrawParticles (void)
{

View file

@ -47,6 +47,7 @@ int part_tex_spark;
int part_tex_smoke[8];
int part_tex_smoke_ring[8];
void
GDT_Init (void)
{
@ -56,6 +57,7 @@ GDT_Init (void)
GDT_InitSmokeRingParticleTexture ();
}
static void
GDT_InitDotParticleTexture (void)
{
@ -156,6 +158,7 @@ GDT_InitSmokeParticleTexture (void)
}
}
static void
GDT_InitSmokeRingParticleTexture (void)
{

View file

@ -49,7 +49,6 @@ R_AnimateLight (void)
{
int i, j, k;
// light animations
// 'm' is normal light, 'a' is no light, 'z' is double bright
i = (int) (cl.time * 10);

View file

@ -240,7 +240,6 @@ float r_avertexnormal_dots[SHADEDOT_QUANT][256] =
;
float *shadedots = r_avertexnormal_dots[0];
int lastposenum, lastposenum0;
@ -304,6 +303,7 @@ GL_DrawAliasFrame (aliashdr_t *paliashdr, int posenum, qboolean fb)
glColor3ubv (lighthalf_v);
}
/*
GL_DrawAliasBlendedFrame

View file

@ -279,6 +279,7 @@ R_TimeRefresh_f (void)
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
}
void
D_FlushCaches (void)
{

View file

@ -243,9 +243,6 @@ SCR_CheckDrawCenterString (void)
}
//=============================================================================
float
CalcFov (float fov_x, float width, float height)
{
@ -284,8 +281,6 @@ SCR_CalcRefdef (void)
// force the status bar to redraw
Sbar_Changed ();
//========================================
// bound viewsize
Cvar_SetValue (scr_viewsize, bound (30, scr_viewsize->int_val, 120));
@ -372,9 +367,6 @@ SCR_SizeDown_f (void)
}
//============================================================================
void
SCR_Init (void)
{
@ -536,9 +528,6 @@ SCR_DrawPause (void)
}
//=============================================================================
void
SCR_SetUpToDrawConsole (void)
{
@ -806,9 +795,6 @@ SCR_RSShot_f (void)
}
//=============================================================================
char *scr_notifystring;
void
@ -844,9 +830,6 @@ SCR_DrawNotifyString (void)
}
//=============================================================================
void
SCR_TileClear (void)
{

View file

@ -59,9 +59,7 @@ float speedscale; // for top sky and bottom sky
// Set to true if a valid skybox is loaded --KB
qboolean skyloaded = false;
/*
R_LoadSkys
*/
char *suf[6] = { "rt", "bk", "lf", "ft", "up", "dn" };
void
R_LoadSkys (const char *skyname)
@ -101,6 +99,7 @@ R_LoadSkys (const char *skyname)
Con_Printf ("Unable to load skybox %s, using normal sky\n", skyname);
}
void
R_SkyBoxPolyVec (vec5_t v)
{
@ -112,8 +111,8 @@ R_SkyBoxPolyVec (vec5_t v)
r_refdef.vieworg[1] + v[3], r_refdef.vieworg[2] + v[4]);
}
#define ftc(x) (x * (254.0/256.0) + (1.0/256.0))
#define ftc(x) (x * (254.0/256.0) + (1.0/256.0))
vec5_t skyvec[6][4] = {
{
// right +y
@ -158,9 +157,9 @@ vec5_t skyvec[6][4] = {
{ftc (0), ftc (0), -1024, 1024, -1024}
}
};
#undef ftc
void
R_DrawSkyBox (void)
{
@ -182,6 +181,7 @@ R_DrawSkyBox (void)
vec3_t domescale;
void
R_DrawSkyLayer (float s)
{
@ -260,6 +260,7 @@ R_DrawSkyDome (void)
glDepthRange (gldepthmin, gldepthmax);
}
void
R_DrawSky (void)
{
@ -276,8 +277,6 @@ R_DrawSky (void)
}
//===============================================================
/*
R_InitSky

View file

@ -45,19 +45,18 @@
#include "glquake.h"
#include "view.h"
extern double host_frametime;
extern byte *vid_basepal;
extern double host_frametime;
extern int onground;
extern byte gammatable[256];
extern byte gammatable[256];
extern qboolean V_CheckGamma (void);
extern cvar_t *cl_cshift_powerup;
extern cvar_t *contrast;
byte ramps[3][256];
float v_blend[4];
byte ramps[3][256];
float v_blend[4];
qboolean V_CheckGamma (void);
/*
@ -69,24 +68,20 @@ qboolean V_CheckGamma (void);
void
V_CalcBlend (void)
{
float r, g, b, a, a2, a3;
int j;
float r = 0, g = 0, b = 0, a = 0;
float a2, a3;
int i;
r = 0;
g = 0;
b = 0;
a = 0;
for (j = 0; j < NUM_CSHIFTS; j++) {
a2 = cl.cshifts[j].percent / 255.0;
for (i = 0; i < NUM_CSHIFTS; i++) {
a2 = cl.cshifts[i].percent / 255.0;
if (!a2)
continue;
a2 = min (a2, 1.0);
r += (cl.cshifts[j].destcolor[0] - r) * a2;
g += (cl.cshifts[j].destcolor[1] - g) * a2;
b += (cl.cshifts[j].destcolor[2] - b) * a2;
r += (cl.cshifts[i].destcolor[0] - r) * a2;
g += (cl.cshifts[i].destcolor[1] - g) * a2;
b += (cl.cshifts[i].destcolor[2] - b) * a2;
a3 = (1.0 - a) * (1.0 - a2);
a = 1.0 - a3;
@ -186,12 +181,12 @@ V_UpdatePalette (void)
// drop the damage value
cl.cshifts[CSHIFT_DAMAGE].percent -= host_frametime * 150;
if (cl.cshifts[CSHIFT_DAMAGE].percent <= 0)
if (cl.cshifts[CSHIFT_DAMAGE].percent < 0)
cl.cshifts[CSHIFT_DAMAGE].percent = 0;
// drop the bonus value
cl.cshifts[CSHIFT_BONUS].percent -= host_frametime * 100;
if (cl.cshifts[CSHIFT_BONUS].percent <= 0)
if (cl.cshifts[CSHIFT_BONUS].percent < 0)
cl.cshifts[CSHIFT_BONUS].percent = 0;
force = V_CheckGamma ();

View file

@ -184,15 +184,12 @@ GL_SubdivideSurface (msurface_t *fa)
SubdividePolygon (numverts, verts[0]);
}
//=========================================================
// speed up sin calculations - Ed
float turbsin[] = {
# include "gl_warp_sin.h"
};
#define TURBSCALE (256.0 / (2 * M_PI))
/*

View file

@ -33,16 +33,17 @@
#include <stdlib.h>
#include <math.h>
#include "bothdefs.h"
#include "client.h"
#include "QF/cmd.h"
#include "QF/compat.h"
#include "QF/cvar.h"
#include "host.h"
#include "QF/msg.h"
#include "pmove.h"
#include "QF/screen.h"
#include "QF/vid.h"
#include "bothdefs.h"
#include "client.h"
#include "host.h"
#include "pmove.h"
#include "view.h"
/*
@ -81,11 +82,9 @@ extern int in_forward, in_forward2, in_back;
frame_t *view_frame;
player_state_t *view_message;
void BuildGammaTable (float, float);
// void BuildGammaTable (float, float);
/*
V_CalcRoll
*/
float
V_CalcRoll (vec3_t angles, vec3_t velocity)
{
@ -111,9 +110,6 @@ V_CalcRoll (vec3_t angles, vec3_t velocity)
}
/*
V_CalcBob
*/
float
V_CalcBob (void)
{
@ -152,9 +148,6 @@ V_CalcBob (void)
}
//=============================================================================
cvar_t *v_centermove;
cvar_t *v_centerspeed;
@ -175,6 +168,7 @@ V_StartPitchDrift (void)
}
}
void
V_StopPitchDrift (void)
{
@ -183,6 +177,7 @@ V_StopPitchDrift (void)
cl.pitchvel = 0;
}
/*
V_DriftPitch
@ -205,7 +200,8 @@ V_DriftPitch (void)
cl.pitchvel = 0;
return;
}
// don't count small mouse motion
// don't count small mouse motion
if (cl.nodrift) {
if (fabs
(cl.frames[(cls.netchan.outgoing_sequence - 1) & UPDATE_MASK].cmd.
@ -230,7 +226,7 @@ V_DriftPitch (void)
move = host_frametime * cl.pitchvel;
cl.pitchvel += host_frametime * v_centerspeed->value;
//Con_Printf ("move: %f (%f)\n", move, host_frametime);
// Con_Printf ("move: %f (%f)\n", move, host_frametime);
if (delta > 0) {
if (move > delta) {
@ -247,6 +243,7 @@ V_DriftPitch (void)
}
}
/*
PALETTE FLASHES
*/
@ -254,7 +251,6 @@ V_DriftPitch (void)
extern cvar_t *cl_cshift_bonus;
extern cvar_t *cl_cshift_contents;
extern cvar_t *cl_cshift_damage;
// extern cvar_t *cl_cshift_powerup;
cshift_t cshift_empty = { {130, 80, 50}, 0 };
cshift_t cshift_water = { {130, 80, 50}, 128 };
@ -264,9 +260,7 @@ cshift_t cshift_lava = { {255, 80, 0}, 150 };
extern byte gammatable[256]; // palette is sent through this
extern cvar_t *vid_gamma;
/*
V_CheckGamma
*/
qboolean
V_CheckGamma (void)
{
@ -284,9 +278,7 @@ V_CheckGamma (void)
return true;
}
/*
V_ParseDamage
*/
void
V_ParseDamage (void)
{
@ -329,10 +321,9 @@ V_ParseDamage (void)
cl.cshifts[CSHIFT_DAMAGE].destcolor[2] = 0;
}
}
//
// calculate view angle kicks
//
// calculate view angle kicks
VectorSubtract (from, cl.simorg, from);
VectorNormalize (from);
@ -348,9 +339,6 @@ V_ParseDamage (void)
}
/*
V_cshift_f
*/
void
V_cshift_f (void)
{
@ -379,12 +367,12 @@ V_BonusFlash_f (void)
cl.cshifts[CSHIFT_BONUS].percent = 50;
}
/*
V_SetContentsColor
Underwater, lava, etc each has a color shift
*/
void
V_SetContentsColor (int contents)
{
@ -416,6 +404,7 @@ V_SetContentsColor (int contents)
VIEW RENDERING
*/
float
angledelta (float a)
{
@ -425,9 +414,7 @@ angledelta (float a)
return a;
}
/*
CalcGunAngle
*/
void
CalcGunAngle (void)
{
@ -467,9 +454,7 @@ CalcGunAngle (void)
cl.viewent.angles[PITCH] = -(r_refdef.viewangles[PITCH] + pitch);
}
/*
V_BoundOffsets
*/
void
V_BoundOffsets (void)
{
@ -490,6 +475,7 @@ V_BoundOffsets (void)
r_refdef.vieworg[2] = cl.simorg[2] + 30;
}
/*
V_AddIdle
@ -544,32 +530,27 @@ V_CalcViewRoll (void)
}
/*
V_CalcIntermissionRefdef
*/
void
V_CalcIntermissionRefdef (void)
{
entity_t *view;
float old;
// view is the weapon model
// view is the weapon model
view = &cl.viewent;
VectorCopy (cl.simorg, r_refdef.vieworg);
VectorCopy (cl.simangles, r_refdef.viewangles);
view->model = NULL;
// always idle in intermission
// always idle in intermission
old = v_idlescale->value;
Cvar_SetValue (v_idlescale, 1);
V_AddIdle ();
Cvar_SetValue (v_idlescale, old);
}
/*
V_CalcRefdef
*/
void
V_CalcRefdef (void)
{
@ -585,12 +566,12 @@ V_CalcRefdef (void)
V_DriftPitch ();
// view is the weapon model (only visible from inside body)
// view is the weapon model (only visible from inside body)
view = &cl.viewent;
bob = V_CalcBob ();
// refresh position from simulated origin
// refresh position from simulated origin
VectorCopy (cl.simorg, r_refdef.vieworg);
r_refdef.vieworg[2] += bob;
@ -616,11 +597,10 @@ V_CalcRefdef (void)
if (view_message->flags & PF_DEAD) // PF_GIB will also set PF_DEAD
r_refdef.viewangles[ROLL] = 80; // dead view angle
// offsets
// offsets
AngleVectors (cl.simangles, forward, right, up);
// set up gun position
// set up gun position
VectorCopy (cl.simangles, view->angles);
CalcGunAngle ();
@ -658,10 +638,10 @@ V_CalcRefdef (void)
view->alpha = 1;
view->colormod[0] = view->colormod[1] = view->colormod[2] = 1;
// set up the refresh position
// set up the refresh position
r_refdef.viewangles[PITCH] += cl.punchangle;
// smooth out stair step ups
// smooth out stair step ups
if ((cl.onground != -1) && (cl.simorg[2] - oldz > 0)) {
float steptime;
@ -678,9 +658,7 @@ V_CalcRefdef (void)
oldz = cl.simorg[2];
}
/*
DropPunchAngle
*/
void
DropPunchAngle (void)
{
@ -689,20 +667,19 @@ DropPunchAngle (void)
cl.punchangle = 0;
}
/*
V_RenderView
The player's clipping box goes from (-16 -16 -24) to (16 16 32) from
the entity origin, so any view position inside that will be valid
*/
extern vrect_t scr_vrect;
void
V_RenderView (void)
{
// if (cl.simangles[ROLL])
// Sys_Error ("cl.simangles[ROLL]"); // DEBUG
cl.simangles[ROLL] = 0; // FIXME @@@
// if (cl.simangles[ROLL])
// Sys_Error ("cl.simangles[ROLL]"); // DEBUG
cl.simangles[ROLL] = 0; // FIXME @@@
if (cls.state != ca_active)
return;
@ -720,11 +697,7 @@ V_RenderView (void)
R_RenderView ();
}
//============================================================================
/*
V_Init
*/
void
V_Init (void)
{
@ -736,6 +709,7 @@ V_Init (void)
"Will not work while mlook is active or freelook is 1.");
}
void
V_Init_Cvars (void)
{

View file

@ -44,9 +44,6 @@ extern byte gammatable[256];
qboolean V_CheckGamma (void);
/*
V_CalcPowerupCshift
*/
void
V_CalcPowerupCshift (void)
{
@ -85,10 +82,6 @@ V_CalcPowerupCshift (void)
}
/*
V_UpdatePalette
*/
void
V_UpdatePalette (void)
{