pvs header

master
Daniel Kolesa 2020-05-14 20:59:02 +02:00
parent 274faebccc
commit fa7a6fdd8c
12 changed files with 36 additions and 21 deletions

View File

@ -1,3 +1,4 @@
#include "pvs.hh"
#include "renderva.hh"
#include "engine.hh"

View File

@ -35,21 +35,6 @@ extern void drawcubemap(int size, const vec &o, float yaw, float pitch, const cu
extern void compacteditvslots();
extern void compactmruvslots();
// pvs
extern void clearpvs();
extern bool pvsoccluded(const ivec &bbmin, const ivec &bbmax);
extern bool pvsoccludedsphere(const vec &center, float radius);
extern bool waterpvsoccluded(int height);
extern void setviewcell(const vec &p);
extern void savepvs(stream *f);
extern void loadpvs(stream *f, int numpvs);
extern int getnumviewcells();
static inline bool pvsoccluded(const ivec &bborigin, int size)
{
return pvsoccluded(bborigin, ivec(bborigin).add(size));
}
// renderlights
#include "renderlights.hh"

View File

@ -1,6 +1,7 @@
#include "blend.hh"
#include "material.hh"
#include "octa.hh"
#include "pvs.hh"
#include "rendergl.hh"
#include "renderva.hh"
#include "texture.hh"

View File

@ -1,3 +1,4 @@
#include "pvs.hh"
#include "octa.hh"
#include "engine.hh"
@ -286,7 +287,7 @@ static struct
vector<materialsurface *> matsurfs;
} waterplanes[MAXWATERPVS];
static vector<materialsurface *> waterfalls;
uint numwaterplanes = 0;
static uint numwaterplanes = 0;
struct pvsworker
{
@ -1061,7 +1062,7 @@ static void findwaterplanes()
if(waterfalls.length() > 0 && numwaterplanes < MAXWATERPVS) numwaterplanes++;
}
void testpvs(int *vcsize)
static void testpvs(int *vcsize)
{
lockpvs_(false);
@ -1098,7 +1099,7 @@ void testpvs(int *vcsize)
COMMAND(testpvs, "i");
void genpvs(int *viewcellsize)
static void genpvs(int *viewcellsize)
{
if(worldsize > 1<<15)
{
@ -1181,7 +1182,7 @@ void genpvs(int *viewcellsize)
COMMAND(genpvs, "i");
void pvsstats()
static void pvsstats()
{
conoutf("%d unique view cells totaling %.1f kB and averaging %d B",
pvs.length(), pvsbuf.length()/1024.0f, pvsbuf.length()/max(pvs.length(), 1));
@ -1252,7 +1253,7 @@ bool waterpvsoccluded(int height)
return false;
}
void saveviewcells(stream *f, viewcellnode &p)
static void saveviewcells(stream *f, viewcellnode &p)
{
f->putchar(p.leafmask);
loopi(8)
@ -1280,7 +1281,7 @@ void savepvs(stream *f)
saveviewcells(f, *viewcells);
}
viewcellnode *loadviewcells(stream *f)
static viewcellnode *loadviewcells(stream *f)
{
viewcellnode *p = new viewcellnode;
p->leafmask = f->getchar();

20
src/engine/pvs.hh 100644
View File

@ -0,0 +1,20 @@
#ifndef ENGINE_PVS_HH
#define ENGINE_PVS_HH
#include <shared/geom.hh>
void clearpvs();
bool pvsoccluded(const ivec &bbmin, const ivec &bbmax);
bool pvsoccludedsphere(const vec &center, float radius);
bool waterpvsoccluded(int height);
void setviewcell(const vec &p);
void savepvs(stream *f);
void loadpvs(stream *f, int numpvs);
int getnumviewcells();
static inline bool pvsoccluded(const ivec &bborigin, int size)
{
return pvsoccluded(bborigin, ivec(bborigin).add(size));
}
#endif

View File

@ -4,6 +4,7 @@
#include "blend.hh"
#include "grass.hh"
#include "material.hh"
#include "pvs.hh"
#include "rendergl.hh"
#include "rendersky.hh"
#include "rendertext.hh"

View File

@ -2,6 +2,7 @@
#include "aa.hh"
#include "material.hh"
#include "pvs.hh"
#include "rendergl.hh"
#include "rendersky.hh"
#include "renderva.hh"

View File

@ -1,4 +1,5 @@
#include "aa.hh"
#include "pvs.hh"
#include "rendergl.hh"
#include "renderva.hh"
#include "shader.hh"

View File

@ -1,5 +1,6 @@
// renderparticles.cpp
#include "pvs.hh"
#include "rendergl.hh"
#include "rendertext.hh"
#include "renderva.hh"

View File

@ -3,6 +3,7 @@
#include "renderva.hh"
#include "blend.hh"
#include "grass.hh"
#include "pvs.hh"
#include "rendergl.hh"
#include "rendersky.hh"
#include "texture.hh"

View File

@ -2,6 +2,7 @@
#include "blend.hh"
#include "octa.hh"
#include "pvs.hh"
#include "rendergl.hh" /* fovy */
#include "renderlights.hh"
#include "stain.hh"

View File

@ -2,6 +2,7 @@
#include "blend.hh"
#include "octa.hh"
#include "pvs.hh"
#include "texture.hh"
#include "world.hh"
#include "worldio.hh"