actually render trails
[carveJwlIkooP6JGAAIwe30JlM.git] / particle.c
index 13cc5d423c2b364da639e4a06f8d86ed077101a7..e1f6ac85b0f31270b75c0fafb91160aa0c767233 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 );
@@ -98,6 +99,7 @@ static void particle_alloc( particle_system *sys, u32 max ){
    static int reg = 1;
    if( reg ){
       shader_particle_register();
+      shader_trail_register();
       reg = 0;
    }