make glider look nice
[carveJwlIkooP6JGAAIwe30JlM.git] / particle.c
index 13cc5d423c2b364da639e4a06f8d86ed077101a7..9c1f87e5e044f8674b4995cc4f6ee53367004c60 100644 (file)
@@ -1,4 +1,5 @@
 #include "particle.h"
+#include "shaders/trail.h"
 
 static void particle_spawn( particle_system *sys, 
                             v3f co, v3f v, f32 lifetime, u32 colour ){
@@ -22,7 +23,7 @@ static void particle_spawn_cone( particle_system *sys,
    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 );
@@ -94,13 +95,11 @@ static void async_particle_init( void *payload, u32 size ){
    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;