ddraw: Use wined3d_bit_scan() in viewport_alloc_active_light_index().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e867d986d5
commit
f30248f336
@ -152,15 +152,10 @@ void viewport_alloc_active_light_index(struct d3d_light *light)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
map = vp->map_lights;
|
|
||||||
assert(vp->active_lights_count < DDRAW_MAX_ACTIVE_LIGHTS && map != ~0u);
|
|
||||||
|
|
||||||
i = 0;
|
map = ~vp->map_lights;
|
||||||
while (map & 1)
|
assert(vp->active_lights_count < DDRAW_MAX_ACTIVE_LIGHTS && map);
|
||||||
{
|
i = wined3d_bit_scan(&map);
|
||||||
map >>= 1;
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
light->active_light_index = i + 1;
|
light->active_light_index = i + 1;
|
||||||
++vp->active_lights_count;
|
++vp->active_lights_count;
|
||||||
vp->map_lights |= 1u << i;
|
vp->map_lights |= 1u << i;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user