A minor removal of a few pieces of dead code. Nothing major. This is
authorknghtbrd <knghtbrd@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 2 Jun 2002 19:52:39 +0000 (19:52 +0000)
committerknghtbrd <knghtbrd@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 2 Jun 2002 19:52:39 +0000 (19:52 +0000)
stage two.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1891 d7cf8633-e32d-0410-b094-e92efae38249

88 files changed:
builddate.c
cd_linux.c
cd_win.c
cgame.c
cgamevm.c
cl_collision.c
cl_demo.c
cl_input.c
cl_light.c
cl_main.c
cl_parse.c
cl_particles.c
cl_screen.c
cl_tent.c
cmd.c
collision.c
common.c
console.c
crc.c
cvar.c
fractalnoise.c
gl_backend.c
gl_draw.c
gl_models.c
gl_rmain.c
gl_rsurf.c
gl_textures.c
host.c
host_cmd.c
image.c
in_svgalib.c
in_win.c
keys.c
mathlib.c
menu.c
model_alias.c
model_brush.c
model_shared.c
model_sprite.c
net_bsd.c
net_dgrm.c
net_loop.c
net_main.c
net_udp.c
net_win.c
net_wins.c
net_wipx.c
palette.c
portals.c
pr_cmds.c
pr_edict.c
pr_exec.c
protocol.c
quakeio.c
r_clip.c
r_crosshairs.c
r_explosion.c
r_lerpanim.c
r_light.c
r_modules.c
r_sky.c
r_sprites.c
sbar.c
screen.h
snd_alsa_0_5.c
snd_dma.c
snd_mem.c
snd_mix.c
snd_oss.c
snd_win.c
sv_light.c
sv_main.c
sv_move.c
sv_phys.c
sv_user.c
sys_linux.c
sys_shared.c
sys_win.c
transform.c
ui.c
vid_3dfxsvga.c
vid_glx.c
vid_shared.c
vid_wgl.c
view.c
wad.c
world.c
zone.c

index c20120b..dcf45be 100644 (file)
@@ -1,2 +1,3 @@
 
 char *buildstring = __TIME__ " " __DATE__;
+
index d188b8e..43a3891 100644 (file)
@@ -417,3 +417,4 @@ void CDAudio_Shutdown(void)
        close(cdfile);
        cdfile = -1;
 }
+
index 0fac1db..d61f269 100644 (file)
--- a/cd_win.c
+++ b/cd_win.c
@@ -474,3 +474,4 @@ void CDAudio_Shutdown(void)
        if (mciSendCommand(wDeviceID, MCI_CLOSE, MCI_WAIT, (DWORD)NULL))
                Con_DPrintf("CDAudio_Shutdown: MCI_CLOSE failed\n");
 }
+
diff --git a/cgame.c b/cgame.c
index 615fb7f..00ca87c 100644 (file)
--- a/cgame.c
+++ b/cgame.c
@@ -27,8 +27,6 @@ typedef struct localentity_s
        float airfrictionscale;
        float gravityscale;
        void (*framethink)(struct localentity_s *e);
-       //int solid;
-       //void (*touch)(struct localentity_s *self, struct localentity_s *other);
        void (*touchnetwork)(struct localentity_s *self);
        cgdrawentity_t draw;
 }
index 57f53dc..eb4f5e1 100644 (file)
--- a/cgamevm.c
+++ b/cgamevm.c
@@ -143,14 +143,7 @@ void CGVM_Draw_Entity(const cgdrawentity_t *e)
                Con_Printf("CGVM_Draw_Entity: invalid model index %i\n", e->model);
                return;
        }
-       r->model = cgvm_model[e->model]; //Mod_ForName(e->model, false, false, false);
-       /*
-       if (!r->model)
-       {
-               Con_Printf("CGVM_Draw_Entity: unable to find model \"%s\"");
-               return;
-       }
-       */
+       r->model = cgvm_model[e->model];
 
        r->frame = e->frame2;
        // FIXME: support colormapping?
@@ -205,8 +198,6 @@ float CGVM_TracePhysics(const float *start, const float *end, const float *world
        VectorAdd(end, middle, end2);
        frac = CL_TraceLine((float *)start2, (float *)end2, impactpos, impactnormal, 0, true);
        VectorSubtract(impactpos, middle, impactpos);
-       //VectorCopy(end, impactpos);
-       //VectorClear(impactnormal);
        *impactentnum = -1;
        return frac;
 }
@@ -273,3 +264,4 @@ void CGVM_Stain(const float *origin, float radius, int cr1, int cg1, int cb1, in
 {
        R_Stain((float *)origin, radius, cr1, cg1, cb1, ca1, cr2, cg2, cb2, ca2);
 }
+
index 22d846a..ea667b6 100644 (file)
@@ -45,8 +45,6 @@ void CL_TraceLine_ScanForBModels(void)
                // look for embedded brush models only
                if (model && model->name[0] == '*')
                {
-                       // this does nothing for * models currently...
-                       //Mod_CheckLoaded(model);
                        if (model->type == mod_brush)
                        {
                                traceline_entity[traceline_entities++] = ent;
@@ -93,7 +91,7 @@ float CL_TraceLine (vec3_t start, vec3_t end, vec3_t impact, vec3_t normal, int
        {
                int n;
                entity_render_t *ent;
-               double /*start2[3], end2[3], */tracemins[3], tracemaxs[3];
+               double tracemins[3], tracemaxs[3];
                tracemins[0] = min(start[0], end[0]);
                tracemaxs[0] = max(start[0], end[0]);
                tracemins[1] = min(start[1], end[1]);
@@ -125,3 +123,4 @@ float CL_TraceLine (vec3_t start, vec3_t end, vec3_t impact, vec3_t normal, int
        }
        return maxfrac;
 }
+
index 40ada2d..551b7cd 100644 (file)
--- a/cl_demo.c
+++ b/cl_demo.c
@@ -143,7 +143,7 @@ int CL_GetMessage (void)
                                if (host_framecount == cls.td_startframe + 1)
                                        cls.td_starttime = realtime;
                        }
-                       else if ( /* cl.time > 0 && */ cl.time <= cl.mtime[0])
+                       else if (cl.time <= cl.mtime[0])
                        {
                                        return 0;               // don't need another message yet
                        }
@@ -350,9 +350,6 @@ void CL_PlayDemo_f (void)
 
        if (neg)
                cls.forcetrack = -cls.forcetrack;
-// ZOID, fscanf is evil
-//     fscanf (cls.demofile, "%i\n", &cls.forcetrack);
-
 }
 
 /*
index e5f6e2e..21d79be 100644 (file)
@@ -119,10 +119,11 @@ void KeyUp (kbutton_t *b)
 void IN_KLookDown (void) {KeyDown(&in_klook);}
 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)
-       V_StartPitchDrift();
+void IN_MLookUp (void)
+{
+       KeyUp(&in_mlook);
+       if ( !(in_mlook.state&1) && lookspring.value)
+               V_StartPitchDrift();
 }
 void IN_UpDown(void) {KeyDown(&in_up);}
 void IN_UpUp(void) {KeyUp(&in_up);}
@@ -154,12 +155,18 @@ void IN_AttackDown(void) {KeyDown(&in_attack);}
 void IN_AttackUp(void) {KeyUp(&in_attack);}
 
 // LordHavoc: added 6 new buttons
-void IN_Button3Down(void) {KeyDown(&in_button3);} void IN_Button3Up(void) {KeyUp(&in_button3);}
-void IN_Button4Down(void) {KeyDown(&in_button4);} void IN_Button4Up(void) {KeyUp(&in_button4);}
-void IN_Button5Down(void) {KeyDown(&in_button5);} void IN_Button5Up(void) {KeyUp(&in_button5);}
-void IN_Button6Down(void) {KeyDown(&in_button6);} void IN_Button6Up(void) {KeyUp(&in_button6);}
-void IN_Button7Down(void) {KeyDown(&in_button7);} void IN_Button7Up(void) {KeyUp(&in_button7);}
-void IN_Button8Down(void) {KeyDown(&in_button8);} void IN_Button8Up(void) {KeyUp(&in_button8);}
+void IN_Button3Down(void) {KeyDown(&in_button3);}
+void IN_Button3Up(void) {KeyUp(&in_button3);}
+void IN_Button4Down(void) {KeyDown(&in_button4);}
+void IN_Button4Up(void) {KeyUp(&in_button4);}
+void IN_Button5Down(void) {KeyDown(&in_button5);}
+void IN_Button5Up(void) {KeyUp(&in_button5);}
+void IN_Button6Down(void) {KeyDown(&in_button6);}
+void IN_Button6Up(void) {KeyUp(&in_button6);}
+void IN_Button7Down(void) {KeyDown(&in_button7);}
+void IN_Button7Up(void) {KeyUp(&in_button7);}
+void IN_Button8Down(void) {KeyDown(&in_button8);}
+void IN_Button8Up(void) {KeyUp(&in_button8);}
 
 void IN_UseDown (void) {KeyDown(&in_use);}
 void IN_UseUp (void) {KeyUp(&in_use);}
@@ -511,3 +518,4 @@ void CL_InitInput (void)
        Cmd_AddCommand ("+button8", IN_Button8Down);
        Cmd_AddCommand ("-button8", IN_Button8Up);
 }
+
index 68cb9e7..9ab6ea3 100644 (file)
@@ -1,3 +1,4 @@
+
 #include "quakedef.h"
 
 dlight_t cl_dlights[MAX_DLIGHTS];
@@ -78,4 +79,3 @@ void CL_DecayLights (void)
        }
 }
 
-
index 73139f7..016cf26 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -355,66 +355,9 @@ static void CL_RelinkNetworkEntities()
                        VectorCopy (ent->state_current.origin, oldorg); // skip trails
                        VectorCopy (ent->state_current.origin, neworg);
                        VectorCopy (ent->state_current.angles, ent->render.angles);
-
-                       /*
-                       // monster interpolation
-                       ent->persistent.steplerptime = 0;
-                       VectorCopy(ent->state_current.origin, ent->persistent.stepoldorigin);
-                       VectorCopy(ent->state_current.angles, ent->persistent.stepoldangles);
-                       VectorCopy(ent->state_current.origin, ent->persistent.steporigin);
-                       VectorCopy(ent->state_current.angles, ent->persistent.stepangles);
-                       */
-               }
-               /*
-               else if ((ent->state_current.flags & ent->state_previous.flags) & ENTFLAG_STEP)
-               {
-                       if (ent->state_current.origin[0] != ent->persistent.steporigin[0]
-                        || ent->state_current.origin[1] != ent->persistent.steporigin[1]
-                        || ent->state_current.origin[2] != ent->persistent.steporigin[2]
-                        || ent->state_current.angles[0] != ent->persistent.stepangles[0]
-                        || ent->state_current.angles[1] != ent->persistent.stepangles[1]
-                        || ent->state_current.angles[2] != ent->persistent.stepangles[2])
-                       {
-                               // update lerp positions
-                               ent->clientpersistent.steplerptime = sv.time;
-                               VectorCopy(ent->steporigin, ent->stepoldorigin);
-                               VectorCopy(ent->stepangles, ent->stepoldangles);
-                               VectorCopy(ent->v.origin, ent->steporigin);
-                               VectorCopy(ent->v.angles, ent->stepangles);
-                       }
-                       lerp = (cl.time - ent->persistent.steplerptime) * 10.0;
-                       if (lerp < 1)
-                       {
-                               // origin
-                               VectorSubtract(ent->persistent.steporigin, ent->persistent.stepoldorigin, delta);
-                               VectorMA(ent->persistent.stepoldorigin, lerp, delta, neworg);
-
-                               // angles
-                               VectorSubtract(ent->persistent.stepangles, ent->persistent.stepoldangles, delta);
-                               // choose shortest rotate (to avoid 'spin around' situations)
-                               if (delta[0] < -180) delta[0] += 360;else if (delta[0] >= 180) delta[0] -= 360;
-                               if (delta[1] < -180) delta[1] += 360;else if (delta[1] >= 180) delta[1] -= 360;
-                               if (delta[2] < -180) delta[2] += 360;else if (delta[2] >= 180) delta[2] -= 360;
-                               VectorMA(ent->stepoldangles, lerp, delta, ent->render.angles);
-                       }
-                       else
-                       {
-                               VectorCopy(ent->persistent.steporigin, neworg);
-                               VectorCopy(ent->persistent.stepangles, ent->render.angles);
-                       }
                }
-               */
                else
                {
-                       /*
-                       // monster interpolation
-                       ent->persistent.steplerptime = 0;
-                       VectorCopy(ent->state_current.origin, ent->persistent.stepoldorigin);
-                       VectorCopy(ent->state_current.angles, ent->persistent.stepoldangles);
-                       VectorCopy(ent->state_current.origin, ent->persistent.steporigin);
-                       VectorCopy(ent->state_current.angles, ent->persistent.stepangles);
-                       */
-
                        // if the delta is large, assume a teleport and don't lerp
                        VectorSubtract(ent->state_current.origin, ent->state_previous.origin, delta);
                        // LordHavoc: increased tolerance from 100 to 200, and now to 1000
@@ -509,23 +452,6 @@ static void CL_RelinkNetworkEntities()
                                {
                                        vec3_t mins, maxs;
                                        int temp;
-                                       /*
-                                       if (ent->render.angles[0] || ent->render.angles[2])
-                                       {
-                                               VectorMA(neworg, 0.25f, ent->render.model->rotatedmins, mins);
-                                               VectorMA(neworg, 0.25f, ent->render.model->rotatedmaxs, maxs);
-                                       }
-                                       else if (ent->render.angles[1])
-                                       {
-                                               VectorMA(neworg, 0.25f, ent->render.model->yawmins, mins);
-                                               VectorMA(neworg, 0.25f, ent->render.model->yawmaxs, maxs);
-                                       }
-                                       else
-                                       {
-                                               VectorMA(neworg, 0.25f, ent->render.model->normalmins, mins);
-                                               VectorMA(neworg, 0.25f, ent->render.model->normalmaxs, maxs);
-                                       }
-                                       */
                                        mins[0] = neworg[0] - 16.0f;
                                        mins[1] = neworg[1] - 16.0f;
                                        mins[2] = neworg[2] - 16.0f;
@@ -547,23 +473,6 @@ static void CL_RelinkNetworkEntities()
                                {
                                        vec3_t mins, maxs;
                                        int temp;
-                                       /*
-                                       if (ent->render.angles[0] || ent->render.angles[2])
-                                       {
-                                               VectorMA(neworg, 0.25f, ent->render.model->rotatedmins, mins);
-                                               VectorMA(neworg, 0.25f, ent->render.model->rotatedmaxs, maxs);
-                                       }
-                                       else if (ent->render.angles[1])
-                                       {
-                                               VectorMA(neworg, 0.25f, ent->render.model->yawmins, mins);
-                                               VectorMA(neworg, 0.25f, ent->render.model->yawmaxs, maxs);
-                                       }
-                                       else
-                                       {
-                                               VectorMA(neworg, 0.25f, ent->render.model->normalmins, mins);
-                                               VectorMA(neworg, 0.25f, ent->render.model->normalmaxs, maxs);
-                                       }
-                                       */
                                        mins[0] = neworg[0] - 16.0f;
                                        mins[1] = neworg[1] - 16.0f;
                                        mins[2] = neworg[2] - 16.0f;
@@ -655,7 +564,7 @@ static void CL_RelinkNetworkEntities()
                        // hack to make glowing player light shine on their gun
                        if (i == cl.viewentity && !chase_active.integer)
                                vec[2] += 30;
-                       CL_AllocDlight (/*&ent->render*/ NULL, vec, 1, dlightcolor[0], dlightcolor[1], dlightcolor[2], 0, 0);
+                       CL_AllocDlight (NULL, vec, 1, dlightcolor[0], dlightcolor[1], dlightcolor[2], 0, 0);
                }
 
                if (chase_active.integer)
@@ -1052,3 +961,4 @@ void CL_Init (void)
        CL_Screen_Init();
        CL_CGVM_Init();
 }
+
index 8f4df28..ef85680 100644 (file)
@@ -116,19 +116,6 @@ This error checks and tracks the total number of entities
 */
 entity_t       *CL_EntityNum (int num)
 {
-       /*
-       if (num >= cl.num_entities)
-       {
-               if (num >= MAX_EDICTS)
-                       Host_Error ("CL_EntityNum: %i is an invalid number",num);
-               cl.num_entities = num;
-//             while (cl.num_entities <= num)
-//             {
-//                     cl_entities[cl.num_entities].colormap = -1; // no special coloring
-//                     cl.num_entities++;
-//             }
-       }
-       */
        if (num >= MAX_EDICTS)
                Host_Error ("CL_EntityNum: %i is an invalid number",num);
                
@@ -341,7 +328,6 @@ Con_DPrintf ("CL_SignonReply: %i\n", cls.signon);
                break;
 
        case 4:
-               SCR_EndLoadingPlaque ();                // allow normal screen updates
                Con_ClearNotify();
                break;
        }
@@ -597,12 +583,8 @@ void CL_ParseUpdate (int bits)
        if (bits & U_EFFECTS2)  new.effects = (new.effects & 0x00FF) | (MSG_ReadByte() << 8);
        if (bits & U_GLOWSIZE)  new.glowsize = MSG_ReadByte();
        if (bits & U_GLOWCOLOR) new.glowcolor = MSG_ReadByte();
-#if 0
-       if (bits & U_COLORMOD)  {int i = MSG_ReadByte();float r = (((int) i >> 5) & 7) * 1.0 / 7, g = (((int) i >> 2) & 7) * 1.0 / 7, b = ((int) i & 3) * 1.0 / 3;Con_Printf("warning: U_COLORMOD %i (%1.2f %1.2f %1.2f) ignored\n", i, r, g, b);}
-#else
        // apparently the dpcrush demo uses this (unintended, and it uses white anyway)
        if (bits & U_COLORMOD)  MSG_ReadByte();
-#endif
        if (bits & U_GLOWTRAIL) new.flags |= RENDER_GLOWTRAIL;
        if (bits & U_FRAME2)    new.frame = (new.frame & 0x00FF) | (MSG_ReadByte() << 8);
        if (bits & U_MODEL2)    new.modelindex = (new.modelindex & 0x00FF) | (MSG_ReadByte() << 8);
@@ -722,8 +704,7 @@ void CL_BitProfile_f(void)
        Con_Printf("bitprofile: %i updates\n");
        if (bitprofilecount)
                for (i = 0;i < 32;i++)
-//                     if (bitprofile[i])
-                               Con_Printf("%s: %i %3.2f%%\n", bitprofilenames[i], bitprofile[i], bitprofile[i] * 100.0 / bitprofilecount);
+                       Con_Printf("%s: %i %3.2f%%\n", bitprofilenames[i], bitprofile[i], bitprofile[i] * 100.0 / bitprofilecount);
        Con_Printf("\n");
        for (i = 0;i < 32;i++)
                bitprofile[i] = 0;
@@ -1058,7 +1039,6 @@ void CL_ParseServerMessage (void)
                        break;
 
                case svc_nop:
-//                     Con_Printf ("svc_nop\n");
                        break;
 
                case svc_time:
@@ -1108,7 +1088,6 @@ void CL_ParseServerMessage (void)
 
                case svc_serverinfo:
                        CL_ParseServerInfo ();
-//                     vid.recalc_refdef = true;       // leave intermission full screen
                        break;
 
                case svc_setangle:
@@ -1246,20 +1225,17 @@ void CL_ParseServerMessage (void)
                case svc_intermission:
                        cl.intermission = 1;
                        cl.completed_time = cl.time;
-//                     vid.recalc_refdef = true;       // go to full screen
                        break;
 
                case svc_finale:
                        cl.intermission = 2;
                        cl.completed_time = cl.time;
-//                     vid.recalc_refdef = true;       // go to full screen
                        SCR_CenterPrint (MSG_ReadString ());
                        break;
 
                case svc_cutscene:
                        cl.intermission = 3;
                        cl.completed_time = cl.time;
-//                     vid.recalc_refdef = true;       // go to full screen
                        SCR_CenterPrint (MSG_ReadString ());
                        break;
 
@@ -1279,15 +1255,6 @@ void CL_ParseServerMessage (void)
                        {
                                int length;
                                length = (int) ((unsigned short) MSG_ReadShort());
-                               /*
-                               if (cgamenetbuffersize < length)
-                               {
-                                       cgamenetbuffersize = length;
-                                       if (cgamenetbuffer)
-                                               Mem_Free(cgamenetbuffer);
-                                       cgamenetbuffer = Mem_Alloc(cgamenetbuffersize);
-                               }
-                               */
                                for (i = 0;i < length;i++)
                                        cgamenetbuffer[i] = MSG_ReadByte();
                                if (!msg_badread)
@@ -1308,3 +1275,4 @@ void CL_ParseServerMessage (void)
        if (entitiesupdated)
                CL_EntityUpdateEnd();
 }
+
index 660ab4a..cf0a0c8 100644 (file)
@@ -95,7 +95,6 @@ static int particlepalette[256] =
 };
 
 static int explosparkramp[8] = {0x4b0700, 0x6f0f00, 0x931f07, 0xb7330f, 0xcf632b, 0xe3974f, 0xffe7b5, 0xffffff};
-//static int explounderwatersparkramp[8] = {0x00074b, 0x000f6f, 0x071f93, 0x0f33b7, 0x2b63cf, 0x4f97e3, 0xb5e7ff, 0xffffff};
 
 // these must match r_part.c's textures
 static const int tex_smoke[8] = {0, 1, 2, 3, 4, 5, 6, 7};
@@ -103,13 +102,11 @@ static const int tex_rainsplash[16] = {8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
 static const int tex_particle = 24;
 static const int tex_rain = 25;
 static const int tex_bubble = 26;
-//static const int tex_rocketglow = 27;
 
 static int                     cl_maxparticles;
 static int                     cl_numparticles;
 static particle_t      *particles;
 static particle_t      **freeparticles; // list used only in compacting particles array
-//static renderparticle_t      *cl_renderparticles;
 
 static cvar_t cl_particles = {CVAR_SAVE, "cl_particles", "1"};
 static cvar_t cl_particles_size = {CVAR_SAVE, "cl_particles_size", "1"};
@@ -169,9 +166,6 @@ void CL_Particles_Init (void)
        particles = (particle_t *) Mem_Alloc(cl_part_mempool, cl_maxparticles * sizeof(particle_t));
        freeparticles = (void *) Mem_Alloc(cl_part_mempool, cl_maxparticles * sizeof(particle_t *));
        cl_numparticles = 0;
-
-       // FIXME: r_refdef stuff should be allocated somewhere else?
-       //r_refdef.particles = cl_renderparticles = Mem_Alloc(cl_refdef_mempool, cl_maxparticles * sizeof(renderparticle_t));
 }
 
 #define particle(ptype, porientation, pcolor1, pcolor2, ptex, plight, padditive, pscalex, pscaley, palpha, ptime, pbounce, px, py, pz, pvx, pvy, pvz, ptime2, pvx2, pvy2, pvz2, pfriction, ppressure)\
@@ -209,10 +203,6 @@ void CL_Particles_Init (void)
                part->color[2] = cb2;\
                part->color[3] = 0xFF;\
                part->flags = partflags;\
-               /*part->tex = (ptex);*/\
-               /*part->orientation = (porientation);*/\
-               /*part->dynlight = (plight);*/\
-               /*part->additive = (padditive);*/\
                part->scalex = (pscalex);\
                part->scaley = (pscaley);\
                part->alpha = (palpha);\
@@ -374,9 +364,6 @@ void CL_ParticleExplosion (vec3_t org, int smoke)
                i = Mod_PointInLeaf(org, cl.worldmodel)->contents;
                if (i == CONTENTS_SLIME || i == CONTENTS_WATER)
                {
-                       //for (i = 0;i < 128;i++)
-                       //      particle(pt_bubble, PARTICLE_BILLBOARD, 0x808080, 0xFFFFFF, tex_bubble, false, true, 2, 2, 255, 9999, 1.5, org[0] + lhrandom(-16, 16), org[1] + lhrandom(-16, 16), org[2] + lhrandom(-16, 16), lhrandom(-96, 96), lhrandom(-96, 96), lhrandom(-96, 96), 0, 0, 0, 0, 0, 0);
-
                        ang[2] = lhrandom(0, 360);
                        fractalnoisequick(noise1, 32, 4);
                        fractalnoisequick(noise2, 32, 8);
@@ -422,32 +409,12 @@ void CL_ParticleExplosion (vec3_t org, int smoke)
                                        VectorScale(v, 0.75, v);
                                        k = explosparkramp[(noise2[j*32+i] >> 5)];
                                        particle(pt_spark, PARTICLE_BILLBOARD, k, k, tex_particle, false, true, 10, 10, lhrandom(128, 255), 9999, 1.5, end[0], end[1], end[2], v[0], v[1], v[2] + 160.0f, 512.0f, 0, 0, 0, 2, 0);
-                               //      VectorRandom(v);
-                               //      VectorScale(v, 384, v);
-                               //      particle(pt_spark, PARTICLE_BILLBOARD, explosparkramp[rand()&7], tex_particle, false, true, 2, 2, lhrandom(16, 255), 9999, 1.5, end[0], end[1], end[2], v[0], v[1], v[2] + 160.0f, 512.0f, 0, 0, 0, 2, 0);
                                }
                        }
                }
        }
        else
