diff --git a/src/render/light/mod.rs b/src/render/light/mod.rs index c1c51fe..8f084d1 100644 --- a/src/render/light/mod.rs +++ b/src/render/light/mod.rs @@ -71,12 +71,17 @@ impl LightBuffer { } } - pub fn remove_light(&mut self, queue: &wgpu::Queue, entity: edict::EntityId) { - todo!() // TODO - } + /// Remove a caster from the buffer, returns true if it was removed. + pub fn remove_light(&mut self, lights_buffer: &mut [U; MAX_LIGHT_COUNT], entity: edict::EntityId) -> bool { + if let Some(removed_idx) = self.used_indexes.remove(&entity) { + self.dead_indexes.push_back(removed_idx); + self.current_count -= 1; + lights_buffer[removed_idx] = U::default(); - pub fn prune_dead_lights(&mut self, queue: &wgpu::Queue, entity: edict::EntityId) { - todo!() // TODO + true + } else { + false + } } }