From: xolatile Date: Sun, 10 Aug 2025 12:30:56 +0000 (+0200) Subject: Cleared all warnings on GCC... X-Git-Url: https://git.xolatile.top/?a=commitdiff_plain;h=bec4167d29a68efd0cd2da36143e7f1c78a119a0;p=xolatile-badassbug.git Cleared all warnings on GCC... --- diff --git a/data/glsl.cfg b/data/glsl.cfg index 3004d05..91e6e8e 100644 --- a/data/glsl.cfg +++ b/data/glsl.cfg @@ -2556,42 +2556,6 @@ lazyshader 0 "glassfast" [ fastshader glass glassfast 2 altshader glass glassfast -lazyshader 0 "grass" [ - attribute vec4 vvertex, vcolor; - attribute vec2 vtexcoord0, vtexcoord1; - attribute vec4 vtangent; - uniform mat4 camprojmatrix; - uniform vec3 camera; - uniform vec3 grassmargin; - varying vec4 color; - varying vec2 texcoord0, texcoord1; - varying vec2 bounds; - void main(void) - { - gl_Position = camprojmatrix * vvertex; - color = vcolor; - texcoord0 = vtexcoord0; - texcoord1 = vtexcoord1 * @lmcoordscale; - vec2 camdir = (camera.xy - vvertex.xy) * grassmargin.y; - bounds = vec2(dot(camdir, vtangent.xy), dot(camdir, vtangent.zw)) + grassmargin.z; - } -] [ - //:fogrgba vec4(0.0) - varying vec4 color; - varying vec2 texcoord0, texcoord1; - varying vec2 bounds; - uniform sampler2D tex0, tex1; - void main(void) - { - vec4 diffuse = texture2D(tex0, texcoord0); - diffuse.rgb *= 2.0; - vec4 lm = texture2D(tex1, texcoord1) * color; - lm.rgb *= lm.a; - float margin = clamp(min(bounds.x, bounds.y), 0.0, 1.0); - gl_FragColor = diffuse * lm * margin; - } -] - shader 0 "overbrightdecal" [ attribute vec4 vvertex, vcolor; attribute vec2 vtexcoord0; diff --git a/data/stdedit.cfg b/data/stdedit.cfg index 6a13f5f..55863e1 100644 --- a/data/stdedit.cfg +++ b/data/stdedit.cfg @@ -136,22 +136,6 @@ entfindinsel = [ ] ] -lse = [ - line = "" - count = 0 - entloop [ - line = ( concatword $line (entget) " " ) - count = ( + $count 1 ) - if (> $count 4) [ - echo $line - line = "" - count = 0 - ] - ] - if (> $count 0 ) [ echo $line ] - echo (enthavesel) entities selected -] - drag = [ dragging 1; onrelease [ dragging 0 ] ] corners = [ selectcorners 1; dragging 1; onrelease [ selectcorners 0; dragging 0 ] ] editmove = [ moving 1; onrelease [ moving 0 ]; result $moving ] diff --git a/src/engine/animmodel.h b/src/engine/animmodel.h index 07143a2..e94aea5 100644 --- a/src/engine/animmodel.h +++ b/src/engine/animmodel.h @@ -195,8 +195,8 @@ struct animmodel : model { virtual ~mesh() { DELETEA(name); } - virtual void calcbb(vec &bbmin, vec &bbmax, const matrix4x3 &m) {} - virtual void genBIH(BIH::mesh &m) {} + virtual void calcbb(vec &bbmin, vec &bbmax, const matrix4x3 &m) = 0; + virtual void genBIH(BIH::mesh &m) = 0; void genBIH(skin &s, vector &bih, const matrix4x3 &t) { BIH::mesh &m = bih.add(); m.xform = t; @@ -352,8 +352,8 @@ struct animmodel : model { meshes.deletecontents(); DELETEP(next); } - virtual int findtag(const char *name) { return -1; } - virtual void concattagtransform(part *p, int i, const matrix4x3 &m, matrix4x3 &n) {} + virtual int findtag(const char *) { return -1; } + virtual void concattagtransform(part *, int, const matrix4x3 &, matrix4x3 &) {} void calcbb(vec &bbmin, vec &bbmax, const matrix4x3 &m) { loopv(meshes) meshes[i]->calcbb(bbmin, bbmax, m); } diff --git a/src/engine/engine.h b/src/engine/engine.h index 29bfaff..1b1d82f 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -65,7 +65,7 @@ extern void cleanuptexture(Texture *t); extern uchar *loadalphamask(Texture *t); extern void loadlayermasks(); extern void loadshaders(); -extern void setuptexparameters(int tnum, int clamp, int filter, GLenum format = GL_RGB, GLenum target = GL_TEXTURE_2D); +extern void setuptexparameters(int tnum, int clamp, int filter, GLenum target = GL_TEXTURE_2D); extern void createtexture(int tnum, int w, int h, void *pixels, int clamp, int filter, GLenum component = GL_RGB, GLenum target = GL_TEXTURE_2D, int pw = 0, int ph = 0, int pitch = 0, bool resize = true, GLenum format = GL_FALSE); extern void blurtexture(int n, int bpp, int w, int h, uchar *dst, const uchar *src, int margin = 0); extern void blurnormals(int n, int w, int h, bvec *dst, const bvec *src, int margin = 0); @@ -182,11 +182,11 @@ extern int classifyface(const cube &c, int orient, const ivec &co, int size); extern int visibletris(const cube &c, int orient, const ivec &co, int size, ushort nmat = MAT_ALPHA, ushort matmask = MAT_ALPHA); extern int visibleorient(const cube &c, int orient); extern void genfaceverts(const cube &c, int orient, ivec v[4]); -extern int calcmergedsize(int orient, const ivec &co, int size, const vertinfo *verts, int numverts); -extern void invalidatemerges(cube &c, const ivec &co, int size, bool msg); +extern int calcmergedsize(const ivec &co, int size, const vertinfo *verts, int numverts); +extern void invalidatemerges(cube &c, bool msg); extern void calcmerges(); -extern int mergefaces(int orient, facebounds *m, int sz); +extern int mergefaces(facebounds *m, int sz); extern void mincubeface(const cube &cu, int orient, const ivec &o, int size, const facebounds &orig, facebounds &cf, ushort nmat = MAT_AIR, ushort matmask = 0); static inline cubeext &ext(cube &c) { @@ -237,7 +237,7 @@ extern int isvisiblesphere(float rad, const vec &cv); extern bool bboccluded(const ivec &bo, const ivec &br); extern occludequery *newquery(void *owner); extern void startquery(occludequery *query); -extern void endquery(occludequery *query); +extern void endquery(void); extern bool checkquery(occludequery *query, bool nowait = false); extern void resetqueries(); extern int getnumqueries(); diff --git a/src/engine/lightmap.cpp b/src/engine/lightmap.cpp index c15e4b6..3840d58 100644 --- a/src/engine/lightmap.cpp +++ b/src/engine/lightmap.cpp @@ -662,7 +662,7 @@ static int finishlightmap(lightmapworker *w) { else return SURFACE_LIGHTMAP_BLEND; } -static int previewlightmapalpha(lightmapworker *w, float lpu, const vec &origin1, const vec &xstep1, const vec &ystep1, const vec &origin2, const vec &xstep2, const vec &ystep2, float side0, float sidestep) { +static int previewlightmapalpha(lightmapworker *w, const vec &origin1, const vec &xstep1, const vec &ystep1, const vec &origin2, const vec &xstep2, const vec &ystep2, float side0, float sidestep) { extern int fullbrightlevel; uchar *dst = w->colorbuf; uchar minalpha = 255, maxalpha = 0; @@ -1014,7 +1014,7 @@ static int setupsurface(lightmapworker *w, plane planes[2], int numplanes, const } int surftype = NO_SURFACE; if(preview) { - surftype = previewlightmapalpha(w, lpu, origin1, xstep1, ystep1, origin2, xstep2, ystep2, side0, sidestep); + surftype = previewlightmapalpha(w, origin1, xstep1, ystep1, origin2, xstep2, ystep2, side0, sidestep); } else { lerpvert lv[MAXFACEVERTS]; @@ -1088,7 +1088,7 @@ static lightmapinfo *setupsurfaces(lightmapworker *w, lightmaptask &task) { vertinfo *verts = c.ext->verts() + c.ext->surfaces[i].verts; loopj(numverts) curlitverts[j].set(verts[j].getxyz()); if(c.merged&(1<start(menustart, 0.03f, showtab ? &menutab : NULL); @@ -564,6 +565,7 @@ static vector needsapply; static struct applymenu : menu { void gui(g3d_gui &g, bool firstpass) { + (void) firstpass; if(guistack.empty()) return; g.start(menustart, 0.03f); g.text("the following settings have changed:", GUI_TEXT_COLOR, "info"); diff --git a/src/engine/normal.cpp b/src/engine/normal.cpp index 64c21c6..05c0cf4 100644 --- a/src/engine/normal.cpp +++ b/src/engine/normal.cpp @@ -246,6 +246,7 @@ void setlerpstep(float v, lerpbounds &bounds) { } void initlerpbounds(float u, float v, const lerpvert *lv, int numv, lerpbounds &start, lerpbounds &end) { + (void) u; const lerpvert *first = &lv[0], *second = NULL; loopi(numv-1) { if(lv[i+1].tc.y < first->tc.y) { second = first; first = &lv[i+1]; } diff --git a/src/engine/octa.cpp b/src/engine/octa.cpp index 21a3938..521a3b4 100644 --- a/src/engine/octa.cpp +++ b/src/engine/octa.cpp @@ -1064,7 +1064,7 @@ static inline bool mergefacecmp(const facebounds &x, const facebounds &y) { return false; } -static int mergefacev(int orient, facebounds *m, int sz, facebounds &n) { +static int mergefacev(facebounds *m, int sz, facebounds &n) { for(int i = sz-1; i >= 0; --i) { if(m[i].v2 < n.v1) break; if(m[i].v2 == n.v1 && m[i].u1 == n.u1 && m[i].u2 == n.u2) { @@ -1076,7 +1076,7 @@ static int mergefacev(int orient, facebounds *m, int sz, facebounds &n) { return 0; } -static int mergefaceu(int orient, facebounds &m, facebounds &n) { +static int mergefaceu(facebounds &m, facebounds &n) { if(m.v1 == n.v1 && m.v2 == n.v2 && m.u2 == n.u1) { n.u1 = m.u1; return 1; @@ -1084,13 +1084,13 @@ static int mergefaceu(int orient, facebounds &m, facebounds &n) { return 0; } -static int mergeface(int orient, facebounds *m, int sz, facebounds &n) { +static int mergeface(facebounds *m, int sz, facebounds &n) { for(bool merged = false; sz; merged = true) { - int vmerged = mergefacev(orient, m, sz, n); + int vmerged = mergefacev(m, sz, n); sz -= vmerged; if(!vmerged && merged) break; if(!sz) break; - int umerged = mergefaceu(orient, m[sz-1], n); + int umerged = mergefaceu(m[sz-1], n); sz -= umerged; if(!umerged) break; } @@ -1098,10 +1098,10 @@ static int mergeface(int orient, facebounds *m, int sz, facebounds &n) { return sz; } -int mergefaces(int orient, facebounds *m, int sz) { +int mergefaces(facebounds *m, int sz) { quicksort(m, sz, mergefacecmp); int nsz = 0; - loopi(sz) nsz = mergeface(orient, m, nsz, m[i]); + loopi(sz) nsz = mergeface(m, nsz, m[i]); return nsz; } @@ -1342,6 +1342,7 @@ struct plink : pedge { }; bool mergepolys(int orient, hashset &links, vector &queue, int owner, poly &p, poly &q, const pedge &e) { + (void) orient; int pe = -1, qe = -1; loopi(p.numverts) if(p.verts[i] == e.from) { pe = i; break; } loopi(q.numverts) if(q.verts[i] == e.to) { qe = i; break; } @@ -1398,6 +1399,7 @@ bool mergepolys(int orient, hashset &links, vector &queue, int o } void addmerge(cube &cu, int orient, const ivec &co, const ivec &n, int offset, poly &p) { + (void)co; cu.merged |= 1<surfaces[orient] = ambientsurface; @@ -1443,6 +1445,7 @@ static inline void clearmerge(cube &c, int orient) { } void addmerges(int orient, const ivec &co, const ivec &n, int offset, vector &polys) { + (void)co; loopv(polys) { poly &p = polys[i]; if(p.merged) addmerge(*p.c, orient, co, n, offset, p); @@ -1451,6 +1454,7 @@ void addmerges(int orient, const ivec &co, const ivec &n, int offset, vector &polys) { + (void) orient; if(polys.length() <= 1) { addmerges(orient, co, n, offset, polys); return; } hashset links(polys.length() <= 32 ? 128 : 1024); vector queue; @@ -1488,13 +1492,13 @@ struct cfpolys { static hashtable cpolys; -void genmerges(cube *c = worldroot, const ivec &o = ivec(0, 0, 0), int size = worldsize>>1) { +void genmerges(int orient = 0, cube *c = worldroot, const ivec &o = ivec(0, 0, 0), int size = worldsize>>1) { if((genmergeprogress++&0xFFF)==0) renderprogress(float(genmergeprogress)/allocnodes, "merging faces..."); neighbourstack[++neighbourdepth] = c; loopi(8) { ivec co(i, o, size); int vis; - if(c[i].children) genmerges(c[i].children, co, size>>1); + if(c[i].children) genmerges(orient, c[i].children, co, size>>1); else if(!isempty(c[i])) loopj(6) if((vis = visibletris(c[i], j, co, size))) { cfkey k; poly p; @@ -1517,7 +1521,7 @@ void genmerges(cube *c = worldroot, const ivec &o = ivec(0, 0, 0), int size = wo } if((size == 1<va->hasmerges; destroyva(c[i].ext->va); c[i].ext->va = NULL; - if(hasmerges) invalidatemerges(c[i], o, size, true); + if(hasmerges) invalidatemerges(c[i], true); } freeoctaentities(c[i]); c[i].ext->tjoints = -1; @@ -726,7 +726,7 @@ void freeeditinfo(editinfo *&e) { e = NULL; } -void pasteblock(block3 &b, selinfo &sel, bool local) { +void pasteblock(block3 &b, selinfo &sel) { sel.s = b.s; int o = sel.orient; sel.orient = b.orient; @@ -748,7 +748,7 @@ void mpcopy(editinfo *&e, selinfo &sel, bool local) { void mppaste(editinfo *&e, selinfo &sel, bool local) { if(e==NULL) return; if(local) game::edittrigger(sel, EDIT_PASTE); - if(e->copy) pasteblock(*e->copy, sel, local); + if(e->copy) pasteblock(*e->copy, sel); } void copy() { @@ -1603,6 +1603,7 @@ bool cleartexgui() { ICOMMAND(cleartexgui, "", (), intret(cleartexgui() ? 1 : 0)); void rendertexturepanel(int w, int h) { + (void) w; if((texpaneltimer -= curtime)>0 && editmode) { glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); pushhudmatrix(); diff --git a/src/engine/octarender.cpp b/src/engine/octarender.cpp index afbc7b2..aa1da76 100644 --- a/src/engine/octarender.cpp +++ b/src/engine/octarender.cpp @@ -452,7 +452,7 @@ extern const vec orientation_bitangent[8][3] = { vec(0, -1, 0), vec(-1, 0, 0), vec(-1, 0, 0) }, }; -void addtris(const sortkey &key, int orient, vertex *verts, int *index, int numverts, int convex, int shadowmask, int tj) { +void addtris(const sortkey &key, int orient, vertex *verts, int *index, int numverts, int shadowmask, int tj) { int &total = vc.worldtris; int edge = orient*(MAXFACEVERTS+1); loopi(numverts-2) if(index[0]!=index[i+1] && index[i+1]!=index[i+2] && index[i+2]!=index[0]) { @@ -591,8 +591,8 @@ void guessnormals(const vec *pos, int numverts, vec *normals) { normals[3] = n2; } -void addcubeverts(VSlot &vslot, int orient, int size, vec *pos, int convex, ushort texture, ushort lmid, vertinfo *vinfo, int numverts, int tj = -1, int grassy = 0, bool alpha = false, int layer = LAYER_TOP) { - (void) grassy; +void addcubeverts(VSlot &vslot, int orient, int size, vec *pos, ushort texture, ushort lmid, vertinfo *vinfo, int numverts, int tj = -1, bool alpha = false, int layer = LAYER_TOP) { + (void) size; int dim = dimension(orient); int shadowmask = alpha ? 0 : calcshadowmask(pos, numverts); LightMap *lm = NULL; @@ -634,7 +634,7 @@ void addcubeverts(VSlot &vslot, int orient, int size, vec *pos, int convex, usho } if(lmid >= LMID_RESERVED) lmid = lm ? lm->tex : LMID_AMBIENT; sortkey key(texture, lmid, !vslot.scroll.iszero() ? dim : 3, layer == LAYER_BLEND ? LAYER_BLEND : LAYER_TOP, alpha ? (vslot.alphaback ? ALPHA_BACK : (vslot.alphafront ? ALPHA_FRONT : NO_ALPHA)) : NO_ALPHA); - addtris(key, orient, verts, index, numverts, convex, shadowmask, tj); + addtris(key, orient, verts, index, numverts, shadowmask, tj); } struct edgegroup { @@ -764,7 +764,7 @@ void gencubeedges(cube *c = worldroot, const ivec &co = ivec(0, 0, 0), int size --neighbourdepth; } -void gencubeverts(cube &c, const ivec &co, int size, int csi) { +void gencubeverts(cube &c, const ivec &co, int size) { if(!(c.visible&0xC0)) return; int vismask = ~c.merged & 0x3F; if(!(c.visible&0x80)) vismask &= c.visible; @@ -796,13 +796,13 @@ void gencubeverts(cube &c, const ivec &co, int size, int csi) { while(tj >= 0 && tjoints[tj].edge < i*(MAXFACEVERTS+1)) tj = tjoints[tj].next; int hastj = tj >= 0 && tjoints[tj].edge < (i+1)*(MAXFACEVERTS+1) ? tj : -1; if(!c.ext) - addcubeverts(vslot, i, size, pos, convex, c.texture[i], LMID_AMBIENT, NULL, numverts, hastj, 0, (c.material&MAT_ALPHA)!=0); + addcubeverts(vslot, i, size, pos, c.texture[i], LMID_AMBIENT, NULL, numverts, hastj, (c.material&MAT_ALPHA)!=0); else { const surfaceinfo &surf = c.ext->surfaces[i]; if(!surf.numverts || surf.numverts&LAYER_TOP) - addcubeverts(vslot, i, size, pos, convex, c.texture[i], surf.lmid[0], verts, numverts, hastj, 0, (c.material&MAT_ALPHA)!=0, LAYER_TOP|(surf.numverts&LAYER_BLEND)); + addcubeverts(vslot, i, size, pos, c.texture[i], surf.lmid[0], verts, numverts, hastj, (c.material&MAT_ALPHA)!=0, LAYER_TOP|(surf.numverts&LAYER_BLEND)); if(surf.numverts&LAYER_BOTTOM) - addcubeverts(layer ? *layer : vslot, i, size, pos, convex, vslot.layer, surf.lmid[1], surf.numverts&LAYER_DUP ? verts + numverts : verts, numverts, hastj); + addcubeverts(layer ? *layer : vslot, i, size, pos, vslot.layer, surf.lmid[1], surf.numverts&LAYER_DUP ? verts + numverts : verts, numverts, hastj); } } } @@ -920,7 +920,7 @@ int genmergedfaces(cube &c, const ivec &co, int size, int minlevel = -1) { mf.numverts = surf.numverts; mf.verts = c.ext->verts() + surf.verts; mf.tjoints = -1; - int level = calcmergedsize(i, co, size, mf.verts, mf.numverts&MAXFACEVERTS); + int level = calcmergedsize(co, size, mf.verts, mf.numverts&MAXFACEVERTS); if(level > minlevel) { maxlevel = max(maxlevel, level); while(tj >= 0 && tjoints[tj].edge < i*(MAXFACEVERTS+1)) tj = tjoints[tj].next; @@ -971,7 +971,7 @@ void addmergedverts(int level, const ivec &o) { pos[i] = vec(v.x, v.y, v.z).mul(1.0f/8).add(vo); } VSlot &vslot = lookupvslot(mf.tex, true); - addcubeverts(vslot, mf.orient, 1<0 || !(mode&RAY_SKIPFIRST))) + if(raycubeintersect(p, v, ray, invray, f) && (dist+f>0 || !(mode&RAY_SKIPFIRST))) return min(dent, dist+f); } FINDCLOSEST(closest = 0, closest = 1, closest = 2); @@ -350,7 +350,7 @@ float rayent(const vec &o, const vec &ray, float radius, int mode, int size, int hitorient = -1; float dist = raycube(o, ray, radius, mode, size); if((mode&RAY_ENTS) == RAY_ENTS) { - float dent = disttooutsideent(o, ray, dist < 0 ? 1e16f : dist, mode, NULL); + float dent = disttooutsideent(o, ray, dist < 0 ? 1e16f : dist, NULL); if(dent < 1e15f && (dist < 0 || dent < dist)) dist = dent; } orient = hitorient; diff --git a/src/engine/rendermodel.cpp b/src/engine/rendermodel.cpp index cfdf326..8174e22 100644 --- a/src/engine/rendermodel.cpp +++ b/src/engine/rendermodel.cpp @@ -515,7 +515,7 @@ void endmodelbatches() { batchedmodel &bm = b.batched[j]; if(bm.flags&(MDL_CULL_VFC|MDL_GHOST)) continue; if(bm.query!=query) { - if(query) endquery(query); + if(query) endquery(); query = bm.query; if(query) startquery(query); } @@ -529,7 +529,7 @@ void endmodelbatches() { if(!rendered) { b.m->startrender(); rendered = true; } renderbatchedmodel(b.m, bm); } - if(query) endquery(query); + if(query) endquery(); if(rendered) b.m->endrender(); } if(transparent.length()) { @@ -543,13 +543,13 @@ void endmodelbatches() { (lastmodel = tm.m)->startrender(); } if(query!=tm.batched->query) { - if(query) endquery(query); + if(query) endquery(); query = tm.batched->query; if(query) startquery(query); } renderbatchedmodel(tm.m, *tm.batched); } - if(query) endquery(query); + if(query) endquery(); if(lastmodel) lastmodel->endrender(); } numbatches = -1; @@ -585,7 +585,7 @@ void endmodelquery() { while(b.batched.length() && b.batched.last().query==modelquery); b.m->endrender(); } - endquery(modelquery); + endquery(); modelquery = NULL; modelattached.setsize(minattached); } @@ -596,7 +596,7 @@ static inline void enablecullmodelquery() { startbb(); } -static inline void rendercullmodelquery(model *m, dynent *d, const vec ¢er, float radius) { +static inline void rendercullmodelquery(dynent *d, const vec ¢er, float radius) { if(fabs(camera1->o.x-center.x) < radius+1 && fabs(camera1->o.y-center.y) < radius+1 && fabs(camera1->o.z-center.z) < radius+1) { @@ -608,7 +608,7 @@ static inline void rendercullmodelquery(model *m, dynent *d, const vec ¢er, startquery(d->query); int br = int(radius*2)+1; drawbb(ivec(int(center.x-radius), int(center.y-radius), int(center.z-radius)), ivec(br, br, br)); - endquery(d->query); + endquery(); } static inline void disablecullmodelquery() { @@ -663,7 +663,7 @@ void rendermodel(entitylight *light, const char *mdl, int anim, const vec &o, fl if(culled) { if(culled&(MDL_CULL_OCCLUDED|MDL_CULL_QUERY) && flags&MDL_CULL_QUERY) { enablecullmodelquery(); - rendercullmodelquery(m, d, center, radius); + rendercullmodelquery(d, center, radius); disablecullmodelquery(); } return; @@ -756,7 +756,7 @@ void rendermodel(entitylight *light, const char *mdl, int anim, const vec &o, fl if(d->query) startquery(d->query); } m->render(anim, basetime, basetime2, o, yaw, pitch, d, a, lightcolor, lightdir, trans); - if(flags&MDL_CULL_QUERY && d->query) endquery(d->query); + if(flags&MDL_CULL_QUERY && d->query) endquery(); m->endrender(); } diff --git a/src/engine/renderparticles.cpp b/src/engine/renderparticles.cpp index 637dcb2..a3cc91f 100644 --- a/src/engine/renderparticles.cpp +++ b/src/engine/renderparticles.cpp @@ -138,9 +138,9 @@ struct partrenderer { } virtual ~partrenderer() { } - virtual void init(int n) { } + virtual void init(int) { } virtual void reset() = 0; - virtual void resettracked(physent *owner) { } + virtual void resettracked(physent *) { } virtual particle *addpart(const vec &o, const vec &d, int fade, int color, float size, int gravity = 0) = 0; virtual void update() { } virtual void render() = 0; @@ -201,8 +201,7 @@ struct listrenderer : partrenderer { } virtual ~listrenderer() { } - virtual void killpart(listparticle *p) { - } + virtual void killpart(listparticle *) {} void reset() { if(!list) return; listparticle *p = list; @@ -301,6 +300,7 @@ struct meterrenderer : listrenderer { glEnable(GL_BLEND); } void renderpart(listparticle *p, const vec &o, const vec &d, int blend, int ts) { + (void) ts; (void) d; (void) blend; int basetype = type&0xFF; float scale = FONTH*p->size/80.0f, right = 8, left = p->progress/100.0f*right; matrix4x3 m(camright, vec(camup).neg(), vec(camdir).neg(), o); @@ -362,6 +362,7 @@ struct textrenderer : listrenderer { if(p->text && p->flags&1) delete[] p->text; } void renderpart(listparticle *p, const vec &o, const vec &d, int blend, int ts) { + (void) ts; (void) d; float scale = p->size/80.0f, xoff = -(text_width(p->text) + ((p->flags>>1)&7)*FONTH)/2, yoff = 0; matrix4x3 m(camright, vec(camup).neg(), vec(camdir).neg(), o); m.scale(scale); @@ -387,6 +388,7 @@ struct texticonrenderer : listrenderer { gle::end(); } void renderpart(listparticle *p, const vec &o, const vec &d, int blend, int ts) { + (void) ts; (void) d; float scale = p->size/80.0f, xoff = p->val, yoff = 0; matrix4x3 m(camright, vec(camup).neg(), vec(camdir).neg(), o); m.scale(scale); @@ -485,6 +487,7 @@ static inline void seedpos(particleemitter &pe, const vec &o, const vec &d, int template<> inline void seedpos(particleemitter &pe, const vec &o, const vec &d, int fade, float size, int grav) { + (void) pe; (void) o; (void) fade; (void) grav; pe.extendbb(d, size); } diff --git a/src/engine/renderva.cpp b/src/engine/renderva.cpp index a98614a..be57ab3 100644 --- a/src/engine/renderva.cpp +++ b/src/engine/renderva.cpp @@ -217,7 +217,7 @@ void startquery(occludequery *query) { glBeginQuery_(GL_SAMPLES_PASSED, query->id); } -void endquery(occludequery *query) { +void endquery(void) { glEndQuery_(GL_SAMPLES_PASSED); } @@ -390,7 +390,7 @@ void rendermapmodels() { } startquery(oe->query); drawbb(oe->bbmin, ivec(oe->bbmax).sub(oe->bbmin)); - endquery(oe->query); + endquery(); } if(!queried) { endbb(); @@ -556,7 +556,7 @@ static void renderquery(renderstate &cur, occludequery *query, vtxarray *va, boo startquery(query); if(full) drawbb(ivec(va->bbmin).sub(1), ivec(va->bbmax).sub(va->bbmin).add(2)); else drawbb(va->geommin, ivec(va->geommax).sub(va->geommin)); - endquery(query); + endquery(); } enum { @@ -694,7 +694,7 @@ static void changevbuf(renderstate &cur, int pass, vtxarray *va) { } } -static void changebatchtmus(renderstate &cur, int pass, geombatch &b) { +static void changebatchtmus(renderstate &cur, geombatch &b) { bool changed = false; extern bool brightengeom; extern int fullbright; @@ -778,7 +778,7 @@ static void changetexgen(renderstate &cur, int dim, Slot &slot, VSlot &vslot) { cur.texgendim = dim; } -static void renderbatch(renderstate &cur, int pass, geombatch &b) { +static void renderbatch(geombatch &b) { geombatch *shadowed = NULL; int rendered = -1; for(geombatch *curbatch = &b;; curbatch = &geombatches[curbatch->batch]) { @@ -840,8 +840,8 @@ static void renderbatches(renderstate &cur, int pass) { if(cur.texgendim != b.es.dim || (cur.texgendim <= 2 && cur.texgenvslot != &b.vslot)) changetexgen(cur, b.es.dim, *b.vslot.slot, b.vslot); } else if(cur.texgendim != b.es.dim) changetexgen(cur, b.es.dim, *b.vslot.slot, b.vslot); - if(pass == RENDERPASS_LIGHTMAP) changebatchtmus(cur, pass, b); - renderbatch(cur, pass, b); + if(pass == RENDERPASS_LIGHTMAP) changebatchtmus(cur, b); + renderbatch(b); } resetbatches(); } @@ -881,7 +881,7 @@ void renderzpass(renderstate &cur, vtxarray *va) { if(va->query) { \ \ flush; \ - endquery(va->query); \ + endquery(); \ } \ } while(0) diff --git a/src/engine/skelmodel.h b/src/engine/skelmodel.h index ad5d34e..140acf8 100644 --- a/src/engine/skelmodel.h +++ b/src/engine/skelmodel.h @@ -169,16 +169,19 @@ struct skelmodel : animmodel { m.tcstride = sizeof(vert); } static inline void assignvert(vvertn &vv, int j, vert &v, blendcombo &c) { + (void)j;(void)c; vv.pos = v.pos; vv.norm = v.norm; vv.tc = v.tc; } inline void assignvert(vvertbump &vv, int j, vert &v, blendcombo &c) { + (void)c; vv.pos = v.pos; vv.tc = v.tc; vv.tangent = bumpverts[j].tangent; } static inline void assignvert(vvertnw &vv, int j, vert &v, blendcombo &c) { + (void)j; vv.pos = v.pos; vv.norm = v.norm; vv.tc = v.tc; @@ -251,7 +254,7 @@ struct skelmodel : animmodel { vdata += voffset; loopi(numverts) fillvert(vdata[i], verts[i]); } - void interpverts(const dualquat * RESTRICT bdata1, const dualquat * RESTRICT bdata2, bool tangents, void * RESTRICT vdata, skin &s) { + void interpverts(const dualquat * RESTRICT bdata1, const dualquat * RESTRICT bdata2, bool tangents, void * RESTRICT vdata) { const int blendoffset = ((skelmeshgroup *)group)->skel->numgpubones; bdata2 -= blendoffset; #define IPLOOP(type, dosetup, dotransform) \ @@ -284,6 +287,7 @@ struct skelmodel : animmodel { else s->setvariant(min(maxweights, g->vweights)-1, 0); } void render(const animstate *as, skin &s, vbocacheentry &vc) { + (void) as;(void) s;(void) vc; if(!Shader::lastshader) return; glDrawRangeElements_(GL_TRIANGLES, minvert, maxvert, elen, GL_UNSIGNED_SHORT, &((skelmeshgroup *)group)->edata[eoffset]); glde++; @@ -741,6 +745,7 @@ struct skelmodel : animmodel { loopv(antipodes) sc.bdata[antipodes[i].child].fixantipodal(sc.bdata[antipodes[i].parent]); } void concattagtransform(part *p, int i, const matrix4x3 &m, matrix4x3 &n) { + (void)i;(void)m;(void)n;(void)p; matrix4x3 t; t.mul(bones[tags[i].bone].base, tags[i].matrix); t.posttranslate(p->translate, p->model->scale); @@ -960,6 +965,7 @@ struct skelmodel : animmodel { gle::clearebo(); } void bindvbo(const animstate *as, vbocacheentry &vc, skelcacheentry *sc = NULL, blendcacheentry *bc = NULL) { + (void) bc; vvert *vverts = 0; bindpos(ebuf, vc.vbuf, &vverts->pos, vertsize); if(as->cur.anim&ANIM_NOSKIN) { @@ -995,6 +1001,7 @@ struct skelmodel : animmodel { } } void concattagtransform(part *p, int i, const matrix4x3 &m, matrix4x3 &n) { + (void)i;(void)m;(void)n;(void)p; skel->concattagtransform(p, i, m, n); } int addblendcombo(const blendcombo &c) { @@ -1131,7 +1138,7 @@ struct skelmodel : animmodel { (animcacheentry &)vc = sc; loopv(meshes) { skelmesh &m = *(skelmesh *)meshes[i]; - m.interpverts(sc.bdata, bc ? bc->bdata : NULL, tangents, vdata + m.voffset*vertsize, p->skins[i]); + m.interpverts(sc.bdata, bc ? bc->bdata : NULL, tangents, vdata + m.voffset*vertsize); } gle::bindvbo(vc.vbuf); glBufferData_(GL_ARRAY_BUFFER, vlen*vertsize, vdata, GL_STREAM_DRAW); diff --git a/src/engine/texture.cpp b/src/engine/texture.cpp index 744996e..e372815 100644 --- a/src/engine/texture.cpp +++ b/src/engine/texture.cpp @@ -700,7 +700,7 @@ GLenum textarget(GLenum subtarget) { return subtarget; } -void setuptexparameters(int tnum, int clamp, int filter, GLenum format, GLenum target) { +void setuptexparameters(int tnum, int clamp, int filter, GLenum target) { glBindTexture(target, tnum); glTexParameteri(target, GL_TEXTURE_WRAP_S, clamp&1 ? GL_CLAMP_TO_EDGE : (clamp&0x100 ? GL_MIRRORED_REPEAT : GL_REPEAT)); glTexParameteri(target, GL_TEXTURE_WRAP_T, clamp&2 ? GL_CLAMP_TO_EDGE : (clamp&0x200 ? GL_MIRRORED_REPEAT : GL_REPEAT)); @@ -801,7 +801,7 @@ static GLenum textype(GLenum &component, GLenum &format) { void createtexture(int tnum, int w, int h, void *pixels, int clamp, int filter, GLenum component, GLenum subtarget, int pw, int ph, int pitch, bool resize, GLenum format) { GLenum target = textarget(subtarget), type = textype(component, format); - if(filter >= 0 && clamp >= 0) setuptexparameters(tnum, clamp, filter, format, target); + if(filter >= 0 && clamp >= 0) setuptexparameters(tnum, clamp, filter, target); if(!pw) pw = w; if(!ph) ph = h; int tw = w, th = h; @@ -815,7 +815,7 @@ void createtexture(int tnum, int w, int h, void *pixels, int clamp, int filter, void createcompressedtexture(int tnum, int w, int h, uchar *data, int align, int blocksize, int levels, int clamp, int filter, GLenum format, GLenum subtarget) { GLenum target = textarget(subtarget); - if(filter >= 0 && clamp >= 0) setuptexparameters(tnum, clamp, filter, format, target); + if(filter >= 0 && clamp >= 0) setuptexparameters(tnum, clamp, filter, target); uploadcompressedtexture(target, subtarget, format, w, h, data, align, blocksize, levels, filter > 1); } diff --git a/src/engine/world.cpp b/src/engine/world.cpp index 69a78d0..d2941d0 100644 --- a/src/engine/world.cpp +++ b/src/engine/world.cpp @@ -288,6 +288,7 @@ void entrotate(int *cw) { if(noentedit()) return; int d = dimension(sel.orient); int dd = (*cw<0) == dimcoord(sel.orient) ? R[d] : C[d]; + (void) dd; vec s(sel.o.v); groupeditpure( e.o[dd] -= (e.o[dd]-(sel.s[dd]*sel.grid/2+sel.o[dd]))*2; @@ -756,7 +757,6 @@ void nearestent() { ICOMMAND(enthavesel,"", (), addimplicit(intret(entgroup.length()))); ICOMMAND(entselect, "e", (uint *body), if(!noentedit()) addgroup(e.type != ET_EMPTY && entgroup.find(n)<0 && executebool(body))); -ICOMMAND(entloop, "e", (uint *body), if(!noentedit()) addimplicit(groupeditloop(((void)e, execute(body))))); ICOMMAND(insel, "", (), entfocus(efocus, intret(pointinsel(sel, e.o)))); ICOMMAND(entindex, "", (), intret(efocus)); COMMAND(entset, "siiiii"); diff --git a/src/fpsgame/fps.cpp b/src/fpsgame/fps.cpp index d167582..d5501c4 100644 --- a/src/fpsgame/fps.cpp +++ b/src/fpsgame/fps.cpp @@ -524,13 +524,6 @@ namespace game { const char *teamcolor(const char *name, const char *team, const char *alt) { return teamcolor(name, team && isteam(team, player1->team), alt); } - VARP(teamsounds, 0, 1, 1); - void teamsound(bool sameteam, int n, const vec *loc) { - playsound(n, loc, NULL); - } - void teamsound(fpsent *d, int n, const vec *loc) { - teamsound(isteam(d->team, player1->team), n, loc); - } void suicide(physent *d) { if(d==player1 || (d->type==ENT_PLAYER && ((fpsent *)d)->ai)) { if(d->state!=CS_ALIVE) return; diff --git a/src/fpsgame/game.h b/src/fpsgame/game.h index c76498a..92d4fd1 100644 --- a/src/fpsgame/game.h +++ b/src/fpsgame/game.h @@ -515,8 +515,6 @@ namespace game { extern const char *teamcolorname(fpsent *d, const char *alt = "you"); extern const char *teamcolor(const char *name, bool sameteam, const char *alt = NULL); extern const char *teamcolor(const char *name, const char *team, const char *alt = NULL); - extern void teamsound(bool sameteam, int n, const vec *loc = NULL); - extern void teamsound(fpsent *d, int n, const vec *loc = NULL); extern fpsent *pointatplayer(); extern fpsent *hudplayer(); extern fpsent *followingplayer(fpsent *fallback = NULL);