-       {
-               /*
-               int i;
-               vec3_t v;
-               for (i = 0;i < 256;i++)
-               {
-                       do
-                       {
-                               VectorRandom(v);
-                       }
-                       while(DotProduct(v,v) < 0.75);
-                       VectorScale(v, 512, v);
-                       k = explosparkramp[rand()&7];
-                       particle(pt_spark, PARTICLE_BILLBOARD, k, k, tex_particle, false, true, 4, 4, 255, 9999, 1.5, org[0], org[1], org[2], v[0], v[1], v[2] + 160.0f, 512.0f, 0, 0, 0, 2, 0);
-               }
-               */
                R_NewExplosion(org);
-       }
 }
 
 /*
@@ -476,18 +443,11 @@ CL_BlobExplosion
 */
 void CL_BlobExplosion (vec3_t org)
 {
-       //int i;
        if (!cl_particles.integer) return;
 
        R_Stain(org, 96, 80, 80, 80, 128, 176, 176, 176, 128);
-       //R_Stain(org, 96, 96, 64, 96, 128, 160, 128, 160, 128);
 
        R_NewExplosion(org);
-
-       //for (i = 0;i < 256;i++)
-       //      particle(pt_blob , PARTICLE_BILLBOARD, particlepalette[ 66+(rand()%6)], tex_particle, false, true, 4, 4, 255, 9999, 0, org[0] + lhrandom(-16, 16), org[1] + lhrandom(-16, 16), org[2] + lhrandom(-16, 16), lhrandom(-4, 4), lhrandom(-4, 4), lhrandom(-128, 128), 0, 0, 0, 0, 0, 0);
-       //for (i = 0;i < 256;i++)
-       //      particle(pt_blob2, PARTICLE_BILLBOARD, particlepalette[150+(rand()%6)], tex_particle, false, true, 4, 4, 255, 9999, 0, org[0] + lhrandom(-16, 16), org[1] + lhrandom(-16, 16), org[2] + lhrandom(-16, 16), lhrandom(-4, 4), lhrandom(-4, 4), lhrandom(-128, 128), 0, 0, 0, 0, 0, 0);
 }
 
 /*
@@ -675,7 +635,6 @@ void CL_Stardust (vec3_t mins, vec3_t maxs, int count)
        int k;
        float t;
        vec3_t o, v, center;
-       //Con_Printf("CL_Stardust ('%f %f %f', '%f %f %f', %d);\n", mins[0], mins[1], mins[2], maxs[0], maxs[1], maxs[2], count);
        if (!cl_particles.integer) return;
 
        if (maxs[0] <= mins[0]) {t = mins[0];mins[0] = maxs[0];maxs[0] = t;}
@@ -727,8 +686,6 @@ void CL_Flames (vec3_t org, vec3_t vel, int count)
        {
                k = particlepalette[224 + (rand()&15)];
                particle(pt_flame, PARTICLE_BILLBOARD, k, k, tex_particle, false, true, 4, 4, lhrandom(64, 128), 9999, 1.1, org[0], org[1], org[2], vel[0] + lhrandom(-128, 128), vel[1] + lhrandom(-128, 128), vel[2] + lhrandom(-128, 128), 0, 0, 0, 0, 1, 0);
-               //if (count & 1)
-               //      particle(pt_fade, PARTICLE_BILLBOARD, 0x202020, 0x404040, tex_smoke[rand()&7], false, true, 6, 6, lhrandom(32, 64), 9999, 0, org[0], org[1], org[2], vel[0] + lhrandom(-64, 64), vel[1] + lhrandom(-64, 64), vel[2] + lhrandom(-64, 64), 64.0f, 0, 0, 0, 0, 0);
        }
 }
 
@@ -778,7 +735,6 @@ void CL_TeleportSplash (vec3_t org)
        for (i=-16 ; i<16 ; i+=8)
                for (j=-16 ; j<16 ; j+=8)
                        for (k=-24 ; k<32 ; k+=8)
-                               //particle(pt_fade, PARTICLE_BILLBOARD, 0xA0A0A0, 0xFFFFFF, tex_particle, false, true, 1.5, 1.5, lhrandom(64, 128), 9999, 0, org[0] + i + lhrandom(0, 8), org[1] + j + lhrandom(0, 8), org[2] + k + lhrandom(0, 8), i*2 + lhrandom(-12.5, 12.5), j*2 + lhrandom(-12.5, 12.5), k*2 + lhrandom(27.5, 52.5), 384.0f, 0, 0, 0, 1, 0);
                                particle(pt_fade, PARTICLE_BILLBOARD, 0xA0A0A0, 0xFFFFFF, tex_particle, false, true, 10, 10, lhrandom(64, 128), 9999, 0, org[0] + i + lhrandom(0, 8), org[1] + j + lhrandom(0, 8), org[2] + k + lhrandom(0, 8), lhrandom(-64, 64), lhrandom(-64, 64), lhrandom(-256, 256), 256.0f, 0, 0, 0, 1, 0);
 }
 
@@ -792,9 +748,6 @@ void CL_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent)
        VectorSubtract(end, start, dir);
        VectorNormalize(dir);
 
-       //if (type == 0 && host_frametime != 0) // rocket glow
-       //      particle(pt_oneframe, PARTICLE_BILLBOARD, 0xFFFFFF, 0xFFFFFF, tex_rocketglow, false, true, 24, 24, 255, 9999, 0, end[0] - 12 * dir[0], end[1] - 12 * dir[1], end[2] - 12 * dir[2], 0, 0, 0, 0, 0, 0, 0, 0, 0);
-
        VectorSubtract (end, start, vec);
        len = VectorNormalizeLength (vec);
        dec = -ent->persistent.trail_time;
@@ -826,26 +779,11 @@ void CL_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent)
                        case 0: // rocket trail
                                if (!cl_particles_smoke.integer)
                                        return;
-                               //dec = 5;
-                               //particle(pt_fade, PARTICLE_BILLBOARD, 0x202020, 0x404040, tex_particle, true, false, dec, dec, 128, 9999, 0, pos[0], pos[1], pos[2], lhrandom(-8, 8), lhrandom(-8, 8), lhrandom(-8, 8), 256.0f, 0, 0, 0, 0, 0);
                                dec = 6;
                                particle(pt_fade, PARTICLE_BILLBOARD, 0x303030, 0x606060, tex_smoke[rand()&7], true, false, dec, dec, 64, 9999, 0, pos[0], pos[1], pos[2], lhrandom(-5, 5), lhrandom(-5, 5), lhrandom(-5, 5), 64.0f, 0, 0, 0, 0, 0);
-                               //particle(pt_fade, PARTICLE_BILLBOARD, 0x202020, 0x404040, tex_smoke[rand()&7], false, true, dec, dec, 128, 9999, 0, pos[0], pos[1], pos[2], lhrandom(-10, 10), lhrandom(-10, 10), lhrandom(-10, 10), 128.0f, 0, 0, 0, 0, 0);
-                               //dec = 10;
-                               //particle(pt_smoke, PARTICLE_BILLBOARD, 0x202020, 0x404040, tex_smoke[rand()&7], false, true, 2, 2, 160, 9999, 0, pos[0], pos[1], pos[2], 0, 0, 0, 0, 0, 0, 0, 0, 0);
                                if (bubbles && cl_particles_bubbles.integer)
                                {
                                        particle(pt_bubble, PARTICLE_BILLBOARD, 0x404040, 0x808080, tex_bubble, false, true, 2, 2, 255, 9999, 1.5, pos[0], pos[1], pos[2], lhrandom(-16, 16), lhrandom(-16, 16), lhrandom(-16, 16), 0, 0, 0, 0, 0, 0);
-                                       //particle(pt_bubble, PARTICLE_BILLBOARD, 0x404040, 0x808080, tex_bubble, false, true, 2, 2, 255, 9999, 1.5, pos[0], pos[1], pos[2], lhrandom(-16, 16), lhrandom(-16, 16), lhrandom(-16, 16), 0, 0, 0, 0, 0, 0);
-                               }
-                               else
-                               {
-                                       //particle(pt_spark, PARTICLE_BILLBOARD, particlepalette[0x68 + (rand() & 7)], tex_particle, false, true, 2, 2, lhrandom(128, 255), 9999, 1.5, pos[0], pos[1], pos[2], lhrandom(-64, 64), lhrandom(-64, 64), lhrandom(-64, 64), 512.0f, 0, 0, 0, 1, 0);
-                                       //particle(pt_spark, PARTICLE_BILLBOARD, particlepalette[0x68 + (rand() & 7)], tex_particle, false, true, 2, 2, lhrandom(128, 255), 9999, 1.5, pos[0], pos[1], pos[2], lhrandom(-64, 64), lhrandom(-64, 64), lhrandom(-64, 64), 512.0f, 0, 0, 0, 1, 0);
-                                       //particle(pt_spark, PARTICLE_BILLBOARD, particlepalette[0x68 + (rand() & 7)], tex_particle, false, true, 1, 1, lhrandom(128, 255), 9999, 1.5, pos[0], pos[1], pos[2], lhrandom(-64, 64) - vel[0] * 0.0625, lhrandom(-64, 64) - vel[1] * 0.0625, lhrandom(-64, 64) - vel[2] * 0.0625, 512.0f, 0, 0, 0, 1, 0);
-                                       //particle(pt_spark, PARTICLE_BILLBOARD, particlepalette[0x68 + (rand() & 7)], tex_particle, false, true, 1, 1, lhrandom(128, 255), 9999, 1.5, pos[0], pos[1], pos[2], lhrandom(-64, 64) - vel[0] * 0.0625, lhrandom(-64, 64) - vel[1] * 0.0625, lhrandom(-64, 64) - vel[2] * 0.0625, 512.0f, 0, 0, 0, 1, 0);
-                                       //particle(pt_spark, PARTICLE_BILLBOARD, particlepalette[0x68 + (rand() & 7)], tex_particle, false, true, 1, 1, lhrandom(128, 255), 9999, 1.5, pos[0], pos[1], pos[2], lhrandom(-64, 64) - vel[0] * 0.0625, lhrandom(-64, 64) - vel[1] * 0.0625, lhrandom(-64, 64) - vel[2] * 0.0625, 512.0f, 0, 0, 0, 1, 0);
-                                       //particle(pt_spark, PARTICLE_BILLBOARD, particlepalette[0x68 + (rand() & 7)], tex_particle, false, true, 1, 1, lhrandom(128, 255), 9999, 1.5, pos[0], pos[1], pos[2], lhrandom(-64, 64) - vel[0] * 0.0625, lhrandom(-64, 64) - vel[1] * 0.0625, lhrandom(-64, 64) - vel[2] * 0.0625, 512.0f, 0, 0, 0, 1, 0);
                                }
                                break;
 
@@ -853,15 +791,11 @@ void CL_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent)
                                // FIXME: make it gradually stop smoking
                                if (!cl_particles_smoke.integer)
                                        return;
-                               //dec = 5;
-                               //particle(pt_fade, PARTICLE_BILLBOARD, 0x202020, 0x404040, tex_particle, true, false, dec, dec, 128, 9999, 0, pos[0], pos[1], pos[2], lhrandom(-8, 8), lhrandom(-8, 8), lhrandom(-8, 8), 256.0f, 0, 0, 0, 0, 0);
                                dec = 6;
                                particle(pt_fade, PARTICLE_BILLBOARD, 0x202020, 0x404040, tex_smoke[rand()&7], true, false, dec, dec, 64, 9999, 0, pos[0], pos[1], pos[2], lhrandom(-5, 5), lhrandom(-5, 5), lhrandom(-5, 5), 128.0f, 0, 0, 0, 0, 0);
-                               //particle(pt_smoke, PARTICLE_BILLBOARD, 0x202020, 0x404040, tex_smoke[rand()&7], false, true, 2, 2, 160, 9999, 0, pos[0], pos[1], pos[2], 0, 0, 0, 0, 0, 0, 0, 0, 0);
                                if (bubbles && cl_particles_bubbles.integer)
                                {
                                        particle(pt_bubble, PARTICLE_BILLBOARD, 0x404040, 0x808080, tex_bubble, false, true, 2, 2, 255, 9999, 1.5, pos[0], pos[1], pos[2], lhrandom(-16, 16), lhrandom(-16, 16), lhrandom(-16, 16), 0, 0, 0, 0, 0, 0);
-                                       //particle(pt_bubble, PARTICLE_BILLBOARD, c * 2, tex_bubble, false, true, 2, 2, 255, 9999, 1.5, pos[0], pos[1], pos[2], lhrandom(-16, 16), lhrandom(-16, 16), lhrandom(-16, 16), 0, 0, 0, 0, 0, 0);
                                }
                                break;
 
@@ -871,8 +805,6 @@ void CL_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent)
                                        return;
                                dec = lhrandom(cl_particles_blood_size_min.value, cl_particles_blood_size_max.value);
                                particle(pt_blood, PARTICLE_BILLBOARD, 0x000000, 0x200000, tex_smoke[rand()&7], true, false, dec, dec, cl_particles_blood_alpha.value * 255.0f, 9999, -1, pos[0], pos[1], pos[2], vel[0] * 0.5f + lhrandom(-64, 64), vel[1] * 0.5f + lhrandom(-64, 64), vel[2] * 0.5f + lhrandom(-64, 64), 0, 0, 0, 0, 1, 0);
-                               //particle(pt_blood, PARTICLE_BILLBOARD, 0x000000, 0x200000, tex_smoke[rand()&7], true, false, dec, dec, cl_particles_blood_alpha.value * 255.0f, 9999, -1, pos[0], pos[1], pos[2], lhrandom(-64, 64), lhrandom(-64, 64), lhrandom(-64, 64), 0, 0, 0, 0, 1, 0);
-                               //particle(pt_blood, PARTICLE_BILLBOARD, 0x000000, 0x200000, tex_particle, true, false, dec, dec, cl_particles_blood_alpha.value * 255.0f, 9999, -1, pos[0], pos[1], pos[2], lhrandom(-64, 64), lhrandom(-64, 64), lhrandom(-64, 64), 0, 0, 0, 0, 1, 0);
                                break;
 
                        case 4: // slight blood
@@ -880,25 +812,20 @@ void CL_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent)
                                        return;
                                dec = lhrandom(cl_particles_blood_size_min.value, cl_particles_blood_size_max.value);
                                particle(pt_blood, PARTICLE_BILLBOARD, 0x000000, 0x200000, tex_smoke[rand()&7], true, false, dec, dec, cl_particles_blood_alpha.value * 255.0f, 9999, -1, pos[0], pos[1], pos[2], vel[0] * 0.5f + lhrandom(-64, 64), vel[1] * 0.5f + lhrandom(-64, 64), vel[2] * 0.5f + lhrandom(-64, 64), 0, 0, 0, 0, 1, 0);
-                               //particle(pt_blood, PARTICLE_BILLBOARD, 0x000000, 0x200000, tex_smoke[rand()&7], true, false, dec, dec, cl_particles_blood_alpha.value * 128.0f, 9999, -1, pos[0], pos[1], pos[2], lhrandom(-64, 64), lhrandom(-64, 64), lhrandom(-64, 64), 0, 0, 0, 0, 1, 0);
-                               //particle(pt_blood, PARTICLE_BILLBOARD, 0x000000, 0x200000, tex_particle, true, false, dec, dec, cl_particles_blood_alpha.value * 128.0f, 9999, -1, pos[0], pos[1], pos[2], lhrandom(-64, 64), lhrandom(-64, 64), lhrandom(-64, 64), 0, 0, 0, 0, 1, 0);
                                break;
 
                        case 3: // green tracer
                                dec = 6;
-                               //particle(pt_fade, PARTICLE_BILLBOARD, 0x373707, 0x373707, tex_particle, false, true, dec, dec, 128, 9999, 0, pos[0], pos[1], pos[2], 0, 0, 0, 384.0f, 0, 0, 0, 0, 0);
                                particle(pt_fade, PARTICLE_BILLBOARD, 0x373707, 0x373707, tex_particle, false, false, dec, dec, 128, 9999, 0, pos[0], pos[1], pos[2], lhrandom(-8, 8), lhrandom(-8, 8), lhrandom(-8, 8), 384.0f, 0, 0, 0, 0, 0);
                                break;
 
                        case 5: // flame tracer
                                dec = 6;
-                               //particle(pt_fade, PARTICLE_BILLBOARD, 0xCF632B, 0xCF632B, tex_particle, false, true, dec, dec, 128, 9999, 0, pos[0], pos[1], pos[2], 0, 0, 0, 384.0f, 0, 0, 0, 0, 0);
                                particle(pt_fade, PARTICLE_BILLBOARD, 0xCF632B, 0xCF632B, tex_particle, false, false, dec, dec, 128, 9999, 0, pos[0], pos[1], pos[2], lhrandom(-8, 8), lhrandom(-8, 8), lhrandom(-8, 8), 384.0f, 0, 0, 0, 0, 0);
                                break;
 
                        case 6: // voor trail
                                dec = 6;
-                               //particle(pt_fade, PARTICLE_BILLBOARD, 0x47232B, 0x47232B, tex_particle, false, true, dec, dec, 128, 9999, 0, pos[0], pos[1], pos[2], 0, 0, 0, 384.0f, 0, 0, 0, 0, 0);
                                particle(pt_fade, PARTICLE_BILLBOARD, 0x47232B, 0x47232B, tex_particle, false, false, dec, dec, 128, 9999, 0, pos[0], pos[1], pos[2], lhrandom(-8, 8), lhrandom(-8, 8), lhrandom(-8, 8), 384.0f, 0, 0, 0, 0, 0);
                                break;
 
@@ -945,16 +872,12 @@ CL_MoveParticles
 void CL_MoveParticles (void)
 {
        particle_t *p;
-       //renderparticle_t *r, *rend;
        int i, activeparticles, maxparticle, j, a, pressureused = false, content;
        float gravity, dvel, frametime, f, dist, normal[3], v[3], org[3];
 
        // LordHavoc: early out condition
        if (!cl_numparticles)
-       {
-               //r_refdef.numparticles = 0;
                return;
-       }
 
        frametime = cl.time - cl.oldtime;
        if (!frametime)
@@ -965,7 +888,7 @@ void CL_MoveParticles (void)
        activeparticles = 0;
        maxparticle = -1;
        j = 0;
-       for (i = 0, p = particles/*, r = r_refdef.particles, rend = r + cl_maxparticles*/;i < cl_numparticles;i++, p++)
+       for (i = 0, p = particles;i < cl_numparticles;i++, p++)
        {
                if (p->die < cl.time)
                {
@@ -1049,45 +972,6 @@ void CL_MoveParticles (void)
                        if (a != CONTENTS_EMPTY && a != CONTENTS_SKY)
                        {
                                p->die = -1;
-                               /*
-                               if (a == CONTENTS_SOLID && Mod_PointInLeaf(p->oldorg, cl.worldmodel)->contents == CONTENTS_SOLID)
-                                       break; // still in solid
-                               p->die = cl.time + 1000;
-                               p->vel[0] = p->vel[1] = p->vel[2] = 0;
-                               switch (a)
-                               {
-                               case CONTENTS_LAVA:
-                               case CONTENTS_SLIME:
-                                       p->tex = tex_smoke[rand()&7];
-                                       p->orientation = PARTICLE_BILLBOARD;
-                                       p->type = pt_steam;
-                                       p->alpha = 96;
-                                       p->scalex = 5;
-                                       p->scaley = 5;
-                                       p->vel[2] = 96;
-                                       break;
-                               case CONTENTS_WATER:
-                                       p->tex = tex_smoke[rand()&7];
-                                       p->orientation = PARTICLE_BILLBOARD;
-                                       p->type = pt_splash;
-                                       p->alpha = 96;
-                                       p->scalex = 5;
-                                       p->scaley = 5;
-                                       p->vel[2] = 96;
-                                       break;
-                               default: // CONTENTS_SOLID and any others
-                                       TraceLine(p->oldorg, p->org, v, normal, 0, true);
-                                       VectorCopy(v, p->org);
-                                       p->tex = tex_smoke[rand()&7];
-                                       p->orientation = PARTICLE_BILLBOARD;
-                                       p->type = pt_fade;
-                                       p->time2 = 384.0f;
-                                       p->scalex = 5;
-                                       p->scaley = 5;
-                                       VectorClear(p->vel);
-                                       break;
-                               }
-                               */
                        }
                        break;
                case pt_blood:
@@ -1099,11 +983,9 @@ void CL_MoveParticles (void)
                        {
                                if (a == CONTENTS_WATER || a == CONTENTS_SLIME)
                                {
-                                       //p->friction = 5;
                                        p->scalex += frametime * (cl_particles_blood_size_min.value + cl_particles_blood_size_max.value);
                                        p->scaley += frametime * (cl_particles_blood_size_min.value + cl_particles_blood_size_max.value);
                                        p->alpha -= frametime * max(cl_particles_blood_alpha.value, 0.01f) * 128.0f;
-                                       //p->vel[2] += gravity * 0.25f;
                                        if (p->alpha < 1)
                                                p->die = -1;
                                }
@@ -1149,15 +1031,6 @@ void CL_MoveParticles (void)
                        {
                                p->die = -1;
                                break;
-                               /*
-                               p->tex = tex_smoke[rand()&7];
-                               p->orientation = PARTICLE_BILLBOARD;
-                               p->type = pt_splashpuff;
-                               p->scalex = 4;
-                               p->scaley = 4;
-                               p->vel[0] = p->vel[1] = p->vel[2] = 0;
-                               break;
-                               */
                        }
                        p->vel[0] *= (1 - (frametime * 0.0625));
                        p->vel[1] *= (1 - (frametime * 0.0625));
@@ -1185,7 +1058,6 @@ void CL_MoveParticles (void)
                        p->scalex += frametime * 16;
                        p->scaley += frametime * 16;
                        p->alpha -= frametime * 320;
-                       //p->vel[2] += gravity * 0.2;
                        if (p->alpha < 1)
                                p->die = -1;
                        break;
@@ -1208,63 +1080,7 @@ void CL_MoveParticles (void)
                        a = content;
                        if (a != CONTENTS_EMPTY && a != CONTENTS_SKY)
                                p->die = -1;
-                       /*
-                       f = 0;
-                       b = Mod_PointInLeaf(p->oldorg, cl.worldmodel)->contents;
-                       VectorCopy(p->oldorg, o);
-                       while (f < 1)
-                       {
-                               a = b;
-                               f = TraceLine(o, p->org, v, normal, a, true);
-                               b = cl_traceline_endcontents;
-                               if (f < 1 && b != CONTENTS_EMPTY && b != CONTENTS_SKY)
-                               {
-                                       #if 1
-                                       p->die = -1;
-                                       #else
-                                       p->die = cl.time + 1000;
-                                       p->vel[0] = p->vel[1] = p->vel[2] = 0;
-                                       VectorCopy(v, p->org);
-                                       switch (b)
-                                       {
-                                       case CONTENTS_LAVA:
-                                       case CONTENTS_SLIME:
-                                               p->tex = tex_smoke[rand()&7];
-                                               p->orientation = PARTICLE_BILLBOARD;
-                                               p->type = pt_steam;
-                                               p->scalex = 3;
-                                               p->scaley = 3;
-                                               p->vel[2] = 96;
-                                               break;
-                                       default: // water, solid, and anything else
-                                               p->tex = tex_rainsplash[0];
-                                               p->orientation = PARTICLE_ORIENTED_DOUBLESIDED;
-                                               p->time2 = 0;
-                                               VectorCopy(normal, p->vel2);
-                                       //      VectorAdd(p->org, normal, p->org);
-                                               p->type = pt_raindropsplash;
-                                               p->scalex = 8;
-                                               p->scaley = 8;
-                                               break;
-                                       }
-                                       #endif
-                                       break;
-                               }
-                       }
-                       */
-                       break;
-                       /*
-               case pt_raindropsplash:
-                       p->time2 += frametime * 64.0f;
-                       if (p->time2 >= 16.0f)
-                       {
-                               p->die = -1;
-                               break;
-                       }
-                       p->tex = tex_rainsplash[(int) p->time2];
-                       p->orientation = PARTICLE_ORIENTED_DOUBLESIDED;
                        break;
-                       */
                case pt_flame:
                        p->alpha -= frametime * 384;
                        p->vel[2] += gravity;
@@ -1297,30 +1113,8 @@ void CL_MoveParticles (void)
                        activeparticles++;
                        if (p->pressure)
                                pressureused = true;
-
-                       /*
-                       // build renderparticle for renderer to use
-                       r->orientation = p->orientation;
-                       r->additive = p->additive;
-                       r->dir[0] = p->vel2[0];
-                       r->dir[1] = p->vel2[1];
-                       r->dir[2] = p->vel2[2];
-                       r->org[0] = p->org[0];
-                       r->org[1] = p->org[1];
-                       r->org[2] = p->org[2];
-                       r->tex = p->tex;
-                       r->scalex = p->scalex * cl_particles_size.value;
-                       r->scaley = p->scaley * cl_particles_size.value;
-                       r->dynlight = p->dynlight;
-                       r->color[0] = p->color[0] * (1.0f / 255.0f);
-                       r->color[1] = p->color[1] * (1.0f / 255.0f);
-                       r->color[2] = p->color[2] * (1.0f / 255.0f);
-                       r->color[3] = p->alpha * (1.0f / 255.0f);
-                       r++;
-                       */
                }
        }
-       //r_refdef.numparticles = r - r_refdef.particles;
        // fill in gaps to compact the array
        i = 0;
        while (maxparticle >= activeparticles)
@@ -1353,8 +1147,6 @@ void CL_MoveParticles (void)
                                                {
                                                        dist = freeparticles[j]->scalex * 4.0f * frametime / sqrt(dist);
                                                        VectorMA(p->vel, dist, diff, p->vel);
-                                                       //dist = freeparticles[j]->scalex * 4.0f * frametime / dist;
-                                                       //VectorMA(p->vel, dist, freeparticles[j]->vel, p->vel);
                                                }
                                        }
                                }
@@ -1460,42 +1252,6 @@ static void R_InitParticleTexture (void)
                setuptex(i + 0, 0, i + 0, &data[0][0][0], particletexturedata);
                setuptex(i + 0, 1, i + 0, &data[0][0][0], particletexturedata);
        }
-       /*
-       for (i = 0;i < 8;i++)
-       {
-               do
-               {
-                       fractalnoise(&noise1[0][0], 64, 4);
-                       fractalnoise(&noise2[0][0], 64, 8);
-                       m = 0;
-                       for (y = 0;y < 32;y++)
-                       {
-                               dy = y - 16;
-                               for (x = 0;x < 32;x++)
-                               {
-                                       d = (noise1[y][x] - 128) * 2 + 128;
-                                       d = bound(0, d, 255);
-                                       data[y][x][0] = data[y][x][1] = data[y][x][2] = d;
-                                       dx = x - 16;
-                                       d = (noise2[y][x] - 128) * 3 + 192;
-                                       if (d > 0)
-                                               d = (d * (256 - (int) (dx*dx+dy*dy))) >> 8;
-                                       d = bound(0, d, 255);
-                                       data[y][x][3] = (qbyte) d;
-                                       if (m < d)
-                                               m = d;
-                               }
-                       }
-               }
-               while (m < 224);
-
-               setuptex(i + 0, 0, i + 0, &data[0][0][0], particletexturedata);
-               for (y = 0;y < 32;y++)
-                       for (x = 0;x < 32;x++)
-                               data[y][x][0] = data[y][x][1] = data[y][x][2] = 255;
-               setuptex(i + 0, 1, i + 8, &data[0][0][0], particletexturedata);
-       }
-       */
 
        // rain splash
        for (i = 0;i < 16;i++)
@@ -1562,28 +1318,6 @@ static void R_InitParticleTexture (void)
        setuptex(26, 0, 34, &data[0][0][0], particletexturedata);
        setuptex(26, 1, 34, &data[0][0][0], particletexturedata);
 
-       // rocket flare
-       /*
-       for (y = 0;y < 32;y++)
-       {
-               dy = y - 16;
-               for (x = 0;x < 32;x++)
-               {
-                       dx = x - 16;
-                       d = (2048.0f / (dx*dx+dy*dy+1)) - 8.0f;
-                       data[y][x][0] = bound(0, d * 1.0f, 255);
-                       data[y][x][1] = bound(0, d * 0.8f, 255);
-                       data[y][x][2] = bound(0, d * 0.5f, 255);
-                       data[y][x][3] = bound(0, d * 1.0f, 255);
-               }
-       }
-       setuptex(27, 0, 35, &data[0][0][0], particletexturedata);
-       for (y = 0;y < 32;y++)
-               for (x = 0;x < 32;x++)
-                       data[y][x][0] = data[y][x][1] = data[y][x][2] = 255;
-       setuptex(28, 1, 36, &data[0][0][0], particletexturedata);
-       */
-
        particlefonttexture = R_LoadTexture (particletexturepool, "particlefont", 256, 256, particletexturedata, TEXTYPE_RGBA, TEXF_ALPHA | TEXF_PRECACHE);
 }
 
@@ -1613,7 +1347,6 @@ int partindexarray[6] = {0, 1, 2, 0, 2, 3};
 
 void R_DrawParticles (void)
 {
-       //renderparticle_t *r;
        int i, lighting, dynlight, additive, texnum, orientation;
        float minparticledist, org[3], uprightangles[3], up2[3], right2[3], v[3], right[3], up[3], tvxyz[4][4], tvst[4][2], fog, ifog, fogvec[3];
        mleaf_t *leaf;
@@ -1622,7 +1355,6 @@ void R_DrawParticles (void)
        particle_t *p;
 
        // LordHavoc: early out conditions
-       //if ((!r_refdef.numparticles) || (!r_drawparticles.integer))
        if ((!cl_numparticles) || (!r_drawparticles.integer))
                return;
 
@@ -1630,7 +1362,7 @@ void R_DrawParticles (void)
        if (!r_dynamic.integer)
                lighting = 0;
 
-       c_particles += cl_numparticles; //r_refdef.numparticles;
+       c_particles += cl_numparticles;
 
        uprightangles[0] = 0;
        uprightangles[1] = r_refdef.viewangles[1];
@@ -1654,7 +1386,7 @@ void R_DrawParticles (void)
        m.texcoords[0] = &tvst[0][0];
        m.texcoordstep[0] = sizeof(float[2]);
 
-       for (i = 0/*, r = r_refdef.particles*/, p = particles;i < /*r_refdef.numparticles*/cl_numparticles;i++, p++)
+       for (i = 0, p = particles;i < cl_numparticles;i++, p++)
        {
                // LordHavoc: only render if not too close
                if (DotProduct(p->org, vpn) < minparticledist)
@@ -1828,3 +1560,4 @@ void R_DrawParticles (void)
                }
        }
 }
+
index 74f00ef..17079c9 100644 (file)
@@ -20,9 +20,7 @@ float         scr_conlines;           // lines of console to display
 int                    clearconsole;
 int                    clearnotify;
 
-//qboolean     scr_disabled_for_loading;
 qboolean       scr_drawloading = false;
-//float                scr_disabled_time;
 
 static qbyte menuplyr_pixels[4096];
 
@@ -144,18 +142,6 @@ void SCR_CheckDrawCenterString (void)
 
 /*
 ==============
-SCR_DrawRam
-==============
-*/
-void SCR_DrawRam (void)
-{
-//     if (!scr_showram.integer)
-//             return;
-//     DrawQ_Pic (32, 0, "ram", 0, 0, 1, 1, 1, 1, 0);
-}
-
-/*
-==============
 SCR_DrawTurtle
 ==============
 */
@@ -232,9 +218,6 @@ void SCR_DrawLoading (void)
 {
        cachepic_t      *pic;
 
-       //if (!scr_drawloading)
-       //      return;
-
        pic = Draw_CachePic ("gfx/loading.lmp");
        DrawQ_Pic ((vid.conwidth - pic->width)/2, (vid.conheight - pic->height)/2, "gfx/loading.lmp", 0, 0, 1, 1, 1, 1, 0);
 }
@@ -313,42 +296,10 @@ void SCR_BeginLoadingPlaque (void)
 
        S_StopAllSounds (true);
 
-//     if (cls.state != ca_connected)
-//             return;
-//     if (cls.signon != SIGNONS)
-//             return;
-
-// redraw with no console and the loading plaque
-//     Con_ClearNotify ();
-//     scr_centertime_off = 0;
-//     scr_con_current = 0;
-
        scr_drawloading = true;
        CL_UpdateScreen ();
        scr_drawloading = true;
        CL_UpdateScreen ();
-       //scr_drawloading = false;
-
-//     scr_disabled_for_loading = true;
-//     scr_disabled_time = realtime;
-}
-
-/*
-===============
-SCR_EndLoadingPlaque
-
-================
-*/
-void SCR_EndLoadingPlaque (void)
-{
-       /*
-       if (!scr_drawloading)
-               return;
-
-//     scr_disabled_for_loading = false;
-       scr_drawloading = false;
-       Con_ClearNotify ();
-       */
 }
 
 //=============================================================================
