diff --git a/src/engine/light.cc b/src/engine/light.cc index 2f70e9b..e451e08 100644 --- a/src/engine/light.cc +++ b/src/engine/light.cc @@ -642,7 +642,8 @@ void initlights() loaddeferredlightshaders(); } -void lightreaching(const vec &target, vec &color, vec &dir, bool fast, extentity *t, float minambient) +#if 0 +static void lightreaching(const vec &target, vec &color, vec &dir, bool fast = false, extentity *t = nullptr, float minambient = 0.4f) { if(fullbright && editmode) { @@ -702,4 +703,4 @@ void lightreaching(const vec &target, vec &color, vec &dir, bool fast, extentity if(dir.iszero()) dir = vec(0, 0, 1); else dir.normalize(); } - +#endif diff --git a/src/engine/physics.hh b/src/engine/physics.hh index e6665ca..6e968e2 100644 --- a/src/engine/physics.hh +++ b/src/engine/physics.hh @@ -35,4 +35,11 @@ void cleardynentcache(); void updatedynentcache(physent *d); bool entinmap(dynent *d, bool avoidplayers = false); +enum { RAY_BB = 1, RAY_POLY = 3, RAY_ALPHAPOLY = 7, RAY_ENTS = 9, RAY_CLIPMAT = 16, RAY_SKIPFIRST = 32, RAY_EDITMAT = 64, RAY_SHADOW = 128, RAY_PASS = 256, RAY_SKIPSKY = 512 }; + +float raycube (const vec &o, const vec &ray, float radius = 0, int mode = RAY_CLIPMAT, int size = 0, extentity *t = 0); +float raycubepos(const vec &o, const vec &ray, vec &hit, float radius = 0, int mode = RAY_CLIPMAT, int size = 0); +float rayfloor (const vec &o, vec &floor, int mode = 0, float radius = 0); +bool raycubelos(const vec &o, const vec &dest, vec &hitpos); + #endif diff --git a/src/engine/rendergl.cc b/src/engine/rendergl.cc index 44c53b0..9166f35 100644 --- a/src/engine/rendergl.cc +++ b/src/engine/rendergl.cc @@ -1387,7 +1387,7 @@ FVAR(thirdpersonup, -25, 0, 25); FVAR(thirdpersonside, -25, 0, 25); physent *camera1 = NULL; static bool detachedcamera = false; -bool isthirdperson() { return player!=camera1 || detachedcamera; } +static bool isthirdperson() { return player!=camera1 || detachedcamera; } static void fixcamerarange() { diff --git a/src/engine/renderparticles.cc b/src/engine/renderparticles.cc index bc5c82a..4d097d0 100644 --- a/src/engine/renderparticles.cc +++ b/src/engine/renderparticles.cc @@ -6,6 +6,7 @@ #include "octaedit.hh" // editmode #include "octarender.hh" #include "pvs.hh" +#include "physics.hh" // ray* #include "rendergl.hh" #include "rendertext.hh" #include "renderva.hh" diff --git a/src/shared/iengine.hh b/src/shared/iengine.hh index 55c819f..90f7140 100644 --- a/src/shared/iengine.hh +++ b/src/shared/iengine.hh @@ -6,19 +6,6 @@ extern int elapsedtime; // elapsed frame time extern int totalmillis; // total elapsed time extern int gamespeed, paused; -extern void lightent(extentity &e, float height = 8.0f); -extern void lightreaching(const vec &target, vec &color, vec &dir, bool fast = false, extentity *e = 0, float minambient = 0.4f); - -enum { RAY_BB = 1, RAY_POLY = 3, RAY_ALPHAPOLY = 7, RAY_ENTS = 9, RAY_CLIPMAT = 16, RAY_SKIPFIRST = 32, RAY_EDITMAT = 64, RAY_SHADOW = 128, RAY_PASS = 256, RAY_SKIPSKY = 512 }; - -extern float raycube (const vec &o, const vec &ray, float radius = 0, int mode = RAY_CLIPMAT, int size = 0, extentity *t = 0); -extern float raycubepos(const vec &o, const vec &ray, vec &hit, float radius = 0, int mode = RAY_CLIPMAT, int size = 0); -extern float rayfloor (const vec &o, vec &floor, int mode = 0, float radius = 0); -extern bool raycubelos(const vec &o, const vec &dest, vec &hitpos); - -extern int thirdperson; -extern bool isthirdperson(); - // command extern int variable(const char *name, int min, int cur, int max, int *storage, identfun fun, int flags); extern float fvariable(const char *name, float min, float cur, float max, float *storage, identfun fun, int flags);