#include "particle.h"
+#include "shaders/trail.h"
static void particle_spawn( particle_system *sys,
v3f co, v3f v, f32 lifetime, u32 colour ){
v3_tangent_basis( dir, tx, ty );
v3f rand;
- vg_rand_cone( rand, angle );
+ vg_rand_cone( &vg.rand, rand, angle );
v3_muls( tx, rand[0]*speed, p->v );
v3_muladds( p->v, ty, rand[1]*speed, p->v );
v3_muladds( p->v, dir, rand[2]*speed, p->v );
VG_CHECK_GL_ERR();
}
-static void particle_alloc( particle_system *sys, u32 max ){
- static int reg = 1;
- if( reg ){
- shader_particle_register();
- reg = 0;
- }
+static void particle_init(void){
+ shader_particle_register();
+}
+static void particle_alloc( particle_system *sys, u32 max ){
size_t stride = sizeof(particle_vert);
sys->max = max;