Skip to content

Commit

Permalink
spearmint: OpenGL2: Fix setting (unused) dlightBits
Browse files Browse the repository at this point in the history
If num_dlights is 32, the dlightBits were set to 0. Now it's correctly set
to UINT_MAX. However the "tr.refdef.dlightBits" variable isn't actually used
for anything in the OpenGL2 renderer.

Fixes undefined behavior reported by cppcheck analyzer.
  • Loading branch information
zturtleman committed Jun 15, 2020
1 parent 025a26f commit 46d1608
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/renderergl2/tr_light.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void R_CullDlights( void ) {
tr.refdef.num_dlights = MAX_DLIGHTS;
}

tr.refdef.dlightBits = ( 1 << tr.refdef.num_dlights ) - 1;
tr.refdef.dlightBits = ( 1ULL << tr.refdef.num_dlights ) - 1;
#else
int i, numDlights, dlightBits;
dlight_t *dl;
Expand Down

0 comments on commit 46d1608

Please sign in to comment.