Commit f30248f3 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Use wined3d_bit_scan() in viewport_alloc_active_light_index().

parent e867d986
...@@ -152,15 +152,10 @@ void viewport_alloc_active_light_index(struct d3d_light *light) ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment