diff --git a/src/engine/blend.cc b/src/engine/blend.cc index 1034098..53f64bc 100644 --- a/src/engine/blend.cc +++ b/src/engine/blend.cc @@ -1,3 +1,5 @@ +#include "blend.hh" + #include "engine.hh" enum @@ -261,7 +263,7 @@ static void fillblendmap(uchar &type, BlendMapNode &node, int size, uchar val, i } } -void fillblendmap(int x, int y, int w, int h, uchar val) +static void fillblendmap(int x, int y, int w, int h, uchar val) { int bmsize = worldsize>>BM_SCALE, x1 = clamp(x, 0, bmsize), @@ -308,7 +310,7 @@ static void invertblendmap(uchar &type, BlendMapNode &node, int size, int x1, in } } -void invertblendmap(int x, int y, int w, int h) +static void invertblendmap(int x, int y, int w, int h) { int bmsize = worldsize>>BM_SCALE, x1 = clamp(x, 0, bmsize), @@ -426,7 +428,7 @@ static void blitblendmap(uchar &type, BlendMapNode &node, int bmx, int bmy, int } } -void blitblendmap(uchar *src, int sx, int sy, int sw, int sh, int smode) +static void blitblendmap(uchar *src, int sx, int sy, int sw, int sh, int smode) { int bmsize = worldsize>>BM_SCALE; if(max(sx, sy) >= bmsize || min(sx+sw, sy+sh) <= 0 || min(sw, sh) <= 0) return; @@ -549,7 +551,7 @@ void moveblendmap(uchar type, BlendMapNode &node, int size, int x, int y, int dx } } -void moveblendmap(int dx, int dy) +static void moveblendmap(int dx, int dy) { BlendMapRoot old = blendmap; blendmap.type = BM_SOLID; @@ -677,7 +679,7 @@ struct BlendTexture static vector blendtexs; -void dumpblendtexs() +static void dumpblendtexs() { loopv(blendtexs) { @@ -877,7 +879,7 @@ ICOMMAND(clearblendbrushes, "", (), curbrush = -1; }); -void delblendbrush(const char *name) +static void delblendbrush(const char *name) { loopv(brushes) if(!strcmp(brushes[i]->name, name)) { @@ -889,7 +891,7 @@ void delblendbrush(const char *name) COMMAND(delblendbrush, "s"); -void addblendbrush(const char *name, const char *imgname) +static void addblendbrush(const char *name, const char *imgname) { delblendbrush(name); @@ -940,7 +942,7 @@ ICOMMAND(curblendbrush, "", (), intret(curbrush)); extern int nompedit; -bool canpaintblendmap(bool brush = true, bool sel = false, bool msg = true) +static bool canpaintblendmap(bool brush = true, bool sel = false, bool msg = true) { if(noedit(!sel, msg) || (nompedit && multiplayer())) return false; if(!blendpaintmode) @@ -965,7 +967,7 @@ ICOMMAND(rotateblendbrush, "i", (int *val), brush->reorient(r.flipx, r.flipy, r.swapxy); }); -void paintblendmap(bool msg) +static void paintblendmap(bool msg) { if(!canpaintblendmap(true, false, msg)) return; @@ -1010,7 +1012,7 @@ ICOMMAND(paintblendmap, "D", (int *isdown), else stoppaintblendmap(); }); -void clearblendmapsel() +static void clearblendmapsel() { if(noedit(false) || (nompedit && multiplayer())) return; extern selinfo sel; @@ -1024,7 +1026,7 @@ void clearblendmapsel() COMMAND(clearblendmapsel, ""); -void invertblendmapsel() +static void invertblendmapsel() { if(noedit(false) || (nompedit && multiplayer())) return; extern selinfo sel; @@ -1045,7 +1047,7 @@ ICOMMAND(invertblendmap, "", (), previewblends(ivec(0, 0, 0), ivec(worldsize, worldsize, worldsize)); }); -void showblendmap() +static void showblendmap() { if(noedit(true) || (nompedit && multiplayer())) return; previewblends(ivec(0, 0, 0), ivec(worldsize, worldsize, worldsize)); diff --git a/src/engine/engine.hh b/src/engine/engine.hh index eb7582a..13b2cdd 100644 --- a/src/engine/engine.hh +++ b/src/engine/engine.hh @@ -743,33 +743,6 @@ extern void generategrass(); extern void rendergrass(); extern void cleanupgrass(); -// blendmap -extern int blendpaintmode; - -struct BlendMapCache; -extern BlendMapCache *newblendmapcache(); -extern void freeblendmapcache(BlendMapCache *&cache); -extern bool setblendmaporigin(BlendMapCache *cache, const ivec &o, int size); -extern bool hasblendmap(BlendMapCache *cache); -extern uchar lookupblendmap(BlendMapCache *cache, const vec &pos); -extern void resetblendmap(); -extern void enlargeblendmap(); -extern void shrinkblendmap(int octant); -extern void optimizeblendmap(); -extern void stoppaintblendmap(); -extern void trypaintblendmap(); -extern void renderblendbrush(GLuint tex, float x, float y, float w, float h); -extern void renderblendbrush(); -extern bool loadblendmap(stream *f, int info); -extern void saveblendmap(stream *f); -extern uchar shouldsaveblendmap(); -extern bool usesblendmap(int x1 = 0, int y1 = 0, int x2 = worldsize, int y2 = worldsize); -extern int calcblendlayer(int x1, int y1, int x2, int y2); -extern void updateblendtextures(int x1 = 0, int y1 = 0, int x2 = worldsize, int y2 = worldsize); -extern void bindblendtexture(const ivec &p); -extern void clearblendtextures(); -extern void cleanupblendmap(); - // recorder namespace recorder diff --git a/src/engine/grass.cc b/src/engine/grass.cc index d3fe477..439b118 100644 --- a/src/engine/grass.cc +++ b/src/engine/grass.cc @@ -1,3 +1,5 @@ +#include "blend.hh" + #include "engine.hh" VARP(grass, 0, 1, 1); diff --git a/src/engine/light.cc b/src/engine/light.cc index 5a43148..576b00f 100644 --- a/src/engine/light.cc +++ b/src/engine/light.cc @@ -1,3 +1,5 @@ +#include "blend.hh" + #include "engine.hh" CVAR1R(ambient, 0x191919); diff --git a/src/engine/main.cc b/src/engine/main.cc index dcba38a..b17daf1 100644 --- a/src/engine/main.cc +++ b/src/engine/main.cc @@ -1,5 +1,7 @@ // main.cpp: initialisation & main loop +#include "blend.hh" + #include "engine.hh" extern void cleargamma(); diff --git a/src/engine/octaedit.cc b/src/engine/octaedit.cc index a4c1ec0..4ac9a6a 100644 --- a/src/engine/octaedit.cc +++ b/src/engine/octaedit.cc @@ -1,3 +1,5 @@ +#include "blend.hh" + #include "engine.hh" extern int outline; diff --git a/src/engine/octarender.cc b/src/engine/octarender.cc index 706d308..72d699a 100644 --- a/src/engine/octarender.cc +++ b/src/engine/octarender.cc @@ -1,5 +1,7 @@ // octarender.cpp: fill vertex arrays with different cube surfaces. +#include "blend.hh" + #include "engine.hh" struct vboinfo diff --git a/src/engine/rendergl.cc b/src/engine/rendergl.cc index 9ecac2a..bf816b6 100644 --- a/src/engine/rendergl.cc +++ b/src/engine/rendergl.cc @@ -1,6 +1,7 @@ // rendergl.cpp: core opengl rendering stuff #include "aa.hh" +#include "blend.hh" #include "engine.hh" diff --git a/src/engine/renderva.cc b/src/engine/renderva.cc index a7a9aba..8b45974 100644 --- a/src/engine/renderva.cc +++ b/src/engine/renderva.cc @@ -1,5 +1,7 @@ // renderva.cpp: handles the occlusion and rendering of vertex arrays +#include "blend.hh" + #include "engine.hh" static inline void drawtris(GLsizei numindices, const GLvoid *indices, ushort minvert, ushort maxvert) diff --git a/src/engine/world.cc b/src/engine/world.cc index eea3181..f6ec825 100644 --- a/src/engine/world.cc +++ b/src/engine/world.cc @@ -1,5 +1,7 @@ // world.cpp: core map management stuff +#include "blend.hh" + #include "engine.hh" VARR(mapversion, 1, MAPVERSION, 0); diff --git a/src/engine/worldio.cc b/src/engine/worldio.cc index de700eb..c14dd4d 100644 --- a/src/engine/worldio.cc +++ b/src/engine/worldio.cc @@ -1,5 +1,9 @@ // worldio.cpp: loading & saving of maps and savegames +#ifndef STANDALONE +#include "blend.hh" +#endif + #include "engine.hh" void validmapname(char *dst, const char *src, const char *prefix = NULL, const char *alt = "untitled", size_t maxlen = 100) diff --git a/src/shared/tools.hh b/src/shared/tools.hh index 7b28c6a..2b80912 100644 --- a/src/shared/tools.hh +++ b/src/shared/tools.hh @@ -3,9 +3,17 @@ #ifndef _TOOLS_H #define _TOOLS_H +#include +#include +#include + #include #include +#ifndef STANDALONE +#include "gl.hh" +#endif + #ifdef NULL #undef NULL #endif