X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=model_brush.h;h=30296c1b7114dc4adefec7d6c1120b16f7e8a313;hb=668a437d46dfad040c8e32398fd7cb916345f7d1;hp=29bfe0539977e846bb099e692133e4f629ddbe0b;hpb=fb58cf191b52bed41ed00c4c28b2df3b43825bb3;p=xonotic%2Fdarkplaces.git diff --git a/model_brush.h b/model_brush.h index 29bfe053..30296c1b 100644 --- a/model_brush.h +++ b/model_brush.h @@ -18,6 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef MODEL_BRUSH_H +#define MODEL_BRUSH_H + /* ============================================================================== @@ -54,28 +57,36 @@ mplane_t; typedef struct texture_s { - char name[16]; - unsigned width, height; - int flags; // LordHavoc: SURF_ flags - - rtexture_t *texture; - rtexture_t *glowtexture; - rtexture_t *fogtexture; // alpha-only version of main texture - - int anim_total; // total frames in sequence (< 2 = not animated) - struct texture_s *anim_frames[10]; // LordHavoc: direct pointers to each of the frames in the sequence - struct texture_s *alternate_anims; // bmodels in frame 1 use these + // name + char name[16]; + // size + unsigned int width, height; + // SURF_ flags + unsigned int flags; + + // base texture without fullbrights, never NULL + rtexture_t *texture; + // fullbrights texture, NULL if no fullbrights used + rtexture_t *glowtexture; + // alpha texture (used for fogging), NULL if opaque + rtexture_t *fogtexture; + + // total frames in sequence and alternate sequence + int anim_total[2]; + // direct pointers to each of the frames in the sequences + // (indexed as [alternate][frame]) + struct texture_s *anim_frames[2][10]; + // set if animated or there is an alternate frame set + // (this is an optimization in the renderer) + int animated; } texture_t; #define SURF_PLANEBACK 2 #define SURF_DRAWSKY 4 -//#define SURF_DRAWSPRITE 8 #define SURF_DRAWTURB 0x10 #define SURF_LIGHTMAP 0x20 -//#define SURF_DRAWBACKGROUND 0x40 -//#define SURF_UNDERWATER 0x80 #define SURF_DRAWNOALPHA 0x100 #define SURF_DRAWFULLBRIGHT 0x200 #define SURF_LIGHTBOTHSIDES 0x400 @@ -111,6 +122,8 @@ surfvertex_t; // LordHavoc: replaces glpoly, triangle mesh typedef struct surfmesh_s { + // can be multiple meshs per surface + struct surfmesh_s *chain; int numverts; int numtriangles; surfvertex_t *vertex; @@ -153,7 +166,7 @@ typedef struct msurface_s // the stride when building lightmaps to comply with fragment update int lightmaptexturestride; // mesh for rendering - surfmesh_t mesh; + surfmesh_t *mesh; // these are just 3D points defining the outline of the polygon, // no texcoord info (that can be generated from these) @@ -261,6 +274,7 @@ typedef struct int lastclipnode; vec3_t clip_mins; vec3_t clip_maxs; + vec3_t clip_size; } hull_t; @@ -276,6 +290,20 @@ typedef struct mportal_s } mportal_t; +typedef struct mlight_s +{ + vec3_t origin; + float falloff; + vec3_t light; + float subtract; + vec3_t spotdir; + float spotcone; // cosine of spotlight cone angle (or 0 if not a spotlight) + float distbias; + int style; + int numleafs; // used only for loading calculations, number of leafs this shines on +} +mlight_t; + extern rtexture_t *r_notexture; extern texture_t r_notexture_mip; @@ -283,3 +311,6 @@ struct model_s; void Mod_LoadBrushModel (struct model_s *mod, void *buffer); void Mod_BrushInit(void); void Mod_FindNonSolidLocation(vec3_t pos, struct model_s *mod); + +#endif +