@@ -401,10 +352,6 @@ void R_TimeReport_Start(void)
        {
                speedstringcount = 0;
                AngleVectors (r_refdef.viewangles, vpn, NULL, NULL);
-               //sprintf(r_speeds_string, "org:'%c%6.2f %c%6.2f %c%6.2f' ang:'%c%3.0f %c%3.0f %c%3.0f' dir:'%c%2.3f %c%2.3f %c%2.3f'\n%6i walls %6i dlitwalls %7i modeltris %7i meshtris\nBSP: %6i faces %6i nodes %6i leafs\n%4i models %4i bmodels %4i sprites %5i particles %3i dlights\n",
-               //      r_refdef.vieworg[0] < 0 ? '-' : ' ', fabs(r_refdef.vieworg[0]), r_refdef.vieworg[1] < 0 ? '-' : ' ', fabs(r_refdef.vieworg[1]), r_refdef.vieworg[2] < 0 ? '-' : ' ', fabs(r_refdef.vieworg[2]),
-               //      r_refdef.viewangles[0] < 0 ? '-' : ' ', fabs(r_refdef.viewangles[0]), r_refdef.viewangles[1] < 0 ? '-' : ' ', fabs(r_refdef.viewangles[1]), r_refdef.viewangles[2] < 0 ? '-' : ' ', fabs(r_refdef.viewangles[2]),
-               //      vpn[0] < 0 ? '-' : ' ', fabs(vpn[0]), vpn[1] < 0 ? '-' : ' ', fabs(vpn[1]), vpn[2] < 0 ? '-' : ' ', fabs(vpn[2]),
                sprintf(r_speeds_string,
                        "org:'%+8.2f %+8.2f %+8.2f' ang:'%+4.0f %+4.0f %+4.0f' dir:'%+2.3f %+2.3f %+2.3f'\n"
                        "world:%6i faces%6i nodes%6i leafs%6i walls%6i dlitwalls\n"
@@ -425,7 +372,6 @@ void R_TimeReport_Start(void)
                c_bmodels = 0;
                c_sprites = 0;
                c_particles = 0;
-       //      c_dlights = 0;
 
                r_timereport_start = Sys_DoubleTime();
        }
@@ -443,7 +389,7 @@ void R_TimeReport_End(void)
                for (i = 0;r_speeds_string[i];i++)
                        if (r_speeds_string[i] == '\n')
                                lines++;
-               y = vid.conheight - sb_lines - lines * 8/* - 8*/;
+               y = vid.conheight - sb_lines - lines * 8;
                i = j = 0;
                DrawQ_Fill(0, y, vid.conwidth, lines * 8, 0, 0, 0, 0.5, 0);
                while (r_speeds_string[i])
@@ -1000,7 +946,6 @@ void CL_UpdateScreen(void)
 
        R_TimeReport("setup");
 
-       SCR_DrawRam ();
        SCR_DrawNet ();
        SCR_DrawTurtle ();
        SCR_DrawPause ();
@@ -1038,3 +983,4 @@ void CL_Screen_NewMap(void)
 {
        SHOWLMP_clear();
 }
+
index 971dc6e..52cca6d 100644 (file)
--- a/cl_tent.c
+++ b/cl_tent.c
@@ -138,7 +138,6 @@ void CL_ParseTEnt (void)
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                // LordHavoc: changed to spark shower
                CL_SparkShower(pos, vec3_origin, 15);
-               //CL_RunParticleEffect (pos, vec3_origin, 0, 10);
                if ( rand() % 5 )
                        S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
                else
@@ -157,7 +156,6 @@ void CL_ParseTEnt (void)
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                // LordHavoc: changed to spark shower
                CL_SparkShower(pos, vec3_origin, 15);
-               //CL_RunParticleEffect (pos, vec3_origin, 0, 10);
                CL_AllocDlight (NULL, pos, 200, 0.1f, 0.1f, 1.0f, 1000, 0.2);
                S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
                if ( rand() % 5 )
@@ -178,7 +176,6 @@ void CL_ParseTEnt (void)
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                // LordHavoc: changed to dust shower
                CL_SparkShower(pos, vec3_origin, 30);
-               //CL_RunParticleEffect (pos, vec3_origin, 0, 20);
                if ( rand() % 5 )
                        S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
                else
@@ -197,7 +194,6 @@ void CL_ParseTEnt (void)
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                // LordHavoc: changed to dust shower
                CL_SparkShower(pos, vec3_origin, 30);
-               //CL_RunParticleEffect (pos, vec3_origin, 0, 20);
                CL_AllocDlight (NULL, pos, 200, 0.1f, 0.1f, 1.0f, 1000, 0.2);
                if ( rand() % 5 )
                        S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
@@ -282,7 +278,6 @@ void CL_ParseTEnt (void)
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                // LordHavoc: changed to dust shower
                CL_SparkShower(pos, vec3_origin, 15);
-               //CL_RunParticleEffect (pos, vec3_origin, 0, 20);
                break;
 
        case TE_GUNSHOTQUAD:                    // quad bullet hitting wall
@@ -296,7 +291,6 @@ void CL_ParseTEnt (void)
                MSG_ReadVector(pos);
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                CL_ParticleExplosion (pos, false);
-//             CL_BlastParticles (pos, 120, 120);
                // LordHavoc: boosted color from 1.0, 0.8, 0.4 to 1.25, 1.0, 0.5
                CL_AllocDlight (NULL, pos, 350, 1.25f, 1.0f, 0.5f, 700, 0.5);
                S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
@@ -306,26 +300,14 @@ void CL_ParseTEnt (void)
                MSG_ReadVector(pos);
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                CL_ParticleExplosion (pos, false);
-//             CL_BlastParticles (pos, 120, 480);
                CL_AllocDlight (NULL, pos, 600, 0.5f, 0.4f, 1.0f, 1200, 0.5);
                S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
                break;
 
-               /*
-       case TE_SMOKEEXPLOSION:                 // rocket explosion with a cloud of smoke
-               MSG_ReadVector(pos);
-               Mod_FindNonSolidLocation(pos, cl.worldmodel);
-               CL_ParticleExplosion (pos, true);
-               CL_AllocDlight (NULL, pos, 350, 1.0f, 0.8f, 0.4f, 700, 0.5);
-               S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
-               break;
-               */
-
        case TE_EXPLOSION3:                             // Nehahra movie colored lighting explosion
                MSG_ReadVector(pos);
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                CL_ParticleExplosion (pos, false);
-//             CL_BlastParticles (pos, 120, 120);
                CL_AllocDlight (NULL, pos, 350, MSG_ReadCoord(), MSG_ReadCoord(), MSG_ReadCoord(), 700, 0.5);
                S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
                break;
@@ -334,7 +316,6 @@ void CL_ParseTEnt (void)
                MSG_ReadVector(pos);
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                CL_ParticleExplosion (pos, false);
-//             CL_BlastParticles (pos, 120, 120);
                color[0] = MSG_ReadByte() * (1.0 / 255.0);
                color[1] = MSG_ReadByte() * (1.0 / 255.0);
                color[2] = MSG_ReadByte() * (1.0 / 255.0);
@@ -346,7 +327,6 @@ void CL_ParseTEnt (void)
                MSG_ReadVector(pos);
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                CL_BlobExplosion (pos);
-//             CL_BlastParticles (pos, 120, 120);
 
                S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
                CL_AllocDlight (NULL, pos, 600, 0.8f, 0.4f, 1.0f, 1200, 0.5);
@@ -428,7 +408,6 @@ void CL_ParseTEnt (void)
                colorStart = MSG_ReadByte ();
                colorLength = MSG_ReadByte ();
                CL_ParticleExplosion2 (pos, colorStart, colorLength);
-//             CL_BlastParticles (pos, 80, 80);
                tempcolor = (qbyte *)&d_8to24table[(rand()%colorLength) + colorStart];
                CL_AllocDlight (NULL, pos, 350, tempcolor[0] * (1.0f / 255.0f), tempcolor[1] * (1.0f / 255.0f), tempcolor[2] * (1.0f / 255.0f), 700, 0.5);
                S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
@@ -535,4 +514,3 @@ void CL_UpdateTEnts (void)
 
 }
 
-
diff --git a/cmd.c b/cmd.c
index a9da1b0..d46db84 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -510,10 +510,8 @@ char       *Cmd_Args (void)
 }
 
 
-#if 1
 #define CMD_TOKENIZELENGTH 4096
 char cmd_tokenizebuffer[CMD_TOKENIZELENGTH];
-#endif
 
 /*
 ============
@@ -525,15 +523,8 @@ Parses the given string into command line tokens.
 static void Cmd_TokenizeString (char *text)
 {
        int l;
-#ifdef CMD_TOKENIZELENGTH
        int pos;
        pos = 0;
-#else
-       int i;
-// clear the args from the last string
-       for (i=0 ; i<cmd_argc ; i++)
-               Z_Free (cmd_argv[i]);
-#endif
 
        cmd_argc = 0;
        cmd_args = NULL;
@@ -565,14 +556,10 @@ static void Cmd_TokenizeString (char *text)
                if (cmd_argc < MAX_ARGS)
                {
                        l = strlen(com_token) + 1;
-#ifdef CMD_TOKENIZELENGTH
                        if (pos + l > CMD_TOKENIZELENGTH)
                                Sys_Error("Cmd_TokenizeString: ran out of %i character buffer space for command arguements\n", CMD_TOKENIZELENGTH);
                        cmd_argv[cmd_argc] = cmd_tokenizebuffer + pos;
                        pos += l;
-#else
-                       cmd_argv[cmd_argc] = Z_Malloc (l);
-#endif
                        strcpy (cmd_argv[cmd_argc], com_token);
                        cmd_argc++;
                }
@@ -590,9 +577,6 @@ void        Cmd_AddCommand (char *cmd_name, xcommand_t function)
 {
        cmd_function_t  *cmd;
 
-//     if (host_initialized)   // because hunk allocation would get stomped
-//             Sys_Error ("Cmd_AddCommand after host_initialized");
-
 // fail if the command is a variable name
        if (Cvar_VariableString(cmd_name)[0])
        {
@@ -634,7 +618,6 @@ qboolean    Cmd_Exists (char *cmd_name)
 }
 
 
-
 /*
 ============
 Cmd_CompleteCommand
index 2511205..de40572 100644 (file)
@@ -33,8 +33,6 @@ static int RecursiveHullCheck (RecursiveHullCheckTraceInfo_t *t, int num, double
        int ret;
        mplane_t *plane;
        double t1, t2;
-       //double frac;
-       //double mid[3];
 
        // variables that need to be stored on the stack when recursing
        dclipnode_t *node;
@@ -170,6 +168,7 @@ loc0:
 // used if start and end are the same
 static void RecursiveHullCheckPoint (RecursiveHullCheckTraceInfo_t *t, int num)
 {
+       // If you can read this, you understand BSP trees
        while (num >= 0)
                num = t->hull->clipnodes[num].children[((t->hull->planes[t->hull->clipnodes[num].planenum].type < 3) ? (t->start[t->hull->planes[t->hull->clipnodes[num].planenum].type]) : (DotProduct(t->hull->planes[t->hull->clipnodes[num].planenum].normal, t->start))) < t->hull->planes[t->hull->clipnodes[num].planenum].dist];
 
@@ -435,3 +434,4 @@ void Collision_ClipTrace (trace_t *trace, const void *cent, const model_t *cmode
                        rhc.trace->ent = (void *) cent;
        }
 }
+
index 80a7389..3859d20 100644 (file)
--- a/common.c
+++ b/common.c
@@ -44,10 +44,6 @@ mempool_t *pak_mempool;
 
 qboolean com_modified;   // set true if using non-id files
 
-//qboolean proghack;
-
-//int static_registered = 1;  // only for startup check, then set
-
 qboolean msg_suppress_1 = 0;
 
 void COM_InitFilesystem (void);
@@ -95,126 +91,6 @@ The file "parms.txt" will be read out of the game directory and appended to the
 ============================================================================
 */
 
-/*
-void Q_memset (void *dest, int fill, int count)
-{
-       int             i;
-
-       if ( (((long)dest | count) & 3) == 0)
-       {
-               count >>= 2;
-               fill = fill | (fill<<8) | (fill<<16) | (fill<<24);
-               for (i=0 ; i<count ; i++)
-                       ((int *)dest)[i] = fill;
-       }
-       else
-               for (i=0 ; i<count ; i++)
-                       ((qbyte *)dest)[i] = fill;
-}
-
-void Q_memcpy (void *dest, void *src, int count)
-{
-       int             i;
-       
-       if (( ( (long)dest | (long)src | count) & 3) == 0 )
-       {
-               count>>=2;
-               for (i=0 ; i<count ; i++)
-                       ((int *)dest)[i] = ((int *)src)[i];
-       }
-       else
-               for (i=0 ; i<count ; i++)
-                       ((qbyte *)dest)[i] = ((qbyte *)src)[i];
-}
-
-int Q_memcmp (void *m1, void *m2, int count)
-{
-       while(count)
-       {
-               count--;
-               if (((qbyte *)m1)[count] != ((qbyte *)m2)[count])
-                       return -1;
-       }
-       return 0;
-}
-
-void Q_strcpy (char *dest, char *src)
-{
-       while (*src)
-       {
-               *dest++ = *src++;
-       }
-       *dest++ = 0;
-}
-
-void Q_strncpy (char *dest, char *src, int count)
-{
-       while (*src && count--)
-       {
-               *dest++ = *src++;
-       }
-       if (count)
-               *dest++ = 0;
-}
-
-int Q_strlen (char *str)
-{
-       int             count;
-       
-       count = 0;
-       while (str[count])
-               count++;
-
-       return count;
-}
-
-char *Q_strrchr(char *s, char c)
-{
-    int len = Q_strlen(s);
-    s += len;
-    while (len--)
-       if (*--s == c) return s;
-    return 0;
-}
-
-void Q_strcat (char *dest, char *src)
-{
-       dest += Q_strlen(dest);
-       Q_strcpy (dest, src);
-}
-
-int Q_strcmp (char *s1, char *s2)
-{
-       while (1)
-       {
-               if (*s1 != *s2)
-                       return -1;              // strings not equal    
-               if (!*s1)
-                       return 0;               // strings are equal
-               s1++;
-               s2++;
-       }
-
-       return -1;
-}
-
-int Q_strncmp (char *s1, char *s2, int count)
-{
-       while (1)
-       {
-               if (!count--)
-                       return 0;
-               if (*s1 != *s2)
-                       return -1;              // strings not equal    
-               if (!*s1)
-                       return 0;               // strings are equal
-               s1++;
-               s2++;
-       }
-
-       return -1;
-}
-*/
 int Q_strncasecmp (char *s1, char *s2, int n)
 {
        int             c1, c2;
@@ -238,8 +114,6 @@ int Q_strncasecmp (char *s1, char *s2, int n)
                }
                if (!c1)
                        return 0;               // strings are equal
-//              s1++;
-//              s2++;
        }
 
        return -1;
@@ -249,141 +123,6 @@ int Q_strcasecmp (char *s1, char *s2)
 {
        return Q_strncasecmp (s1, s2, 99999);
 }
-/*
-int Q_atoi (char *str)
-{
-       int             val;
-       int             sign;
-       int             c;
-
-       if (*str == '-')
-       {
-               sign = -1;
-               str++;
-       }
-       else
-               sign = 1;
-               
-       val = 0;
-
-//
-// check for hex
-//
-       if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X') )
-       {
-               str += 2;
-               while (1)
-               {
-                       c = *str++;
-                       if (c >= '0' && c <= '9')
-                               val = (val<<4) + c - '0';
-                       else if (c >= 'a' && c <= 'f')
-                               val = (val<<4) + c - 'a' + 10;
-                       else if (c >= 'A' && c <= 'F')
-                               val = (val<<4) + c - 'A' + 10;
-                       else
-                               return val*sign;
-               }
-       }
-       
-//
-// check for character
-//
-       if (str[0] == '\'')
-       {
-               return sign * str[1];
-       }
-       
-//
-// assume decimal
-//
-       while (1)
-       {
-               c = *str++;
-               if (c <'0' || c > '9')
-                       return val*sign;
-               val = val*10 + c - '0';
-       }
-       
-       return 0;
-}
-
-
-float Q_atof (char *str)
-{
-       double                  val;
-       int             sign;
-       int             c;
-       int             decimal, total;
-       
-       if (*str == '-')
-       {
-               sign = -1;
-               str++;
-       }
-       else
-               sign = 1;
-               
-       val = 0;
-
-//
-// check for hex
-//
-       if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X') )
-       {
-               str += 2;
-               while (1)
-               {
-                       c = *str++;
-                       if (c >= '0' && c <= '9')
-                               val = (val*16) + c - '0';
-                       else if (c >= 'a' && c <= 'f')
-                               val = (val*16) + c - 'a' + 10;
-                       else if (c >= 'A' && c <= 'F')
-                               val = (val*16) + c - 'A' + 10;
-                       else
-                               return val*sign;
-               }
-       }
-       
-//
-// check for character
-//
-       if (str[0] == '\'')
-       {
-               return sign * str[1];
-       }
-       
-//
-// assume decimal
-//
-       decimal = -1;
-       total = 0;
-       while (1)
-       {
-               c = *str++;
-               if (c == '.')
-               {
-                       decimal = total;
-                       continue;
-               }
-               if (c <'0' || c > '9')
-                       break;
-               val = val*10 + c - '0';
-               total++;
-       }
-
-       if (decimal == -1)
-               return val*sign;
-       while (total > decimal)
-       {
-               val /= 10;
-               total--;
-       }
-
-       return val*sign;
-}
-*/
 
 /*
 ============================================================================
@@ -479,11 +218,6 @@ void MSG_WriteChar (sizebuf_t *sb, int c)
 {
        qbyte    *buf;
        
-//#ifdef PARANOID
-//     if (c < -128 || c > 127)
-//             Sys_Error ("MSG_WriteChar: range error");
-//#endif
-
        buf = SZ_GetSpace (sb, 1);
        buf[0] = c;
 }
@@ -492,11 +226,6 @@ void MSG_WriteByte (sizebuf_t *sb, int c)
 {
        qbyte    *buf;
        
-//#ifdef PARANOID
-//     if (c < 0 || c > 255)
-//             Sys_Error ("MSG_WriteByte: range error");
-//#endif
-
        buf = SZ_GetSpace (sb, 1);
        buf[0] = c;
 }
@@ -505,11 +234,6 @@ void MSG_WriteShort (sizebuf_t *sb, int c)
 {
        qbyte    *buf;
 
-//#ifdef PARANOID
-//     if (c < ((short)0x8000) || c > (short)0x7fff)
-//             Sys_Error ("MSG_WriteShort: range error");
-//#endif
-
        buf = SZ_GetSpace (sb, 2);
        buf[0] = c&0xff;
        buf[1] = c>>8;
@@ -587,45 +311,6 @@ void MSG_BeginReading (void)
        msg_badread = false;
 }
 
-/*
-// returns -1 and sets msg_badread if no more characters are available
-int MSG_ReadChar (void)
-{
-       int     c;
-
-       // LordHavoc: minor optimization
-       if (msg_readcount >= net_message.cursize)
-//     if (msg_readcount+1 > net_message.cursize)
-       {
-               msg_badread = true;
-               return -1;
-       }
-
-       c = (signed char)net_message.data[msg_readcount];
-       msg_readcount++;
-
-       return c;
-}
-
-int MSG_ReadByte (void)
-{
-       int     c;
-
-       // LordHavoc: minor optimization
-       if (msg_readcount >= net_message.cursize)
-//     if (msg_readcount+1 > net_message.cursize)
-       {
-               msg_badread = true;
-               return -1;
-       }
-
-       c = (unsigned char)net_message.data[msg_readcount];
-       msg_readcount++;
-
-       return c;
-}
-*/
-
 int MSG_ReadShort (void)
 {
        int     c;
@@ -721,23 +406,6 @@ float MSG_ReadCoord (void)
                return MSG_ReadShort() * (1.0f/8.0f);
 }
 
-/*
-float MSG_ReadCoord (void)
-{
-       return MSG_ReadShort() * (1.0f/8.0f);
-}
-
-float MSG_ReadAngle (void)
-{
-       return MSG_ReadChar() * (360.0f/256.0f);
-}
-
-float MSG_ReadPreciseAngle (void)
-{
-       return MSG_ReadShort() * (360.0f/65536);
-}
-*/
-
 
 //===========================================================================
 
@@ -1045,26 +713,16 @@ void COM_CheckRegistered (void)
 {
        Cvar_Set ("cmdline", com_cmdline);
 
-//     static_registered = 0;
-
        if (!Sys_FileTime("gfx/pop.lmp"))
        {
                if (com_modified)
                        Con_Printf ("Playing shareware version, with modification.\nwarning: most mods require full quake data.\n");
                else
                        Con_Printf ("Playing shareware version.\n");
-//#if WINDED
-//     Sys_Error ("This dedicated server requires a full registered copy of Quake");
-//#endif
-//             Con_Printf ("Playing shareware version.\n");
-//             if (com_modified)
-//                     Sys_Error ("You must have the registered version to use modified games");
                return;
        }
 
-//     Cvar_Set ("cmdline", com_cmdline);
        Cvar_Set ("registered", "1");
-//     static_registered = 1;
        Con_Printf ("Playing registered version.\n");
 }
 
@@ -1250,17 +908,6 @@ char    *va(char *format, ...)
 }
 
 
-/// just for debugging
-int     memsearch (qbyte *start, int count, int search)
-{
-       int             i;
-
-       for (i=0 ; i<count ; i++)
-               if (start[i] == search)
-                       return i;
-       return -1;
-}
-
 /*
 =============================================================================
 
@@ -1519,11 +1166,6 @@ int COM_FindFile (char *filename, QFile **file, qboolean quiet, qboolean zip)
 // search through the path, one element at a time
 //
        search = com_searchpaths;
-//     if (proghack)
-//     {       // gross hack to use quake 1 progs with quake 2 maps
-//             if (!strcmp(filename, "progs.dat"))
-//                     search = search->next;
-//     }
 
        for ( ; search ; search = search->next)
        {
@@ -1545,13 +1187,6 @@ int COM_FindFile (char *filename, QFile **file, qboolean quiet, qboolean zip)
                }
                else
                {               
-       // check a file in the directory tree
-//                     if (!static_registered)
-//                     {       // if not a registered version, don't ever go beyond base
-//                             if ( strchr (filename, '/') || strchr (filename,'\\'))
-//                                     continue;
-//                     }
-                       
                        sprintf (netpath, "%s/%s",search->filename, filename);
                        
                        findtime = Sys_FileTime (netpath);
@@ -1673,10 +1308,8 @@ pack_t *COM_LoadPackFile (char *packfile)
        dpackfile_t             *info;
 
        if (Sys_FileOpenRead (packfile, &packhandle) == -1)
-       {
-               //Con_Printf ("Couldn't open %s\n", packfile);
                return NULL;
-       }
+
        Sys_FileRead (packhandle, (void *)&header, sizeof(header));
        if (memcmp(header.id, "PACK", 4))
                Sys_Error ("%s is not a packfile", packfile);
@@ -1729,7 +1362,6 @@ then loads and adds pak1.pak pak2.pak ...
 */
 void COM_AddGameDirectory (char *dir)
 {
-       //int i;
        stringlist_t *list, *current;
        searchpath_t *search;
        pack_t *pak;
@@ -1765,28 +1397,6 @@ void COM_AddGameDirectory (char *dir)
                }
        }
        freedirectory(list);
-
-       /*
-//
-// add any pak files in the format pak0.pak pak1.pak, ...
-//
-       for (i=0 ; ; i++)
-       {
-               sprintf (pakfile, "%s/pak%i.pak", dir, i);
-               pak = COM_LoadPackFile (pakfile);
-               if (!pak)
-                       break;
-               search = Mem_Alloc(pak_mempool, sizeof(searchpath_t));
-               search->pack = pak;
-               search->next = com_searchpaths;
-               com_searchpaths = search;
-       }
-       */
-
-//
-// add the contents of the parms.txt file to the end of the command line
-//
-
 }
 
 /*
@@ -1906,9 +1516,6 @@ void COM_InitFilesystem (void)
                        com_searchpaths = search;
                }
        }
-
-//     if (COM_CheckParm ("-proghack"))
-//             proghack = true;
 }
 
 int COM_FileExists(char *filename)
@@ -1965,3 +1572,4 @@ void COM_ToUpperString(char *in, char *out)
                        *out++ = *in++;
        }
 }
+
index 5d424f6..14dcb7d 100644 (file)
--- a/console.c
+++ b/console.c
@@ -83,18 +83,13 @@ void Con_ToggleConsole_f (void)
        if (key_dest == key_console)
        {
                if (cls.state == ca_connected)
-//             {
                        key_dest = key_game;
-//                     key_lines[edit_line][1] = 0;    // clear any typing
-//                     key_linepos = 1;
-//             }
                else
                        M_Menu_Main_f ();
        }
        else
                key_dest = key_console;
 
-       SCR_EndLoadingPlaque ();
        memset (con_times, 0, sizeof(con_times));
 }
 
@@ -389,7 +384,6 @@ void Con_Printf (char *fmt, ...)
 {
        va_list         argptr;
        char            msg[MAXPRINTMSG];
-//     static qboolean inupdate;
 
        va_start (argptr,fmt);
        vsprintf (msg,fmt,argptr);
@@ -415,24 +409,6 @@ void Con_Printf (char *fmt, ...)
 
 // write it to the scrollable buffer
        Con_Print (msg);
-
-// update the screen if the console is displayed
-       // LordHavoc: I don't think there's a real need for this
-       /*
-       // LordHavoc: don't print text while loading scripts
-       if (cls.state != ca_disconnected)
-       if (cls.signon != SIGNONS && !scr_disabled_for_loading )
-       {
-       // protect against infinite loop if something in SCR_UpdateScreen calls
-       // Con_Printf
-               if (!inupdate)
-               {
-                       inupdate = true;
-                       SCR_UpdateScreen ();
-                       inupdate = false;
-               }
-       }
-       */
 }
 
 /*
@@ -469,16 +445,12 @@ void Con_SafePrintf (char *fmt, ...)
 {
        va_list         argptr;
        char            msg[1024];
-       //int                   temp;
 
        va_start (argptr,fmt);
        vsprintf (msg,fmt,argptr);
        va_end (argptr);
 
-       //temp = scr_disabled_for_loading;
-       //scr_disabled_for_loading = true;
        Con_Printf ("%s", msg);
-       //scr_disabled_for_loading = temp;
 }
 
 
diff --git a/crc.c b/crc.c
index 9024e07..57f7d3a 100644 (file)
--- a/crc.c
+++ b/crc.c
@@ -98,3 +98,4 @@ unsigned short CRC_Block(qbyte *data, int size)
                crc = (crc << 8) ^ crctable[(crc >> 8) ^ (*data++)];
        return crc ^ CRC_XOR_VALUE;
 }
+
diff --git a/cvar.c b/cvar.c
index b51e87a..152a86a 100644 (file)
--- a/cvar.c
+++ b/cvar.c
@@ -348,3 +348,4 @@ void Cvar_List_f (void)
        Con_Printf ("\n");
 }
 // 2000-01-09 CvarList command by Maddes
+
index 73f122e..4574902 100644 (file)
@@ -110,3 +110,4 @@ void fractalnoisequick(qbyte *noise, int size, int startgrid)
        }
 #undef n
 }
+
index d25ca67..7b272fd 100644 (file)
@@ -1,9 +1,7 @@
 
 #include "quakedef.h"
 
-//cvar_t gl_mesh_maxtriangles = {0, "gl_mesh_maxtriangles", "21760"};
 cvar_t gl_mesh_maxtriangles = {0, "gl_mesh_maxtriangles", "1024"};
-//cvar_t gl_mesh_batchtriangles = {0, "gl_mesh_batchtriangles", "1024"};
 cvar_t gl_mesh_batchtriangles = {0, "gl_mesh_batchtriangles", "0"};
 cvar_t gl_mesh_transtriangles = {0, "gl_mesh_transtriangles", "16384"};
 cvar_t gl_mesh_floatcolors = {0, "gl_mesh_floatcolors", "0"};
@@ -318,8 +316,6 @@ void GL_UnlockArray(void)
        }
 }
 
-//static float gldepthmin, gldepthmax;
-
 /*
 =============
 GL_SetupFrame
@@ -336,13 +332,8 @@ static void GL_SetupFrame (void)
        if (!r_render.integer)
                return;
 
-//     qglClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // LordHavoc: moved to SCR_UpdateScreen
-//     gldepthmin = 0;
-//     gldepthmax = 1;
        qglDepthFunc (GL_LEQUAL);CHECKGLERROR
 
-//     qglDepthRange (gldepthmin, gldepthmax);CHECKGLERROR
-
        // set up viewpoint
        qglMatrixMode(GL_PROJECTION);CHECKGLERROR
        qglLoadIdentity ();CHECKGLERROR
@@ -366,8 +357,6 @@ static void GL_SetupFrame (void)
        // set view pyramid
        qglFrustum(-xmax, xmax, -ymax, ymax, zNear, zFar);CHECKGLERROR
 
-//     qglCullFace(GL_FRONT);CHECKGLERROR
-
        qglMatrixMode(GL_MODELVIEW);CHECKGLERROR
        qglLoadIdentity ();CHECKGLERROR
 
@@ -380,24 +369,6 @@ static void GL_SetupFrame (void)
        qglRotatef (-r_refdef.viewangles[1],  0, 0, 1);CHECKGLERROR
        // camera location
        qglTranslatef (-r_refdef.vieworg[0],  -r_refdef.vieworg[1],  -r_refdef.vieworg[2]);CHECKGLERROR
-
-//     qglGetFloatv (GL_MODELVIEW_MATRIX, r_world_matrix);
-
-       //
-       // set drawing parms
-       //
-//     if (gl_cull.integer)
-//     {
-//             qglEnable(GL_CULL_FACE);CHECKGLERROR
-//     }
-//     else
-//     {
-//             qglDisable(GL_CULL_FACE);CHECKGLERROR
-//     }
-
-//     qglEnable(GL_BLEND);CHECKGLERROR
-//     qglEnable(GL_DEPTH_TEST);CHECKGLERROR
-//     qglDepthMask(1);CHECKGLERROR
 }
 
 static int mesh_blendfunc1;
@@ -795,19 +766,6 @@ void GL_DrawRangeElements(int firstvert, int endvert, int indexcount, GLuint *in
                }
                qglEnd();
        }
-       /*
-       if (qglDrawRangeElements)
-               qglDrawRangeElements(GL_TRIANGLES, firstvert, endvert, indexcount, index);
-       else
-       {
-       }
-       #ifdef WIN32
-       // FIXME: dynamic link to GL so we can get DrawRangeElements on WIN32
-       qglDrawElements(GL_TRIANGLES, indexcount, GL_UNSIGNED_INT, index);CHECKGLERROR
-       #else
-       qglDrawRangeElements(GL_TRIANGLES, firstvert, firstvert + mesh->verts, indexcount, GL_UNSIGNED_INT, index);CHECKGLERROR
-       #endif
-       */
 }
 
 // renders mesh buffers, called to flush buffers when full
@@ -833,8 +791,6 @@ void R_Mesh_Render(void)
        if (!gl_mesh_floatcolors.integer || gl_mesh_drawmode.integer == 0)
                GL_ConvertColorsFloatToByte();
 
-       // lock the arrays now that they will have no further modifications
-       //GL_LockArray(0, currentvertex);CHECKGLERROR
        if (gl_backend_rebindtextures)
        {
                gl_backend_rebindtextures = false;
@@ -1253,10 +1209,6 @@ void R_Mesh_Draw(const rmeshinfo_t *m)
                else
                        memcpy(&texcoord[j][0].t[0], m->texcoords[j], m->numverts * sizeof(buf_texcoord_t));
        }
-       #if 0
-       for (;j < backendunits;j++)
-               memset(&texcoord[j][0].t[0], 0, m->numverts * sizeof(buf_texcoord_t));
-       #endif
 
        if (currenttriangle >= max_batch)
                R_Mesh_Render();
@@ -1415,10 +1367,6 @@ void R_Mesh_Draw_NativeOnly(const rmeshinfo_t *m)
        memcpy(vert, m->vertex, m->numverts * sizeof(buf_vertex_t));
        for (j = 0;j < MAX_TEXTUREUNITS && m->tex[j];j++)
                memcpy(&texcoord[j][0].t[0], m->texcoords[j], m->numverts * sizeof(buf_texcoord_t));
-       #if 0
-       for (;j < backendunits;j++)
-               memset(&texcoord[j][0].t[0], 0, m->numverts * sizeof(buf_texcoord_t));
-       #endif
 
        memcpy(fcolor, m->color, m->numverts * sizeof(buf_fcolor_t));
 
@@ -1644,9 +1592,6 @@ text to the screen.
 */
 void SCR_UpdateScreen (void)
 {
-       //Mem_CheckSentinelsGlobal();
-       //R_TimeReport("memtest");
-
        VID_Finish ();
 
        R_TimeReport("finish");
@@ -1677,3 +1622,4 @@ void SCR_UpdateScreen (void)
        // (this doesn't wait for the commands themselves to complete)
        qglFlush();
 }
+
index e73bbcd..de361fb 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -20,8 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "quakedef.h"
 
-//#define GL_COLOR_INDEX8_EXT     0x80E5
-
 cvar_t scr_conalpha = {CVAR_SAVE, "scr_conalpha", "1"};
 
 static rtexture_t *char_texture;
@@ -215,9 +213,6 @@ cachepic_t  *Draw_CachePic (char *path)
        for (pic = cachepichash[hashkey];pic;pic = pic->chain)
                if (!strcmp (path, pic->name))
                        return pic;
-       //for (pic = cachepics, i = 0;i < numcachepics;pic++, i++)
-       //      if (!strcmp (path, pic->name))
-       //              return pic;
 
        if (numcachepics == MAX_CACHED_PICS)
                Sys_Error ("numcachepics == MAX_CACHED_PICS");
@@ -339,24 +334,6 @@ void R_DrawQueue(void)
        color = 0;
        qglColor4ub(0,0,0,0);
 
-       // LordHavoc: NEAREST mode on text if not scaling up
-       /*
-       if (vid.realwidth <= (int) vid.conwidth)
-       {
-               qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-               CHECKGLERROR
-               qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-               CHECKGLERROR
-       }
-       else
-       {
-               qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-               CHECKGLERROR
-               qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-               CHECKGLERROR
-       }
-       */
-
        overbright = v_overbrightbits.integer;
        batch = false;
        batchcount = 0;
