diff --git a/include/QF/model.h b/include/QF/model.h index d4f20524a..4290b45bb 100644 --- a/include/QF/model.h +++ b/include/QF/model.h @@ -102,6 +102,9 @@ typedef struct texture_s #define SURF_DRAWBACKGROUND 0x40 #define SURF_UNDERWATER 0x80 #define SURF_DONTWARP 0x100 +#define SURF_DRAWNOALPHA 0x200 +#define SURF_DRAWFULLBRIGHT 0x400 +#define SURF_LIGHTBOTHSIDES 0x800 // !!! if this is changed, it must be changed in asm_draw.h too !!! typedef struct diff --git a/libs/models/brush/model_brush.c b/libs/models/brush/model_brush.c index 095197032..dd0fdc385 100644 --- a/libs/models/brush/model_brush.c +++ b/libs/models/brush/model_brush.c @@ -80,7 +80,7 @@ Mod_PointInLeaf (vec3_t p, model_t *model) return (mleaf_t *) node; plane = node->plane; d = DotProduct (p, plane->normal) - plane->dist; - if (d > 0) + if (d >= 0) node = node->children[0]; else node = node->children[1]; @@ -537,7 +537,9 @@ Mod_LoadFaces (lump_t *l) if (out->texinfo->texture->name[0] == '*') // turbulent { - out->flags |= (SURF_DRAWTURB | SURF_DRAWTILED); + out->flags |= (SURF_DRAWTURB + | SURF_DRAWTILED + | SURF_LIGHTBOTHSIDES); for (i = 0; i < 2; i++) { out->extents[i] = 16384; out->texturemins[i] = -8192; diff --git a/libs/video/renderer/gl/gl_rlight.c b/libs/video/renderer/gl/gl_rlight.c index 32300eab9..0d82d2931 100644 --- a/libs/video/renderer/gl/gl_rlight.c +++ b/libs/video/renderer/gl/gl_rlight.c @@ -288,23 +288,21 @@ static void mark_surfaces (msurface_t *surf, vec3_t lightorigin, dlight_t *light, int bit) { - float dist, dist2, d; + float dist; +#if 1 + float dist2, d; float maxdist = light->radius * light->radius; vec3_t impact; +#endif surf->dlightframe = r_framecount; dist = PlaneDiff(lightorigin, surf->plane); if (surf->flags & SURF_PLANEBACK) dist = -dist; -#if 0 -//FIXME SURF_LIGHTBOTHSIDES seems to be a darkplaces thing. need to investigate if ((dist < -0.25f && !(surf->flags & SURF_LIGHTBOTHSIDES)) - || dist > radius) + || dist > light->radius) return; -#else - if (dist < -0.25f || dist > light->radius) - return; -#endif +#if 1 dist2 = dist * dist; dist = -dist; VectorMA (light->origin, dist, surf->plane->normal, impact); @@ -337,7 +335,7 @@ mark_surfaces (msurface_t *surf, vec3_t lightorigin, dlight_t *light, return; } } - +#endif if (surf->dlightframe != r_framecount) { surf->dlightbits = 0; surf->dlightframe = r_framecount;