diff --git a/src/engine/dynlight.cc b/src/engine/dynlight.cc index e19f8c9..f6ebcb6 100644 --- a/src/engine/dynlight.cc +++ b/src/engine/dynlight.cc @@ -1,3 +1,5 @@ +#include "dynlight.hh" + #include "pvs.hh" #include "renderva.hh" @@ -52,8 +54,8 @@ struct dynlight } }; -vector dynlights; -vector closedynlights; +static vector dynlights; +static vector closedynlights; void adddynlight(const vec &o, float radius, const vec &color, int fade, int peak, int flags, float initradius, const vec &initcolor, physent *owner, const vec &dir, int spot) { @@ -78,7 +80,7 @@ void adddynlight(const vec &o, float radius, const vec &color, int fade, int pea dynlights.insert(insert, d); } -void cleardynlights() +static void cleardynlights() { int faded = -1; loopv(dynlights) if(lastmillis + +struct physent; + +enum +{ + DL_SHRINK = 1<<8, + DL_EXPAND = 1<<9, + DL_FLASH = 1<<10 +}; + +void adddynlight(const vec &o, float radius, const vec &color, int fade = 0, int peak = 0, int flags = 0, float initradius = 0, const vec &initcolor = vec(0, 0, 0), physent *owner = NULL, const vec &dir = vec(0, 0, 0), int spot = 0); +void dynlightreaching(const vec &target, vec &color, vec &dir, bool hud = false); +void removetrackeddynlights(physent *owner = NULL); + +void updatedynlights(); +int finddynlights(); +bool getdynlight(int n, vec &o, float &radius, vec &color, vec &dir, int &spot, int &flags); + +#endif diff --git a/src/engine/engine.hh b/src/engine/engine.hh index 0ec31d1..03ac599 100644 --- a/src/engine/engine.hh +++ b/src/engine/engine.hh @@ -87,12 +87,6 @@ extern void destroyva(vtxarray *va, bool reparent = true); extern void updatevabb(vtxarray *va, bool force = false); extern void updatevabbs(bool force = false); -// dynlight - -extern void updatedynlights(); -extern int finddynlights(); -extern bool getdynlight(int n, vec &o, float &radius, vec &color, vec &dir, int &spot, int &flags); - // command extern hashnameset idents; extern int identflags; diff --git a/src/engine/renderlights.cc b/src/engine/renderlights.cc index 6ddec6b..9d8f2cf 100644 --- a/src/engine/renderlights.cc +++ b/src/engine/renderlights.cc @@ -1,6 +1,7 @@ #include "renderlights.hh" #include "aa.hh" +#include "dynlight.hh" #include "main.hh" // initwarning #include "material.hh" #include "octaedit.hh" // editmode diff --git a/src/shared/iengine.hh b/src/shared/iengine.hh index a711c68..32aafe1 100644 --- a/src/shared/iengine.hh +++ b/src/shared/iengine.hh @@ -109,18 +109,6 @@ extern void fatal(const char *s, ...) PRINTFARGS(1, 2); struct VSlot; -// dynlight -enum -{ - DL_SHRINK = 1<<8, - DL_EXPAND = 1<<9, - DL_FLASH = 1<<10 -}; - -extern void adddynlight(const vec &o, float radius, const vec &color, int fade = 0, int peak = 0, int flags = 0, float initradius = 0, const vec &initcolor = vec(0, 0, 0), physent *owner = NULL, const vec &dir = vec(0, 0, 0), int spot = 0); -extern void dynlightreaching(const vec &target, vec &color, vec &dir, bool hud = false); -extern void removetrackeddynlights(physent *owner = NULL); - // rendergl extern physent *camera1; extern vec worldpos, camdir, camright, camup;