@@ -430,7 +407,6 @@ void R_DrawQueue(void)
                                        qglBegin(GL_TRIANGLES);
                                        batchcount = 0;
                                }
-                               //DrawQuad(dq->x, dq->y, w, h, 0, 0, 1, 1);
                                qglTexCoord2f (0, 0);qglVertex2f (x  , y  );
                                qglTexCoord2f (1, 0);qglVertex2f (x+w, y  );
                                qglTexCoord2f (1, 1);qglVertex2f (x+w, y+h);
@@ -457,7 +433,6 @@ void R_DrawQueue(void)
                                        qglBegin(GL_TRIANGLES);
                                        batchcount = 0;
                                }
-                               //DrawQuad(dq->x, dq->y, dq->scalex, dq->scaley, 0, 0, 1, 1);
                                qglTexCoord2f (0, 0);qglVertex2f (x  , y  );
                                qglTexCoord2f (1, 0);qglVertex2f (x+w, y  );
                                qglTexCoord2f (1, 1);qglVertex2f (x+w, y+h);
@@ -493,7 +468,6 @@ void R_DrawQueue(void)
                                        t = (num >> 4)*0.0625f + (0.5f / 256.0f);
                                        u = 0.0625f - (1.0f / 256.0f);
                                        v = 0.0625f - (1.0f / 256.0f);
-                                       //DrawQuad(x, y, w, h, (num & 15)*0.0625f + (0.5f / 256.0f), (num >> 4)*0.0625f + (0.5f / 256.0f), 0.0625f - (1.0f / 256.0f), 0.0625f - (1.0f / 256.0f));
                                        qglTexCoord2f (s  , t  );qglVertex2f (x  , y  );
                                        qglTexCoord2f (s+u, t  );qglVertex2f (x+w, y  );
                                        qglTexCoord2f (s+u, t+v);qglVertex2f (x+w, y+h);
@@ -577,3 +551,4 @@ void R_DrawQueue(void)
        qglColor4ub (255, 255, 255, 255);
        CHECKGLERROR
 }
+
index f8ca764..02f9e34 100644 (file)
@@ -1,7 +1,6 @@
 
 #include "quakedef.h"
 
-//cvar_t gl_transform = {0, "gl_transform", "1"};
 cvar_t r_quickmodels = {0, "r_quickmodels", "1"};
 
 typedef struct
@@ -23,46 +22,6 @@ zymbonematrix *zymbonepose;
 
 rmeshinfo_t aliasmeshinfo;
 
-/*
-void GL_SetupModelTransform (vec3_t origin, vec3_t angles, vec_t scale)
-{
-       qglTranslatef (origin[0], origin[1], origin[2]);
-
-       if (scale != 1)
-               qglScalef (scale, scale, scale);
-       if (angles[1])
-           qglRotatef (angles[1],  0, 0, 1);
-       if (angles[0])
-           qglRotatef (-angles[0],  0, 1, 0);
-       if (angles[2])
-           qglRotatef (angles[2],  1, 0, 0);
-}
-*/
-
-/*
-rtexturepool_t *chrometexturepool;
-rtexture_t *chrometexture;
-
-// currently unused reflection effect texture
-void makechrometexture(void)
-{
-       int i;
-       qbyte noise[64*64];
-       qbyte data[64*64][4];
-
-       fractalnoise(noise, 64, 8);
-
-       // convert to RGBA data
-       for (i = 0;i < 64*64;i++)
-       {
-               data[i][0] = data[i][1] = data[i][2] = noise[i];
-               data[i][3] = 255;
-       }
-
-       chrometexture = R_LoadTexture (chrometexturepool, "chrometexture", 64, 64, &data[0][0], TEXTYPE_RGBA, TEXF_MIPMAP | TEXF_PRECACHE);
-}
-*/
-
 mempool_t *gl_models_mempool;
 
 void gl_models_start(void)
@@ -75,13 +34,10 @@ void gl_models_start(void)
        aliasvertcolor2 = Mem_Alloc(gl_models_mempool, sizeof(float[MD2MAX_VERTS][4])); // used temporarily for tinted coloring
        zymbonepose = Mem_Alloc(gl_models_mempool, sizeof(zymbonematrix[256]));
        aliasvertusage = Mem_Alloc(gl_models_mempool, sizeof(int[MD2MAX_VERTS]));
-       //chrometexturepool = R_AllocTexturePool();
-       //makechrometexture();
 }
 
 void gl_models_shutdown(void)
 {
-       //R_FreeTexturePool(&chrometexturepool);
        Mem_FreePool(&gl_models_mempool);
 }
 
@@ -91,7 +47,6 @@ void gl_models_newmap(void)
 
 void GL_Models_Init(void)
 {
-//     Cvar_RegisterVariable(&gl_transform);
        Cvar_RegisterVariable(&r_quickmodels);
 
        R_RegisterModule("GL_Models", gl_models_start, gl_models_shutdown, gl_models_newmap);
@@ -101,34 +56,27 @@ void R_AliasTransformVerts(int vertcount)
 {
        vec3_t point;
        float *av;
-//     float *avn;
        av = aliasvert;
-//     avn = aliasvertnorm;
        while (vertcount >= 4)
        {
                VectorCopy(av, point);softwaretransform(point, av);av += 4;
                VectorCopy(av, point);softwaretransform(point, av);av += 4;
                VectorCopy(av, point);softwaretransform(point, av);av += 4;
                VectorCopy(av, point);softwaretransform(point, av);av += 4;
-//             VectorCopy(avn, point);softwaretransformdirection(point, avn);avn += 3;
-//             VectorCopy(avn, point);softwaretransformdirection(point, avn);avn += 3;
-//             VectorCopy(avn, point);softwaretransformdirection(point, avn);avn += 3;
-//             VectorCopy(avn, point);softwaretransformdirection(point, avn);avn += 3;
                vertcount -= 4;
        }
        while(vertcount > 0)
        {
                VectorCopy(av, point);softwaretransform(point, av);av += 4;
-//             VectorCopy(avn, point);softwaretransformdirection(point, avn);avn += 3;
                vertcount--;
        }
 }
 
 void R_AliasLerpVerts(int vertcount,
-                                         float lerp1, trivertx_t *verts1, vec3_t fscale1, vec3_t translate1,
-                                         float lerp2, trivertx_t *verts2, vec3_t fscale2, vec3_t translate2,
-                                         float lerp3, trivertx_t *verts3, vec3_t fscale3, vec3_t translate3,
-                                         float lerp4, trivertx_t *verts4, vec3_t fscale4, vec3_t translate4)
+               float lerp1, trivertx_t *verts1, vec3_t fscale1, vec3_t translate1,
+               float lerp2, trivertx_t *verts2, vec3_t fscale2, vec3_t translate2,
+               float lerp3, trivertx_t *verts3, vec3_t fscale3, vec3_t translate3,
+               float lerp4, trivertx_t *verts4, vec3_t fscale4, vec3_t translate4)
 {
        int i;
        vec3_t scale1, scale2, scale3, scale4, translate;
@@ -555,22 +503,6 @@ int ZymoticLerpBones(int count, zymbonematrix *bonebase, frameblend_t *blend, zy
        float lerp1, lerp2, lerp3, lerp4;
        zymbonematrix *out, rootmatrix, m, *bone1, *bone2, *bone3, *bone4;
 
-       /*
-       m.m[0][0] = 0;
-       m.m[0][1] = -1;
-       m.m[0][2] = 0;
-       m.m[0][3] = 0;
-       m.m[1][0] = 1;
-       m.m[1][1] = 0;
-       m.m[1][2] = 0;
-       m.m[1][3] = 0;
-       m.m[2][0] = 0;
-       m.m[2][1] = 0;
-       m.m[2][2] = 1;
-       m.m[2][3] = 0;
-       R_ConcatTransforms(&softwaretransform_matrix[0], &m.m[0][0], &rootmatrix.m[0][0]);
-       */
-
        // LordHavoc: combine transform from zym coordinate space to quake coordinate space with model to world transform matrix
        rootmatrix.m[0][0] = softwaretransform_matrix[0][1];
        rootmatrix.m[0][1] = -softwaretransform_matrix[0][0];
@@ -951,3 +883,4 @@ void R_DrawAliasModel (void)
        else
                R_DrawQ1Q2AliasModel(fog);
 }
+
index cae6f82..ca11e96 100644 (file)
@@ -21,8 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "quakedef.h"
 
-//static qboolean      r_cache_thrash;         // compatability
-
 entity_render_t        *currentrenderentity;
 
 int                    r_framecount;           // used for dlight push checking
@@ -33,10 +31,6 @@ int                  c_brush_polys, c_alias_polys, c_light_polys, c_faces, c_nodes, c_leafs, c_
 
 qboolean       envmap;                         // true during envmap command capture
 
-// LordHavoc: moved all code related to particles into r_part.c
-//int                  particletexture;        // little dot for particles
-//int                  playertextures;         // up to 16 color translated skins
-
 //
 // view origin
 //
@@ -45,9 +39,6 @@ vec3_t        vpn;
 vec3_t vright;
 vec3_t r_origin;
 
-//float        r_world_matrix[16];
-//float        r_base_world_matrix[16];
-
 //
 // screen size info
 //
@@ -57,19 +48,15 @@ mleaf_t             *r_viewleaf, *r_oldviewleaf;
 
 unsigned short d_lightstylevalue[256]; // 8.8 fraction of base light value
 
-//cvar_t       r_norefresh = {0, "r_norefresh","0"};
 cvar_t r_drawentities = {0, "r_drawentities","1"};
 cvar_t r_drawviewmodel = {0, "r_drawviewmodel","1"};
 cvar_t r_speeds = {0, "r_speeds","0"};
 cvar_t r_fullbright = {0, "r_fullbright","0"};
-//cvar_t       r_lightmap = {0, "r_lightmap","0"};
 cvar_t r_wateralpha = {CVAR_SAVE, "r_wateralpha","1"};
 cvar_t r_dynamic = {CVAR_SAVE, "r_dynamic","1"};
 cvar_t r_waterripple = {CVAR_SAVE, "r_waterripple","0"};
 cvar_t r_fullbrights = {CVAR_SAVE, "r_fullbrights", "1"};
 
-//cvar_t       r_dynamicbothsides = {CVAR_SAVE, "r_dynamicbothsides", "1"}; // LordHavoc: can disable dynamic lighting of backfaces, but quake maps are weird so it doesn't always work right...
-
 cvar_t gl_fogenable = {0, "gl_fogenable", "0"};
 cvar_t gl_fogdensity = {0, "gl_fogdensity", "0.25"};
 cvar_t gl_fogred = {0, "gl_fogred","0.3"};
@@ -79,7 +66,6 @@ cvar_t        gl_fogstart = {0, "gl_fogstart", "0"};
 cvar_t gl_fogend = {0, "gl_fogend","0"};
 
 cvar_t r_ser = {CVAR_SAVE, "r_ser", "1"};
-//cvar_t       gl_viewmodeldepthhack = {0, "gl_viewmodeldepthhack", "1"};
 
 cvar_t r_multitexture = {0, "r_multitexture", "1"};
 
@@ -98,16 +84,13 @@ static void R_TimeRefresh_f (void)
 
        intimerefresh = 1;
        start = Sys_DoubleTime ();
-       //qglDrawBuffer (GL_FRONT);
        for (i = 0;i < 128;i++)
        {
                r_refdef.viewangles[0] = 0;
                r_refdef.viewangles[1] = i/128.0*360.0;
                r_refdef.viewangles[2] = 0;
                CL_UpdateScreen();
-               //R_RenderView();
        }
-       //qglDrawBuffer  (GL_BACK);
 
        stop = Sys_DoubleTime ();
        intimerefresh = 0;
@@ -253,15 +236,12 @@ void GL_Main_Init(void)
        Cvar_RegisterVariable (&r_drawentities);
        Cvar_RegisterVariable (&r_drawviewmodel);
        Cvar_RegisterVariable (&r_speeds);
-//     Cvar_RegisterVariable (&r_dynamicwater);
-//     Cvar_RegisterVariable (&r_dynamicbothsides);
        Cvar_RegisterVariable (&r_fullbrights);
        Cvar_RegisterVariable (&r_wateralpha);
        Cvar_RegisterVariable (&r_dynamic);
        Cvar_RegisterVariable (&r_waterripple);
        Cvar_RegisterVariable (&r_fullbright);
        Cvar_RegisterVariable (&r_ser);
-//     Cvar_RegisterVariable (&gl_viewmodeldepthhack);
        Cvar_RegisterVariable (&r_multitexture);
        if (gamemode == GAME_NEHAHRA)
                Cvar_SetValue("r_fullbrights", 0);
@@ -340,8 +320,6 @@ void GL_Init (void)
        gl_extensions = glGetString (GL_EXTENSIONS);
        Con_Printf ("GL_EXTENSIONS: %s\n", gl_extensions);
 
-//     Con_Printf ("%s %s\n", gl_renderer, gl_version);
-
        VID_CheckExtensions();
 
        // LordHavoc: report supported extensions
@@ -349,8 +327,6 @@ void GL_Init (void)
 
        qglCullFace(GL_FRONT);
        qglEnable(GL_TEXTURE_2D);
-
-//     qglPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
 }
 
 
@@ -465,18 +441,7 @@ void R_DrawViewModel (void)
 
        R_LerpAnimation(currentrenderentity);
 
-       // hack the depth range to prevent view model from poking into walls
-//     if (gl_viewmodeldepthhack.integer)
-//     {
-//             R_Mesh_Render();
-//             qglDepthRange (gldepthmin, gldepthmin + 0.3*(gldepthmax-gldepthmin));
-//     }
        currentrenderentity->model->Draw();
-//     if (gl_viewmodeldepthhack.integer)
-//     {
-//             R_Mesh_Render();
-//             qglDepthRange (gldepthmin, gldepthmax);
-//     }
 }
 
 static void R_SetFrustum (void)
@@ -533,8 +498,6 @@ static void R_SetupFrame (void)
        r_oldviewleaf = r_viewleaf;
        r_viewleaf = Mod_PointInLeaf (r_origin, cl.worldmodel);
 
-//     r_cache_thrash = false;
-
        R_AnimateLight ();
 }
 
@@ -578,30 +541,6 @@ static void R_BlendView(void)
        tvxyz[2][1] = tvxyz[0][1] + vright[1] * r;
        tvxyz[2][2] = tvxyz[0][2] + vright[2] * r;
        R_Mesh_Draw(&m);
-
-       /*
-       qglMatrixMode(GL_PROJECTION);
-       qglLoadIdentity ();
-       qglOrtho  (0, 1, 1, 0, -99999, 99999);
-       qglMatrixMode(GL_MODELVIEW);
-       qglLoadIdentity ();
-       qglDisable (GL_DEPTH_TEST);
-       qglDisable (GL_CULL_FACE);
-       qglDisable(GL_TEXTURE_2D);
-       qglEnable(GL_BLEND);
-       qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-       qglBegin (GL_TRIANGLES);
-       qglColor4f (r_refdef.viewblend[0] * overbrightscale, r_refdef.viewblend[1] * overbrightscale, r_refdef.viewblend[2] * overbrightscale, r_refdef.viewblend[3]);
-       qglVertex2f (-5, -5);
-       qglVertex2f (10, -5);
-       qglVertex2f (-5, 10);
-       qglEnd ();
-
-       qglEnable (GL_CULL_FACE);
-       qglEnable (GL_DEPTH_TEST);
-       qglDisable(GL_BLEND);
-       qglEnable(GL_TEXTURE_2D);
-       */
 }
 
 /*
@@ -704,7 +643,5 @@ void R_RenderView (void)
        // render any queued meshs
        R_Mesh_Finish();
        R_TimeReport("meshfinish");
-
-       //Mem_CheckSentinelsGlobal();
-       //R_TimeReport("memtest");
 }
+
index c810b02..d9b6338 100644 (file)
@@ -88,18 +88,12 @@ static int R_AddDynamicLights (msurface_t *surf)
                        continue;                                       // not lit by this light
 
                softwareuntransform(r_dlight[lnum].origin, local);
-//             VectorSubtract (r_dlight[lnum].origin, currentrenderentity->origin, local);
                dist = DotProduct (local, surf->plane->normal) - surf->plane->dist;
 
                // for comparisons to minimum acceptable light
                // compensate for LIGHTOFFSET
                maxdist = (int) r_dlight[lnum].cullradius2 + LIGHTOFFSET;
 
-               // already clamped, skip this
-               // clamp radius to avoid exceeding 32768 entry division table
-               //if (maxdist > 4194304)
-               //      maxdist = 4194304;
-
                dist2 = dist * dist;
                dist2 += LIGHTOFFSET;
                if (dist2 >= maxdist)
@@ -448,27 +442,6 @@ static void R_BuildLightMap (msurface_t *surf, int dlightchanged)
        R_UpdateTexture(surf->lightmaptexture, templight);
 }
 
-/*
-===============
-R_TextureAnimation
-
-Returns the proper texture for a given time and base texture
-===============
-*/
-/*
-// note: this was manually inlined in R_PrepareSurfaces
-static texture_t *R_TextureAnimation (texture_t *base)
-{
-       if (currentrenderentity->frame && base->alternate_anims != NULL)
-               base = base->alternate_anims;
-
-       if (base->anim_total < 2)
-               return base;
-
-       return base->anim_frames[(int)(cl.time * 5.0f) % base->anim_total];
-}
-*/
-
 
 /*
 =============================================================
@@ -531,10 +504,6 @@ static void RSurfShader_Sky(msurface_t *firstsurf)
                                m.numtriangles = mesh->numtriangles;
                                m.numverts = mesh->numverts;
                                m.index = mesh->index;
-                               //m.cr = 0;
-                               //m.cg = 0;
-                               //m.cb = 0;
-                               //m.ca = 0;
                                if (softwaretransform_complexity)
                                {
                                        m.vertex = &svert[0].v[0];
@@ -904,8 +873,7 @@ static void RSurfShader_Water(msurface_t *firstsurf)
                        RSurfShader_Water_Pass_Glow(surf);
        if (fogenabled)
                for (surf = firstsurf;surf;surf = surf->chain)
-                       //if (currentrenderentity->alpha * (surf->flags & SURF_DRAWNOALPHA ? 1 : r_wateralpha.value) >= 1.0f)
-                               RSurfShader_Water_Pass_Fog(surf);
+                       RSurfShader_Water_Pass_Fog(surf);
 }
 
 static void RSurfShader_Wall_Pass_BaseMTex(msurface_t *surf)
@@ -1972,8 +1940,6 @@ void R_PrepareSurfaces(void)
                        {
                                surf->insertframe = r_framecount;
                                c_faces++;
-                               // manually inlined R_TextureAnimation
-                               //t = R_TextureAnimation(surf->texinfo->texture);
                                t = surf->texinfo->texture;
                                if (t->alternate_anims != NULL && currentrenderentity->frame)
                                        t = t->alternate_anims;
@@ -2006,38 +1972,14 @@ static float portalpointbuffer[256][3];
 void R_DrawPortals(void)
 {
        int drawportals, i;
-//     mleaf_t *leaf, *endleaf;
        mportal_t *portal, *endportal;
-       mvertex_t *point/*, *endpoint*/;
+       mvertex_t *point;
        rmeshinfo_t m;
        drawportals = r_drawportals.integer;
+
        if (drawportals < 1)
                return;
-       /*
-       leaf = cl.worldmodel->leafs;
-       endleaf = leaf + cl.worldmodel->numleafs;
-       for (;leaf < endleaf;leaf++)
-       {
-               if (leaf->visframe == r_framecount && leaf->portals)
-               {
-                       i = leaf - cl.worldmodel->leafs;
-                       r = (i & 0x0007) << 5;
-                       g = (i & 0x0038) << 2;
-                       b = (i & 0x01C0) >> 1;
-                       portal = leaf->portals;
-                       while (portal)
-                       {
-                               transpolybegin(0, 0, 0, TPOLYTYPE_ALPHA);
-                               point = portal->points + portal->numpoints - 1;
-                               endpoint = portal->points;
-                               for (;point >= endpoint;point--)
-                                       transpolyvertub(point->position[0], point->position[1], point->position[2], 0, 0, r, g, b, 32);
-                               transpolyend();
-                               portal = portal->next;
-                       }
-               }
-       }
-       */
+
        memset(&m, 0, sizeof(m));
        m.transparent = true;
        m.blendfunc1 = GL_SRC_ALPHA;
@@ -2135,10 +2077,6 @@ static void R_SurfMarkLights (void)
                                         || (surf->styles[1] != 255 && (d_lightstylevalue[surf->styles[1]] != surf->cached_light[1]
                                         || (surf->styles[2] != 255 && (d_lightstylevalue[surf->styles[2]] != surf->cached_light[2]
                                         || (surf->styles[3] != 255 && (d_lightstylevalue[surf->styles[3]] != surf->cached_light[3]))))))))
-                                       //if (surf->cached_light[0] != d_lightstylevalue[surf->styles[0]]
-                                       // || surf->cached_light[1] != d_lightstylevalue[surf->styles[1]]
-                                       // || surf->cached_light[2] != d_lightstylevalue[surf->styles[2]]
-                                       // || surf->cached_light[3] != d_lightstylevalue[surf->styles[3]])
                                                R_BuildLightMap(surf, false); // base lighting changed
                                        else if (surf->dlightframe == r_framecount && r_dlightmap.integer)
                                                R_BuildLightMap(surf, true); // only dlights
@@ -2199,3 +2137,4 @@ void R_DrawBrushModelNormal (void)
                R_DrawSurfaces(SHADERSTAGE_SKY);
        R_DrawSurfaces(SHADERSTAGE_NORMAL);
 }
+
index 81e5104..43bf88e 100644 (file)
@@ -1,3 +1,4 @@
+
 #include "quakedef.h"
 
 cvar_t r_max_size = {CVAR_SAVE, "r_max_size", "2048"};
@@ -6,7 +7,7 @@ cvar_t  r_picmip = {CVAR_SAVE, "r_picmip", "0"};
 cvar_t r_lerpimages = {CVAR_SAVE, "r_lerpimages", "1"};
 cvar_t r_precachetextures = {CVAR_SAVE, "r_precachetextures", "1"};
 
-int            gl_filter_min = GL_LINEAR_MIPMAP_LINEAR; //NEAREST;
+int            gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
 int            gl_filter_mag = GL_LINEAR;
 
 
@@ -269,7 +270,6 @@ rtexturepool_t *R_AllocTexturePool(void)
        pool = Mem_Alloc(texturemempool, sizeof(gltexturepool_t));
        if (pool == NULL)
                return NULL;
-       //memset(pool, 0, sizeof(gltexturepool_t));
        pool->next = gltexturepoolchain;
        gltexturepoolchain = pool;
        pool->sentinel = TEXTUREPOOL_SENTINEL;
@@ -472,7 +472,6 @@ static void r_textures_start(void)
        texturedatamempool = Mem_AllocPool("Texture Storage (not yet uploaded)");
        textureprocessingmempool = Mem_AllocPool("Texture Processing Buffers");
        gltexnuminuse = Mem_Alloc(texturemempool, MAX_GLTEXTURES);
-       //memset(gltexnuminuse, 0, MAX_GLTEXTURES);
 }
 
 static void r_textures_shutdown(void)
@@ -484,12 +483,6 @@ static void r_textures_shutdown(void)
                R_FreeTexturePool(&temp);
        }
 
-       /*
-       if (resizebuffer) Mem_Free(resizebuffer);resizebuffer = NULL;
-       if (colorconvertbuffer) Mem_Free(colorconvertbuffer);colorconvertbuffer = NULL;
-       if (texturebuffer) Mem_Free(texturebuffer);texturebuffer = NULL;
-       if (gltexnuminuse) Mem_Free(gltexnuminuse);gltexnuminuse = NULL;
-       */
        resizebuffersize = 0;
        texturebuffersize = 0;
        resizebuffer = NULL;
@@ -719,7 +712,6 @@ static void R_FindImageForTexture(gltexture_t *glt)
                image = Mem_Alloc(texturemempool, sizeof(gltextureimage_t));
                if (image == NULL)
                        Sys_Error("R_FindImageForTexture: ran out of memory\n");
-               //memset(image, 0, sizeof(*image));
                image->type = GLIMAGETYPE_FRAGMENTS;
                image->width = block_size;
                image->height = block_size;
@@ -738,7 +730,6 @@ static void R_FindImageForTexture(gltexture_t *glt)
                image = Mem_Alloc(texturemempool, sizeof(gltextureimage_t));
                if (image == NULL)
                        Sys_Error("R_FindImageForTexture: ran out of memory\n");
-               //memset(image, 0, sizeof(*image));
                image->type = GLIMAGETYPE_TILE;
                image->blockallocation = NULL;
 
