From 76e259b17603c4ab2c22bf7238c72847c5dbe505 Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 31 Jan 2010 23:27:11 +0000 Subject: [PATCH] fix more warnings git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9906 d7cf8633-e32d-0410-b094-e92efae38249 --- r_explosion.c | 20 ++++++++++---------- r_shadow.c | 26 ++++++++++++++++++-------- snd_mix.c | 4 ++-- sv_main.c | 6 ++++-- sv_phys.c | 10 ++++++++-- svbsp.c | 3 +-- svvm_cmds.c | 6 +++--- 7 files changed, 46 insertions(+), 29 deletions(-) diff --git a/r_explosion.c b/r_explosion.c index ecb83f17..031d6649 100644 --- a/r_explosion.c +++ b/r_explosion.c @@ -50,7 +50,7 @@ explosion_t; static explosion_t explosion[MAX_EXPLOSIONS]; static rtexture_t *explosiontexture; -static rtexture_t *explosiontexturefog; +//static rtexture_t *explosiontexturefog; static rtexturepool_t *explosiontexturepool; #endif @@ -59,14 +59,14 @@ cvar_t r_explosionclip = {CVAR_SAVE, "r_explosionclip", "1", "enables collision #ifdef MAX_EXPLOSIONS static cvar_t r_drawexplosions = {0, "r_drawexplosions", "1", "enables rendering of explosion shells (see also cl_particles_explosions_shell)"}; -extern qboolean r_loadfog; +//extern qboolean r_loadfog; static void r_explosion_start(void) { int x, y; static unsigned char noise1[128][128], noise2[128][128], noise3[128][128], data[128][128][4]; explosiontexturepool = R_AllocTexturePool(); explosiontexture = NULL; - explosiontexturefog = NULL; + //explosiontexturefog = NULL; fractalnoise(&noise1[0][0], 128, 32); fractalnoise(&noise2[0][0], 128, 4); fractalnoise(&noise3[0][0], 128, 4); @@ -87,13 +87,13 @@ static void r_explosion_start(void) } } explosiontexture = R_LoadTexture2D(explosiontexturepool, "explosiontexture", 128, 128, &data[0][0][0], TEXTYPE_BGRA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_FORCELINEAR, NULL); - if (r_loadfog) - { - for (y = 0;y < 128;y++) - for (x = 0;x < 128;x++) - data[y][x][0] = data[y][x][1] = data[y][x][2] = 255; - explosiontexturefog = R_LoadTexture2D(explosiontexturepool, "explosiontexture_fog", 128, 128, &data[0][0][0], TEXTYPE_BGRA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_FORCELINEAR, NULL); - } +// if (r_loadfog) +// { +// for (y = 0;y < 128;y++) +// for (x = 0;x < 128;x++) +// data[y][x][0] = data[y][x][1] = data[y][x][2] = 255; +// explosiontexturefog = R_LoadTexture2D(explosiontexturepool, "explosiontexture_fog", 128, 128, &data[0][0][0], TEXTYPE_BGRA, TEXF_MIPMAP | TEXF_ALPHA | TEXF_FORCELINEAR, NULL); +// } // note that explosions survive the restart } diff --git a/r_shadow.c b/r_shadow.c index 9e84a43c..25f422fa 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -3414,7 +3414,10 @@ void R_Shadow_PrepareLight(rtlight_t *rtlight) float f; int numleafs, numsurfaces; int *leaflist, *surfacelist; - unsigned char *leafpvs, *shadowtrispvs, *lighttrispvs, *surfacesides; + unsigned char *leafpvs; + unsigned char *shadowtrispvs; + unsigned char *lighttrispvs; + //unsigned char *surfacesides; int numlightentities; int numlightentities_noselfshadow; int numshadowentities; @@ -3478,7 +3481,7 @@ void R_Shadow_PrepareLight(rtlight_t *rtlight) leafpvs = rtlight->static_leafpvs; numsurfaces = rtlight->static_numsurfaces; surfacelist = rtlight->static_surfacelist; - surfacesides = NULL; + //surfacesides = NULL; shadowtrispvs = rtlight->static_shadowtrispvs; lighttrispvs = rtlight->static_lighttrispvs; } @@ -3491,7 +3494,7 @@ void R_Shadow_PrepareLight(rtlight_t *rtlight) leaflist = r_shadow_buffer_leaflist; leafpvs = r_shadow_buffer_leafpvs; surfacelist = r_shadow_buffer_surfacelist; - surfacesides = r_shadow_buffer_surfacesides; + //surfacesides = r_shadow_buffer_surfacesides; shadowtrispvs = r_shadow_buffer_shadowtrispvs; lighttrispvs = r_shadow_buffer_lighttrispvs; // if the reduced leaf bounds are offscreen, skip it @@ -3506,7 +3509,7 @@ void R_Shadow_PrepareLight(rtlight_t *rtlight) leafpvs = NULL; numsurfaces = 0; surfacelist = NULL; - surfacesides = NULL; + //surfacesides = NULL; shadowtrispvs = NULL; lighttrispvs = NULL; } @@ -4877,7 +4880,14 @@ typedef enum lighttype_e {LIGHTTYPE_MINUSX, LIGHTTYPE_RECIPX, LIGHTTYPE_RECIPXX, void R_Shadow_LoadWorldLightsFromMap_LightArghliteTyrlite(void) { - int entnum, style, islight, skin, pflags, effects, type, n; + int entnum; + int style; + int islight; + int skin; + int pflags; + //int effects; + int type; + int n; char *entfiledata; const char *data; float origin[3], angles[3], radius, color[3], light[4], fadescale, lightscale, originhack[3], overridecolor[3], vec[4]; @@ -4911,7 +4921,7 @@ void R_Shadow_LoadWorldLightsFromMap_LightArghliteTyrlite(void) style = 0; skin = 0; pflags = 0; - effects = 0; + //effects = 0; islight = false; while (1) { @@ -5038,8 +5048,8 @@ void R_Shadow_LoadWorldLightsFromMap_LightArghliteTyrlite(void) skin = (int)atof(value); else if (!strcmp("pflags", key)) pflags = (int)atof(value); - else if (!strcmp("effects", key)) - effects = (int)atof(value); + //else if (!strcmp("effects", key)) + // effects = (int)atof(value); else if (cl.worldmodel->type == mod_brushq3) { if (!strcmp("scale", key)) diff --git a/snd_mix.c b/snd_mix.c index ec3de1b7..30e5a523 100644 --- a/snd_mix.c +++ b/snd_mix.c @@ -467,8 +467,8 @@ void S_MixToBuffer(void *stream, unsigned int bufferframes) for (i = 0; i < total_channels ; i++, ch++) { sfx_t *sfx; - unsigned int ltime; - unsigned int count; + int ltime; + int count; sfx = ch->sfx; if (sfx == NULL) diff --git a/sv_main.c b/sv_main.c index c2643719..8b192aae 100644 --- a/sv_main.c +++ b/sv_main.c @@ -2705,7 +2705,9 @@ int SV_ParticleEffectIndex(const char *name) int filepass; fs_offset_t filesize; unsigned char *filedata; - const char *text, *textstart, *textend; + const char *text; + const char *textstart; + //const char *textend; char argv[16][1024]; char filename[MAX_QPATH]; if (!sv.particleeffectnamesloaded) @@ -2726,7 +2728,7 @@ int SV_ParticleEffectIndex(const char *name) if (!filedata) continue; textstart = (const char *)filedata; - textend = (const char *)filedata + filesize; + //textend = (const char *)filedata + filesize; text = textstart; for (linenumber = 1;;linenumber++) { diff --git a/sv_phys.c b/sv_phys.c index 5c091977..13a0cc15 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -2142,7 +2142,13 @@ Only used by players */ void SV_WalkMove (prvm_edict_t *ent) { - int clip, oldonground, originalmove_clip, originalmove_flags, originalmove_groundentity, hitsupercontentsmask, type; + int clip; + int oldonground; + //int originalmove_clip; + int originalmove_flags; + int originalmove_groundentity; + int hitsupercontentsmask; + int type; vec3_t upmove, downmove, start_origin, start_velocity, stepnormal, originalmove_origin, originalmove_velocity; trace_t downtrace, trace; qboolean applygravity; @@ -2206,7 +2212,7 @@ void SV_WalkMove (prvm_edict_t *ent) VectorCopy(ent->fields.server->origin, originalmove_origin); VectorCopy(ent->fields.server->velocity, originalmove_velocity); - originalmove_clip = clip; + //originalmove_clip = clip; originalmove_flags = (int)ent->fields.server->flags; originalmove_groundentity = ent->fields.server->groundentity; diff --git a/svbsp.c b/svbsp.c index c3e69371..85b82a49 100644 --- a/svbsp.c +++ b/svbsp.c @@ -158,7 +158,7 @@ static void SVBSP_InsertOccluderPolygonNodes(svbsp_t *b, int *parentnodenumpoint { // now we need to create up to numpoints + 1 new nodes, forming a BSP tree // describing the occluder polygon's shadow volume - int i, j, p, basenum; + int i, j, p; svbsp_node_t *node; // points and lines are valid testers but not occluders @@ -187,7 +187,6 @@ static void SVBSP_InsertOccluderPolygonNodes(svbsp_t *b, int *parentnodenumpoint // note down the first available nodenum for the *parentnodenumpointer // line which is done last to allow multithreaded queries during an // insertion - basenum = b->numnodes; for (i = 0, p = poly->numpoints - 1;i < poly->numpoints;p = i, i++) { #if 1 diff --git a/svvm_cmds.c b/svvm_cmds.c index 52a9bb93..e5e5210f 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -1216,7 +1216,7 @@ static void VM_SV_aim (void) int i, j; trace_t tr; float dist, bestdist; - float speed; + //float speed; VM_SAFEPARMCOUNT(2, VM_SV_aim); @@ -1237,7 +1237,7 @@ static void VM_SV_aim (void) VM_Warning("aim: can not use free entity\n"); return; } - speed = PRVM_G_FLOAT(OFS_PARM1); + //speed = PRVM_G_FLOAT(OFS_PARM1); VectorCopy (ent->fields.server->origin, start); start[2] += 20; @@ -1349,7 +1349,7 @@ sizebuf_t *WriteDest (void) return sv.writeentitiestoclient_msg; } - return NULL; + //return NULL; } static void VM_SV_WriteByte (void) -- 2.39.2