From: divverent Date: Thu, 19 Apr 2012 20:27:53 +0000 (+0000) Subject: remove some more dead code X-Git-Tag: xonotic-v0.7.0~148 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bca36f0405cd976d105a3a43542193ed81925247;p=xonotic%2Fdarkplaces.git remove some more dead code git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11805 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=6f1a935ecaf044b18f487094317fcef26a467316 --- diff --git a/cl_collision.c b/cl_collision.c index bee473b2..05b1a799 100644 --- a/cl_collision.c +++ b/cl_collision.c @@ -94,7 +94,7 @@ float CL_SelectTraceLine(const vec3_t start, const vec3_t end, vec3_t impact, ve } } 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); diff --git a/cl_parse.c b/cl_parse.c index 9e414372..4b8da407 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -3664,7 +3664,7 @@ void CL_ParseServerMessage(void) 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; diff --git a/cl_screen.c b/cl_screen.c index f1ae5669..0989a4b1 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -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 - // 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++) { diff --git a/common.c b/common.c index 7440cc6c..3c34b7e5 100644 --- 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); - isContinuation = false; goto out; case '\n': // end of line result += processLine(passthroughPL, startOfLine, cursor - startOfLine, spaceUsedInLine, isContinuation); diff --git a/csprogs.c b/csprogs.c index ff6a0a11..45cb9551 100644 --- 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 - csprogsdatacrc = -1; if (!cls.demoplayback || csqc_usedemoprogs.integer) { csprogsfn = va(vabuf, sizeof(vabuf), "dlcache/%s.%i.%i", csqc_progname.string, requiredsize, requiredcrc); diff --git a/dpsoftrast.c b/dpsoftrast.c index 754cf685..b8262b4c 100644 --- a/dpsoftrast.c +++ b/dpsoftrast.c @@ -617,9 +617,6 @@ int DPSOFTRAST_Texture_New(int flags, int width, int height, int depth) d = depth; size = 0; mipmaps = 0; - w = width; - h = height; - d = depth; 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++) { - 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]; @@ -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]; - float z; + // float z; 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; - 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 @@ -4795,8 +4792,6 @@ static void DPSOFTRAST_Draw_DepthTest(DPSOFTRAST_State_Thread *thread, DPSOFTRAS 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; diff --git a/ft2.c b/ft2.c index 12e88905..f55d0e22 100644 --- 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; - 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) diff --git a/gl_backend.c b/gl_backend.c index fefedcb3..bb20a109 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -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; - 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; diff --git a/gl_draw.c b/gl_draw.c index 17213e56..dab25100 100644 --- 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; - 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); @@ -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; } */ - 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; diff --git a/gl_rmain.c b/gl_rmain.c index 13660bfe..ddf6e83b 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -9496,7 +9496,6 @@ static void RSurf_DrawBatch_GL11_ApplyFog(void) 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; @@ -11191,7 +11190,6 @@ static void R_DrawModelDecals_FadeEntity(entity_render_t *ent) 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++) @@ -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; - decal = decalsystem->decals; faderate = 1.0f / max(0.001f, cl_decals_fadetime.value); diff --git a/host.c b/host.c index 9b717993..ef7ee408 100644 --- a/host.c +++ b/host.c @@ -672,7 +672,6 @@ void Host_Main(void) Host_Init(); realtime = 0; - dirtytime = Sys_DirtyTime(); for (;;) { if (setjmp(host_abortframe)) diff --git a/image.c b/image.c index 4f85e83e..366e80dd 100644 --- 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; } - x = 0; - y = 0; pix_inc = 1; if ((targa_header.image_type & ~8) == 2) pix_inc = (targa_header.pixel_size + 7) / 8; diff --git a/model_alias.c b/model_alias.c index 6c212aa5..ada6604d 100644 --- a/model_alias.c +++ b/model_alias.c @@ -781,7 +781,6 @@ static void Mod_MDL_LoadFrames (unsigned char* datapointer, int inverts, int *ve // 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; diff --git a/model_brush.c b/model_brush.c index 23fa6d48..7a15c8ac 100644 --- a/model_brush.c +++ b/model_brush.c @@ -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; - 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; diff --git a/model_shared.c b/model_shared.c index d9948aea..5d06edc5 100644 --- a/model_shared.c +++ b/model_shared.c @@ -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; - e = model->surfmesh.data_element3i + surface->num_firsttriangle*3; if (!surface->num_triangles) continue; lightmapindex = mod_generatelightmaps_lightmaptriangles[surface->num_firsttriangle].lightmapindex; diff --git a/protocol.c b/protocol.c index 29999302..db2de2f0 100644 --- a/protocol.c +++ b/protocol.c @@ -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)); - oldsnapindex = -1; oldsnap = NULL; if (delta) { diff --git a/r_shadow.c b/r_shadow.c index 71701fb5..d4cf86b7 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -5548,8 +5548,8 @@ void R_Shadow_LoadWorldLights(void) n = 0; while (*s) { - t = s; /* + t = s; shadow = true; for (;COM_Parse(t, true) && strcmp( if (COM_Parse(t, true)) diff --git a/snd_mix.c b/snd_mix.c index 29012cc0..2274f353 100644 --- 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; - wantframes = totalmixframes; istartframe = 0; for (wantframes = totalmixframes;wantframes > 0;posd += count * speedd, wantframes -= count) {