@@ -810,7 +801,6 @@ static gltexture_t *R_SetupTexture(gltexturepool_t *pool, char *identifier, int
 {
        gltexture_t *glt;
        glt = Mem_Alloc(texturemempool, sizeof(gltexture_t));
-       //memset(glt, 0, sizeof(gltexture_t));
        if (identifier)
        {
                glt->identifier = Mem_Alloc(texturemempool, strlen(identifier)+1);
@@ -872,10 +862,6 @@ rtexture_t *R_LoadTexture (rtexturepool_t *rtexturepool, char *identifier, int w
 
        texinfo = R_GetTexTypeInfo(textype, flags);
 
-       // data can be NULL
-//     if (data == NULL)
-//             Host_Error("R_LoadTexture: \"%s\" has no data\n", identifier);
-
        if (flags & TEXF_FRAGMENT)
        {
                if (width > block_size || height > block_size)
@@ -955,9 +941,6 @@ rtexture_t *R_ProceduralTexture (rtexturepool_t *rtexturepool, char *identifier,
 
        texinfo = R_GetTexTypeInfo(textype, flags);
 
-       // no function is supported, for odd uses
-//     if (generate == NULL)
-//             Host_Error("R_ProceduralTexture: \"%s\" has no generate function\n", identifier);
        if (flags & TEXF_FRAGMENT)
        {
                if (width > block_size || height > block_size)
@@ -1086,19 +1069,7 @@ void R_UpdateTexture(rtexture_t *rt, qbyte *data)
        if (data == NULL)
                Host_Error("R_UpdateTexture: no data supplied\n");
        glt = (gltexture_t *)rt;
-       /*
-       if (!(glt->flags & GLTEXF_PROCEDURAL))
-       {
-               if (glt->inputtexels == NULL)
-               {
-                       glt->inputtexels = Mem_Alloc(texturedatamempool, glt->width * glt->height * glt->textype->inputbytesperpixel);
-                       if (glt->inputtexels == NULL)
-                               Host_Error("R_UpdateTexture: ran out of memory\n");
-               }
-               memcpy(glt->inputtexels, data, glt->width * glt->height * glt->textype->inputbytesperpixel);
-       }
-       R_Upload(glt, data);
-       */
+
        // if it has not been uploaded yet, update the data that will be used when it is
        if (glt->inputtexels)
                memcpy(glt->inputtexels, data, glt->width * glt->height * glt->textype->inputbytesperpixel);
diff --git a/host.c b/host.c
index 28ff3f1..3379706 100644 (file)
--- a/host.c
+++ b/host.c
@@ -143,8 +143,6 @@ void Host_Error (char *error, ...)
        }
        inerror = true;
        
-       SCR_EndLoadingPlaque ();                // reenable screen updates
-
        va_start (argptr,error);
        vsprintf (hosterrorstring,error,argptr);
        va_end (argptr);
@@ -571,11 +569,7 @@ qboolean Host_FilterTime (double time)
        if (host_framerate.value > 0)
                host_frametime = host_framerate.value;
        else if (cl_avidemo.value >= 0.1f)
-       {
-               // don't allow really short frames
-               //if (host_frametime > (1.0 / cl_avidemo.value))
-                       host_frametime = (1.0 / cl_avidemo.value);
-       }
+               host_frametime = (1.0 / cl_avidemo.value);
        else
        {
                // don't allow really short frames
@@ -630,7 +624,6 @@ void Host_ServerFrame (void)
                sv.frametime = 0;
        frametimetotal = 0;
        lastservertime = realtime;
-//     pr_global_struct->frametime = host_frametime;
 
 // set the time and clear the general datagram
        SV_ClearDatagram ();
@@ -839,7 +832,7 @@ void Host_Init (void)
        NET_Init ();
        SV_Init ();
 
-       Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
+       Con_Printf ("Builddate: %s\n", buildstring);
 
        if (cls.state != ca_dedicated)
        {
@@ -891,9 +884,6 @@ void Host_Shutdown(void)
        }
        isdown = true;
 
-// keep Con_Printf from trying to update the screen
-//     scr_disabled_for_loading = true;
-
        Host_WriteConfiguration (); 
 
        CDAudio_Shutdown ();
index 3934de4..1dec6ec 100644 (file)
@@ -30,19 +30,9 @@ Host_Quit_f
 ==================
 */
 
-// LordHavoc: didn't like it asking me if I wanted to quit
-//extern void M_Menu_Quit_f (void);
-
 extern qboolean host_shuttingdown;
 void Host_Quit_f (void)
 {
-       /*
-       if (key_dest != key_console && cls.state != ca_dedicated)
-       {
-               M_Menu_Quit_f ();
-               return;
-       }
-       */
        host_shuttingdown = true;
        CL_Disconnect ();
        Host_ShutdownServer(false);
@@ -680,11 +670,7 @@ void Host_Name_f (void)
                Con_Printf ("\"name\" is \"%s\"\n", cl_name.string);
                return;
        }
-       //if (Cmd_Argc () == 2)
-       //      newName = Cmd_Argv(1);
-       //else
-       //      newName = Cmd_Args();
-       //newName[15] = 0;
+
        if (Cmd_Argc () == 2)
                strncpy(newName, Cmd_Argv(1), 15);
        else
@@ -895,7 +881,6 @@ void Host_Color_f(void)
                return;
        }
 
-       // void(float color) SV_ChangeTeam;
        if ((f = ED_FindFunction ("SV_ChangeTeam")) && (SV_ChangeTeam = (func_t)(f - pr_functions)))
        {
                Con_DPrintf("Calling SV_ChangeTeam\n");
@@ -1122,7 +1107,6 @@ void Host_Spawn_f (void)
        MSG_WriteByte (&host_client->message, STAT_MONSTERS);
        MSG_WriteLong (&host_client->message, pr_global_struct->killed_monsters);
 
-//
 // send a fixangle
 // Never send a roll angle, because savegames can catch the server
 // in a state where it is expecting the client to correct the angle
@@ -1662,3 +1646,4 @@ void Host_InitCommands (void)
        Cmd_AddCommand ("viewnext", Host_Viewnext_f);
        Cmd_AddCommand ("viewprev", Host_Viewprev_f);
 }
+
diff --git a/image.c b/image.c
index 87c5274..2023b0a 100644 (file)
--- a/image.c
+++ b/image.c
@@ -1185,3 +1185,4 @@ void Image_MipReduce(qbyte *in, qbyte *out, int *width, int *height, int destwid
                        Sys_Error("Image_MipReduce: desired size already achieved\n");
        }
 }
+
index fe0719d..be41687 100644 (file)
@@ -68,9 +68,6 @@ static void keyhandler(int scancode, int state)
        int sc;
 
        sc = scancode & 0x7f;
-#if 0
-       Con_Printf("scancode=%x (%d%s)\n", scancode, sc, scancode&0x80?"+128":"");
-#endif
        Key_Event(scantokey[sc], state == KEY_EVENTPRESS);
 }
 
@@ -247,10 +244,6 @@ static void IN_init_mouse(void)
                mouserate = atoi(com_argv[COM_CheckParm("-mrate")+1]);
        }
 
-#if 0
-       printf("Mouse: dev=%s,type=%s,speed=%d\n",
-               mousedev, mice[mtype].name, mouserate);
-#endif
        if (mouse_init(mousedev, mtype, mouserate)) {
                Con_Printf("No mouse found\n");
                UseMouse = 0;
@@ -338,3 +331,4 @@ void IN_Move(usercmd_t *cmd)
 void IN_HandlePause (qboolean pause)
 {
 }
+
index 04cdbcd..37db2e0 100644 (file)
--- a/in_win.c
+++ b/in_win.c
@@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "quakedef.h"
 #include "winquake.h"
-//#include "dosisms.h"
 
 #include <dinput.h>
 
@@ -472,7 +471,6 @@ IN_Shutdown
 */
 void IN_Shutdown (void)
 {
-//     usingmouse = false;
        IN_DeactivateMouse ();
        IN_ShowMouse ();
 
@@ -562,9 +560,7 @@ void IN_MouseMove (usercmd_t *cmd)
 
                        /* Unable to read data or no data available */
                        if (FAILED(hr) || dwElements == 0)
-                       {
                                break;
-                       }
 
                        /* Look at the element to see what happened */
 
@@ -683,7 +679,6 @@ IN_ClearStates
 */
 void IN_ClearStates (void)
 {
-
        if (mouseactive)
        {
                mx_accum = 0;
@@ -959,8 +954,6 @@ qboolean IN_ReadJoystick (void)
                // read error occurred
                // turning off the joystick seems too harsh for 1 read error,
                // but what should be done?
-               // Con_Printf ("IN_ReadJoystick: no response\n");
-               // joy_avail = false;
                return false;
        }
 }
@@ -1138,3 +1131,4 @@ void IN_JoyMove (usercmd_t *cmd)
                }
        }
 }
+
diff --git a/keys.c b/keys.c
index 133da90..f44a468 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -161,7 +161,7 @@ void Key_Console (int key)
 {
        if (key == K_ENTER)
        {
-               Cbuf_AddText (key_lines[edit_line]+1);  // skip the >
+               Cbuf_AddText (key_lines[edit_line]+1);  // skip the ]
                Cbuf_AddText ("\n");
                Con_Printf ("%s\n",key_lines[edit_line]);
                edit_line = (edit_line + 1) & 31;
index fa5b853..ae9ff63 100644 (file)
--- a/mathlib.c
+++ b/mathlib.c
@@ -153,70 +153,10 @@ float Q_RSqrt(float number)
        return y * (1.5f - (number * 0.5f * y * y));
 }
 
-#if 0
-// LordHavoc: no longer used at all
-void ProjectPointOnPlane( vec3_t dst, const vec3_t p, const vec3_t normal )
-{
-#if 0
-       // LordHavoc: the old way...
-       float d;
-       vec3_t n;
-       float inv_denom;
-
-       inv_denom = 1.0F / DotProduct( normal, normal );
-
-       d = DotProduct( normal, p ) * inv_denom;
-
-       n[0] = normal[0] * inv_denom;
-       n[1] = normal[1] * inv_denom;
-       n[2] = normal[2] * inv_denom;
-
-       dst[0] = p[0] - d * n[0];
-       dst[1] = p[1] - d * n[1];
-       dst[2] = p[2] - d * n[2];
-#else
-       // LordHavoc: optimized to death and beyond
-       float d;
-
-       // LordHavoc: the normal is a unit vector by definition,
-       //            therefore inv_denom was pointless.
-       d = DotProduct(normal, p);
-       dst[0] = p[0] - d * normal[0];
-       dst[1] = p[1] - d * normal[1];
-       dst[2] = p[2] - d * normal[2];
-#endif
-}
-#endif
 
 // assumes "src" is normalized
 void PerpendicularVector( vec3_t dst, const vec3_t src )
 {
-#if 0
-       // LordHavoc: the old way...
-       int     pos;
-       int i;
-       float minelem, d;
-       vec3_t tempvec;
-
-       // find the smallest magnitude axially aligned vector
-       minelem = 1.0F;
-       for ( pos = 0, i = 0; i < 3; i++ )
-       {
-               if ( fabs( src[i] ) < minelem )
-               {
-                       pos = i;
-                       minelem = fabs( src[i] );
-               }
-       }
-       VectorClear(tempvec);
-       tempvec[pos] = 1.0F;
-
-       // project the point onto the plane defined by src
-       ProjectPointOnPlane( dst, tempvec, src );
-
-       // normalize the result
-       VectorNormalize(dst);
-#else
        // LordHavoc: optimized to death and beyond
        int     pos;
        float minelem;
@@ -263,7 +203,6 @@ void PerpendicularVector( vec3_t dst, const vec3_t src )
                dst[1] = 0;
                dst[2] = 0;
        }
-#endif
 }
 
 
@@ -302,145 +241,6 @@ void VectorVectorsDouble(const double *forward, double *right, double *up)
 
 void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point, float degrees )
 {
-#if 0
-       // LordHavoc: the old way, cryptic brute force...
-       float   m[3][3];
-       float   im[3][3];
-       float   zrot[3][3];
-       float   tmpmat[3][3];
-       float   rot[3][3];
-       int     i;
-       vec3_t vr, vup, vf;
-
-       vf[0] = dir[0];
-       vf[1] = dir[1];
-       vf[2] = dir[2];
-
-       PerpendicularVector( vr, dir );
-       CrossProduct( vr, vf, vup );
-
-       m[0][0] = vr[0];
-       m[1][0] = vr[1];
-       m[2][0] = vr[2];
-
-       m[0][1] = vup[0];
-       m[1][1] = vup[1];
-       m[2][1] = vup[2];
-
-       m[0][2] = vf[0];
-       m[1][2] = vf[1];
-       m[2][2] = vf[2];
-
-       memcpy( im, m, sizeof( im ) );
-
-       im[0][1] = m[1][0];
-       im[0][2] = m[2][0];
-       im[1][0] = m[0][1];
-       im[1][2] = m[2][1];
-       im[2][0] = m[0][2];
-       im[2][1] = m[1][2];
-
-       memset( zrot, 0, sizeof( zrot ) );
-       zrot[0][0] = zrot[1][1] = zrot[2][2] = 1.0F;
-
-       zrot[0][0] = cos( DEG2RAD( degrees ) );
-       zrot[0][1] = sin( DEG2RAD( degrees ) );
-       zrot[1][0] = -sin( DEG2RAD( degrees ) );
-       zrot[1][1] = cos( DEG2RAD( degrees ) );
-
-       R_ConcatRotations( m, zrot, tmpmat );
-       R_ConcatRotations( tmpmat, im, rot );
-
-       for ( i = 0; i < 3; i++ )
-               dst[i] = rot[i][0] * point[0] + rot[i][1] * point[1] + rot[i][2] * point[2];
-#elif 0
-       // LordHavoc: on the path to unintelligible code...
-//     float   m[3][3];
-//     float   im[3][3];
-//     float   zrot[3][3];
-       float   tmpmat[3][3];
-//     float   rot[3][3];
-       float   angle, c, s;
-//     int     i;
-       vec3_t vr, vu, vf;
-
-       angle = DEG2RAD(degrees);
-
-       c = cos(angle);
-       s = sin(angle);
-
-       vf[0] = dir[0];
-       vf[1] = dir[1];
-       vf[2] = dir[2];
-
-       PerpendicularVector(vr, dir);
-       CrossProduct(vr, vf, vu);
-
-//     m   [0][0] = vr[0];m   [0][1] = vu[0];m   [0][2] = vf[0];
-//     m   [1][0] = vr[1];m   [1][1] = vu[1];m   [1][2] = vf[1];
-//     m   [2][0] = vr[2];m   [2][1] = vu[2];m   [2][2] = vf[2];
-//     im  [0][0] = vr[0];im  [0][1] = vr[1];im  [0][2] = vr[2];
-//     im  [1][0] = vu[0];im  [1][1] = vu[1];im  [1][2] = vu[2];
-//     im  [2][0] = vf[0];im  [2][1] = vf[1];im  [2][2] = vf[2];
-//     zrot[0][0] =     c;zrot[0][1] =     s;zrot[0][2] =     0;
-//     zrot[1][0] =    -s;zrot[1][1] =     c;zrot[1][2] =     0;
-//     zrot[2][0] =     0;zrot[2][1] =     0;zrot[2][2] =     1;
-
-//     tmpmat[0][0] = m[0][0] * zrot[0][0] + m[0][1] * zrot[1][0] + m[0][2] * zrot[2][0];
-//     tmpmat[0][1] = m[0][0] * zrot[0][1] + m[0][1] * zrot[1][1] + m[0][2] * zrot[2][1];
-//     tmpmat[0][2] = m[0][0] * zrot[0][2] + m[0][1] * zrot[1][2] + m[0][2] * zrot[2][2];
-//     tmpmat[1][0] = m[1][0] * zrot[0][0] + m[1][1] * zrot[1][0] + m[1][2] * zrot[2][0];
-//     tmpmat[1][1] = m[1][0] * zrot[0][1] + m[1][1] * zrot[1][1] + m[1][2] * zrot[2][1];
-//     tmpmat[1][2] = m[1][0] * zrot[0][2] + m[1][1] * zrot[1][2] + m[1][2] * zrot[2][2];
-//     tmpmat[2][0] = m[2][0] * zrot[0][0] + m[2][1] * zrot[1][0] + m[2][2] * zrot[2][0];
-//     tmpmat[2][1] = m[2][0] * zrot[0][1] + m[2][1] * zrot[1][1] + m[2][2] * zrot[2][1];
-//     tmpmat[2][2] = m[2][0] * zrot[0][2] + m[2][1] * zrot[1][2] + m[2][2] * zrot[2][2];
-
-       tmpmat[0][0] = vr[0] *  c + vu[0] * -s;
-       tmpmat[0][1] = vr[0] *  s + vu[0] *  c;
-//     tmpmat[0][2] =                           vf[0];
-       tmpmat[1][0] = vr[1] *  c + vu[1] * -s;
-       tmpmat[1][1] = vr[1] *  s + vu[1] *  c;
-//     tmpmat[1][2] =                           vf[1];
-       tmpmat[2][0] = vr[2] *  c + vu[2] * -s;
-       tmpmat[2][1] = vr[2] *  s + vu[2] *  c;
-//     tmpmat[2][2] =                           vf[2];
-
-//     rot[0][0] = tmpmat[0][0] * vr[0] + tmpmat[0][1] * vu[0] + tmpmat[0][2] * vf[0];
-//     rot[0][1] = tmpmat[0][0] * vr[1] + tmpmat[0][1] * vu[1] + tmpmat[0][2] * vf[1];
-//     rot[0][2] = tmpmat[0][0] * vr[2] + tmpmat[0][1] * vu[2] + tmpmat[0][2] * vf[2];
-//     rot[1][0] = tmpmat[1][0] * vr[0] + tmpmat[1][1] * vu[0] + tmpmat[1][2] * vf[0];
-//     rot[1][1] = tmpmat[1][0] * vr[1] + tmpmat[1][1] * vu[1] + tmpmat[1][2] * vf[1];
-//     rot[1][2] = tmpmat[1][0] * vr[2] + tmpmat[1][1] * vu[2] + tmpmat[1][2] * vf[2];
-//     rot[2][0] = tmpmat[2][0] * vr[0] + tmpmat[2][1] * vu[0] + tmpmat[2][2] * vf[0];
-//     rot[2][1] = tmpmat[2][0] * vr[1] + tmpmat[2][1] * vu[1] + tmpmat[2][2] * vf[1];
-//     rot[2][2] = tmpmat[2][0] * vr[2] + tmpmat[2][1] * vu[2] + tmpmat[2][2] * vf[2];
-
-//     rot[0][0] = tmpmat[0][0] * vr[0] + tmpmat[0][1] * vu[0] + vf[0] * vf[0];
-//     rot[0][1] = tmpmat[0][0] * vr[1] + tmpmat[0][1] * vu[1] + vf[0] * vf[1];
-//     rot[0][2] = tmpmat[0][0] * vr[2] + tmpmat[0][1] * vu[2] + vf[0] * vf[2];
-//     rot[1][0] = tmpmat[1][0] * vr[0] + tmpmat[1][1] * vu[0] + vf[1] * vf[0];
-//     rot[1][1] = tmpmat[1][0] * vr[1] + tmpmat[1][1] * vu[1] + vf[1] * vf[1];
-//     rot[1][2] = tmpmat[1][0] * vr[2] + tmpmat[1][1] * vu[2] + vf[1] * vf[2];
-//     rot[2][0] = tmpmat[2][0] * vr[0] + tmpmat[2][1] * vu[0] + vf[2] * vf[0];
-//     rot[2][1] = tmpmat[2][0] * vr[1] + tmpmat[2][1] * vu[1] + vf[2] * vf[1];
-//     rot[2][2] = tmpmat[2][0] * vr[2] + tmpmat[2][1] * vu[2] + vf[2] * vf[2];
-
-//     dst[0] = rot[0][0] * point[0] + rot[0][1] * point[1] + rot[0][2] * point[2];
-//     dst[1] = rot[1][0] * point[0] + rot[1][1] * point[1] + rot[1][2] * point[2];
-//     dst[2] = rot[2][0] * point[0] + rot[2][1] * point[1] + rot[2][2] * point[2];
-
-       dst[0] = (tmpmat[0][0] * vr[0] + tmpmat[0][1] * vu[0] + vf[0] * vf[0]) * point[0]
-              + (tmpmat[0][0] * vr[1] + tmpmat[0][1] * vu[1] + vf[0] * vf[1]) * point[1]
-              + (tmpmat[0][0] * vr[2] + tmpmat[0][1] * vu[2] + vf[0] * vf[2]) * point[2];
-       dst[1] = (tmpmat[1][0] * vr[0] + tmpmat[1][1] * vu[0] + vf[1] * vf[0]) * point[0]
-              + (tmpmat[1][0] * vr[1] + tmpmat[1][1] * vu[1] + vf[1] * vf[1]) * point[1]
-              + (tmpmat[1][0] * vr[2] + tmpmat[1][1] * vu[2] + vf[1] * vf[2]) * point[2];
-       dst[2] = (tmpmat[2][0] * vr[0] + tmpmat[2][1] * vu[0] + vf[2] * vf[0]) * point[0]
-              + (tmpmat[2][0] * vr[1] + tmpmat[2][1] * vu[1] + vf[2] * vf[1]) * point[1]
-              + (tmpmat[2][0] * vr[2] + tmpmat[2][1] * vu[2] + vf[2] * vf[2]) * point[2];
-#else
-       // LordHavoc: optimized to death and beyond, cryptic in an entirely new way
        float   t0, t1;
        float   angle, c, s;
        vec3_t  vr, vu, vf;
@@ -454,8 +254,6 @@ void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point,
        vf[1] = dir[1];
        vf[2] = dir[2];
 
-//     PerpendicularVector(vr, dir);
-//     CrossProduct(vr, vf, vu);
        VectorVectors(vf, vr, vu);
 
        t0 = vr[0] *  c + vu[0] * -s;
@@ -475,7 +273,6 @@ void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point,
        dst[2] = (t0 * vr[0] + t1 * vu[0] + vf[2] * vf[0]) * point[0]
               + (t0 * vr[1] + t1 * vu[1] + vf[2] * vf[1]) * point[1]
               + (t0 * vr[2] + t1 * vu[2] + vf[2] * vf[2]) * point[2];
-#endif
 }
 
 /*-----------------------------------------------------------------*/
@@ -668,36 +465,6 @@ void AngleMatrix (const vec3_t angles, const vec3_t translate, vec_t matrix[][4]
        matrix[2][3] = translate[2];
 }
 
-// LordHavoc: changed CrossProduct to a #define
-/*
-void CrossProduct (vec3_t v1, vec3_t v2, vec3_t cross)
-{
-       cross[0] = v1[1]*v2[2] - v1[2]*v2[1];
-       cross[1] = v1[2]*v2[0] - v1[0]*v2[2];
-       cross[2] = v1[0]*v2[1] - v1[1]*v2[0];
-}
-*/
-
-/*
-// LordHavoc: fixme: do more research on gcc assembly so that qftol_minushalf and result will not be considered unused
-static double qftol_minushalf = -0.5;
-
-int qftol(double v)
-{
-       int result;
-#ifdef _MSC_VER
-       __asm
-       {
-               fld             v
-               fadd    qftol_minushalf
-               fistp   result
-       }
-#else // gcc hopefully
-       asm("fldl v\n\tfaddl qftol_minushalf\n\tfistpl result");
-#endif
-       return result;
-}
-*/
 
 // LordHavoc: renamed these to Length, and made the normal ones #define
 float VectorNormalizeLength (vec3_t v)
@@ -719,27 +486,6 @@ float VectorNormalizeLength (vec3_t v)
 
 }
 
-/*
-float VectorNormalizeLength2 (vec3_t v, vec3_t dest) // LordHavoc: added to allow copying while doing the calculation...
-{
-       float   length, ilength;
-
-       length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
-       length = sqrt (length);         // FIXME
-
-       if (length)
-       {
-               ilength = 1/length;
-               dest[0] = v[0] * ilength;
-               dest[1] = v[1] * ilength;
-               dest[2] = v[2] * ilength;
-       }
-       else
-               dest[0] = dest[1] = dest[2] = 0;
-               
-       return length;
-}
-*/
 
 /*
 ================
@@ -791,3 +537,4 @@ void Mathlib_Init(void)
        for (a = 1;a < 4096;a++)
                ixtable[a] = 1.0f / a;
 }
+
diff --git a/menu.c b/menu.c
index dd30799..5c657a4 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -153,7 +153,6 @@ void M_DrawBackground(void)
        menu_height = 200;
        menu_x = (vid.conwidth - menu_width) * 0.5;
        menu_y = (vid.conheight - menu_height) * 0.5;
-       //DrawQ_Fill(menu_x, menu_y, menu_width, menu_height, 0, 0, 0, 0.5, 0);
        DrawQ_Fill(0, 0, vid.conwidth, vid.conheight, 0, 0, 0, 0.5, 0);
 }
 
@@ -174,13 +173,6 @@ void M_DrawCharacter (float cx, float cy, int num)
 
 void M_Print (float cx, float cy, char *str)
 {
-       /*
-       while (*str)
-       {
-               M_DrawCharacter (cx, cy, (*str++)+128);
-               cx += 8;
-       }
-       */
        DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0);
 }
 
@@ -191,13 +183,6 @@ void M_PrintWhite (float cx, float cy, char *str)
 
 void M_ItemPrint (float cx, float cy, char *str, int unghosted)
 {
-       /*
-       while (*str)
-       {
-               M_DrawCharacter (cx, cy, (*str++)+128);
-               cx += 8;
-       }
-       */
        if (unghosted)
                DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0);
        else
@@ -325,50 +310,6 @@ void M_ToggleMenu_f (void)
        }
 }
 
-// LordHavoc: FIXME: finish this menu stuff
-#if 0
-#define MAXMENUITEMS 128
-
-typedef struct menuitem_s
-{
-       char *string; // may be text, or an image to use, or a cvar name, depending on the functions used
-       char *description;
-       char *command; // used by command items mainly (when used, this command is executed)
-       cvar_t *cvar; // used for cvar items (sliders, number boxes), value is retrieved from the cvar itself
-       int selectable; // purely decorative if this is false
-       int selected; // true if this menu item is currently selected, used by funcs so they don't need to know anything but fields in the menuitem
-       float selecttime; // the time that this menu item was activated (copied from realtime), used for animating selection flashs and such
-       float color[4]; // current color for the item (may be different than base color, due to selection flash effects)
-       float basecolor[4]; // the base color
-       float x, y, width, height; // width and height are used for mouse selection
-       void(*drawfunc)(struct menuitem_s *item);
-       void(*activefunc)(struct menuitem_s *item);
-//     void(*selectfunc)(struct menuitem_s *item);
-//     void(*deselectfunc)(struct menuitem_s *item);
-       void(*usefunc)(struct menuitem_s *item);
-}
-menuitem_t;
-
-menuitem_t menuitem[MAXMENUITEMS];
-int menuitems;
-
-void menuitem_text_drawfunc(struct menuitem_s *item)
-{
-       // FIXME: handle color flashs and such when selected
-       M_Print (item->x, item->y, item->string);
-}
-
-void menuitem_image_drawfunc(struct menuitem_s *item)
-{
-       // FIXME: handle color flashs and such when selected
-       M_DrawPic (item->x, item->y, item->string);
-}
-
-void menuitem_command_usefunc(struct menuitem_s *item)
-{
-       Cbuf_AddText (item->command);
-}
-#endif
 
 int demo_cursor;
 void M_Demo_Draw (void)
@@ -427,7 +368,6 @@ void M_Demo_Key (int k)
 /* MAIN MENU */
 
 int    m_main_cursor;
-//#define      MAIN_ITEMS      5
 
 int MAIN_ITEMS = 4; // Nehahra: Menu Disable
 
@@ -1385,70 +1325,12 @@ void M_DrawSlider (int x, int y, float range)
 
 void M_DrawCheckbox (int x, int y, int on)
 {
-#if 0
-       if (on)
-               M_DrawCharacter (x, y, 131);
-       else
-               M_DrawCharacter (x, y, 129);
-#endif
        if (on)
                M_Print (x, y, "on");
        else
                M_Print (x, y, "off");
 }
 
-/*
-int m_2dres[] =
-{
-       320, 200,
-       320, 240,
-       400, 300,
-       512, 384,
-       640, 480,
-       800, 600,
-       1024, 768,
-       1280, 960,
-       1600, 1200,
-       2048, 1536
-};
-
-int M_Num2DResolutions(void)
-{
-       return sizeof(m_2dres) / sizeof(int[2]);
-};
-
-float M_Classify2DResolution(void)
-{
-       int i, num, *res, best, bestdist, diff[3];
-       num = M_Num2DResolutions();
-       best = -1;
-       bestdist = 1000000000;
-       for (i = 0;i < num;i++)
-       {
-               res = m_2dres + i * 2;
-               diff[0] = res[0] - vid.conwidth;
-               diff[1] = res[1] - vid.conheight;
-               diff[2] = 0;
-               dist = DotProduct(diff, diff);
-               if (bestdist > dist)
-               {
-                       bestdist = dist;
-                       best = i;
-               }
-       }
-       return i;
-}
-
-void M_Adjust2DResolution(int dir)
-{
-       int i, num;
-       i = M_Classify2DResolution() + dir;
-       num = M_Num2DResolutions() - 1;
-       i = bound(0, i, num);
-       Cvar_SetValue("v_2dwidth", m_2dres[i*2]);
-       Cvar_SetValue("v_2dheight", m_2dres[i*2+1]);
-}
-*/
 
 void M_Options_Draw (void)
 {
@@ -1909,7 +1791,6 @@ int               msgNumber;
 int            m_quit_prevstate;
 qboolean       wasInMenus;
 
-//#ifndef      _WIN32
 char *quitMessage [] = 
 {
 /* .........1.........2.... */
@@ -1976,7 +1857,6 @@ char *quitMessage [] =
   "      constructive?     ",
   "                        ",
 };
-//#endif
 
 void M_Menu_Quit_f (void)
 {
@@ -2025,38 +1905,11 @@ void M_Quit_Key (int key)
 
 void M_Quit_Draw (void)
 {
-/*
-#ifdef _WIN32
-       M_DrawTextBox (0, 0, 38, 23);
-       M_PrintWhite (16, 12,  "  Quake version 1.09 by id Software\n\n");
-       M_PrintWhite (16, 28,  "Programming        Art \n");
-       M_Print (16, 36,  " John Carmack       Adrian Carmack\n");
-       M_Print (16, 44,  " Michael Abrash     Kevin Cloud\n");
-       M_Print (16, 52,  " John Cash          Paul Steed\n");
-       M_Print (16, 60,  " Dave 'Zoid' Kirsch\n");
-       M_PrintWhite (16, 68,  "Design             Biz\n");
-       M_Print (16, 76,  " John Romero        Jay Wilbur\n");
-       M_Print (16, 84,  " Sandy Petersen     Mike Wilson\n");
-       M_Print (16, 92,  " American McGee     Donna Jackson\n");
-       M_Print (16, 100,  " Tim Willits        Todd Hollenshead\n");
-       M_PrintWhite (16, 108, "Support            Projects\n");
-       M_Print (16, 116, " Barrett Alexander  Shawn Green\n");
-       M_PrintWhite (16, 124, "Sound Effects\n");
-       M_Print (16, 132, " Trent Reznor and Nine Inch Nails\n\n");
-       M_PrintWhite (16, 140, "Quake is a trademark of Id Software,\n");
-       M_PrintWhite (16, 148, "inc., (c)1996 Id Software, inc. All\n");
-       M_PrintWhite (16, 156, "rights reserved. NIN logo is a\n");
-       M_PrintWhite (16, 164, "registered trademark licensed to\n");
-       M_PrintWhite (16, 172, "Nothing Interactive, Inc. All rights\n");
-       M_PrintWhite (16, 180, "reserved. Press y to exit\n");
-#else
-*/
        M_DrawTextBox (56, 76, 24, 4);
        M_Print (64, 84,  quitMessage[msgNumber*4+0]);
        M_Print (64, 92,  quitMessage[msgNumber*4+1]);
        M_Print (64, 100, quitMessage[msgNumber*4+2]);
        M_Print (64, 108, quitMessage[msgNumber*4+3]);
-//#endif
 }
 
 //=============================================================================
@@ -2672,12 +2525,6 @@ void M_GameOptions_Draw (void)
                        M_Print (x, 154, "  First, question your  ");
                        M_Print (x, 162, "   sanity, then email   ");
                        M_Print (x, 170, " havoc@gamevisions.com  ");
-                       /*
-                       M_Print (x, 146, "  More than 4 players   ");
-                       M_Print (x, 154, " requires using command ");
-                       M_Print (x, 162, "line parameters; please ");
-                       M_Print (x, 170, "   see techinfo.txt.    ");
-                       */
                }
                else
                {
@@ -3241,3 +3088,4 @@ void M_ConfigureNetSubsystem(void)
        if (IPXConfig || TCPIPConfig)
                net_hostport = lanConfig_port;
 }
+
index e80ee4d..5bdf6f9 100644 (file)
@@ -484,12 +484,8 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
 
        Mod_MDL_LoadFrames (startframes, numverts, totalverts, scale, translate);
 
-       // LordHavoc: fixed model bbox - was //FIXME: do this right
-       //loadmodel->mins[0] = loadmodel->mins[1] = loadmodel->mins[2] = -16;
-       //loadmodel->maxs[0] = loadmodel->maxs[1] = loadmodel->maxs[2] = 16;
        modelyawradius = sqrt(modelyawradius);
        modelradius = sqrt(modelradius);
-//     loadmodel->modelradius = modelradius;
        for (j = 0;j < 3;j++)
        {
                loadmodel->normalmins[j] = aliasbboxmin[j];
@@ -749,7 +745,6 @@ void Mod_LoadQ2AliasModel (model_t *mod, void *buffer)
        // LordHavoc: model bbox
        modelyawradius = sqrt(modelyawradius);
        modelradius = sqrt(modelradius);
-//     loadmodel->modelradius = modelradius;
        for (j = 0;j < 3;j++)
        {
                loadmodel->normalmins[j] = aliasbboxmin[j];
@@ -948,7 +943,6 @@ void Mod_LoadZymoticModel(model_t *mod, void *buffer)
 
        // model bbox
        modelradius = pheader->radius;
-//     loadmodel->modelradius = pheader->radius;
        for (i = 0;i < 3;i++)
        {
                loadmodel->normalmins[i] = pheader->mins[i];
@@ -970,3 +964,4 @@ void Mod_LoadZymoticModel(model_t *mod, void *buffer)
        loadmodel->DrawSky = NULL;
        loadmodel->DrawShadow = NULL;
 }
+
index be7c306..c4fae28 100644 (file)
@@ -60,8 +60,6 @@ mleaf_t *Mod_PointInLeaf (vec3_t p, model_t *model)
        mnode_t         *node;
 
        Mod_CheckLoaded(model);
-//     if (!model || !model->nodes)
-//             Sys_Error ("Mod_PointInLeaf: bad model");
 
        // LordHavoc: modified to start at first clip node,
        // in other words: first node of the (sub)model
@@ -86,32 +84,6 @@ void Mod_FindNonSolidLocation(vec3_t pos, model_t *mod)
        pos[2]-=1;
 }
 
-/*
-mleaf_t *Mod_PointInLeaf (vec3_t p, model_t *model)
-{
-       mnode_t         *node;
-       float           d;
-       mplane_t        *plane;
-
-       if (!model || !model->nodes)
-               Sys_Error ("Mod_PointInLeaf: bad model");
-
-       node = model->nodes;
-       while (1)
-       {
-               if (node->contents < 0)
-                       return (mleaf_t *)node;
-               plane = node->plane;
-               d = DotProduct (p,plane->normal) - plane->dist;
-               if (d > 0)
-                       node = node->children[0];
-               else
-                       node = node->children[1];
-       }
-
-       return NULL;    // never reached
-}
-*/
 
 /*
 ===================
@@ -128,18 +100,6 @@ static qbyte *Mod_DecompressVis (qbyte *in, model_t *model)
        row = (model->numleafs+7)>>3;
        out = decompressed;
 
-       /*
-       if (!in)
-       {       // no vis info, so make all visible
-               while (row)
-               {
-                       *out++ = 0xff;
-                       row--;
-               }
-               return decompressed;
-       }
-       */
-
        do
        {
                if (*in)
@@ -1039,14 +999,8 @@ void Mod_GenerateWarpMesh (msurface_t *surf)
        memset(mesh->vertex, 0, mesh->numverts * sizeof(surfvertex_t));
 
        for (i = 0;i < mesh->numtriangles;i++)
-       {
                for (j = 0;j < 3;j++)
-               {
                        mesh->index[i*3+j] = subdivpolyindex[i][j];
-                       //if (mesh->index[i] < 0 || mesh->index[i] >= mesh->numverts)
-                       //      Host_Error("Mod_GenerateWarpMesh: invalid index generated\n");
-               }
-       }
 
        for (i = 0, v = mesh->vertex;i < subdivpolyverts;i++, v++)
        {
@@ -1063,7 +1017,6 @@ void Mod_GenerateVertexLitMesh (msurface_t *surf)
        surfvertex_t    *out;
        surfmesh_t              *mesh;
 
-       //surf->flags |= SURF_LIGHTMAP;
        smax = surf->extents[0] >> 4;
        tmax = surf->extents[1] >> 4;
        surf->lightmaptexturestride = 0;
@@ -1130,8 +1083,6 @@ void Mod_GenerateLightmappedMesh (msurface_t *surf)
                surf->lightmaptexturestride = R_CompatibleFragmentWidth((surf->extents[0]>>4)+1, loadmodel->lightmaprgba ? TEXTYPE_RGBA : TEXTYPE_RGB, 0);
                surf->lightmaptexture = R_ProceduralTexture(loadmodel->texturepool, NULL, surf->lightmaptexturestride, (surf->extents[1]>>4)+1, loadmodel->lightmaprgba ? TEXTYPE_RGBA : TEXTYPE_RGB, TEXF_FRAGMENT | TEXF_PRECACHE, NULL, NULL, 0);
        }
-//     surf->lightmaptexture = R_LoadTexture(loadmodel->texturepool, va("lightmap%08x", lightmapnum), surf->lightmaptexturestride, (surf->extents[1]>>4)+1, NULL, loadmodel->lightmaprgba ? TEXTYPE_RGBA : TEXTYPE_RGB, TEXF_FRAGMENT | TEXF_PRECACHE);
-//     surf->lightmaptexture = R_LoadTexture(loadmodel->texturepool, va("lightmap%08x", lightmapnum), surf->lightmaptexturestride, (surf->extents[1]>>4)+1, NULL, loadmodel->lightmaprgba ? TEXTYPE_RGBA : TEXTYPE_RGB, TEXF_PRECACHE);
        R_FragmentLocation(surf->lightmaptexture, NULL, NULL, &xbase, &ybase, &xscale, &yscale);
        xscale = (xscale - xbase) * 16.0 / ((surf->extents[0] & ~15) + 16);
        yscale = (yscale - ybase) * 16.0 / ((surf->extents[1] & ~15) + 16);
@@ -1352,13 +1303,6 @@ static void Mod_LoadFaces (lump_t *l)
                else if (out->texinfo->texture->flags & SURF_DRAWTURB)
                {
                        out->shader = &Cshader_water;
-                       /*
-                       for (i=0 ; i<2 ; i++)
-                       {
-                               out->extents[i] = 16384*1024;
-                               out->texturemins[i] = -8192*1024;
-                       }
-                       */
                        out->samples = NULL;
                        Mod_GenerateWarpMesh (out);
                }
@@ -1534,15 +1478,7 @@ static void Mod_LoadLeafs (lump_t *l)
                for (j=0 ; j<4 ; j++)
                        out->ambient_sound_level[j] = in->ambient_level[j];
 
-               // gl underwater warp
-               // LordHavoc: disabled underwater warping
-               /*
-               if (out->contents != CONTENTS_EMPTY)
-               {
-                       for (j=0 ; j<out->nummarksurfaces ; j++)
-                               out->firstmarksurface[j]->flags |= SURF_UNDERWATER;
-               }
-               */
+               // FIXME: Insert caustics here
        }
 }
 
@@ -1749,8 +1685,6 @@ static void Mod_LoadPlanes (lump_t *l)
                out->normal[2] = LittleFloat (in->normal[2]);
                out->dist = LittleFloat (in->dist);
 
-               // LordHavoc: recalculated by PlaneClassify, FIXME: validate type and report error if type does not match normal?
-//             out->type = LittleLong (in->type);
                PlaneClassify(out);
        }
 }
