]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rsurf.c
handle funky ToAscii values (shift/ctrl/alt sometimes produce ascii values for no...
[xonotic/darkplaces.git] / gl_rsurf.c
index 84a9a6743d00af792a1e1d61d3e918123830fb51..255a49b3640bfc7713a1fd97346a35096cc6d2d2 100644 (file)
@@ -249,7 +249,7 @@ static void R_BuildLightMap (const entity_render_t *ent, msurface_t *surf)
 
        // set to full bright if no light data
                bl = intblocklights;
-               if ((ent->effects & EF_FULLBRIGHT) || !ent->model->brushq1.lightdata)
+               if (!ent->model->brushq1.lightdata)
                {
                        for (i = 0;i < size3;i++)
                                bl[i] = 255*256;
@@ -337,7 +337,7 @@ static void R_BuildLightMap (const entity_render_t *ent, msurface_t *surf)
 
        // set to full bright if no light data
                bl = floatblocklights;
-               if ((ent->effects & EF_FULLBRIGHT) || !ent->model->brushq1.lightdata)
+               if (!ent->model->brushq1.lightdata)
                        j = 255*256;
                else
                        j = r_ambient.value * 512.0f; // would be 128.0f logically, but using 512.0f to match winquake style
@@ -1232,6 +1232,16 @@ static void RSurfShader_Wall_Lightmap(const entity_render_t *ent, const texture_
                        }
                }
        }
+       else if (ent->effects & EF_FULLBRIGHT)
+       {
+               RSurfShader_OpaqueWall_Pass_BaseTexture(ent, texture, surfchain);
+               if (r_detailtextures.integer)
+                       RSurfShader_OpaqueWall_Pass_BaseDetail(ent, texture, surfchain);
+               if (texture->skin.glow)
+                       RSurfShader_OpaqueWall_Pass_Glow(ent, texture, surfchain);
+               if (fogenabled)
+                       RSurfShader_OpaqueWall_Pass_Fog(ent, texture, surfchain);
+       }
        else if (r_shadow_realtime_world.integer)
        {
                // opaque base lighting
@@ -1786,6 +1796,7 @@ void R_Q3BSP_DrawSkyFace(entity_render_t *ent, q3mface_t *face)
        rmeshstate_t m;
        if (!face->num_triangles)
                return;
+       c_faces++;
        if (skyrendernow)
        {
                skyrendernow = false;
@@ -2020,15 +2031,14 @@ void R_Q3BSP_DrawFace(entity_render_t *ent, q3mface_t *face)
 {
        if (!face->num_triangles)
                return;
-       if (face->texture->renderflags)
+       if (face->texture->surfaceparms)
        {
-               if (face->texture->renderflags & Q3MTEXTURERENDERFLAGS_SKY)
-                       return;
-               if (face->texture->renderflags & Q3MTEXTURERENDERFLAGS_NODRAW)
+               if (face->texture->surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NODRAW))
                        return;
        }
+       c_faces++;
        face->visframe = r_framecount;
-       if ((face->texture->renderflags & Q3MTEXTURERENDERFLAGS_TRANSPARENT) || ent->alpha < 1 || (ent->effects & EF_ADDITIVE))
+       if ((face->texture->surfaceparms & Q3SURFACEPARM_TRANS) || ent->alpha < 1 || (ent->effects & EF_ADDITIVE))
        {
                vec3_t facecenter, center;
                facecenter[0] = (face->mins[0] + face->maxs[0]) * 0.5f;
@@ -2077,11 +2087,13 @@ void R_Q3BSP_RecursiveWorldNode(entity_render_t *ent, q3mnode_t *node, const vec
        {
                if (R_CullBox(node->mins, node->maxs))
                        return;
+               c_nodes++;
                R_Q3BSP_RecursiveWorldNode(ent, node->children[0], modelorg, pvs, markframe);
                node = node->children[1];
        }
        if (R_CullBox(node->mins, node->maxs))
                return;
+       c_leafs++;
        leaf = (q3mleaf_t *)node;
        if (pvs[leaf->clusterindex >> 3] & (1 << (leaf->clusterindex & 7)))
                for (i = 0;i < leaf->numleaffaces;i++)
@@ -2110,12 +2122,12 @@ void R_Q3BSP_DrawSky(entity_render_t *ent)
                                R_Q3BSP_RecursiveWorldNode(ent, model->brushq3.data_nodes, modelorg, pvs, r_framecount);
                        }
                        for (i = 0, face = model->brushq3.data_thismodel->firstface;i < model->brushq3.data_thismodel->numfaces;i++, face++)
-                               if (face->markframe == r_framecount && (face->texture->renderflags & Q3MTEXTURERENDERFLAGS_SKY) && !R_CullBox(face->mins, face->maxs))
+                               if (face->markframe == r_framecount && (face->texture->surfaceflags & Q3SURFACEFLAG_SKY) && !R_CullBox(face->mins, face->maxs))
                                        R_Q3BSP_DrawSkyFace(ent, face);
                }
                else
                        for (i = 0, face = model->brushq3.data_thismodel->firstface;i < model->brushq3.data_thismodel->numfaces;i++, face++)
-                               if ((face->texture->renderflags & Q3MTEXTURERENDERFLAGS_SKY))
+                               if ((face->texture->surfaceflags & Q3SURFACEFLAG_SKY))
                                        R_Q3BSP_DrawSkyFace(ent, face);
        }
 }
@@ -2191,7 +2203,7 @@ void R_Q3BSP_DrawShadowVolume(entity_render_t *ent, vec3_t relativelightorigin,
 
 void R_Q3BSP_DrawFaceLight(entity_render_t *ent, q3mface_t *face, vec3_t relativelightorigin, vec3_t relativeeyeorigin, float lightradius, float *lightcolor, const matrix4x4_t *matrix_modeltofilter, const matrix4x4_t *matrix_modeltoattenuationxyz, const matrix4x4_t *matrix_modeltoattenuationz)
 {
-       if ((face->texture->renderflags & Q3MTEXTURERENDERFLAGS_NODRAW) || !face->num_triangles)
+       if ((face->texture->surfaceflags & Q3SURFACEFLAG_NODRAW) || !face->num_triangles)
                return;
        R_Shadow_DiffuseLighting(face->num_vertices, face->num_triangles, face->data_element3i, face->data_vertex3f, face->data_svector3f, face->data_tvector3f, face->data_normal3f, face->data_texcoordtexture2f, relativelightorigin, lightradius, lightcolor, matrix_modeltofilter, matrix_modeltoattenuationxyz, matrix_modeltoattenuationz, face->texture->skin.base, face->texture->skin.nmap, NULL);
        R_Shadow_SpecularLighting(face->num_vertices, face->num_triangles, face->data_element3i, face->data_vertex3f, face->data_svector3f, face->data_tvector3f, face->data_normal3f, face->data_texcoordtexture2f, relativelightorigin, relativeeyeorigin, lightradius, lightcolor, matrix_modeltofilter, matrix_modeltoattenuationxyz, matrix_modeltoattenuationz, face->texture->skin.gloss, face->texture->skin.nmap, NULL);