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;
|
||||
while (map & 1)
|
||||
{
|
||||
map >>= 1;
|
||||
++i;
|
||||
}
|
||||
map = ~vp->map_lights;
|
||||
assert(vp->active_lights_count < DDRAW_MAX_ACTIVE_LIGHTS && map);
|
||||
i = wined3d_bit_scan(&map);
|
||||
light->active_light_index = i + 1;
|
||||
++vp->active_lights_count;
|
||||
vp->map_lights |= 1u << i;
|
||||
|
|
Loading…
Reference in New Issue