@@ -1928,9 +1862,6 @@ static winding_t *ClipWinding (winding_t *in, mplane_t *split, int keepon)
        // free the original winding
        FreeWinding (in);
 
-       // debugging
-       //Mem_CheckSentinels(neww);
-
        return neww;
 }
 
@@ -2043,10 +1974,6 @@ static void DivideWinding (winding_t *in, mplane_t *split, winding_t **front, wi
                VectorCopy (mid, b->points[b->numpoints]);
                b->numpoints++;
        }
-
-       // debugging
-       //Mem_CheckSentinels(f);
-       //Mem_CheckSentinels(b);
 }
 
 typedef struct portal_s
@@ -2070,7 +1997,6 @@ static portal_t *AllocPortal (void)
 {
        portal_t *p;
        p = Mem_Alloc(loadmodel->mempool, sizeof(portal_t));
-       //memset(p, 0, sizeof(portal_t));
        p->chain = portalchain;
        portalchain = p;
        return p;
@@ -2107,8 +2033,6 @@ static void Mod_FinalizePortals(void)
        mleaf_t *leaf, *endleaf;
        winding_t *w;
 
-       //Mem_CheckSentinelsGlobal();
-
        // recalculate bounding boxes for all leafs (because qbsp is very sloppy)
        leaf = loadmodel->leafs;
        endleaf = leaf + loadmodel->numleafs;
@@ -2142,8 +2066,6 @@ static void Mod_FinalizePortals(void)
 
        Mod_RecursiveRecalcNodeBBox(loadmodel->nodes);
 
-       //Mem_CheckSentinelsGlobal();
-
        // tally up portal and point counts
        p = portalchain;
        numportals = 0;
@@ -2234,8 +2156,6 @@ static void Mod_FinalizePortals(void)
                FreePortal(p);
                p = pnext;
        }
-
-       //Mem_CheckSentinelsGlobal();
 }
 
 /*
@@ -2319,8 +2239,6 @@ static void Mod_RecursiveNodePortals (mnode_t *node)
        portal_t *portal, *nextportal, *nodeportal, *splitportal, *temp;
        winding_t *nodeportalwinding, *frontwinding, *backwinding;
 
-       //      CheckLeafPortalConsistancy (node);
-
        // if a leaf, we're done
        if (node->contents)
                return;
@@ -2338,7 +2256,6 @@ static void Mod_RecursiveNodePortals (mnode_t *node)
        nodeportal->plane = *node->plane;
 
        nodeportalwinding = BaseWindingForPlane (node->plane);
-       //Mem_CheckSentinels(nodeportalwinding);
        side = 0;       // shut up compiler warning
        for (portal = (portal_t *)node->portals;portal;portal = portal->next[side])
        {
@@ -2433,52 +2350,10 @@ static void Mod_RecursiveNodePortals (mnode_t *node)
        Mod_RecursiveNodePortals(back);
 }
 
-/*
-void Mod_MakeOutsidePortals(mnode_t *node)
-{
-       int                     i, j;
-       portal_t        *p, *portals[6];
-       mnode_t         *outside_node;
-
-       outside_node = Mem_Alloc(loadmodel->mempool, sizeof(mnode_t));
-       outside_node->contents = CONTENTS_SOLID;
-       outside_node->portals = NULL;
-
-       for (i = 0;i < 3;i++)
-       {
-               for (j = 0;j < 2;j++)
-               {
-                       portals[j*3 + i] = p = AllocPortal ();
-                       memset (&p->plane, 0, sizeof(mplane_t));
-                       p->plane.normal[i] = j ? -1 : 1;
-                       p->plane.dist = -65536;
-                       p->winding = BaseWindingForPlane (&p->plane);
-                       if (j)
-                               AddPortalToNodes (p, outside_node, node);
-                       else
-                               AddPortalToNodes (p, node, outside_node);
-               }
-       }
-
-       // clip the basewindings by all the other planes
-       for (i = 0;i < 6;i++)
-       {
-               for (j = 0;j < 6;j++)
-               {
-                       if (j == i)
-                               continue;
-                       portals[i]->winding = ClipWinding (portals[i]->winding, &portals[j]->plane, true);
-               }
-       }
-}
-*/
 
 static void Mod_MakePortals(void)
 {
-//     Con_Printf("building portals for %s\n", loadmodel->name);
-
        portalchain = NULL;
-//     Mod_MakeOutsidePortals (loadmodel->nodes);
        Mod_RecursiveNodePortals (loadmodel->nodes);
        Mod_FinalizePortals();
 }
@@ -2518,44 +2393,24 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
        // store which lightmap format to use
        mod->lightmaprgba = r_lightmaprgba.integer;
 
-//     Mem_CheckSentinelsGlobal();
-       // LordHavoc: had to move entity loading above everything to allow parsing various settings from worldspawn
        Mod_LoadEntities (&header->lumps[LUMP_ENTITIES]);
-//     Mem_CheckSentinelsGlobal();
        Mod_LoadVertexes (&header->lumps[LUMP_VERTEXES]);
-//     Mem_CheckSentinelsGlobal();
        Mod_LoadEdges (&header->lumps[LUMP_EDGES]);
-//     Mem_CheckSentinelsGlobal();
        Mod_LoadSurfedges (&header->lumps[LUMP_SURFEDGES]);
-//     Mem_CheckSentinelsGlobal();
        Mod_LoadTextures (&header->lumps[LUMP_TEXTURES]);
-//     Mem_CheckSentinelsGlobal();
        Mod_LoadLighting (&header->lumps[LUMP_LIGHTING]);
-//     Mem_CheckSentinelsGlobal();
        Mod_LoadPlanes (&header->lumps[LUMP_PLANES]);
-//     Mem_CheckSentinelsGlobal();
        Mod_LoadTexinfo (&header->lumps[LUMP_TEXINFO]);
-//     Mem_CheckSentinelsGlobal();
        Mod_LoadFaces (&header->lumps[LUMP_FACES]);
-//     Mem_CheckSentinelsGlobal();
        Mod_LoadMarksurfaces (&header->lumps[LUMP_MARKSURFACES]);
-//     Mem_CheckSentinelsGlobal();
        Mod_LoadVisibility (&header->lumps[LUMP_VISIBILITY]);
-//     Mem_CheckSentinelsGlobal();
        Mod_LoadLeafs (&header->lumps[LUMP_LEAFS]);
-//     Mem_CheckSentinelsGlobal();
        Mod_LoadNodes (&header->lumps[LUMP_NODES]);
-//     Mem_CheckSentinelsGlobal();
        Mod_LoadClipnodes (&header->lumps[LUMP_CLIPNODES]);
-//     Mem_CheckSentinelsGlobal();
-//     Mod_LoadEntities (&header->lumps[LUMP_ENTITIES]);
        Mod_LoadSubmodels (&header->lumps[LUMP_MODELS]);
-//     Mem_CheckSentinelsGlobal();
 
        Mod_MakeHull0 ();
-//     Mem_CheckSentinelsGlobal();
        Mod_MakePortals();
-//     Mem_CheckSentinelsGlobal();
 
        mod->numframes = 2;             // regular and alternate animation
 
@@ -2625,7 +2480,6 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
                mod->yawmaxs[2] = mod->normalmaxs[2];
                mod->rotatedmins[0] = mod->rotatedmins[1] = mod->rotatedmins[2] = -modelradius;
                mod->rotatedmaxs[0] = mod->rotatedmaxs[1] = mod->rotatedmaxs[2] = modelradius;
-//             mod->modelradius = modelradius;
                // LordHavoc: check for empty submodels (lacrima.bsp has such a glitch)
                if (mod->normalmins[0] > mod->normalmaxs[0] || mod->normalmins[1] > mod->normalmaxs[1] || mod->normalmins[2] > mod->normalmaxs[2])
                {
@@ -2636,14 +2490,8 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
                        VectorClear(mod->yawmaxs);
                        VectorClear(mod->rotatedmins);
                        VectorClear(mod->rotatedmaxs);
-                       //mod->modelradius = 0;
                }
 
-//             VectorCopy (bm->maxs, mod->maxs);
-//             VectorCopy (bm->mins, mod->mins);
-
-//             mod->radius = RadiusFromBounds (mod->mins, mod->maxs);
-
                mod->numleafs = bm->visleafs;
 
                mod->SERAddEntity = Mod_Brush_SERAddEntity;
@@ -2668,5 +2516,5 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
                        mod = loadmodel;
                }
        }
-//     Mem_CheckSentinelsGlobal();
 }
+
index f9fc38a..0af7ff3 100644 (file)
@@ -151,9 +151,6 @@ static model_t *Mod_LoadModel (model_t *mod, qboolean crash, qboolean checkdisk,
                crc = CRC_Block(buf, com_filesize);
        }
 
-       // make sure nothing got trashed
-       //Mem_CheckSentinelsGlobal();
-
        // allocate a new model
        loadmodel = mod;
 
@@ -179,9 +176,6 @@ static model_t *Mod_LoadModel (model_t *mod, qboolean crash, qboolean checkdisk,
 
        Mem_Free(buf);
 
-       // make sure nothing got trashed
-       //Mem_CheckSentinelsGlobal();
-
        return mod;
 }
 
@@ -208,15 +202,6 @@ Mod_ClearAll
 */
 void Mod_ClearAll (void)
 {
-       /*
-       int             i;
-       model_t *mod;
-
-       for (i = 0, mod = mod_known;i < MAX_MOD_KNOWN;i++, mod++)
-               if (mod->name[0])
-                       if (mod->usesheap)
-                               Mod_FreeModel(mod);
-       */
 }
 
 void Mod_ClearUsed(void)
@@ -311,23 +296,6 @@ model_t *Mod_ForName (char *name, qboolean crash, qboolean checkdisk, qboolean i
 
 qbyte *mod_base;
 
-/*
-=================
-RadiusFromBounds
-=================
-*/
-/*
-float RadiusFromBounds (vec3_t mins, vec3_t maxs)
-{
-       int             i;
-       vec3_t  corner;
-
-       for (i=0 ; i<3 ; i++)
-               corner[i] = fabs(mins[i]) > fabs(maxs[i]) ? fabs(mins[i]) : fabs(maxs[i]);
-
-       return Length (corner);
-}
-*/
 
 //=============================================================================
 
index 346fddb..7af45a9 100644 (file)
@@ -225,7 +225,6 @@ void Mod_Sprite_SharedSetup(qbyte *datapointer, int version, int *palette)
                loadmodel->normalmins[i] = loadmodel->yawmins[i] = loadmodel->rotatedmins[i] = -modelradius;
                loadmodel->normalmaxs[i] = loadmodel->yawmaxs[i] = loadmodel->rotatedmaxs[i] = modelradius;
        }
-//     loadmodel->modelradius = modelradius;
 }
 
 void Mod_Sprite_SERAddEntity(void)
@@ -303,7 +302,6 @@ void Mod_LoadSpriteModel (model_t *mod, void *buffer)
                                palette[i][2] = *in++;
                                palette[i][3] = 255;
                        }
-       //              palette[255][0] = palette[255][1] = palette[255][2] = palette[255][3] = 0;
                        loadmodel->flags |= EF_ADDITIVE;
                        break;
                case SPRHL_INDEXALPHA:
@@ -336,3 +334,4 @@ void Mod_LoadSpriteModel (model_t *mod, void *buffer)
        else
                Host_Error ("Mod_LoadSpriteModel: %s has wrong version number (%i should be 1 (quake) or 32 (sprite32) or 2 (halflife)", loadmodel->name, version);
 }
+
index 79d62f8..1713515 100644 (file)
--- a/net_bsd.c
+++ b/net_bsd.c
@@ -91,3 +91,4 @@ net_landriver_t       net_landrivers[MAX_NET_DRIVERS] =
 };
 
 int net_numlandrivers = 1;
+
index e609b55..c8956e6 100644 (file)
@@ -326,9 +326,6 @@ int Datagram_GetMessage (qsocket_t *sock)
        {
                length = sfunc.Read (sock->socket, (qbyte *)&packetBuffer, NET_DATAGRAMSIZE, &readaddr);
 
-//     if ((rand() & 255) > 220)
-//             continue;
-
                if (length == 0)
                        break;
 
@@ -489,20 +486,12 @@ void NET_Stats_f (void)
        {
                for (s = net_activeSockets; s; s = s->next)
                        PrintStats(s);
-               // LordHavoc: sockets are dynamically allocated now
-               //for (s = net_freeSockets; s; s = s->next)
-               //      PrintStats(s);
        }
        else
        {
                for (s = net_activeSockets; s; s = s->next)
                        if (Q_strcasecmp(Cmd_Argv(1), s->address) == 0)
                                break;
-               // LordHavoc: sockets are dynamically allocated now
-               //if (s == NULL)
-               //      for (s = net_freeSockets; s; s = s->next)
-               //              if (Q_strcasecmp(Cmd_Argv(1), s->address) == 0)
-               //                      break;
                if (s == NULL)
                        return;
                PrintStats(s);
@@ -1086,7 +1075,6 @@ static qsocket_t *_Datagram_CheckNewConnections (void)
        MSG_WriteByte(&net_message, CCREP_ACCEPT);
        dfunc.GetSocketAddr(newsock, &newaddr);
        MSG_WriteLong(&net_message, dfunc.GetSocketPort(&newaddr));
-//     MSG_WriteString(&net_message, dfunc.AddrToString(&newaddr));
        *((int *)net_message.data) = BigLong(NETFLAG_CTL | (net_message.cursize & NETFLAG_LENGTH_MASK));
        dfunc.Write (acceptsock, net_message.data, net_message.cursize, &clientaddr);
        SZ_Clear(&net_message);
@@ -1274,12 +1262,10 @@ static qsocket_t *_Datagram_Connect (char *host)
                                // is it from the right place?
                                if (sfunc.AddrCompare(&readaddr, &sendaddr) != 0)
                                {
-//#ifdef DEBUG
                                        Con_DPrintf("wrong reply address\n");
                                        Con_DPrintf("Expected: %s\n", StrAddr (&sendaddr));
                                        Con_DPrintf("Received: %s\n", StrAddr (&readaddr));
                                        CL_UpdateScreen ();
-//#endif
                                        ret = 0;
                                        continue;
                                }
@@ -1397,3 +1383,4 @@ qsocket_t *Datagram_Connect (char *host)
                                break;
        return ret;
 }
+
index 8424ca9..bfb356b 100644 (file)
@@ -244,3 +244,4 @@ void Loop_Close (qsocket_t *sock)
        else
                loop_server = NULL;
 }
+
index 4450e23..4c6971d 100644 (file)
@@ -22,8 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "quakedef.h"
 
 qsocket_t *net_activeSockets = NULL;
-//qsocket_t *net_freeSockets = NULL;
-//int net_numsockets = 0;
 mempool_t *net_mempool;
 
 qboolean       ipxAvailable = false;
@@ -90,16 +88,9 @@ qsocket_t *NET_NewQSocket (void)
 {
        qsocket_t       *sock;
 
-//     if (net_freeSockets == NULL)
-//             return NULL;
-
        if (net_activeconnections >= svs.maxclients)
                return NULL;
 
-       // get one from free list
-//     sock = net_freeSockets;
-//     net_freeSockets = sock->next;
-       // LordHavoc: sockets are dynamically allocated now
        sock = Mem_Alloc(net_mempool, sizeof(qsocket_t));
 
        // add it to active list
@@ -146,11 +137,6 @@ void NET_FreeQSocket(qsocket_t *sock)
                        Sys_Error ("NET_FreeQSocket: not active\n");
        }
 
-       // add it to free list
-//     sock->next = net_freeSockets;
-//     net_freeSockets = sock;
-//     sock->disconnected = true;
-       // LordHavoc: sockets are dynamically allocated now
        Mem_Free(sock);
 }
 
@@ -206,13 +192,6 @@ static void MaxPlayers_f (void)
                Cbuf_AddText ("listen 1\n");
 
        svs.maxclients = n;
-       // LordHavoc: resetting deathmatch and coop was silly
-       /*
-       if (n == 1)
-               Cvar_Set ("deathmatch", "0");
-       else
-               Cvar_Set ("deathmatch", "1");
-       */
 }
 
 
@@ -700,8 +679,6 @@ void NET_Init (void)
 {
        int                     i;
        int                     controlSocket;
-       // LordHavoc: sockets are dynamically allocated now
-       //qsocket_t     *s;
 
        i = COM_CheckParm ("-port");
        if (!i)
@@ -720,25 +697,10 @@ void NET_Init (void)
 
        if (COM_CheckParm("-listen") || cls.state == ca_dedicated || gamemode == GAME_BLOODBATH)
                listening = true;
-       // LordHavoc: sockets are dynamically allocated now
-       //net_numsockets = svs.maxclientslimit;
-       //if (cls.state != ca_dedicated)
-       //      net_numsockets++;
 
        SetNetTime();
 
        net_mempool = Mem_AllocPool("qsocket");
-       // LordHavoc: sockets are dynamically allocated now
-       /*
-       s = Mem_Alloc(net_mempool, net_numsockets * sizeof(qsocket_t));
-       for (i = 0; i < net_numsockets; i++)
-       {
-               s->next = net_freeSockets;
-               net_freeSockets = s;
-               s->disconnected = true;
-               s++;
-       }
-       */
 
        // allocate space for network message buffer
        SZ_Alloc (&net_message, NET_MAXMESSAGE, "net_message");
@@ -843,3 +805,4 @@ void SchedulePollProcedure(PollProcedure *proc, double timeOffset)
        proc->next = pp;
        prev->next = proc;
 }
+
index 9b91330..1847185 100644 (file)
--- a/net_udp.c
+++ b/net_udp.c
@@ -414,4 +414,3 @@ int UDP_SetSocketPort (struct qsockaddr *addr, int port)
        return 0;
 }
 
-//=============================================================================
index 019a9c7..d34348c 100644 (file)
--- a/net_win.c
+++ b/net_win.c
@@ -21,7 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "net_loop.h"
 #include "net_dgrm.h"
-//#include "net_ser.h"
 
 net_driver_t net_drivers[MAX_NET_DRIVERS] =
 {
@@ -118,3 +117,4 @@ net_landriver_t     net_landrivers[MAX_NET_DRIVERS] =
 };
 
 int net_numlandrivers = 2;
+
index 236c355..4deb5c7 100644 (file)
@@ -571,4 +571,3 @@ int WINS_SetSocketPort (struct qsockaddr *addr, int port)
        return 0;
 }
 
-//=============================================================================
index bf53adb..1272978 100644 (file)
@@ -428,4 +428,3 @@ int WIPX_SetSocketPort (struct qsockaddr *addr, int port)
        return 0;
 }
 
-//=============================================================================
index 82da3de..c7dd2e8 100644 (file)
--- a/palette.c
+++ b/palette.c
@@ -2,7 +2,6 @@
 #include "quakedef.h"
 
 unsigned int d_8to24table[256];
-//qbyte d_15to8table[32768];
 qbyte host_basepal[768];
 
 cvar_t v_gamma = {CVAR_SAVE, "v_gamma", "1"};
@@ -28,38 +27,6 @@ void Palette_Setup8to24(void)
        d_8to24table[255] = 0; // completely transparent black
 }
 
-/*
-void   Palette_Setup15to8(void)
-{
-       qbyte   *pal;
-       unsigned r,g,b;
-       unsigned v;
-       int     r1,g1,b1;
-       int             j,k,l;
-       unsigned short i;
-
-       for (i = 0;i < 32768;i++)
-       {
-               r = ((i & 0x001F) << 3)+4;
-               g = ((i & 0x03E0) >> 2)+4;
-               b = ((i & 0x7C00) >> 7)+4;
-               pal = (unsigned char *)d_8to24table;
-               for (v = 0, k = 0, l = 1000000000;v < 256;v++, pal += 4)
-               {
-                       r1 = r - pal[0];
-                       g1 = g - pal[1];
-                       b1 = b - pal[2];
-                       j = r1*r1+g1*g1+b1*b1;
-                       if (j < l)
-                       {
-                               k = v;
-                               l = j;
-                       }
-               }
-               d_15to8table[i] = k;
-       }
-}
-*/
 
 void BuildGammaTable8(float prescale, float gamma, float scale, float base, qbyte *out)
 {
@@ -205,5 +172,5 @@ void Palette_Init(void)
                host_basepal[i] = temp[host_basepal[i]];
 
        Palette_Setup8to24();
-//     Palette_Setup15to8();
 }
+
index 1ad130c..0343e9d 100644 (file)
--- a/portals.c
+++ b/portals.c
@@ -11,7 +11,6 @@ static int ranoutofportals;
 static float portaltemppoints[2][256][3];
 static float portaltemppoints2[256][3];
 static int portal_markid = 0;
-//float viewportalpoints[16*3];
 static float boxpoints[4*3];
 
 int Portal_ClipPolygonToPlane(float *in, float *out, int inpoints, int maxoutpoints, tinyplane_t *p)
@@ -66,18 +65,6 @@ begin:
        return outpoints;
 }
 
-/*
-void Portal_TriangleToPlane(vec3_t point1, vec3_t point2, vec3_t point3, tinyplane_t *p)
-{
-       vec3_t v1, v2;
-       VectorSubtract(point1, point2, v1);
-       VectorSubtract(point3, point2, v2);
-       CrossProduct(v1, v2, p->normal);
-//     VectorNormalize(p->normal);
-       VectorNormalizeFast(p->normal);
-       p->dist = DotProduct(point1, p->normal);
-}
-*/
 
 int Portal_PortalThroughPortalPlanes(tinyplane_t *clipplanes, int clipnumplanes, float *targpoints, int targnumpoints, float *out, int maxpoints)
 {
@@ -134,7 +121,6 @@ int Portal_RecursiveFlowSearch (mleaf_t *leaf, vec3_t eye, int firstclipplane, i
                                newplanes = &portalplanes[firstclipplane + numclipplanes];
                                for (prev = newpoints - 1, i = 0;i < newpoints;prev = i, i++)
                                {
-//                                     Portal_TriangleToPlane(eye, portaltemppoints2[i], portaltemppoints2[prev], newplanes + i);
                                        VectorSubtract(eye, portaltemppoints2[i], v1);
                                        VectorSubtract(portaltemppoints2[prev], portaltemppoints2[i], v2);
                                        CrossProduct(v1, v2, newplanes[i].normal);
@@ -218,7 +204,6 @@ int Portal_CheckPolygon(model_t *model, vec3_t eye, float *polypoints, int numpo
        // calculate the planes, and make sure the polygon can see it's own center
        for (prev = numpoints - 1, i = 0;i < numpoints;prev = i, i++)
        {
-//             Portal_TriangleToPlane(eye, portaltemppoints2[i], portaltemppoints2[prev], newplanes + i);
                VectorSubtract(eye, (&polypoints[i * 3]), v1);
                VectorSubtract((&polypoints[prev * 3]), (&polypoints[i * 3]), v2);
                CrossProduct(v1, v2, portalplanes[i].normal);
@@ -329,3 +314,4 @@ int Portal_CheckBox(model_t *model, vec3_t eye, vec3_t a, vec3_t b)
 
        return false;
 }
+
index c133493..6042f09 100644 (file)
--- a/pr_cmds.c
+++ b/pr_cmds.c
@@ -168,13 +168,9 @@ void PF_objerror (void)
        ed = PROG_TO_EDICT(pr_global_struct->self);
        ED_Print (ed);
        ED_Free (ed);
-
-// LordHavoc: bug fix - no longer kills server
-//     Host_Error ("Program error");
 }
 
 
-
 /*
 ==============
 PF_makevectors
@@ -225,80 +221,12 @@ void PF_setorigin (void)
 
 void SetMinMaxSize (edict_t *e, float *min, float *max, qboolean rotate)
 {
-       /*
-       float   *angles;
-       vec3_t  rmin, rmax;
-       float   bounds[2][3];
-       float   xvector[2], yvector[2];
-       float   a;
-       vec3_t  base, transformed;
-       int             i, j, k, l;
-       */
        int             i;
        
        for (i=0 ; i<3 ; i++)
                if (min[i] > max[i])
                        PR_RunError ("backwards mins/maxs");
 
-       /*
-       rotate = false;         // FIXME: implement rotation properly again
-
-       if (!rotate)
-       {
-               VectorCopy (min, rmin);
-               VectorCopy (max, rmax);
-       }
-       else
-       {
-       // find min / max for rotations
-               angles = e->v.angles;
-               
-               a = angles[1]/180 * M_PI;
-
-               xvector[0] = cos(a);
-               xvector[1] = sin(a);
-               yvector[0] = -sin(a);
-               yvector[1] = cos(a);
-               
-               VectorCopy (min, bounds[0]);
-               VectorCopy (max, bounds[1]);
-
-               rmin[0] = rmin[1] = rmin[2] = 9999;
-               rmax[0] = rmax[1] = rmax[2] = -9999;
-               
-               for (i=0 ; i<= 1 ; i++)
-               {
-                       base[0] = bounds[i][0];
-                       for (j=0 ; j<= 1 ; j++)
-                       {
-                               base[1] = bounds[j][1];
-                               for (k=0 ; k<= 1 ; k++)
-                               {
-                                       base[2] = bounds[k][2];
-                                       
-                               // transform the point
-                                       transformed[0] = xvector[0]*base[0] + yvector[0]*base[1];
-                                       transformed[1] = xvector[1]*base[0] + yvector[1]*base[1];
-                                       transformed[2] = base[2];
-                                       
-                                       for (l=0 ; l<3 ; l++)
-                                       {
-                                               if (transformed[l] < rmin[l])
-                                                       rmin[l] = transformed[l];
-                                               if (transformed[l] > rmax[l])
-                                                       rmax[l] = transformed[l];
-                                       }
-                               }
-                       }
-               }
-       }
-       
-// set derived values
-       VectorCopy (rmin, e->v.mins);
-       VectorCopy (rmax, e->v.maxs);
-       VectorSubtract (max, min, e->v.size);
-       */
-       
 // set derived values
        VectorCopy (min, e->v.mins);
        VectorCopy (max, e->v.maxs);
@@ -356,24 +284,11 @@ void PF_setmodel (void)
 
 
        e->v.model = m - pr_strings;
-       e->v.modelindex = i; //SV_ModelIndex (m);
+       e->v.modelindex = i;
 
-       mod = sv.models[ (int)e->v.modelindex];  // Mod_ForName (m, true);
+       mod = sv.models[ (int)e->v.modelindex];
 
        if (mod)
-       /*
-       { // LordHavoc: corrected model bounding box, but for compatibility that means I have to break it here
-               vec3_t min, max;
-               if (mod->type == ALIASTYPE_MDL)
-               {
-                       min[0] = min[1] = min[2] = -16;
-                       max[0] = max[1] = max[2] = 16;
-                       SetMinMaxSize (e, min, max, true);
-               }
-               else
-                       SetMinMaxSize (e, mod->mins, mod->maxs, true);
-       }
-       */
                SetMinMaxSize (e, mod->normalmins, mod->normalmaxs, true);
        else
                SetMinMaxSize (e, vec3_origin, vec3_origin, true);
@@ -727,8 +642,6 @@ break()
 */
 void PF_break (void)
 {
-//     Con_Printf ("break statement\n");
-//     *(int *)-4 = 0; // dump to debugger
        PR_RunError ("break statement");
 }
 
@@ -1123,12 +1036,6 @@ void PF_ftos (void)
        v = G_FLOAT(OFS_PARM0);
 
        s = PR_GetTempString();
-       /*
-       if (v == (int)v)
-               sprintf (s, "%d",(int)v);
-       else
-               sprintf (s, "%5.1f",v);
-       */
        // LordHavoc: ftos improvement
        sprintf (s, "%g", v);
        G_INT(OFS_RETURN) = s - pr_strings;
@@ -2717,3 +2624,4 @@ PF_te_plasmaburn,         // #433
 
 builtin_t *pr_builtins = pr_builtin;
 int pr_numbuiltins = sizeof(pr_builtin)/sizeof(pr_builtin[0]);
+
index 23a05d1..c812c00 100644 (file)
@@ -351,39 +351,6 @@ dfunction_t *ED_FindFunction (char *name)
 
 
 /*
-eval_t *GetEdictFieldValue(edict_t *ed, char *field)
-{
-       ddef_t                  *def = NULL;
-       int                             i;
-       static int              rep = 0;
-
-       for (i=0 ; i<GEFV_CACHESIZE ; i++)
-       {
-               if (!strcmp(field, gefvCache[i].field))
-               {
-                       def = gefvCache[i].pcache;
-                       goto Done;
-               }
-       }
-
-       def = ED_FindField (field);
-
-       if (strlen(field) < MAX_FIELD_LEN)
-       {
-               gefvCache[rep].pcache = def;
-               strcpy (gefvCache[rep].field, field);
-               rep ^= 1;
-       }
-
-Done:
-       if (!def)
-               return NULL;
-
-       return (eval_t *)((char *)&ed->v + def->ofs*4);
-}
-*/
-
-/*
 ============
 PR_ValueString
 
@@ -1495,14 +1462,6 @@ edict_t *EDICT_NUM_ERROR(int n)
        Host_Error ("EDICT_NUM: bad number %i", n);
        return NULL;
 }
-/*
-edict_t *EDICT_NUM(int n)
-{
-       if (n < 0 || n >= sv.max_edicts)
-               Sys_Error ("EDICT_NUM: bad number %i", n);
-       return (edict_t *)((qbyte *)sv.edicts+ (n)*pr_edict_size);
-}
-*/
 
 int NUM_FOR_EDICT(edict_t *e)
 {
@@ -1524,3 +1483,4 @@ int NoCrash_NUM_FOR_EDICT(edict_t *e)
        b = b / pr_edict_size;
        return b;
 }
+
index 1db1128..113941a 100644 (file)
--- a/pr_exec.c
+++ b/pr_exec.c
@@ -21,10 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "quakedef.h"
 
 
-/*
-
-*/
-
 typedef struct
 {
        int                             s;
@@ -425,3 +421,4 @@ chooseexecprogram:
                }
        }
 }
+
index 0c2d844..4a66bfc 100644 (file)
@@ -44,7 +44,6 @@ void EntityFrame_AckFrame(entity_database_t *d, int frame)
 // (server) clears frame, to prepare for adding entities
 void EntityFrame_Clear(entity_frame_t *f, vec3_t eye)
 {
-       //memset(f, 0, sizeof(*f));
        f->time = 0;
        f->framenum = 0;
        f->numentities = 0;
@@ -481,51 +480,6 @@ void EntityFrame_Read(entity_database_t *d)
        EntityFrame_AddFrame(d, f);
 }
 
-/*
-// (client) reads (and interpolates) the eye location from the database,
-// given a current time
-int EntityFrame_FetchEye(entity_database_t *d, vec3_t eye, double time)
-{
-       float frac;
-       if (d->numframes == 0)
-               return false;
-//             Host_Error("EntityFrame_FetchEye: no frames\n");
-       if (d->numframes > 1 && d->frames[d->numframes - 2].time != d->frames[d->numframes - 1].time)
-       {
-               frac = (time - d->frames[d->numframes - 2].time) / (d->frames[d->numframes - 1].time - d->frames[d->numframes - 2].time);
-               frac = bound(0, frac, 1);
-               VectorSubtract(d->frames[d->numframes - 2].eye, d->frames[d->numframes - 1].eye, eye);
-               VectorMA(d->frames[d->numframes - 2].eye, frac, eye, eye);
-       }
-       else
-               VectorCopy(d->frames[0].eye, eye);
-       return true;
-}
-
-// (client) fetchs an entity from a frame, index is the index into the frame's entity list, returns false if index is out of bounds
-int EntityFrame_FetchEntityByIndex(entity_frame_t *f, entity_state_t *e, int index)
-{
-       if (index < 0 || index >= f->numentities)
-               return false;
-       memcpy(e, f->entitydata + index, sizeof(*e));
-       return true;
-}
-
-int EntityFrame_FetchEntityByNumber(entity_frame_t *f, entity_state_t *e, int number)
-{
-       int i;
-       for (i = 0;i < f->numentities;i++)
-       {
-               if (f->entitydata[i].number == number)
-               {
-                       memcpy(e, f->entitydata + i, sizeof(*e));
-                       return true;
-               }
-       }
-       ClearStateToDefault(e);
-       return false;
-}
-*/
 
 // (client) returns the frame number of the most recent frame recieved
 int EntityFrame_MostRecentlyRecievedFrameNum(entity_database_t *d)
@@ -535,3 +489,4 @@ int EntityFrame_MostRecentlyRecievedFrameNum(entity_database_t *d)
        else
                return -1;
 }
