diff --git a/src/engine/aa.cc b/src/engine/aa.cc index 204997e..42a9505 100644 --- a/src/engine/aa.cc +++ b/src/engine/aa.cc @@ -1,13 +1,13 @@ #include "aa.hh" +#include +#include + #include "main.hh" // fatal #include "rendergl.hh" #include "renderlights.hh" #include "texture.hh" -#include -#include - extern int intel_texalpha_bug; VARFP(tqaa, 0, 0, 1, cleanupaa()); diff --git a/src/engine/bih.cc b/src/engine/bih.cc index c44fc65..ce97823 100644 --- a/src/engine/bih.cc +++ b/src/engine/bih.cc @@ -1,11 +1,10 @@ +#include + #include "physics.hh" #include "rendermodel.hh" // loadmapmodel #include "stain.hh" #include "texture.hh" -#include -#include - extern vec hitsurface; bool BIH::triintersect(const mesh &m, int tidx, const vec &mo, const vec &mray, float maxdist, float &dist, int mode) diff --git a/src/engine/blend.cc b/src/engine/blend.cc index 9597d9a..5adea57 100644 --- a/src/engine/blend.cc +++ b/src/engine/blend.cc @@ -1,5 +1,8 @@ #include "blend.hh" +#include +#include + #include "console.hh" /* conoutf */ #include "light.hh" #include "main.hh" // multiplayer, timings @@ -9,9 +12,6 @@ #include "texture.hh" #include "world.hh" -#include -#include - enum { BM_BRANCH = 0, diff --git a/src/engine/command.cc b/src/engine/command.cc index d4ab9a1..9994766 100644 --- a/src/engine/command.cc +++ b/src/engine/command.cc @@ -3,12 +3,11 @@ #include "command.hh" +#include + #include "console.hh" #include "main.hh" // fatal, timings -#include -#include - hashnameset idents; // contains ALL vars/commands/aliases vector identmap; ident *dummyident = NULL; diff --git a/src/engine/console.cc b/src/engine/console.cc index 29d1e92..ce67c8f 100644 --- a/src/engine/console.cc +++ b/src/engine/console.cc @@ -2,14 +2,14 @@ #include "console.hh" +#include +#include + #include "command.hh" // idents, identflags #include "main.hh" #include "octaedit.hh" // editmode #include "rendertext.hh" -#include -#include - static void resetcomplete(); static void complete(char *s, int maxlen, const char *cmdprefix); diff --git a/src/engine/dynlight.cc b/src/engine/dynlight.cc index fae7974..bef75ee 100644 --- a/src/engine/dynlight.cc +++ b/src/engine/dynlight.cc @@ -1,14 +1,14 @@ #include "dynlight.hh" +#include +#include + #include "main.hh" // timings #include "physics.hh" // collide #include "pvs.hh" #include "rendergl.hh" // camera1 #include "renderva.hh" -#include -#include - VARNP(dynlights, usedynlights, 0, 1, 1); VARP(dynlightdist, 0, 1024, 10000); diff --git a/src/engine/grass.cc b/src/engine/grass.cc index bfb08de..4a19052 100644 --- a/src/engine/grass.cc +++ b/src/engine/grass.cc @@ -1,12 +1,12 @@ +#include +#include + #include "blend.hh" #include "main.hh" // timings #include "rendergl.hh" // xtraverts #include "renderva.hh" #include "texture.hh" -#include -#include - VARP(grass, 0, 1, 1); VAR(dbggrass, 0, 0, 1); VARP(grassdist, 0, 256, 10000); diff --git a/src/engine/light.cc b/src/engine/light.cc index ebdc789..f4af376 100644 --- a/src/engine/light.cc +++ b/src/engine/light.cc @@ -1,5 +1,8 @@ #include "light.hh" +#include +#include + #include "blend.hh" #include "console.hh" /* conoutf */ #include "main.hh" // renderbackground, player @@ -11,9 +14,6 @@ #include "texture.hh" #include "world.hh" -#include -#include - CVAR1R(ambient, 0x191919); FVARR(ambientscale, 0, 1, 16); diff --git a/src/engine/main.cc b/src/engine/main.cc index edb0079..fd9ac82 100644 --- a/src/engine/main.cc +++ b/src/engine/main.cc @@ -2,6 +2,10 @@ #include "main.hh" +#include +#include +#include + #include "blend.hh" #include "command.hh" // checksleep, writecfg #include "console.hh" @@ -19,10 +23,6 @@ #include "texture.hh" #include "world.hh" -#include -#include -#include - static SDL_Window *screen = NULL; static int curvsync = -1; diff --git a/src/engine/material.cc b/src/engine/material.cc index af529ed..d5f2e67 100644 --- a/src/engine/material.cc +++ b/src/engine/material.cc @@ -1,4 +1,8 @@ #include "material.hh" + +#include +#include + #include "octaedit.hh" // editmode #include "octarender.hh" #include "rendergl.hh" @@ -8,9 +12,6 @@ #include "water.hh" #include "world.hh" -#include -#include - vector editsurfs, glasssurfs[4], watersurfs[4], waterfallsurfs[4], lavasurfs[4], lavafallsurfs[4]; struct QuadNode diff --git a/src/engine/movie.cc b/src/engine/movie.cc index 7315537..03b078f 100644 --- a/src/engine/movie.cc +++ b/src/engine/movie.cc @@ -9,14 +9,14 @@ #include "movie.hh" +#include + #include "console.hh" /* conoutf */ #include "main.hh" #include "rendergl.hh" #include "rendertext.hh" #include "texture.hh" -#include - VAR(dbgmovie, 0, 0, 1); struct aviindexentry diff --git a/src/engine/normal.cc b/src/engine/normal.cc index 71ea87a..ff8654b 100644 --- a/src/engine/normal.cc +++ b/src/engine/normal.cc @@ -1,11 +1,11 @@ +#include + #include "light.hh" #include "main.hh" // renderprogress #include "octarender.hh" #include "texture.hh" #include "world.hh" -#include - struct normalkey { vec pos; diff --git a/src/engine/octa.cc b/src/engine/octa.cc index 84973ce..f849632 100644 --- a/src/engine/octa.cc +++ b/src/engine/octa.cc @@ -2,6 +2,9 @@ #include "octa.hh" +#include +#include + #include "console.hh" /* conoutf */ #include "light.hh" #include "main.hh" // renderprogress, timings @@ -9,9 +12,6 @@ #include "octarender.hh" #include "world.hh" -#include -#include - static const uchar fv[6][4] = // indexes for cubecoords, per each vert of a face orientation { { 2, 1, 6, 5 }, diff --git a/src/engine/octaedit.cc b/src/engine/octaedit.cc index 049712d..0a0b7ca 100644 --- a/src/engine/octaedit.cc +++ b/src/engine/octaedit.cc @@ -1,5 +1,9 @@ #include "octaedit.hh" +#include +#include +#include + #include "blend.hh" #include "command.hh" #include "console.hh" /* conoutf */ @@ -16,10 +20,6 @@ #include "texture.hh" #include "world.hh" -#include -#include -#include - extern int outline; bool boxoutline = false; diff --git a/src/engine/octarender.cc b/src/engine/octarender.cc index 1593396..31284ae 100644 --- a/src/engine/octarender.cc +++ b/src/engine/octarender.cc @@ -2,6 +2,10 @@ #include "octarender.hh" +#include +#include +#include + #include "blend.hh" #include "console.hh" /* conoutf */ #include "grass.hh" @@ -16,10 +20,6 @@ #include "texture.hh" #include "world.hh" -#include -#include -#include - struct vboinfo { int uses; diff --git a/src/engine/physics.cc b/src/engine/physics.cc index 978888f..c3f13f9 100644 --- a/src/engine/physics.cc +++ b/src/engine/physics.cc @@ -5,6 +5,10 @@ #include "physics.hh" +#include +#include +#include + #include "console.hh" /* conoutf */ #include "main.hh" // player, timings #include "rendergl.hh" // camera1 @@ -12,10 +16,6 @@ #include "octa.hh" #include "world.hh" -#include -#include -#include - #include "mpr.hh" const int MAXCLIPOFFSET = 4; diff --git a/src/engine/pvs.cc b/src/engine/pvs.cc index 28461b7..8b5a8ef 100644 --- a/src/engine/pvs.cc +++ b/src/engine/pvs.cc @@ -1,5 +1,7 @@ #include "pvs.hh" +#include + #include "console.hh" /* conoutf */ #include "main.hh" // numcpus, interceptkey, renderbackground #include "octa.hh" @@ -7,8 +9,6 @@ #include "rendergl.hh" // camera1 #include "world.hh" -#include - enum { PVS_HIDE_GEOM = 1<<0, diff --git a/src/engine/rendergl.cc b/src/engine/rendergl.cc index 85b1368..8955c89 100644 --- a/src/engine/rendergl.cc +++ b/src/engine/rendergl.cc @@ -1,8 +1,12 @@ // rendergl.cpp: core opengl rendering stuff +#include "rendergl.hh" + #include -#include +#include +#include +#include #include "aa.hh" #include "blend.hh" @@ -14,7 +18,6 @@ #include "octaedit.hh" #include "octarender.hh" // valist #include "physics.hh" // movecamera -#include "rendergl.hh" #include "renderlights.hh" #include "rendermodel.hh" #include "renderparticles.hh" @@ -24,10 +27,6 @@ #include "texture.hh" #include "water.hh" -#include -#include -#include - static vec minimapcenter(0, 0, 0), minimapradius(0, 0, 0), minimapscale(0, 0, 0); bool hasVAO = false, hasTR = false, hasTSW = false, hasPBO = false, hasFBO = false, hasAFBO = false, hasDS = false, hasTF = false, hasCBF = false, hasS3TC = false, hasFXT1 = false, hasLATC = false, hasRGTC = false, hasAF = false, hasFBB = false, hasFBMS = false, hasTMS = false, hasMSS = false, hasFBMSBS = false, hasUBO = false, hasMBR = false, hasDB2 = false, hasDBB = false, hasTG = false, hasTQ = false, hasPF = false, hasTRG = false, hasTI = false, hasHFV = false, hasHFP = false, hasDBT = false, hasDC = false, hasDBGO = false, hasEGPU4 = false, hasGPU4 = false, hasGPU5 = false, hasBFE = false, hasEAL = false, hasCR = false, hasOQ2 = false, hasES3 = false, hasCB = false, hasCI = false; diff --git a/src/engine/renderlights.cc b/src/engine/renderlights.cc index 1590150..27fc089 100644 --- a/src/engine/renderlights.cc +++ b/src/engine/renderlights.cc @@ -1,5 +1,9 @@ #include "renderlights.hh" +#include +#include +#include + #include "aa.hh" #include "dynlight.hh" #include "light.hh" @@ -17,10 +21,6 @@ #include "texture.hh" #include "world.hh" -#include -#include -#include - #define CHANGE_SHADERS 0 int gw = -1, gh = -1, bloomw = -1, bloomh = -1, lasthdraccum = 0; diff --git a/src/engine/rendermodel.cc b/src/engine/rendermodel.cc index 782bcfc..1dc5365 100644 --- a/src/engine/rendermodel.cc +++ b/src/engine/rendermodel.cc @@ -1,5 +1,9 @@ #include "rendermodel.hh" +#include +#include +#include + #include "aa.hh" #include "command.hh" // identflags #include "console.hh" /* conoutf */ @@ -12,10 +16,6 @@ #include "shader.hh" #include "texture.hh" -#include -#include -#include - VAR(oqdynent, 0, 1, 1); VAR(animationinterpolationtime, 0, 200, 1000); diff --git a/src/engine/renderparticles.cc b/src/engine/renderparticles.cc index a272add..a617731 100644 --- a/src/engine/renderparticles.cc +++ b/src/engine/renderparticles.cc @@ -1,5 +1,9 @@ // renderparticles.cpp +#include +#include +#include + #include "console.hh" /* conoutf */ #include "main.hh" // initing, minimized, loadprogress, timings #include "renderparticles.hh" @@ -16,10 +20,6 @@ #include "water.hh" #include "world.hh" -#include -#include -#include - #if 0 void regular_particle_flame(int type, const vec &p, float radius, float height, int color, int density = 3, float scale = 2.0f, float speed = 200.0f, float fade = 600.0f, int gravity = -15); void particle_splash(int type, int num, int fade, const vec &p, int color = 0xFFFFFF, float size = 1.0f, int radius = 150, int gravity = 2); diff --git a/src/engine/rendersky.cc b/src/engine/rendersky.cc index cbdf8d9..a3ad108 100644 --- a/src/engine/rendersky.cc +++ b/src/engine/rendersky.cc @@ -1,3 +1,6 @@ +#include +#include + #include "console.hh" /* conoutf */ #include "light.hh" #include "main.hh" // timings @@ -8,9 +11,6 @@ #include "renderva.hh" #include "texture.hh" -#include -#include - static Texture *sky[6] = { 0, 0, 0, 0, 0, 0 }, *clouds[6] = { 0, 0, 0, 0, 0, 0 }; static void loadsky(const char *basename, Texture *texs[6]) diff --git a/src/engine/rendertext.cc b/src/engine/rendertext.cc index e8ffa85..2e66482 100644 --- a/src/engine/rendertext.cc +++ b/src/engine/rendertext.cc @@ -1,12 +1,12 @@ #include "rendertext.hh" +#include +#include + #include "main.hh" // fatal, totalmillis #include "rendergl.hh" // xtraverts #include "texture.hh" -#include -#include - static hashnameset fonts; static font *fontdef = NULL; static int fontdeftex = 0; diff --git a/src/engine/renderva.cc b/src/engine/renderva.cc index f351008..1feffad 100644 --- a/src/engine/renderva.cc +++ b/src/engine/renderva.cc @@ -2,6 +2,10 @@ #include "renderva.hh" +#include +#include +#include + #include "blend.hh" #include "grass.hh" #include "main.hh" // renderprogress, timings @@ -15,10 +19,6 @@ #include "texture.hh" #include "world.hh" -#include -#include -#include - static inline void drawtris(GLsizei numindices, const GLvoid *indices, ushort minvert, ushort maxvert) { glDrawRangeElements_(GL_TRIANGLES, minvert, maxvert, numindices, GL_UNSIGNED_SHORT, indices); diff --git a/src/engine/shader.cc b/src/engine/shader.cc index 119da01..9be1d3a 100644 --- a/src/engine/shader.cc +++ b/src/engine/shader.cc @@ -2,6 +2,9 @@ #include "shader.hh" +#include +#include + #include "command.hh" // identflags #include "console.hh" /* conoutf */ #include "main.hh" // loadprogress, renderprogress, fatal @@ -10,9 +13,6 @@ #include "rendermodel.hh" // cleanupmodels #include "texture.hh" -#include -#include - Shader *Shader::lastshader = NULL; Shader *nullshader = NULL, *hudshader = NULL, *hudtextshader = NULL, *hudnotextureshader = NULL, *nocolorshader = NULL, *foggedshader = NULL, *foggednotextureshader = NULL, *ldrshader = NULL, *ldrnotextureshader = NULL, *stdworldshader = NULL; diff --git a/src/engine/stain.cc b/src/engine/stain.cc index 9757c2b..a4fae57 100644 --- a/src/engine/stain.cc +++ b/src/engine/stain.cc @@ -1,5 +1,9 @@ #include "stain.hh" +#include +#include +#include + #include "console.hh" /* conoutf */ #include "main.hh" // initing, loadprogress, timings #include "material.hh" @@ -9,10 +13,6 @@ #include "texture.hh" #include "world.hh" -#include -#include -#include - struct stainvert { vec pos; diff --git a/src/engine/texture.cc b/src/engine/texture.cc index 245b2ec..6f8a004 100644 --- a/src/engine/texture.cc +++ b/src/engine/texture.cc @@ -1,8 +1,11 @@ // texture.cpp: texture slot management +#include "texture.hh" + #include -#include "texture.hh" +#include +#include #include "command.hh" // identflags #include "console.hh" /* conoutf */ @@ -16,9 +19,6 @@ #include "shader.hh" #include "world.hh" -#include -#include - #ifdef __APPLE__ #include "SDL2_image/SDL_image.h" #else diff --git a/src/engine/water.cc b/src/engine/water.cc index 57efe82..0f73a5a 100644 --- a/src/engine/water.cc +++ b/src/engine/water.cc @@ -1,5 +1,8 @@ #include "water.hh" +#include +#include + #include "main.hh" // timings #include "material.hh" #include "octarender.hh" @@ -7,9 +10,6 @@ #include "texture.hh" #include "world.hh" -#include -#include - extern const vec matnormals[6]; extern vector watersurfs[4], waterfallsurfs[4], lavasurfs[4], lavafallsurfs[4]; diff --git a/src/engine/world.cc b/src/engine/world.cc index ab706c1..8ad3f02 100644 --- a/src/engine/world.cc +++ b/src/engine/world.cc @@ -1,5 +1,11 @@ // world.cpp: core map management stuff +#include "world.hh" + +#include +#include +#include + #include "blend.hh" #include "command.hh" #include "console.hh" /* conoutf */ @@ -17,11 +23,6 @@ #include "stain.hh" #include "texture.hh" #include "worldio.hh" -#include "world.hh" - -#include -#include -#include VARNR(mapscale, worldscale, 1, 0, 0); VARNR(mapsize, worldsize, 1, 0, 0); diff --git a/src/engine/worldio.cc b/src/engine/worldio.cc index d3183a4..7f42abe 100644 --- a/src/engine/worldio.cc +++ b/src/engine/worldio.cc @@ -1,5 +1,10 @@ // worldio.cpp: loading & saving of maps and savegames +#include "worldio.hh" + +#include +#include + #include "blend.hh" #include "command.hh" // idents, identflags #include "console.hh" /* conoutf */ @@ -11,10 +16,6 @@ #include "rendermodel.hh" // loadmapmodel, getmminfo, flushpreloadedmodels #include "texture.hh" #include "world.hh" -#include "worldio.hh" - -#include -#include #define OCTAVERSION 33 diff --git a/src/engine/worldio.hh b/src/engine/worldio.hh index 39e65ad..76584b9 100644 --- a/src/engine/worldio.hh +++ b/src/engine/worldio.hh @@ -1,6 +1,8 @@ #ifndef ENGINE_WORLDIO_HH #define ENGINE_WORLDIO_HH +#include + uint getmapcrc(); void clearmapcrc(); bool load_world(const char *mname, const char *cname = NULL); diff --git a/src/game/game.cc b/src/game/game.cc index 4b5c849..26ebe24 100644 --- a/src/game/game.cc +++ b/src/game/game.cc @@ -1,4 +1,4 @@ -#include "cube.hh" +#include #include #include diff --git a/src/shared/cube.hh b/src/shared/cube.hh deleted file mode 100644 index 06315eb..0000000 --- a/src/shared/cube.hh +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __CUBE_H__ -#define __CUBE_H__ - -#include "command.hh" - -#endif diff --git a/src/shared/igame.hh b/src/shared/igame.hh index b365bc9..613bb3a 100644 --- a/src/shared/igame.hh +++ b/src/shared/igame.hh @@ -3,6 +3,7 @@ struct entity; struct extentity; struct physent; +struct dynent; struct selinfo; struct VSlot; diff --git a/src/shared/stream.cc b/src/shared/stream.cc index 36fa26f..96356f4 100644 --- a/src/shared/stream.cc +++ b/src/shared/stream.cc @@ -1,6 +1,6 @@ -#include /* conoutf */ +#include "command.hh" -#include "cube.hh" +#include /* conoutf */ ///////////////////////// character conversion /////////////// diff --git a/src/shared/tools.cc b/src/shared/tools.cc index 1ad1fc7..aa31292 100644 --- a/src/shared/tools.cc +++ b/src/shared/tools.cc @@ -1,8 +1,8 @@ // implementation of generic tools -#include +#include "tools.hh" -#include "cube.hh" +#include void *operator new(size_t size) { diff --git a/src/shared/zip.cc b/src/shared/zip.cc index 0726a62..0ab39d0 100644 --- a/src/shared/zip.cc +++ b/src/shared/zip.cc @@ -1,6 +1,6 @@ -#include /* conoutf */ +#include "command.hh" -#include "cube.hh" +#include /* conoutf */ enum {