diff --git a/Quake/gl_model.h b/Quake/gl_model.h index c581385c..f31e38f6 100644 --- a/Quake/gl_model.h +++ b/Quake/gl_model.h @@ -150,7 +150,8 @@ typedef struct msurface_s // lighting info int dlightframe; - int dlightbits; + unsigned int dlightbits[(MAX_DLIGHTS + 31) >> 5]; + // int is 32 bits, need an array for MAX_DLIGHTS > 32 int lightmaptexturenum; byte styles[MAXLIGHTMAPS]; diff --git a/Quake/gl_rlight.c b/Quake/gl_rlight.c index 26617f96..b739fbf7 100644 --- a/Quake/gl_rlight.c +++ b/Quake/gl_rlight.c @@ -165,7 +165,7 @@ DYNAMIC LIGHTS R_MarkLights -- johnfitz -- rewritten to use LordHavoc's lighting speedup ============= */ -void R_MarkLights (dlight_t *light, int bit, mnode_t *node) +void R_MarkLights (dlight_t *light, int num, mnode_t *node) { mplane_t *splitplane; msurface_t *surf; @@ -214,18 +214,18 @@ start: { if (surf->dlightframe != r_dlightframecount) // not dynamic until now { - surf->dlightbits = bit; + surf->dlightbits[num >> 5] = 1U << (num & 31); surf->dlightframe = r_dlightframecount; } else // already dynamic - surf->dlightbits |= bit; + surf->dlightbits[num >> 5] |= 1U << (num & 31); } } if (node->children[0]->contents >= 0) - R_MarkLights (light, bit, node->children[0]); + R_MarkLights (light, num, node->children[0]); if (node->children[1]->contents >= 0) - R_MarkLights (light, bit, node->children[1]); + R_MarkLights (light, num, node->children[1]); } /* @@ -249,7 +249,7 @@ void R_PushDlights (void) { if (l->die < cl.time || !l->radius) continue; - R_MarkLights ( l, 1<nodes ); + R_MarkLights (l, i, cl.worldmodel->nodes); } } diff --git a/Quake/glquake.h b/Quake/glquake.h index 85c543a0..77a95230 100644 --- a/Quake/glquake.h +++ b/Quake/glquake.h @@ -259,7 +259,7 @@ qboolean R_CullBox (vec3_t emins, vec3_t emaxs); void R_StoreEfrags (efrag_t **ppefrag); qboolean R_CullModelForEntity (entity_t *e); void R_RotateForEntity (vec3_t origin, vec3_t angles); -void R_MarkLights (dlight_t *light, int bit, mnode_t *node); +void R_MarkLights (dlight_t *light, int num, mnode_t *node); void R_InitParticles (void); void R_DrawParticles (void); diff --git a/Quake/r_brush.c b/Quake/r_brush.c index e7b31124..a7e38a63 100644 --- a/Quake/r_brush.c +++ b/Quake/r_brush.c @@ -538,7 +538,7 @@ void R_DrawBrushModel (entity_t *e) (!cl_dlights[k].radius)) continue; - R_MarkLights (&cl_dlights[k], 1<nodes + clmodel->hulls[0].firstclipnode); } } @@ -970,7 +970,7 @@ void R_AddDynamicLights (msurface_t *surf) for (lnum=0 ; lnumdlightbits & (1<dlightbits[lnum >> 5] & (1U << (lnum & 31)))) continue; // not lit by this light rad = cl_dlights[lnum].radius; diff --git a/README.html b/README.html index eb5b5883..693b51f4 100644 --- a/README.html +++ b/README.html @@ -175,6 +175,7 @@ these patched libSDL binaries may help.
  • Made Quake shareware 1.00 and 1.01 versions to be recognized properly.
  • Made the keypad keys to send separate key events in game mode.
  • +
  • Fixed increased (more than 32) dynamic lights.
  • Music playback: Made sure that the file's channels count is supported.
  • Support for Solaris.
  • Increased string buffer size from 256 to 384 for PF_VarString to work around broken mods such as UQC.
  • @@ -368,3 +369,4 @@ these patched libSDL binaries may help. + diff --git a/README.sgml b/README.sgml index 5a450aa2..eca047ae 100644 --- a/README.sgml +++ b/README.sgml @@ -101,6 +101,7 @@ these patched libSDL binaries may help. Made Quake shareware 1.00 and 1.01 versions to be recognized properly. Made the keypad keys to send separate key events in game mode. + Fixed increased (more than 32) dynamic lights. Music playback: Made sure that the file's channels count is supported. Support for Solaris. Increased string buffer size from 256 to 384 for PF_VarString to work around broken mods such as UQC. diff --git a/README.txt b/README.txt index 5762eeb4..4f11b7ec 100644 --- a/README.txt +++ b/README.txt @@ -163,6 +163,8 @@ o Made the keypad keys to send separate key events in game mode. + o Fixed increased (more than 32) dynamic lights. + o Music playback: Made sure that the file's channels count is supported.