+
index f297e0e..65535f9 100644 (file)
--- a/quakeio.c
+++ b/quakeio.c
 # include <unistd.h>
 #endif
 
-//#ifdef _MSC_VER
-//# define _POSIX_
-//#endif
-
 #include <stdarg.h>
 #include <stdlib.h>
 #include <limits.h>
@@ -402,3 +398,4 @@ void QuakeIO_Init(void)
 {
        quakeio_mempool = Mem_AllocPool("file management");
 }
+
index db77a80..362268c 100644 (file)
--- a/r_clip.c
+++ b/r_clip.c
@@ -16,10 +16,6 @@ typedef struct clipsurf_s
        // updated each time the surface is added to the stack,
        // for quicker comparisons.
        float wcurrent;
-       // this is a linked list of all edges belonging to this surface,
-       // used to remove them if this is a non-solid surface that is
-       // marked visible (it can not hide anything, so it is useless)
-//     struct clipedge_s *edgechain;
 }
 clipsurf_t;
 
@@ -60,9 +56,6 @@ clippixel_t *clipbuffer;
 #endif
 
 float r_clip_viewmatrix[3][3], r_clip_viewmulx, r_clip_viewmuly, r_clip_viewcenterx, r_clip_viewcentery;
-// REMOVELATER
-//float xscale, yscale, xscaleinv, yscaleinv;
-//float r_clip_nearclipdist, r_clip_nearclipdist2;
 tinyplane_t r_clip_viewplane[5];
 
 mempool_t *r_clip_mempool;
@@ -82,20 +75,12 @@ void R_Clip_MakeViewMatrix(void)
        VectorCopy (vright, r_clip_viewmatrix[0]);
        VectorNegate (vup, r_clip_viewmatrix[1]);
        VectorCopy (vpn, r_clip_viewmatrix[2]);
-//     r_clip_nearclipdist = DotProduct(r_origin, vpn) + 4.0f;
-//     r_clip_nearclipdist2 = r_clip_nearclipdist - 8.0f;
        VectorCopy (vpn, r_clip_viewplane[0].normal);
        r_clip_viewplane[0].dist = DotProduct(r_origin, vpn);
        memcpy(&r_clip_viewplane[1], &frustum[0], sizeof(tinyplane_t));
        memcpy(&r_clip_viewplane[2], &frustum[1], sizeof(tinyplane_t));
        memcpy(&r_clip_viewplane[3], &frustum[2], sizeof(tinyplane_t));
        memcpy(&r_clip_viewplane[4], &frustum[3], sizeof(tinyplane_t));
-// REMOVELATER
-//     maxscreenscaleinv = (1.0f / max(clipwidth, clipheight)) * horizontalfieldofview * 0.5f;
-//     xscale = clipwidth / horizontalfieldofview;
-//     xscaleinv = 1.0 / xscale;
-//     yscale = xscale * pixelaspect;
-//     yscaleinv = 1.0 / yscale;
 }
 
 void R_Clip_StartFrame(void)
@@ -221,26 +206,6 @@ int R_Clip_TriangleToPlane(vec3_t point1, vec3_t point2, vec3_t point3, tinyplan
                return false;
 }
 
-/*
-int R_Clip_TriangleToDoublePlane(double *point1, double *point2, double *point3, tinydoubleplane_t *p)
-{
-       double y, number;
-       double v1[3], v2[3];
-       VectorSubtract(point1, point2, v1);
-       VectorSubtract(point3, point2, v2);
-       CrossProduct(v1, v2, p->normal);
-       number = DotProduct(p->normal, p->normal);
-       if (number >= 0.1)
-       {
-               y = 1.0 / sqrt(number);
-               VectorScale(p->normal, y, p->normal);
-               p->dist = DotProduct(point1, p->normal);
-               return true;
-       }
-       else
-               return false;
-}
-*/
 
 int R_Clip_ClipPolygonToPlane(float *in, float *out, int inpoints, int stride, tinyplane_t *plane)
 {
@@ -301,14 +266,9 @@ void R_Clip_AddPolygon (vec_t *points, int numverts, int stride, int solid, void
        float deltax, deltay, vx, vy, vz, fx;
        int i, j, k, nextvert, temp, topy, bottomy, height, addededges;
        clipedge_t *pedge;
-//     tinydoubleplane_t plane;
        tinyplane_t localplane;
-//     tinyplane_t testplane;
        float distinv;
 
-//     if (!solid)
-//             return;
-
        if (polyplane == NULL)
        {
                polyplane = &localplane;
@@ -328,29 +288,6 @@ void R_Clip_AddPolygon (vec_t *points, int numverts, int stride, int solid, void
                if (DotProduct(r_origin, polyplane->normal) < (polyplane->dist + 0.5f))
                        return;
        }
-#if 0 // debugging (validates planes passed in)
-       else
-       {
-               // calculate the plane for the polygon
-               if (!R_Clip_TriangleToPlane((float *) points, (float *) ((qbyte *)points + stride), (float *) ((qbyte *)points + 2 * stride), &localplane))
-               {
-                       for (i = 0;i < numverts;i++)
-                               for (j = i + 1;j < numverts;j++)
-                                       for (k = j + 1;k < numverts;k++)
-                                               if (R_Clip_TriangleToPlane((float *) ((qbyte *)points + i * stride), (float *) ((qbyte *)points + j * stride), (float *) ((qbyte *)points + k * stride), &localplane))
-                                                       goto valid4;
-                       return; // gave up
-                       valid4:;
-               }
-
-//             if ((DotProduct(r_origin, polyplane->normal) < (polyplane->dist + 0.5f)) != (DotProduct(r_origin, localplane.normal) < (localplane.dist + 0.5f)))
-               if (DotProduct(polyplane->normal, localplane.normal) < 0.9f)
-               {
-                       Con_Printf("*\n");
-                       return;
-               }
-       }
-#endif
 
        // for adaptive limits
        needededges += numverts;
@@ -375,7 +312,6 @@ void R_Clip_AddPolygon (vec_t *points, int numverts, int stride, int solid, void
        if (pavailedge + numverts > clipedgesend)
                return;
 
-#if 1
        for (i = 0;i < numverts;i++)
        {
                vx = tempverts2[i][0] - r_origin[0];
@@ -386,115 +322,25 @@ void R_Clip_AddPolygon (vec_t *points, int numverts, int stride, int solid, void
                screenverts[i][1] = (r_clip_viewmatrix[1][0] * vx + r_clip_viewmatrix[1][1] * vy + r_clip_viewmatrix[1][2] * vz) * r_clip_viewmuly * screenverts[i][2] + r_clip_viewcentery;
        }
 
-       /*
-       if (polyplane != NULL)
-       {
-       */
-       /*
-               distinv = 1.0f / (polyplane->dist - DotProduct(r_origin, polyplane->normal));
-               pavailsurf->wstepx = DotProduct(r_clip_viewmatrix[0], polyplane->normal) * xscaleinv * distinv;
-               pavailsurf->wstepy = DotProduct(r_clip_viewmatrix[1], polyplane->normal) * yscaleinv * distinv;
-               pavailsurf->w00 = DotProduct(r_clip_viewmatrix[2], polyplane->normal) * distinv - r_clip_viewcenterx * pavailsurf->wstepx - r_clip_viewcentery * pavailsurf->wstepy;
-       */
-       /*
-       }
-       else
-       {
-       */
-               // calculate the plane for the polygon
-               if (!R_Clip_TriangleToPlane(screenverts[0], screenverts[1], screenverts[2], &localplane))
-               {
-                       for (i = 0;i < numverts;i++)
-                               for (j = i + 1;j < numverts;j++)
-                                       for (k = j + 1;k < numverts;k++)
-                                               if (R_Clip_TriangleToPlane(screenverts[i], screenverts[j], screenverts[k], &localplane))
-                                                       goto valid;
-                       return; // gave up
-                       valid:;
-               }
-
-               // Set up the 1/z gradients from the polygon, calculating the
-               // base value at screen coordinate 0,0 so we can use screen
-               // coordinates directly when calculating 1/z from the gradients
-               distinv = 1.0f / localplane.normal[2];
-               pavailsurf->wstepx = -(localplane.normal[0] * distinv);
-               pavailsurf->wstepy = -(localplane.normal[1] * distinv);
-               pavailsurf->w00 = localplane.dist * distinv;
-       /*
-       }
-       */
-       // REMOVELATER
-       /*
-       prevdist = z1 * plane.normal[2] - plane.dist;
-       dist = z2 * plane.normal[2] - plane.dist;
-       d = prevdist / (prevdist - dist);
-       zc = z1 + d * (z2 - z1);
-
-       prevdist = plane.normal[0] + z1 * plane.normal[2] - plane.dist;
-       dist = plane.normal[0] + z2 * plane.normal[2] - plane.dist;
-       d = prevdist / (prevdist - dist);
-       zx = (z1 + d * (z2 - z1)) - zc;
-
-       prevdist = plane.normal[1] + z1 * plane.normal[2] - plane.dist;
-       dist = plane.normal[1] + z2 * plane.normal[2] - plane.dist;
-       d = prevdist / (prevdist - dist);
-       zy = (z1 + d * (z2 - z1)) - zc;
-       */
-
-       /*
-       zc = (-plane.dist) / ((-plane.dist) - (plane.normal[2] - plane.dist));
-       zx = ((plane.normal[0] - plane.dist) / ((plane.normal[0] - plane.dist) - (plane.normal[0] + plane.normal[2] - plane.dist))) - zc;
-       zy = ((plane.normal[1] - plane.dist) / ((plane.normal[1] - plane.dist) - (plane.normal[1] + plane.normal[2] - plane.dist))) - zc;
-       */
-
-//     zc = (plane.dist / plane.normal[2]);
-//     zx = -(plane.normal[0] / plane.normal[2]);
-//     zy = -(plane.normal[1] / plane.normal[2]);
-//     zy = ((plane.normal[1] - plane.dist) / (-plane.normal[2])) + ((plane.dist) / (-plane.normal[2]));
-#else // REMOVELATER
-       for (i = 0;i < numverts;i++)
-       {
-               vx = tempverts2[i][0] - r_origin[0];
-               vy = tempverts2[i][1] - r_origin[1];
-               vz = tempverts2[i][2] - r_origin[2];
-               screenverts[i][0] = r_clip_viewmatrix[0][0] * vx + r_clip_viewmatrix[0][1] * vy + r_clip_viewmatrix[0][2] * vz;
-               screenverts[i][1] = r_clip_viewmatrix[1][0] * vx + r_clip_viewmatrix[1][1] * vy + r_clip_viewmatrix[1][2] * vz;
-               screenverts[i][2] = r_clip_viewmatrix[2][0] * vx + r_clip_viewmatrix[2][1] * vy + r_clip_viewmatrix[2][2] * vz;
-       }
-
-       // REMOVELATER
        // calculate the plane for the polygon
-       for (i = 0;i < numverts;i++)
-               for (j = i + 1;j < numverts;j++)
-                       for (k = j + 1;k < numverts;k++)
-                               if (R_Clip_TriangleToDoublePlane(screenverts[i], screenverts[j], screenverts[k], &plane))
-                                       goto valid2;
-       return; // gave up
-valid2:;
-
-       distinv = 1.0f / plane.dist;
-       pavailsurf->d_zistepx = plane.normal[0] * xscaleinv * distinv;
-       pavailsurf->d_zistepy = -plane.normal[1] * yscaleinv * distinv;
-       pavailsurf->d_ziorigin = plane.normal[2] * distinv - r_clip_viewcenterx * pavailsurf->wstepx - r_clip_viewcentery * pavailsurf->wstepy;
-
-       for (i = 0;i < numverts;i++)
+       if (!R_Clip_TriangleToPlane(screenverts[0], screenverts[1], screenverts[2], &localplane))
        {
-               screenverts[i][2] = 1.0f / (screenverts[i][2]);
-               screenverts[i][0] = screenverts[i][0] * r_clip_viewmulx * screenverts[i][2] + r_clip_viewcenterx;
-               screenverts[i][1] = screenverts[i][1] * r_clip_viewmuly * screenverts[i][2] + r_clip_viewcentery;
-               // REMOVELATER
-//             if (screenverts[i][0] < -0.5)
-//                     screenverts[i][0] = -0.5;
-//             if (screenverts[i][0] > (clipwidth - 0.5))
-//                     screenverts[i][0] = clipwidth - 0.5;
-//             if (screenverts[i][1] < -0.5)
-//                     screenverts[i][1] = -0.5;
-//             if (screenverts[i][1] > (clipheight - 0.5))
-//                     screenverts[i][1] = clipheight - 0.5;
-//             if (screenverts[i][2] <= 0.0)
-//                     Con_Printf("R_Clip_AddPolygon: vertex z <= 0!\n");
+               for (i = 0;i < numverts;i++)
+                       for (j = i + 1;j < numverts;j++)
+                               for (k = j + 1;k < numverts;k++)
+                                       if (R_Clip_TriangleToPlane(screenverts[i], screenverts[j], screenverts[k], &localplane))
+                                               goto valid;
+               return; // gave up
+valid:;
        }
-#endif
+
+       // Set up the 1/z gradients from the polygon, calculating the
+       // base value at screen coordinate 0,0 so we can use screen
+       // coordinates directly when calculating 1/z from the gradients
+       distinv = 1.0f / localplane.normal[2];
+       pavailsurf->wstepx = -(localplane.normal[0] * distinv);
+       pavailsurf->wstepy = -(localplane.normal[1] * distinv);
+       pavailsurf->w00 = localplane.dist * distinv;
 
        addededges = false;
 
@@ -586,9 +432,7 @@ valid2:;
        pavailsurf++;
 }
 
-/////////////////////////////////////////////////////////////////////
 // Scan all the edges in the global edge table into spans.
-/////////////////////////////////////////////////////////////////////
 void ScanEdges (void)
 {
        int y, rescan;
@@ -707,14 +551,10 @@ void ScanEdges (void)
                                                fx = pedge->x;
                                                // Calculate the surface's 1/z value at this pixel, and cache the y depth for quick compares later
                                                w = (psurf->wcurrent = psurf->w00 + psurf->wstepy * fy) + psurf->wstepx * fx;
-//                                             if (w < 0)
-//                                                     w = 0;
 
                                                // See if that makes it a new top surface
                                                psurf2 = surfstack.next;
                                                w2 = psurf2->wcurrent + psurf2->wstepx * fx;
-//                                             if (w2 < 0 && psurf2 != &surfstack)
-//                                                     w2 = 0;
 
                                                if (w >= w2)
                                                {
@@ -747,8 +587,6 @@ void ScanEdges (void)
                                                        {
                                                                psurf2 = psurf2->next;
                                                                w2 = psurf2->wcurrent + psurf2->wstepx * fx;
-//                                                             if (w2 < 0 && psurf2 != &surfstack)
-//                                                                     w2 = 0;
                                                        }
                                                        while (w < w2);
 
@@ -871,50 +709,6 @@ void ScanEdges (void)
 
 void R_Clip_DisplayBuffer(void)
 {
-       /*
-#if CLIPTEST
-       int i;
-       static int firstupload = true;
-       qbyte clipbuffertex[256*256], *b;
-       if (!r_render.integer)
-               return;
-       if (clipwidth > 256 || clipheight > 256)
-               return;
-       qglBlendFunc(GL_ONE, GL_ONE);
-       qglBindTexture(GL_TEXTURE_2D, 8000);
-       if (firstupload)
-       {
-               memset(clipbuffertex, 0, sizeof(clipbuffertex));
-               qglTexImage2D(GL_TEXTURE_2D, 0, 1, 256, 256, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, clipbuffertex);
-       }
-       qglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-       qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-       qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-       if (lighthalf)
-               qglColor4ub(128, 128, 128, 255);
-       else
-               qglColor4ub(255, 255, 255, 255);
-       firstupload = false;
-       b = clipbuffertex;
-       for (i = 0;i < clipwidth*clipheight;i++)
-       {
-               if (clipbuffer[i].w > 0)
-                       *b++ = bound(0, (int) (clipbuffer[i].w * 4096.0f), 255);
-               else
-                       *b++ = 0;
-       }
-       qglTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, clipwidth, clipheight, GL_LUMINANCE, GL_UNSIGNED_BYTE, clipbuffertex);
-       qglBegin (GL_QUADS);
-       qglTexCoord2f (0                 , 0                  );qglVertex2f (0           , 0            );
-       qglTexCoord2f (clipwidth / 256.0f, 0                  );qglVertex2f (vid.conwidth, 0            );
-       qglTexCoord2f (clipwidth / 256.0f, clipheight / 256.0f);qglVertex2f (vid.conwidth, vid.conheight);
-       qglTexCoord2f (0                 , clipheight / 256.0f);qglVertex2f (0           , vid.conheight);
-       qglEnd ();
-       qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-//     qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-//     qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-#endif
-       */
 }
 
 float boxpoints[4*3];
@@ -1023,3 +817,4 @@ void R_Clip_AddBox(float *a, float *b, void (*callback)(void *nativedata, void *
                callback, nativedata, nativedata2, &clipboxplane[5]
        );
 }
+
index 83a45ec..d1aaca3 100644 (file)
@@ -1,3 +1,4 @@
+
 #include "quakedef.h"
 
 cvar_t crosshair_brightness = {CVAR_SAVE, "crosshair_brightness", "1"};
index a3991d2..d037ff1 100644 (file)
@@ -26,29 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #define EXPLOSIONVERTS ((EXPLOSIONGRID+1)*(EXPLOSIONGRID+1))
 #define EXPLOSIONTRIS (EXPLOSIONGRID*EXPLOSIONGRID*2)
 #define EXPLOSIONSTARTVELOCITY (256.0f)
-//#define EXPLOSIONSTARTVELOCITY (384.0f)
-//#define EXPLOSIONRANDOMVELOCITY (32.0f)
 #define EXPLOSIONFADESTART (1.5f)
-//#define EXPLOSIONFADERATE (4.5f)
 #define EXPLOSIONFADERATE (3.0f)
-/*
-#define MAX_EXPLOSIONGAS (MAX_EXPLOSIONS * EXPLOSIONGAS)
-#define EXPLOSIONGAS 8
-#define EXPLOSIONGASSTARTRADIUS (15.0f)
-#define EXPLOSIONGASSTARTVELOCITY (50.0f)
-#define GASDENSITY_SCALER (32768.0f / EXPLOSIONGAS)
-#define GASFADERATE (GASDENSITY_SCALER * EXPLOSIONGAS * 2)
-
-typedef struct explosiongas_s
-{
-       float pressure;
-       vec3_t origin;
-       vec3_t velocity;
-}
-explosiongas_t;
-
-explosiongas_t explosiongas[MAX_EXPLOSIONGAS];
-*/
 
 float explosiontexcoords[EXPLOSIONVERTS][2];
 int explosiontris[EXPLOSIONTRIS][3];
@@ -117,7 +96,6 @@ void r_explosion_shutdown(void)
 void r_explosion_newmap(void)
 {
        memset(explosion, 0, sizeof(explosion));
-//     memset(explosiongas, 0, sizeof(explosiongas));
 }
 
 int R_ExplosionVert(int column, int row)
@@ -189,53 +167,27 @@ void R_NewExplosion(vec3_t org)
                                // calculate velocity
                                dist = noise[explosionnoiseindex[j]] * (1.0f / 255.0f) + 0.5;
                                VectorScale(explosionspherevertvel[j], dist, explosion[i].vertvel[j]);
-                               //explosion[i].vertvel[j][0] = explosionspherevertvel[j][0] * dist; + (((float) noise[0][explosionnoiseindex[j]] - 128.0f) * (EXPLOSIONRANDOMVELOCITY / 128.0f));
-                               //explosion[i].vertvel[j][1] = explosionspherevertvel[j][1] * dist; + (((float) noise[1][explosionnoiseindex[j]] - 128.0f) * (EXPLOSIONRANDOMVELOCITY / 128.0f));
-                               //explosion[i].vertvel[j][2] = explosionspherevertvel[j][2] * dist; + (((float) noise[2][explosionnoiseindex[j]] - 128.0f) * (EXPLOSIONRANDOMVELOCITY / 128.0f));
                        }
                        break;
                }
        }
-
-       /*
-       i = 0;
-       j = EXPLOSIONGAS;
-       while (i < MAX_EXPLOSIONGAS && j > 0)
-       {
-               while (explosiongas[i].pressure > 0)
-               {
-                       i++;
-                       if (i >= MAX_EXPLOSIONGAS)
-                               return;
-               }
-               VectorRandom(v);
-               VectorMA(org, EXPLOSIONGASSTARTRADIUS, v, v);
-               TraceLine(org, v, explosiongas[i].origin, NULL, 0, true);
-               VectorRandom(v);
-               VectorScale(v, EXPLOSIONGASSTARTVELOCITY, explosiongas[i].velocity);
-               explosiongas[i].pressure = j * GASDENSITY_SCALER;
-               j--;
-       }
-       */
 }
 
 void R_DrawExplosion(explosion_t *e)
 {
        int i;
-       float c[EXPLOSIONVERTS][4], diff[3], centerdir[3], /*fog, */ifog, alpha, dist/*, centerdist, size, scale*/;
+       float c[EXPLOSIONVERTS][4], diff[3], centerdir[3], ifog, alpha, dist;
        rmeshinfo_t m;
        memset(&m, 0, sizeof(m));
        m.transparent = true;
        m.blendfunc1 = GL_SRC_ALPHA;
-       m.blendfunc2 = GL_ONE; //_MINUS_SRC_ALPHA;
+       m.blendfunc2 = GL_ONE;
        m.numtriangles = EXPLOSIONTRIS;
        m.index = &explosiontris[0][0];
        m.numverts = EXPLOSIONVERTS;
        m.vertex = &e->vert[0][0];
        m.vertexstep = sizeof(float[3]);
        alpha = e->alpha;
-       //if (alpha > 1)
-       //      alpha = 1;
        m.cr = 1;
        m.cg = 1;
        m.cb = 1;
@@ -244,22 +196,10 @@ void R_DrawExplosion(explosion_t *e)
        m.colorstep = sizeof(float[4]);
        VectorSubtract(r_origin, e->origin, centerdir);
        VectorNormalizeFast(centerdir);
-       /*
-       centerdist = DotProduct(e->origin, centerdir);
-       size = 0;
-       for (i = 0;i < EXPLOSIONVERTS;i++)
-       {
-               dist = DotProduct(e->vert[i], centerdir) - centerdist;
-               if (size < dist)
-                       size = dist;
-       }
-       scale = 4.0f / size;
-       */
        if (fogenabled)
        {
                for (i = 0;i < EXPLOSIONVERTS;i++)
                {
-                       //dist = (DotProduct(e->vert[i], centerdir) - centerdist) * scale - 2.0f;
                        VectorSubtract(e->vert[i], e->origin, diff);
                        VectorNormalizeFast(diff);
                        dist = (DotProduct(diff, centerdir) * 6.0f - 4.0f) * alpha;
@@ -282,7 +222,6 @@ void R_DrawExplosion(explosion_t *e)
        {
                for (i = 0;i < EXPLOSIONVERTS;i++)
                {
-                       //dist = (DotProduct(e->vert[i], centerdir) - centerdist) * scale - 2.0f;
                        VectorSubtract(e->vert[i], e->origin, diff);
                        VectorNormalizeFast(diff);
                        dist = (DotProduct(diff, centerdir) * 6.0f - 4.0f) * alpha;
@@ -292,62 +231,18 @@ void R_DrawExplosion(explosion_t *e)
                        c[i][3] = 1;
                }
        }
-       /*
-       if (fogenabled)
-       {
-               m.color = &c[0][0];
-               m.colorstep = sizeof(float[4]);
-               for (i = 0;i < EXPLOSIONVERTS;i++)
-               {
-                       // use inverse fog alpha as color
-                       VectorSubtract(e->vert[i], r_origin, diff);
-                       ifog = 1 - exp(fogdensity/DotProduct(diff,diff));
-                       if (ifog < 0)
-                               ifog = 0;
-                       c[i][0] = ifog;
-                       c[i][1] = ifog;
-                       c[i][2] = ifog;
-                       c[i][3] = alpha;
-               }
-       }
-       */
        m.tex[0] = R_GetTexture(explosiontexture);
        m.texcoords[0] = &explosiontexcoords[0][0];
        m.texcoordstep[0] = sizeof(float[2]);
 
        R_Mesh_Draw(&m);
-
-       /*
-       if (fogenabled)
-       {
-               m.blendfunc1 = GL_SRC_ALPHA;
-               m.blendfunc2 = GL_ONE;
-               for (i = 0;i < EXPLOSIONVERTS;i++)
-               {
-                       VectorSubtract(e->vert[i], r_origin, diff);
-                       fog = exp(fogdensity/DotProduct(diff,diff));
-                       c[i][0] = fogcolor[0];
-                       c[i][1] = fogcolor[1];
-                       c[i][2] = fogcolor[2];
-                       c[i][3] = alpha * fog;
-               }
-               //m.color = &c[0][0];
-               //m.colorstep = sizeof(float[4]);
-               m.tex[0] = R_GetTexture(explosiontexturefog);
-               R_Mesh_Draw(&m);
-       }
-       */
 }
 
-void R_MoveExplosion(explosion_t *e/*, explosiongas_t **list, explosiongas_t **listend, */)
+void R_MoveExplosion(explosion_t *e)
 {
        int i;
        float dot, frictionscale, end[3], impact[3], normal[3], frametime;
-       /*
-       vec3_t diff;
-       vec_t dist;
-       explosiongas_t **l;
-       */
+
        frametime = cl.time - e->time;
        e->time = cl.time;
        e->alpha = EXPLOSIONFADESTART - (cl.time - e->starttime) * EXPLOSIONFADERATE;
@@ -362,7 +257,6 @@ void R_MoveExplosion(explosion_t *e/*, explosiongas_t **list, explosiongas_t **l
        {
                if (e->vertvel[i][0] || e->vertvel[i][1] || e->vertvel[i][2])
                {
-                       //e->vertvel[i][2] += sv_gravity.value * frametime * -0.25f;
                        VectorScale(e->vertvel[i], frictionscale, e->vertvel[i]);
                        VectorMA(e->vert[i], frametime, e->vertvel[i], end);
                        if (r_explosionclip.integer)
@@ -378,108 +272,33 @@ void R_MoveExplosion(explosion_t *e/*, explosiongas_t **list, explosiongas_t **l
                        else
                                VectorCopy(end, e->vert[i]);
                }
-               /*
-               for (l = list;l < listend;l++)
-               {
-                       VectorSubtract(e->vert[i], (*l)->origin, diff);
-                       dist = DotProduct(diff, diff);
-                       if (dist < 4096 && dist >= 1)
-                       {
-                               dist = (*l)->pressure * frametime / dist;
-                               VectorMA(e->vertvel[i], dist, diff, e->vertvel[i]);
-                       }
-               }
-               */
        }
        for (i = 0;i < EXPLOSIONGRID;i++)
                VectorCopy(e->vert[i * (EXPLOSIONGRID + 1)], e->vert[i * (EXPLOSIONGRID + 1) + EXPLOSIONGRID]);
        memcpy(e->vert[EXPLOSIONGRID * (EXPLOSIONGRID + 1)], e->vert[0], sizeof(float[3]) * (EXPLOSIONGRID + 1));
 }
 
-/*
-void R_MoveExplosionGas(explosiongas_t *e, explosiongas_t **list, explosiongas_t **listend, float frametime)
-{
-       vec3_t end, diff;
-       vec_t dist, frictionscale;
-       explosiongas_t **l;
-       frictionscale = 1 - frametime;
-       frictionscale = bound(0, frictionscale, 1);
-       if (e->velocity[0] || e->velocity[1] || e->velocity[2])
-       {
-               end[0] = e->origin[0] + frametime * e->velocity[0];
-               end[1] = e->origin[1] + frametime * e->velocity[1];
-               end[2] = e->origin[2] + frametime * e->velocity[2];
-               if (r_explosionclip.integer)
-               {
-                       float f, dot;
-                       vec3_t impact, normal;
-                       f = TraceLine(e->origin, end, impact, normal, 0, true);
-                       VectorCopy(impact, e->origin);
-                       if (f < 1)
-                       {
-                               // clip velocity against the wall
-                               dot = DotProduct(e->velocity, normal) * -1.3f;
-                               e->velocity[0] += normal[0] * dot;
-                               e->velocity[1] += normal[1] * dot;
-                               e->velocity[2] += normal[2] * dot;
-                       }
-               }
-               else
-               {
-                       VectorCopy(end, e->origin);
-               }
-               e->velocity[2] += sv_gravity.value * frametime;
-               VectorScale(e->velocity, frictionscale, e->velocity);
-       }
-       for (l = list;l < listend;l++)
-       {
-               if (*l != e)
-               {
-                       VectorSubtract(e->origin, (*l)->origin, diff);
-                       dist = DotProduct(diff, diff);
-                       if (dist < 4096 && dist >= 1)
-                       {
-                               dist = (*l)->pressure * frametime / dist;
-                               VectorMA(e->velocity, dist, diff, e->velocity);
-                       }
-               }
-       }
-}
-*/
 
 void R_MoveExplosions(void)
 {
        int i;
        float frametime;
-//     explosiongas_t *gaslist[MAX_EXPLOSIONGAS], **l, **end;
+
        frametime = cl.time - cl.oldtime;
-       /*
-       l = &gaslist[0];
-       for (i = 0;i < MAX_EXPLOSIONGAS;i++)
-       {
-               if (explosiongas[i].pressure > 0)
-               {
-                       explosiongas[i].pressure -= frametime * GASFADERATE;
-                       if (explosiongas[i].pressure > 0)
-                               *l++ = &explosiongas[i];
-               }
-       }
-       end = l;
-       for (l = gaslist;l < end;l++)
-               R_MoveExplosionGas(*l, gaslist, end, frametime);
-       */
 
        for (i = 0;i < MAX_EXPLOSIONS;i++)
                if (explosion[i].alpha > 0.01f)
-                       R_MoveExplosion(&explosion[i]/*, gaslist, end, */);
+                       R_MoveExplosion(&explosion[i]);
 }
 
 void R_DrawExplosions(void)
 {
        int i;
+
        if (!r_drawexplosions.integer)
                return;
        for (i = 0;i < MAX_EXPLOSIONS;i++)
                if (explosion[i].alpha > 0.01f)
                        R_DrawExplosion(&explosion[i]);
 }
+
index 83c2b43..fe8f249 100644 (file)
@@ -155,6 +155,5 @@ void R_LerpAnimation(entity_render_t *r)
                        FRAMEBLENDINSERT
                }
        }
-       //Con_Printf("Lerp: %i:%f %i:%f %i:%f %i:%f\n", blend[0].frame, blend[0].lerp, blend[1].frame, blend[1].lerp, blend[2].frame, blend[2].lerp, blend[3].frame, blend[3].lerp);
 }
 
index c8984b7..7dd9076 100644 (file)
--- a/r_light.c
+++ b/r_light.c
@@ -27,7 +27,6 @@ int r_numdlights = 0;
 
 cvar_t r_lightmodels = {CVAR_SAVE, "r_lightmodels", "1"};
 cvar_t r_vismarklights = {0, "r_vismarklights", "1"};
-//cvar_t r_lightmodelhardness = {CVAR_SAVE, "r_lightmodelhardness", "1"};
 
 static rtexture_t *lightcorona;
 static rtexturepool_t *lighttexturepool;
@@ -68,7 +67,6 @@ void r_light_newmap(void)
 void R_Light_Init(void)
 {
        Cvar_RegisterVariable(&r_lightmodels);
-       //Cvar_RegisterVariable(&r_lightmodelhardness);
        Cvar_RegisterVariable(&r_vismarklights);
        R_RegisterModule("R_Light", r_light_start, r_light_shutdown, r_light_newmap);
 }
@@ -174,7 +172,6 @@ void R_DrawCoronas(void)
                        if (CL_TraceLine(r_origin, diff, NULL, NULL, 0, true) == 1)
                        {
                                scale = 1.0f / 262144.0f;
-                               //scale = 64.0f / (DotProduct(diff,diff) + 1024.0f);
                                m.cr = rd->light[0] * scale;
                                m.cg = rd->light[1] * scale;
                                m.cb = rd->light[2] * scale;
@@ -295,65 +292,12 @@ loc0:
                if (dist2 > maxdist)
                        continue;
 
-
-               /*
-               d = DotProduct (impact, surf->texinfo->vecs[0]) + surf->texinfo->vecs[0][3] - surf->texturemins[0];
-
-               if (d < 0)
-               {
-                       dist2 += d * d;
-                       if (dist2 >= maxdist)
-                               continue;
-               }
-               else
-               {
-                       d -= surf->extents[0] + 16;
-                       if (d > 0)
-                       {
-                               dist2 += d * d;
-                               if (dist2 >= maxdist)
-                                       continue;
-                       }
-               }
-
-               d = DotProduct (impact, surf->texinfo->vecs[1]) + surf->texinfo->vecs[1][3] - surf->texturemins[1];
-
-               if (d < 0)
-               {
-                       dist2 += d * d;
-                       if (dist2 >= maxdist)
-                               continue;
-               }
-               else
-               {
-                       d -= surf->extents[1] + 16;
-                       if (d > 0)
-                       {
-                               dist2 += d * d;
-                               if (dist2 >= maxdist)
-                                       continue;
-                       }
-               }
-               */
-
                if (surf->dlightframe != r_framecount) // not dynamic until now
                {
                        surf->dlightbits[0] = surf->dlightbits[1] = surf->dlightbits[2] = surf->dlightbits[3] = surf->dlightbits[4] = surf->dlightbits[5] = surf->dlightbits[6] = surf->dlightbits[7] = 0;
                        surf->dlightframe = r_framecount;
                }
                surf->dlightbits[bitindex] |= bit;
-
-               /*
-               if (((surf->flags & SURF_PLANEBACK) == 0) == ((PlaneDist(lightorigin, surf->plane)) >= surf->plane->dist))
-               {
-                       if (surf->dlightframe != r_framecount) // not dynamic until now
-                       {
-                               surf->dlightbits[0] = surf->dlightbits[1] = surf->dlightbits[2] = surf->dlightbits[3] = surf->dlightbits[4] = surf->dlightbits[5] = surf->dlightbits[6] = surf->dlightbits[7] = 0;
-                               surf->dlightframe = r_framecount;
-                       }
-                       surf->dlightbits[bitindex] |= bit;
-               }
-               */
        }
 
        if (node->children[0]->contents >= 0)
@@ -377,15 +321,6 @@ loc0:
        }
 }
 
