@@ -634,7 +634,7 @@ HRESULT wined3d_light_state_set_light(struct wined3d_light_state *state, DWORD l return WINED3D_OK; } -void wined3d_light_state_enable_light(struct wined3d_light_state *state, const struct wined3d_d3d_info *d3d_info, +BOOL wined3d_light_state_enable_light(struct wined3d_light_state *state, const struct wined3d_d3d_info *d3d_info, struct wined3d_light_info *light_info, BOOL enable) { unsigned int light_count, i;
We probably prefer bool over BOOL here.
+static int lights_compare(const void *key, const struct rb_entry *entry) +{ + const struct wined3d_light_info *light = RB_ENTRY_VALUE(entry, struct wined3d_light_info, entry); + unsigned int original_index = (ULONG_PTR)key; + + return light->OriginalIndex - original_index; +}
Subtraction is not generally a safe way to implement comparison functions. It'll probably be fine in practice because the indices will be relatively small, but I think we'll want to use wined3d_uint32_compare() here instead.