]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
remove some more dead code
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 19 Apr 2012 20:27:53 +0000 (20:27 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 19 Apr 2012 20:30:46 +0000 (22:30 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11805 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=6f1a935ecaf044b18f487094317fcef26a467316

18 files changed:
cl_collision.c
cl_parse.c
cl_screen.c
common.c
csprogs.c
dpsoftrast.c
ft2.c
gl_backend.c
gl_draw.c
gl_rmain.c
host.c
image.c
model_alias.c
model_brush.c
model_shared.c
protocol.c
r_shadow.c
snd_mix.c

index bee473b2a2515ee0db5a3f84b89209fb434fe0cd..05b1a799dc0eb592b4d62d55c7a16993e56b713c 100644 (file)
@@ -94,7 +94,7 @@ float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, ve
                }
        }
        maxfrac = bound(0, maxfrac, 1);
                }
        }
        maxfrac = bound(0, maxfrac, 1);
-       maxrealfrac = bound(0, maxrealfrac, 1);
+       //maxrealfrac = bound(0, maxrealfrac, 1);
        //if (maxfrac < 0 || maxfrac > 1) Con_Printf("fraction out of bounds %f %s:%d\n", maxfrac, __FILE__, __LINE__);
        if (impact)
                VectorLerp(start, maxfrac, end, impact);
        //if (maxfrac < 0 || maxfrac > 1) Con_Printf("fraction out of bounds %f %s:%d\n", maxfrac, __FILE__, __LINE__);
        if (impact)
                VectorLerp(start, maxfrac, end, impact);
index 9e414372afeba4ea282a2578d5baec6c2d157c5e..4b8da407dde50a251f9bb95cd3d33e975c8287ba 100644 (file)
@@ -3664,7 +3664,7 @@ void CL_ParseServerMessage(void)
                                break;
 
                        case qw_svc_chokecount:
                                break;
 
                        case qw_svc_chokecount:
-                               i = MSG_ReadByte(&cl_message);
+                               (void) MSG_ReadByte(&cl_message);
                                // FIXME: apply to netgraph
                                //for (j = 0;j < i;j++)
                                //      cl.frames[(cls.netcon->qw.incoming_acknowledged-1-j)&QW_UPDATE_MASK].receivedtime = -2;
                                // FIXME: apply to netgraph
                                //for (j = 0;j < i;j++)
                                //      cl.frames[(cls.netcon->qw.incoming_acknowledged-1-j)&QW_UPDATE_MASK].receivedtime = -2;
index f1ae56690bc8dac6392aac19e08c7f93dfa67e9e..0989a4b1f0454619cae985837c789cae3d51ee63 100644 (file)
@@ -236,9 +236,6 @@ static void SCR_DrawNetGraph_DrawGraph (int graphx, int graphy, int graphwidth,
        float *c;
        DrawQ_Fill(graphx, graphy, graphwidth, graphheight + textsize * 2, 0, 0, 0, 0.5, 0);
        // draw the bar graph itself
        float *c;
        DrawQ_Fill(graphx, graphy, graphwidth, graphheight + textsize * 2, 0, 0, 0, 0.5, 0);
        // draw the bar graph itself
-       // advance the packet counter because it is the latest packet column being
-       // built up and should come last
-       packetcounter = (packetcounter + 1) % NETGRAPH_PACKETS;
        memset(g, 0, sizeof(g));
        for (j = 0;j < NETGRAPH_PACKETS;j++)
        {
        memset(g, 0, sizeof(g));
        for (j = 0;j < NETGRAPH_PACKETS;j++)
        {
index 7440cc6ccfc1d996507d527f3a338c5265e89cf1..3c34b7e5b69a285c59c83b1b0d704cb1de04f2e8 100644 (file)
--- a/common.c
+++ b/common.c
@@ -742,7 +742,6 @@ int COM_Wordwrap(const char *string, size_t length, float continuationWidth, flo
                {
                        case 0: // end of string
                                result += processLine(passthroughPL, startOfLine, cursor - startOfLine, spaceUsedInLine, isContinuation);
                {
                        case 0: // end of string
                                result += processLine(passthroughPL, startOfLine, cursor - startOfLine, spaceUsedInLine, isContinuation);
-                               isContinuation = false;
                                goto out;
                        case '\n': // end of line
                                result += processLine(passthroughPL, startOfLine, cursor - startOfLine, spaceUsedInLine, isContinuation);
                                goto out;
                        case '\n': // end of line
                                result += processLine(passthroughPL, startOfLine, cursor - startOfLine, spaceUsedInLine, isContinuation);
index ff6a0a1153ec0f5c03607c11516173eac29291da..45cb9551060e589b93cf7758a57d75b28355cec5 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -1000,7 +1000,6 @@ void CL_VM_Init (void)
                return;
 
        // see if the requested csprogs.dat file matches the requested crc
                return;
 
        // see if the requested csprogs.dat file matches the requested crc
-       csprogsdatacrc = -1;
        if (!cls.demoplayback || csqc_usedemoprogs.integer)
        {
                csprogsfn = va(vabuf, sizeof(vabuf), "dlcache/%s.%i.%i", csqc_progname.string, requiredsize, requiredcrc);
        if (!cls.demoplayback || csqc_usedemoprogs.integer)
        {
                csprogsfn = va(vabuf, sizeof(vabuf), "dlcache/%s.%i.%i", csqc_progname.string, requiredsize, requiredcrc);
index 754cf685ddfe84d3a02d7f63a5dfa44bf5350b20..b8262b4c505f5c3432eb776f9c6498d068801841 100644 (file)
@@ -617,9 +617,6 @@ int DPSOFTRAST_Texture_New(int flags, int width, int height, int depth)
        d = depth;
        size = 0;
        mipmaps = 0;
        d = depth;
        size = 0;
        mipmaps = 0;
-       w = width;
-       h = height;
-       d = depth;
        for (;;)
        {
                s = w * h * d * sides * 4;
        for (;;)
        {
                s = w * h * d * sides * 4;
@@ -4050,7 +4047,7 @@ void DPSOFTRAST_PixelShader_LightDirection(DPSOFTRAST_State_Thread *thread, cons
        {
                for (x = startx;x < endx;x++)
                {
        {
                for (x = startx;x < endx;x++)
                {
-                       z = buffer_z[x];
+                       // z = buffer_z[x];
                        diffusetex[0] = buffer_texture_colorbgra8[x*4+0];
                        diffusetex[1] = buffer_texture_colorbgra8[x*4+1];
                        diffusetex[2] = buffer_texture_colorbgra8[x*4+2];
                        diffusetex[0] = buffer_texture_colorbgra8[x*4+0];
                        diffusetex[1] = buffer_texture_colorbgra8[x*4+1];
                        diffusetex[2] = buffer_texture_colorbgra8[x*4+2];
@@ -4587,7 +4584,7 @@ static void DPSOFTRAST_VertexShader_Water(void)
 static void DPSOFTRAST_PixelShader_Water(DPSOFTRAST_State_Thread *thread, const DPSOFTRAST_State_Triangle * RESTRICT triangle, const DPSOFTRAST_State_Span * RESTRICT span)
 {
        float buffer_z[DPSOFTRAST_DRAW_MAXSPANLENGTH];
 static void DPSOFTRAST_PixelShader_Water(DPSOFTRAST_State_Thread *thread, const DPSOFTRAST_State_Triangle * RESTRICT triangle, const DPSOFTRAST_State_Span * RESTRICT span)
 {
        float buffer_z[DPSOFTRAST_DRAW_MAXSPANLENGTH];
-       float z;
+       // float z;
        int x, startx = span->startx, endx = span->endx;
 
        // texture reads
        int x, startx = span->startx, endx = span->endx;
 
        // texture reads
@@ -4656,7 +4653,7 @@ static void DPSOFTRAST_PixelShader_Water(DPSOFTRAST_State_Thread *thread, const
                unsigned char c2[4];
                float Fresnel;
 
                unsigned char c2[4];
                float Fresnel;
 
-               z = buffer_z[x];
+               // z = buffer_z[x];
 
                // "    vec4 ScreenScaleRefractReflectIW = ScreenScaleRefractReflect * (1.0 / ModelViewProjectionPosition.w);\n"
                iw = 1.0f / (ModelViewProjectionPositiondata[3] + ModelViewProjectionPositionslope[3]*x); // / z
 
                // "    vec4 ScreenScaleRefractReflectIW = ScreenScaleRefractReflect * (1.0 / ModelViewProjectionPosition.w);\n"
                iw = 1.0f / (ModelViewProjectionPositiondata[3] + ModelViewProjectionPositionslope[3]*x); // / z
@@ -4795,8 +4792,6 @@ static void DPSOFTRAST_Draw_DepthTest(DPSOFTRAST_State_Thread *thread, DPSOFTRAS
        int depthslope;
        unsigned int d;
        unsigned char *pixelmask;
        int depthslope;
        unsigned int d;
        unsigned char *pixelmask;
-       DPSOFTRAST_State_Triangle *triangle;
-       triangle = &thread->triangles[span->triangle];
        depthpixel = dpsoftrast.fb_depthpixels + span->y * dpsoftrast.fb_width + span->x;
        startx = span->startx;
        endx = span->endx;
        depthpixel = dpsoftrast.fb_depthpixels + span->y * dpsoftrast.fb_width + span->x;
        startx = span->startx;
        endx = span->endx;
diff --git a/ft2.c b/ft2.c
index 12e889057c8c821b09c75f4e96de6f032eec761e..f55d0e220d5411e4fb789277317b7bcfb9f8a247 100644 (file)
--- a/ft2.c
+++ b/ft2.c
@@ -583,7 +583,7 @@ static qboolean Font_LoadFile(const char *name, int _face, ft2_settings_t *setti
        {
                Con_Printf("Failed to load face %i of %s. Falling back to face 0\n", _face, name);
                _face = 0;
        {
                Con_Printf("Failed to load face %i of %s. Falling back to face 0\n", _face, name);
                _face = 0;
-               status = qFT_New_Memory_Face(font_ft2lib, (FT_Bytes)data, datasize, 0, (FT_Face*)&font->face);
+               status = qFT_New_Memory_Face(font_ft2lib, (FT_Bytes)data, datasize, _face, (FT_Face*)&font->face);
        }
        font->data = data;
        if (status)
        }
        font->data = data;
        if (status)
index fefedcb37402264b7905d670225ee3d04d9f69e3..bb20a109a8b92ccc97a25d159cf4930f10bb6b93 100644 (file)
@@ -706,8 +706,6 @@ qboolean R_ScissorForBBox(const float *mins, const float *maxs, int *scissor)
        if (BoxesOverlap(r_refdef.view.origin, r_refdef.view.origin, mins, maxs))
                return false;
 
        if (BoxesOverlap(r_refdef.view.origin, r_refdef.view.origin, mins, maxs))
                return false;
 
-       x1 = y1 = x2 = y2 = 0;
-
        // transform all corners that are infront of the nearclip plane
        VectorNegate(r_refdef.view.frustum[4].normal, plane4f);
        plane4f[3] = r_refdef.view.frustum[4].dist;
        // transform all corners that are infront of the nearclip plane
        VectorNegate(r_refdef.view.frustum[4].normal, plane4f);
        plane4f[3] = r_refdef.view.frustum[4].dist;
index 17213e566db0be1d09e6ca02d42d9e59f1cf59f2..dab25100246b0f597060a34a5bce785b99aa4853 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -1387,7 +1387,8 @@ float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *max
        else
                width_of = fnt->width_of;
 
        else
                width_of = fnt->width_of;
 
-       for (i = 0;((bytes_left = *maxlen - (text - text_start)) > 0) && *text;)
+       i = 0;
+       while (((bytes_left = *maxlen - (text - text_start)) > 0) && *text)
        {
                size_t i0 = i;
                nextch = ch = u8_getnchar(text, &text, bytes_left);
        {
                size_t i0 = i;
                nextch = ch = u8_getnchar(text, &text, bytes_left);
@@ -1616,7 +1617,7 @@ float DrawQ_String_Scale(float startx, float starty, const char *text, size_t ma
                        y += r_textshadow.value * vid.height / vid_conheight.value;
                }
                */
                        y += r_textshadow.value * vid.height / vid_conheight.value;
                }
                */
-               for (i = 0;((bytes_left = maxlen - (text - text_start)) > 0) && *text;)
+               while (((bytes_left = maxlen - (text - text_start)) > 0) && *text)
                {
                        nextch = ch = u8_getnchar(text, &text, bytes_left);
                        i = text - text_start;
                {
                        nextch = ch = u8_getnchar(text, &text, bytes_left);
                        i = text - text_start;
index 13660bfe94f6e2a49bd3be21ce4ede288d6123b7..ddf6e83bd70ea4c7d724a9df3df708326f99d568 100644 (file)
@@ -9496,7 +9496,6 @@ static void RSurf_DrawBatch_GL11_ApplyFog(void)
        if (rsurface.passcolor4f)
        {
                // generate color arrays
        if (rsurface.passcolor4f)
        {
                // generate color arrays
-               c = rsurface.passcolor4f + rsurface.batchfirstvertex * 4;
                rsurface.passcolor4f = (float *)R_FrameData_Alloc(rsurface.batchnumvertices * sizeof(float[4]));
                rsurface.passcolor4f_vertexbuffer = 0;
                rsurface.passcolor4f_bufferoffset = 0;
                rsurface.passcolor4f = (float *)R_FrameData_Alloc(rsurface.batchnumvertices * sizeof(float[4]));
                rsurface.passcolor4f_vertexbuffer = 0;
                rsurface.passcolor4f_bufferoffset = 0;
@@ -11191,7 +11190,6 @@ static void R_DrawModelDecals_FadeEntity(entity_render_t *ent)
        else
                frametime = 0;
        decalsystem->lastupdatetime = r_refdef.scene.time;
        else
                frametime = 0;
        decalsystem->lastupdatetime = r_refdef.scene.time;
-       decal = decalsystem->decals;
        numdecals = decalsystem->numdecals;
 
        for (i = 0, decal = decalsystem->decals;i < numdecals;i++, decal++)
        numdecals = decalsystem->numdecals;
 
        for (i = 0, decal = decalsystem->decals;i < numdecals;i++, decal++)
@@ -11268,7 +11266,6 @@ static void R_DrawModelDecals_Entity(entity_render_t *ent)
                RSurf_ActiveModelEntity(ent, false, false, false);
 
        decalsystem->lastupdatetime = r_refdef.scene.time;
                RSurf_ActiveModelEntity(ent, false, false, false);
 
        decalsystem->lastupdatetime = r_refdef.scene.time;
-       decal = decalsystem->decals;
 
        faderate = 1.0f / max(0.001f, cl_decals_fadetime.value);
 
 
        faderate = 1.0f / max(0.001f, cl_decals_fadetime.value);
 
diff --git a/host.c b/host.c
index 9b717993a938187a989c26f5f98585c2a2c66df3..ef7ee4081e2f2baed8e0f196583077c41d682667 100644 (file)
--- a/host.c
+++ b/host.c
@@ -672,7 +672,6 @@ void Host_Main(void)
        Host_Init();
 
        realtime = 0;
        Host_Init();
 
        realtime = 0;
-       dirtytime = Sys_DirtyTime();
        for (;;)
        {
                if (setjmp(host_abortframe))
        for (;;)
        {
                if (setjmp(host_abortframe))
diff --git a/image.c b/image.c
index 4f85e83e43281148ab1be7af31913e56ce77f888..366e80dd8380c16211b0e2f617f074846127b0c8 100644 (file)
--- a/image.c
+++ b/image.c
@@ -537,8 +537,6 @@ unsigned char *LoadTGA_BGRA (const unsigned char *f, int filesize, int *miplevel
                row_inci = 0;
        }
 
                row_inci = 0;
        }
 
-       x = 0;
-       y = 0;
        pix_inc = 1;
        if ((targa_header.image_type & ~8) == 2)
                pix_inc = (targa_header.pixel_size + 7) / 8;
        pix_inc = 1;
        if ((targa_header.image_type & ~8) == 2)
                pix_inc = (targa_header.pixel_size + 7) / 8;
index 6c212aa5339f298ce3a128daa6276e8e50ef4a3c..ada6604d9f3807fcee35ba11fef3ad37a7a07032 100644 (file)
@@ -781,7 +781,6 @@ static void Mod_MDL_LoadFrames (unsigned char* datapointer, int inverts, int *ve
                // read frames
                for (i = 0;i < groupframes;i++)
                {
                // read frames
                for (i = 0;i < groupframes;i++)
                {
-                       pinframe = (daliasframe_t *)datapointer;
                        datapointer += sizeof(daliasframe_t);
                        Mod_ConvertAliasVerts(inverts, (trivertx_t *)datapointer, loadmodel->surfmesh.data_morphmdlvertex + pose * loadmodel->surfmesh.num_vertices, vertremap);
                        datapointer += sizeof(trivertx_t) * inverts;
                        datapointer += sizeof(daliasframe_t);
                        Mod_ConvertAliasVerts(inverts, (trivertx_t *)datapointer, loadmodel->surfmesh.data_morphmdlvertex + pose * loadmodel->surfmesh.num_vertices, vertremap);
                        datapointer += sizeof(trivertx_t) * inverts;
index 23fa6d48504e31372ab7e6d607d59acf91380ca6..7a15c8acb0ec29d6f823e1e579f2b3ce2a182d58 100644 (file)
@@ -3467,7 +3467,7 @@ static void Mod_Q1BSP_RecursiveNodePortals(mnode_t *node)
        // TODO: calculate node bounding boxes during recursion and calculate a maximum plane size accordingly to improve precision (as most maps do not need 1 billion unit plane polygons)
        PolygonD_QuadForPlane(nodeportal->points, nodeportal->plane.normal[0], nodeportal->plane.normal[1], nodeportal->plane.normal[2], nodeportal->plane.dist, 1024.0*1024.0*1024.0);
        nodeportal->numpoints = 4;
        // TODO: calculate node bounding boxes during recursion and calculate a maximum plane size accordingly to improve precision (as most maps do not need 1 billion unit plane polygons)
        PolygonD_QuadForPlane(nodeportal->points, nodeportal->plane.normal[0], nodeportal->plane.normal[1], nodeportal->plane.normal[2], nodeportal->plane.dist, 1024.0*1024.0*1024.0);
        nodeportal->numpoints = 4;
-       side = 0;       // shut up compiler warning
+       // side = 0;    // shut up compiler warning -> should be no longer needed, Host_Error is declared noreturn now
        for (portal = (portal_t *)node->portals;portal;portal = portal->next[side])
        {
                clipplane = portal->plane;
        for (portal = (portal_t *)node->portals;portal;portal = portal->next[side])
        {
                clipplane = portal->plane;
index d9948aeab8ba7d5e413b11ce616049ff063af5e8..5d06edc5b869c07527550d466025646f4b7b02be 100644 (file)
@@ -4367,7 +4367,6 @@ static void Mod_GenerateLightmaps_CreateLightmaps(dp_model_t *model)
        for (surfaceindex = 0;surfaceindex < model->num_surfaces;surfaceindex++)
        {
                surface = model->data_surfaces + surfaceindex;
        for (surfaceindex = 0;surfaceindex < model->num_surfaces;surfaceindex++)
        {
                surface = model->data_surfaces + surfaceindex;
-               e = model->surfmesh.data_element3i + surface->num_firsttriangle*3;
                if (!surface->num_triangles)
                        continue;
                lightmapindex = mod_generatelightmaps_lightmaptriangles[surface->num_firsttriangle].lightmapindex;
                if (!surface->num_triangles)
                        continue;
                lightmapindex = mod_generatelightmaps_lightmaptriangles[surface->num_firsttriangle].lightmapindex;
index 29999302e3b69f7fa170139b43956a10a43d5a2f..db2de2f08ec155ba4bce8a5ed7aa4af8c2a102ab 100644 (file)
@@ -3265,7 +3265,6 @@ void EntityFrameQW_CL_ReadFrame(qboolean delta)
        newsnapindex = cl.qw_validsequence & QW_UPDATE_MASK;
        newsnap = d->snapshot + newsnapindex;
        memset(newsnap, 0, sizeof(*newsnap));
        newsnapindex = cl.qw_validsequence & QW_UPDATE_MASK;
        newsnap = d->snapshot + newsnapindex;
        memset(newsnap, 0, sizeof(*newsnap));
-       oldsnapindex = -1;
        oldsnap = NULL;
        if (delta)
        {
        oldsnap = NULL;
        if (delta)
        {
index 71701fb52d75bc2dbd51c46ab5371905c94db2bb..d4cf86b71b7152fc24c51d10ff6cf030fda0f669 100644 (file)
@@ -5548,8 +5548,8 @@ void R_Shadow_LoadWorldLights(void)
                n = 0;
                while (*s)
                {
                n = 0;
                while (*s)
                {
-                       t = s;
                        /*
                        /*
+                       t = s;
                        shadow = true;
                        for (;COM_Parse(t, true) && strcmp(
                        if (COM_Parse(t, true))
                        shadow = true;
                        for (;COM_Parse(t, true) && strcmp(
                        if (COM_Parse(t, true))
index 29012cc0a3db9147dfc76c1717c20338a2094c00..2274f353ea5cdf6dc40915721de98d4a05d3b245 100644 (file)
--- a/snd_mix.c
+++ b/snd_mix.c
@@ -360,7 +360,6 @@ void S_MixToBuffer(void *stream, unsigned int bufferframes)
 
                        // do the actual paint now (may skip work if silent)
                        paint = paintbuffer;
 
                        // do the actual paint now (may skip work if silent)
                        paint = paintbuffer;
-                       wantframes = totalmixframes;
                        istartframe = 0;
                        for (wantframes = totalmixframes;wantframes > 0;posd += count * speedd, wantframes -= count)
                        {
                        istartframe = 0;
                        for (wantframes = totalmixframes;wantframes > 0;posd += count * speedd, wantframes -= count)
                        {