Fix undefined behavior when shifting left by 32.
https://bugzilla.icculus.org/show_bug.cgi?id=6432
This commit is contained in:
parent
927c9cc23c
commit
497a74f22a
2 changed files with 16 additions and 16 deletions
|
@ -353,10 +353,10 @@ void R_AddBrushModelSurfaces ( trRefEntity_t *ent ) {
|
|||
R_RecursiveWorldNode
|
||||
================
|
||||
*/
|
||||
static void R_RecursiveWorldNode( mnode_t *node, int planeBits, int dlightBits ) {
|
||||
static void R_RecursiveWorldNode( mnode_t *node, unsigned int planeBits, unsigned int dlightBits ) {
|
||||
|
||||
do {
|
||||
int newDlights[2];
|
||||
unsigned int newDlights[2];
|
||||
|
||||
// if the node wasn't marked as potentially visible, exit
|
||||
if (node->visframe != tr.visCount) {
|
||||
|
@ -661,8 +661,8 @@ void R_AddWorldSurfaces (void) {
|
|||
ClearBounds( tr.viewParms.visBounds[0], tr.viewParms.visBounds[1] );
|
||||
|
||||
// perform frustum culling and add all the potentially visible surfaces
|
||||
if ( tr.refdef.num_dlights > 32 ) {
|
||||
tr.refdef.num_dlights = 32 ;
|
||||
if ( tr.refdef.num_dlights > MAX_DLIGHTS ) {
|
||||
tr.refdef.num_dlights = MAX_DLIGHTS ;
|
||||
}
|
||||
R_RecursiveWorldNode( tr.world->nodes, 15, ( 1 << tr.refdef.num_dlights ) - 1 );
|
||||
R_RecursiveWorldNode( tr.world->nodes, 15, ( 1ULL << tr.refdef.num_dlights ) - 1 );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue