]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_brush.h
No more busy-waiting when framerate cap is reached (in both Linux and win versions)
[xonotic/darkplaces.git] / model_brush.h
index 84e3f8e16b1f1d91fd523f4d155079ae26fc66d6..33b050691d2b6e448dc2e4a3168e250ebcf7b507 100644 (file)
@@ -55,8 +55,8 @@ typedef struct texture_s
 {
        char            name[16];
        unsigned        width, height;
-       int                     gl_texturenum;
-       int                     gl_glowtexturenum; // LordHavoc: fullbrights on walls
+       rtexture_t      *texture;
+       rtexture_t      *glowtexture; // LordHavoc: fullbrights on walls
        struct msurface_s       *texturechain;  // for gl_texsort drawing
        int                     anim_total;                             // total tenths in sequence ( 0 = no)
        int                     anim_min, anim_max;             // time for this frame min <=time< max
@@ -77,6 +77,8 @@ typedef struct texture_s
 // LordHavoc: added these for lava and teleport textures
 #define SURF_DRAWNOALPHA       0x100
 #define SURF_DRAWFULLBRIGHT    0x200
+// LordHavoc: light both sides
+#define SURF_LIGHTBOTHSIDES            0x400
 
 // !!! if this is changed, it must be changed in asm_draw.h too !!!
 typedef struct
@@ -93,8 +95,8 @@ typedef struct
        int                     flags;
 } mtexinfo_t;
 
-// LordHavoc: was 7, I added two more for raw lightmap coordinates, and then 3 more for light accumulation
-#define        VERTEXSIZE      12
+// LordHavoc: was 7, I added one more for raw lightmap position
+#define        VERTEXSIZE      8
 
 typedef struct glpoly_s
 {
@@ -118,7 +120,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;
@@ -127,15 +129,16 @@ typedef struct msurface_s
        
 // lighting info
        int                     dlightframe;
-//     int                     dlightbits[8];
+       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
+       short           cached_dlight;                          // LordHavoc: if lightmap was lit by dynamic lights, update on frame after end of effect to erase it
+       short           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;