]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rsurf.c
fixed animated textures in realtime lighting mode (now calls R_UpdateTextureInfo)
[xonotic/darkplaces.git] / gl_rsurf.c
index a3ab306dbd56cc5810946c0948fa60c47f878c85..5adf08f65e93fb777dae23b69ee9e9835d94ffd0 100644 (file)
@@ -1839,7 +1839,7 @@ void R_Model_Brush_GetLightInfo(entity_render_t *ent, vec3_t relativelightorigin
                                if (!CHECKPVSBIT(outsurfacepvs, surfaceindex))
                                {
                                        surface = model->brushq1.surfaces + surfaceindex;
-                                       if (BoxesOverlap(lightmins, lightmaxs, surface->poly_mins, surface->poly_maxs))
+                                       if (BoxesOverlap(lightmins, lightmaxs, surface->poly_mins, surface->poly_maxs) && (surface->flags & SURF_LIGHTMAP) && !surface->texinfo->texture->skin.fog)
                                        {
                                                for (triangleindex = 0, t = surface->num_firstshadowmeshtriangle, e = model->brush.shadowmesh->element3i + t * 3;triangleindex < surface->mesh.num_triangles;triangleindex++, t++, e += 3)
                                                {
@@ -1922,6 +1922,7 @@ void R_Model_Brush_DrawLight(entity_render_t *ent, vec3_t relativelightorigin, v
                lightmaxs[2] = relativelightorigin[2] + lightradius;
                R_Mesh_Matrix(&ent->matrix);
                Matrix4x4_Transform(&ent->inversematrix, r_vieworigin, modelorg);
+               R_UpdateTextureInfo(ent);
                for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++)
                {
                        surface = model->brushq1.surfaces + surfacelist[surfacelistindex];
@@ -2288,11 +2289,8 @@ void R_Q3BSP_DrawFace(entity_render_t *ent, q3mface_t *face)
 {
        if (!face->num_triangles)
                return;
-       if (face->texture->surfaceparms)
-       {
-               if (face->texture->surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NODRAW))
-                       return;
-       }
+       if (face->texture->surfaceflags && (face->texture->surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NODRAW)))
+               return;
        c_faces++;
        if ((face->texture->surfaceparms & Q3SURFACEPARM_TRANS) || ent->alpha < 1 || (ent->effects & EF_ADDITIVE))
        {
@@ -2518,7 +2516,7 @@ void R_Q3BSP_GetLightInfo(entity_render_t *ent, vec3_t relativelightorigin, floa
                                surfaceindex = surface - model->brushq3.data_faces;
                                if (!CHECKPVSBIT(outsurfacepvs, surfaceindex))
                                {
-                                       if (BoxesOverlap(lightmins, lightmaxs, surface->mins, surface->maxs))
+                                       if (BoxesOverlap(lightmins, lightmaxs, surface->mins, surface->maxs) && !(surface->texture->surfaceparms & Q3SURFACEPARM_TRANS) && !(surface->texture->surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NODRAW)))
                                        {
                                                for (triangleindex = 0, t = surface->num_firstshadowmeshtriangle, e = model->brush.shadowmesh->element3i + t * 3;triangleindex < surface->num_triangles;triangleindex++, t++, e += 3)
                                                {