libpsys
diff src/pattr.h @ 6:d774738f50f6
almost finished with the reorg (2)
author | John Tsiombikas <nuclear@mutantstargoat.com> |
---|---|
date | Tue, 27 Sep 2011 07:42:54 +0300 |
parents | |
children | 9c24273f211b |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/pattr.h Tue Sep 27 07:42:54 2011 +0300 1.3 @@ -0,0 +1,37 @@ 1.4 +#ifndef PATTR_H_ 1.5 +#define PATTR_H_ 1.6 + 1.7 +#include "pstrack.h" 1.8 +#include "rndval.h" 1.9 + 1.10 +struct psys_attributes { 1.11 + unsigned int tex; /* OpenGL texture to use for the billboard */ 1.12 + 1.13 + struct psys_track3 spawn_range; /* radius of emmiter */ 1.14 + struct psys_track rate; /* spawn rate particles per sec */ 1.15 + struct psys_anm_rnd life; /* particle life in seconds */ 1.16 + struct psys_anm_rnd size; /* base particle size */ 1.17 + struct psys_anm_rnd3 dir; /* particle shoot direction */ 1.18 + 1.19 + struct psys_track3 grav; /* external force (usually gravity) */ 1.20 + 1.21 + float drag; /* I don't think this needs to animate */ 1.22 + 1.23 + /* limits */ 1.24 + int max_particles; 1.25 +}; 1.26 + 1.27 +void psys_texture_loader(unsigned int (*load)(const char*, void*), void (*unload)(unsigned int, void*), void *cls); 1.28 + 1.29 +int psys_init_attr(struct psys_attributes *attr); 1.30 +void psys_destroy_attr(struct psys_attributes *attr); 1.31 + 1.32 +void psys_eval_attr(struct psys_attributes *attr, anm_time_t tm); 1.33 + 1.34 +int psys_load_attr(struct psys_attributes *attr, const char *fname); 1.35 +int psys_load_attr_stream(struct psys_attributes *attr, FILE *fp); 1.36 + 1.37 +int psys_save_attr(struct psys_attributes *attr, const char *fname); 1.38 +int psys_save_attr_stream(struct psys_attributes *attr, FILE *fp); 1.39 + 1.40 +#endif