Scene loading fixes
This commit is contained in:
@@ -33,6 +33,8 @@ Particle_System :: struct {
|
||||
_locator: Bucket_Locator;
|
||||
|
||||
on_particle_update: (*Particle_System, float);
|
||||
|
||||
scene: *Scene;
|
||||
}
|
||||
|
||||
create_particle_system :: (pipeline: Pipeline_State_Handle, update_func: (*Particle_System, float), owning_entity: *Entity = null, scene: *Scene = null) -> *Particle_System {
|
||||
@@ -43,9 +45,15 @@ create_particle_system :: (pipeline: Pipeline_State_Handle, update_func: (*Parti
|
||||
particle_system.pipeline = pipeline;
|
||||
particle_system.on_particle_update = update_func;
|
||||
particle_system.owning_entity = owning_entity;
|
||||
particle_system.scene = scene;
|
||||
return particle_system;
|
||||
}
|
||||
|
||||
destroy_particle_system :: (system: *Particle_System) {
|
||||
destroy_buffer(engine.renderer, system.vertex_buffer);
|
||||
bucket_array_remove(*system.scene.particle_systems, system._locator);
|
||||
}
|
||||
|
||||
spawn_particle :: (system: *Particle_System, position: Vector3, velocity: Vector3 = .{0,0,0}, size: float = 1.0, lifetime: float = 1.0, color: Vector4 = .{1,1,1,1}) {
|
||||
particle: Particle;
|
||||
particle.position = position;
|
||||
|
||||
Reference in New Issue
Block a user