X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=model_brush.h;h=172ae413a927bad33be27b3a85d716d244023a84;hp=625da0107be18e72a4fd7b74564c48038f095e8f;hb=6a384398c93b7e2bc1936427797909eb60094160;hpb=8dcce44300385b12c46d494c06aadcfa35a8bc14 diff --git a/model_brush.h b/model_brush.h index 625da010..172ae413 100644 --- a/model_brush.h +++ b/model_brush.h @@ -42,14 +42,11 @@ typedef struct // plane_t structure -// !!! if this is changed, it must be changed in asm_i386.h too !!! typedef struct mplane_s { vec3_t normal; float dist; byte type; // for texture axis selection and fast side tests -// byte signbits; // signx + signy<<1 + signz<<2 -// byte pad[2]; byte pad[3]; int (*BoxOnPlaneSideFunc) (vec3_t emins, vec3_t emaxs, struct mplane_s *p); } mplane_t; @@ -96,8 +93,8 @@ typedef struct int flags; } mtexinfo_t; -// LordHavoc: was 7, I added two more for raw lightmap coordinates -#define VERTEXSIZE 9 +// LordHavoc: was 7, I added one more for raw lightmap position +#define VERTEXSIZE 8 typedef struct glpoly_s { @@ -121,7 +118,7 @@ typedef struct msurface_s short texturemins[2]; short extents[2]; - int light_s, light_t; // gl lightmap coordinates + short light_s, light_t; // gl lightmap coordinates glpoly_t *polys; // multiple if warped struct msurface_s *texturechain; @@ -132,24 +129,33 @@ typedef struct msurface_s int dlightframe; int dlightbits[8]; + int lightframe; // avoid redundent addition of dlights + int worldnodeframe; // only render each surface once + int lightmaptexturenum; byte styles[MAXLIGHTMAPS]; - int cached_light[MAXLIGHTMAPS]; // values currently used in lightmap - qboolean cached_dlight; // true if dynamic light in cache - qboolean cached_lighthalf; // LordHavoc: to cause lightmap to be rerendered when lighthalf changes + unsigned short cached_light[MAXLIGHTMAPS]; // values currently used in lightmap + int cached_lighthalf; // LordHavoc: to cause lightmap to be rerendered when lighthalf changes + float cached_ambient; // LordHavoc: rerender lightmaps when r_ambient changes byte *samples; // [numstyles*surfsize] } msurface_t; +// warning: if this is changed, references must be updated in cpu_* assembly files typedef struct mnode_s { // common with leaf int contents; // 0, to differentiate from leafs int visframe; // node needs to be traversed if current + int lightframe; // LordHavoc: to avoid redundent parent chasing in R_VisMarkLights float minmaxs[6]; // for bounding box culling struct mnode_s *parent; + // LordHavoc: node based dynamic lighting + int dlightbits[8]; + int dlightframe; + // node specific mplane_t *plane; struct mnode_s *children[2]; @@ -165,11 +171,16 @@ typedef struct mleaf_s // common with node int contents; // wil be a negative contents number int visframe; // node needs to be traversed if current + int lightframe; // LordHavoc: to avoid redundent parent chasing in R_VisMarkLights float minmaxs[6]; // for bounding box culling struct mnode_s *parent; + // LordHavoc: node based dynamic lighting + int dlightbits[8]; + int dlightframe; + // leaf specific byte *compressed_vis; efrag_t *efrags; @@ -180,7 +191,6 @@ typedef struct mleaf_s byte ambient_sound_level[NUM_AMBIENTS]; } mleaf_t; -// !!! if this is changed, it must be changed in asm_i386.h too !!! typedef struct { dclipnode_t *clipnodes;