-/*
-static void R_NoVisMarkLights (rdlight_t *rd, int bit, int bitindex)
-{
-       vec3_t lightorigin;
-       softwareuntransform(rd->origin, lightorigin);
-
-       R_OldMarkLights(lightorigin, rd, bit, bitindex, currentrenderentity->model->nodes + currentrenderentity->model->hulls[0].firstclipnode);
-}
-*/
 
 static void R_VisMarkLights (rdlight_t *rd, int bit, int bitindex)
 {
@@ -494,45 +429,6 @@ static void R_VisMarkLights (rdlight_t *rd, int bit, int bitindex)
                                                                impact[1] = rd->origin[1] - surf->plane->normal[1] * dist;
                                                                impact[2] = rd->origin[2] - surf->plane->normal[2] * dist;
 
-#if 0
-                                                               d = DotProduct (impact, surf->texinfo->vecs[0]) + surf->texinfo->vecs[0][3] - surf->texturemins[0];
-                                                               if (d < 0)
-                                                               {
-                                                                       dist2 += d * d;
-                                                                       if (dist2 > maxdist)
-                                                                               continue;
-                                                               }
-                                                               else
-                                                               {
-                                                                       d -= surf->extents[0];
-                                                                       if (d < 0)
-                                                                       {
-                                                                               dist2 += d * d;
-                                                                               if (dist2 > maxdist)
-                                                                                       continue;
-                                                                       }
-                                                               }
-
-                                                               d = DotProduct (impact, surf->texinfo->vecs[1]) + surf->texinfo->vecs[1][3] - surf->texturemins[1];
-                                                               if (d < 0)
-                                                               {
-                                                                       dist2 += d * d;
-                                                                       if (dist2 > maxdist)
-                                                                               continue;
-                                                               }
-                                                               else
-                                                               {
-                                                                       d -= surf->extents[1];
-                                                                       if (d < 0)
-                                                                       {
-                                                                               dist2 += d * d;
-                                                                               if (dist2 > maxdist)
-                                                                                       continue;
-                                                                       }
-                                                               }
-
-#else
-
                                                                impacts = DotProduct (impact, surf->texinfo->vecs[0]) + surf->texinfo->vecs[0][3] - surf->texturemins[0];
                                                                d = bound(0, impacts, surf->extents[0] + 16) - impacts;
                                                                dist2 += d * d;
@@ -545,8 +441,6 @@ static void R_VisMarkLights (rdlight_t *rd, int bit, int bitindex)
                                                                if (dist2 > maxdist)
                                                                        continue;
 
-#endif
-
                                                                if (surf->dlightframe != r_framecount) // not dynamic until now
                                                                {
                                                                        surf->dlightbits[0] = surf->dlightbits[1] = surf->dlightbits[2] = surf->dlightbits[3] = surf->dlightbits[4] = surf->dlightbits[5] = surf->dlightbits[6] = surf->dlightbits[7] = 0;
@@ -608,11 +502,6 @@ loc0:
                        goto loc0;
                }
                // found an intersection
-//             mid = startz + (endz - startz) * (startz - node->plane->dist) / (startz - endz);
-//             mid = startz + distz * (startz - node->plane->dist) / (-distz);
-//             mid = startz + (-(startz - node->plane->dist));
-//             mid = startz - (startz - node->plane->dist);
-//             mid = startz + node->plane->dist - startz;
                mid = node->plane->dist;
                break;
        default:
@@ -626,8 +515,6 @@ loc0:
                        goto loc0;
                }
                // found an intersection
-//             mid = startz + (endz - startz) * ((front - node->plane->dist) / ((front - node->plane->dist) - (back - node->plane->dist)));
-//             mid = startz + (endz - startz) * ((front - node->plane->dist) / (front - back));
                mid = startz + distz * (front - node->plane->dist) / (front - back);
                break;
        }
@@ -680,33 +567,38 @@ loc0:
                                                lightmap += size3;
                                        }
 
-                                       /*
-                                       // LordHavoc: here's the readable version of the interpolation
-                                       // code, not quite as easy for the compiler to optimize...
-
-                                       // dsfrac is the X position in the lightmap pixel, * 16
-                                       // dtfrac is the Y position in the lightmap pixel, * 16
-                                       // r00 is top left corner, r01 is top right corner
-                                       // r10 is bottom left corner, r11 is bottom right corner
-                                       // g and b are the same layout.
-                                       // r0 and r1 are the top and bottom intermediate results
-
-                                       // first we interpolate the top two points, to get the top
-                                       // edge sample
-                                       r0 = (((r01-r00) * dsfrac) >> 4) + r00;
-                                       g0 = (((g01-g00) * dsfrac) >> 4) + g00;
-                                       b0 = (((b01-b00) * dsfrac) >> 4) + b00;
-                                       // then we interpolate the bottom two points, to get the
-                                       // bottom edge sample
-                                       r1 = (((r11-r10) * dsfrac) >> 4) + r10;
-                                       g1 = (((g11-g10) * dsfrac) >> 4) + g10;
-                                       b1 = (((b11-b10) * dsfrac) >> 4) + b10;
-                                       // then we interpolate the top and bottom samples to get the
-                                       // middle sample (the one which was requested)
-                                       r = (((r1-r0) * dtfrac) >> 4) + r0;
-                                       g = (((g1-g0) * dtfrac) >> 4) + g0;
-                                       b = (((b1-b0) * dtfrac) >> 4) + b0;
-                                       */
+/*
+LordHavoc: here's the readable version of the interpolation
+code, not quite as easy for the compiler to optimize...
+
+dsfrac is the X position in the lightmap pixel, * 16
+dtfrac is the Y position in the lightmap pixel, * 16
+r00 is top left corner, r01 is top right corner
+r10 is bottom left corner, r11 is bottom right corner
+g and b are the same layout.
+r0 and r1 are the top and bottom intermediate results
+
+first we interpolate the top two points, to get the top
+edge sample
+
+       r0 = (((r01-r00) * dsfrac) >> 4) + r00;
+       g0 = (((g01-g00) * dsfrac) >> 4) + g00;
+       b0 = (((b01-b00) * dsfrac) >> 4) + b00;
+
+then we interpolate the bottom two points, to get the
+bottom edge sample
+
+       r1 = (((r11-r10) * dsfrac) >> 4) + r10;
+       g1 = (((g11-g10) * dsfrac) >> 4) + g10;
+       b1 = (((b11-b10) * dsfrac) >> 4) + b10;
+
+then we interpolate the top and bottom samples to get the
+middle sample (the one which was requested)
+
+       r = (((r1-r0) * dtfrac) >> 4) + r0;
+       g = (((g1-g0) * dtfrac) >> 4) + g0;
+       b = (((b1-b0) * dtfrac) >> 4) + b0;
+*/
 
                                        color[0] += (float) ((((((((r11-r10) * dsfrac) >> 4) + r10)-((((r01-r00) * dsfrac) >> 4) + r00)) * dtfrac) >> 4) + ((((r01-r00) * dsfrac) >> 4) + r00)) * (1.0f / 32768.0f);
                                        color[1] += (float) ((((((((g11-g10) * dsfrac) >> 4) + g10)-((((g01-g00) * dsfrac) >> 4) + g00)) * dtfrac) >> 4) + ((((g01-g00) * dsfrac) >> 4) + g00)) * (1.0f / 32768.0f);
@@ -721,7 +613,6 @@ loc0:
                startz = mid;
                distz = endz - startz;
                goto loc0;
-//             return RecursiveLightPoint (color, node->children[side ^ 1], x, y, mid, endz);
        }
 }
 
@@ -833,7 +724,7 @@ void R_ModelLightPoint (vec3_t color, vec3_t p, int *dlightbits)
 void R_LightModel(int numverts, float colorr, float colorg, float colorb, int worldcoords)
 {
        int i, j, nearlights = 0;
-       float color[3], basecolor[3], v[3], t, *av, *avn, *avc, a, number, f/*, hardness, hardnessoffset*/, dist2;
+       float color[3], basecolor[3], v[3], t, *av, *avn, *avc, a, number, f, dist2;
        struct
        {
                vec3_t origin;
@@ -845,7 +736,6 @@ void R_LightModel(int numverts, float colorr, float colorg, float colorb, int wo
        }
        nearlight[MAX_DLIGHTS], *nl;
        int modeldlightbits[8];
-       //staticlight_t *sl;
        mlight_t *sl;
        a = currentrenderentity->alpha;
        if (currentrenderentity->effects & EF_FULLBRIGHT)
@@ -861,29 +751,6 @@ void R_LightModel(int numverts, float colorr, float colorg, float colorb, int wo
                        R_ModelLightPoint(basecolor, currentrenderentity->origin, modeldlightbits);
 
                        nl = &nearlight[0];
-                       /*
-                       // this code is unused for now
-                       for (i = 0, sl = staticlight;i < staticlights && nearlights < MAX_DLIGHTS;i++, sl++)
-                       {
-                               if (TraceLine(currentrenderentity->origin, sl->origin, NULL, NULL, 0) == 1)
-                               {
-                                       nl->fadetype = sl->fadetype;
-                                       nl->distancescale = sl->distancescale;
-                                       nl->radius = sl->radius;
-                                       // transform the light into the model's coordinate system
-                                       if (worldcoords)
-                                               VectorCopy(sl->origin, nl->origin);
-                                       else
-                                               softwareuntransform(sl->origin, nl->origin);
-                                       VectorCopy(sl->color, nl->light);
-                                       nl->cullradius2 = 99999999;
-                                       nl->lightsubtract = 0;
-                                       nl++;
-                                       nearlights++;
-                               }
-                       }
-                       */
-                       // this code is unused for now
                        for (i = 0, sl = cl.worldmodel->lights;i < cl.worldmodel->numlights && nearlights < MAX_DLIGHTS;i++, sl++)
                        {
                                if (CL_TraceLine(currentrenderentity->origin, sl->origin, NULL, NULL, 0, false) == 1)
@@ -915,23 +782,19 @@ void R_LightModel(int numverts, float colorr, float colorg, float colorb, int wo
                                }
                                else
                                {
-                                       // convert 0-255 radius coloring to 0-1, while also amplifying the brightness by 16
-                                       //if (TraceLine(currentrenderentity->origin, r_dlight[i].origin, NULL, NULL, 0) == 1)
-                                       {
-                                               // transform the light into the model's coordinate system
-                                               if (worldcoords)
-                                                       VectorCopy(r_dlight[i].origin, nl->origin);
-                                               else
-                                                       softwareuntransform(r_dlight[i].origin, nl->origin);
-                                               nl->cullradius2 = r_dlight[i].cullradius2;
-                                               nl->light[0] = r_dlight[i].light[0] * colorr;
-                                               nl->light[1] = r_dlight[i].light[1] * colorg;
-                                               nl->light[2] = r_dlight[i].light[2] * colorb;
-                                               nl->lightsubtract = r_dlight[i].lightsubtract;
-                                               nl->offset = LIGHTOFFSET;
-                                               nl++;
-                                               nearlights++;
-                                       }
+                                       // transform the light into the model's coordinate system
+                                       if (worldcoords)
+                                               VectorCopy(r_dlight[i].origin, nl->origin);
+                                       else
+                                               softwareuntransform(r_dlight[i].origin, nl->origin);
+                                       nl->cullradius2 = r_dlight[i].cullradius2;
+                                       nl->light[0] = r_dlight[i].light[0] * colorr;
+                                       nl->light[1] = r_dlight[i].light[1] * colorg;
+                                       nl->light[2] = r_dlight[i].light[2] * colorb;
+                                       nl->lightsubtract = r_dlight[i].lightsubtract;
+                                       nl->offset = LIGHTOFFSET;
+                                       nl++;
+                                       nearlights++;
                                }
                        }
                }
@@ -946,8 +809,6 @@ void R_LightModel(int numverts, float colorr, float colorg, float colorb, int wo
        {
                av = aliasvert;
                avn = aliasvertnorm;
-               //hardness = r_lightmodelhardness.value;
-               //hardnessoffset = (1.0f - hardness);
                for (i = 0;i < numverts;i++)
                {
                        VectorCopy(basecolor, color);
@@ -962,13 +823,13 @@ void R_LightModel(int numverts, float colorr, float colorg, float colorb, int wo
                                        if (f > 0)
                                        {
                                                // directional shading
-                                               #if SLOWMATH
+#if SLOWMATH
                                                t = 1.0f / sqrt(dist2);
-                                               #else
+#else
                                                number = DotProduct(v, v);
                                                *((int *)&t) = 0x5f3759df - ((* (int *) &number) >> 1);
                                                t = t * (1.5f - (number * 0.5f * t * t));
-                                               #endif
+#endif
                                                // DotProduct(avn,v) * t is dotproduct with a normalized v,
                                                // the hardness variables are for backlighting/shinyness
                                                f *= DotProduct(avn,v) * t;// * hardness + hardnessoffset;
@@ -995,3 +856,4 @@ void R_LightModel(int numverts, float colorr, float colorg, float colorb, int wo
                }
        }
 }
+
index f9ce950..a4e046e 100644 (file)
@@ -90,3 +90,4 @@ void R_Modules_NewMap(void)
                rendermodule[i].newmap();
        }
 }
+
diff --git a/r_sky.c b/r_sky.c
index 4d47113..deec343 100644 (file)
--- a/r_sky.c
+++ b/r_sky.c
@@ -1,3 +1,4 @@
+
 #include "quakedef.h"
 
 void LoadSky_f(void);
@@ -416,15 +417,6 @@ void R_InitSky (qbyte *src, int bytesperpixel)
        memcpy(skyupperlayerpixels, trans, 128*128*4);
 
        solidskytexture = R_LoadTexture (skytexturepool, "sky_solidtexture", 128, 128, (qbyte *) trans, TEXTYPE_RGBA, TEXF_PRECACHE);
-       /*
-       for (i = 0;i < 128*128;i++)
-       {
-               ((qbyte *)&trans[i])[0] >>= 1;
-               ((qbyte *)&trans[i])[1] >>= 1;
-               ((qbyte *)&trans[i])[2] >>= 1;
-       }
-       solidskytexture_half = R_LoadTexture (skytexturepool, "sky_solidtexture_half", 128, 128, (qbyte *) trans, TEXTYPE_RGBA, TEXF_PRECACHE);
-       */
 
        if (bytesperpixel == 4)
        {
@@ -450,13 +442,5 @@ void R_InitSky (qbyte *src, int bytesperpixel)
        memcpy(skylowerlayerpixels, trans, 128*128*4);
 
        alphaskytexture = R_LoadTexture (skytexturepool, "sky_alphatexture", 128, 128, (qbyte *) trans, TEXTYPE_RGBA, TEXF_ALPHA | TEXF_PRECACHE);
-       /*
-       for (i = 0;i < 128*128;i++)
-       {
-               ((qbyte *)&trans[i])[0] >>= 1;
-               ((qbyte *)&trans[i])[1] >>= 1;
-               ((qbyte *)&trans[i])[2] >>= 1;
-       }
-       alphaskytexture_half = R_LoadTexture (skytexturepool, "sky_alphatexture_half", 128, 128, (qbyte *) trans, TEXTYPE_RGBA, TEXF_ALPHA | TEXF_PRECACHE);
-       */
 }
+
index 741a913..37d870c 100644 (file)
@@ -1,6 +1,6 @@
+
 #include "quakedef.h"
 
-// LordHavoc: disabled lerping
 #define LERPSPRITES
 
 #ifdef LERPSPRITES
@@ -70,8 +70,6 @@ int R_SpriteSetup (int type, float org[3], float left[3], float up[3])
                VectorNegate(vpn, matrix3[0]);
                matrix3[0][2] = 0;
                VectorNormalizeFast(matrix3[0]);
-               //VectorVectors(matrix3[0], matrix3[1], matrix3[2]);
-               //VectorNegate(matrix3[1], matrix3[1]);
                matrix3[1][0] = matrix3[0][1];
                matrix3[1][1] = -matrix3[0][0];
                matrix3[1][2] = 0;
@@ -85,7 +83,6 @@ int R_SpriteSetup (int type, float org[3], float left[3], float up[3])
                VectorSubtract(currentrenderentity->origin, r_origin, matrix3[0]);
                matrix3[0][2] = 0;
                VectorNormalizeFast(matrix3[0]);
-               //VectorVectors(matrix3[0], matrix3[1], matrix3[2]);
                matrix3[1][0] = matrix3[0][1];
                matrix3[1][1] = -matrix3[0][0];
                matrix3[1][2] = 0;
@@ -122,10 +119,6 @@ int R_SpriteSetup (int type, float org[3], float left[3], float up[3])
                break;
        }
 
-       // don't draw if view origin is behind it
-       //if (DotProduct(org, matrix3[0]) < (DotProduct(r_origin, matrix3[0]) - 1.0f))
-       //      return true;
-
        if (currentrenderentity->scale != 1)
        {
                VectorScale(matrix3[1], currentrenderentity->scale, left);
@@ -265,3 +258,4 @@ void R_DrawSpriteModel ()
                GL_DrawSpriteImage(true, frame, R_GetTexture(frame->fogtexture), org, up, left, fogcolor[0],fogcolor[1],fogcolor[2], fog * currentrenderentity->alpha);
 #endif
 }
+
diff --git a/sbar.c b/sbar.c
index 9e1deae..2c988ed 100644 (file)
--- a/sbar.c
+++ b/sbar.c
@@ -406,7 +406,6 @@ void Sbar_UpdateScoreboard (void)
 }
 
 
-
 /*
 ===============
 Sbar_SoloScoreboard
@@ -1061,3 +1060,4 @@ void Sbar_FinaleOverlay (void)
        pic = Draw_CachePic ("gfx/finale.lmp");
        DrawQ_Pic((vid.conwidth - pic->width)/2, 16, "gfx/finale.lmp", 0, 0, 1, 1, 1, 1, 0);
 }
+
index 86b9e10..33283a4 100644 (file)
--- a/screen.h
+++ b/screen.h
@@ -27,7 +27,6 @@ void CL_UpdateScreen (void);
 void SCR_CenterPrint (char *str);
 
 void SCR_BeginLoadingPlaque (void);
-void SCR_EndLoadingPlaque (void);
 
 extern float scr_con_current;
 extern float scr_conlines; // lines of console to display
index ba04b5b..9f9c850 100644 (file)
@@ -214,9 +214,6 @@ qboolean SNDDMA_Init(void)
                frag_size/=2;
        }
 
-//     err_msg="audio flush";
-//     if ((rc=snd_pcm_channel_flush(pcm_handle, SND_PCM_CHANNEL_PLAYBACK))<0)
-//             goto error;
        err_msg="audio munmap";
        if ((rc=snd_pcm_munmap(pcm_handle, SND_PCM_CHANNEL_PLAYBACK))<0)
                goto error;
@@ -233,9 +230,6 @@ qboolean SNDDMA_Init(void)
        params.buf.block.frag_size=frag_size;
        params.buf.block.frags_min=1;
        params.buf.block.frags_max=-1;
-//     err_msg="audio flush";
-//     if ((rc=snd_pcm_channel_flush(pcm_handle, SND_PCM_CHANNEL_PLAYBACK))<0)
-//             goto error;
        err_msg="audio params";
        if ((rc=snd_pcm_channel_params(pcm_handle, &params))<0)
                goto error;
index 3817ea4..85e7f13 100644 (file)
--- a/snd_dma.c
+++ b/snd_dma.c
@@ -71,7 +71,6 @@ cvar_t volume = {CVAR_SAVE, "volume", "0.7"};
 
 cvar_t nosound = {0, "nosound", "0"};
 cvar_t precache = {0, "precache", "1"};
-//cvar_t loadas8bit = {0, "loadas8bit", "0"};
 cvar_t bgmbuffer = {0, "bgmbuffer", "4096"};
 cvar_t ambient_level = {0, "ambient_level", "0.3"};
 cvar_t ambient_fade = {0, "ambient_fade", "100"};
@@ -189,7 +188,6 @@ void S_Init (void)
 
        Cvar_RegisterVariable(&nosound);
        Cvar_RegisterVariable(&precache);
-//     Cvar_RegisterVariable(&loadas8bit);
        Cvar_RegisterVariable(&bgmbuffer);
        Cvar_RegisterVariable(&ambient_level);
        Cvar_RegisterVariable(&ambient_fade);
@@ -198,16 +196,6 @@ void S_Init (void)
        Cvar_RegisterVariable(&_snd_mixahead);
        Cvar_RegisterVariable(&snd_swapstereo); // LordHavoc: for people with backwards sound wiring
 
-       /*
-       if (host_parms.memsize < 0x800000)
-       {
-               Cvar_Set ("loadas8bit", "1");
-               Con_Printf ("loading all sounds as 8bit\n");
-       }
-       */
-
-
-
        snd_initialized = true;
 
        known_sfx = Mem_Alloc(snd_mempool, MAX_SFX*sizeof(sfx_t));
@@ -241,9 +229,6 @@ void S_Init (void)
 
        // provides a tick sound until washed clean
 
-//     if (shm->buffer)
-//             shm->buffer[4] = shm->buffer[5] = 0x7f; // force a pop for debugging
-
        ambient_sfx[AMBIENT_WATER] = S_PrecacheSound ("ambience/water1.wav");
        ambient_sfx[AMBIENT_SKY] = S_PrecacheSound ("ambience/wind2.wav");
 
@@ -798,8 +783,6 @@ void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
                                continue;
                        }
                }
-
-
        }
 
 //
@@ -811,10 +794,7 @@ void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
                ch = channels;
                for (i=0 ; i<total_channels; i++, ch++)
                        if (ch->sfx && (ch->leftvol || ch->rightvol) )
-                       {
-                               //Con_Printf ("%3i %3i %s\n", ch->leftvol, ch->rightvol, ch->sfx->name);
                                total++;
-                       }
 
                Con_Printf ("----(%i)----\n", total);
        }
@@ -884,10 +864,7 @@ void S_Update_(void)
 
 // check to make sure that we haven't overshot
        if (paintedtime < soundtime)
-       {
-               //Con_Printf ("S_Update_ : overflow\n");
                paintedtime = soundtime;
-       }
 
 // mix ahead of current position
        endtime = soundtime + _snd_mixahead.value * shm->speed;
index