nuclear@67: #ifndef PATTR_H_ nuclear@67: #define PATTR_H_ nuclear@67: nuclear@67: #include "pstrack.h" nuclear@67: #include "rndval.h" nuclear@67: nuclear@67: /* the particle attributes vary from 0 to 1 during its lifetime */ nuclear@67: struct psys_particle_attributes { nuclear@67: struct psys_track3 color; nuclear@67: struct psys_track alpha; nuclear@67: struct psys_track size; nuclear@67: }; nuclear@67: nuclear@67: struct psys_attributes { nuclear@67: unsigned int tex; /* OpenGL texture to use for the billboard */ nuclear@67: nuclear@67: struct psys_track3 spawn_range; /* radius of emmiter */ nuclear@67: struct psys_track rate; /* spawn rate particles per sec */ nuclear@67: struct psys_anm_rnd life; /* particle life in seconds */ nuclear@67: struct psys_anm_rnd size; /* base particle size */ nuclear@67: struct psys_anm_rnd3 dir; /* particle shoot direction */ nuclear@67: nuclear@67: struct psys_track3 grav; /* external force (usually gravity) */ nuclear@67: float drag; /* I don't think this needs to animate */ nuclear@67: nuclear@67: /* particle attributes */ nuclear@67: struct psys_particle_attributes part_attr; nuclear@67: nuclear@67: /* limits */ nuclear@67: int max_particles; nuclear@67: }; nuclear@67: nuclear@67: #ifdef __cplusplus nuclear@67: extern "C" { nuclear@67: #endif nuclear@67: nuclear@67: void psys_texture_loader(unsigned int (*load)(const char*, void*), void (*unload)(unsigned int, void*), void *cls); nuclear@67: nuclear@67: struct psys_attributes *psys_create_attr(void); nuclear@67: void psys_free_attr(struct psys_attributes *attr); nuclear@67: nuclear@67: int psys_init_attr(struct psys_attributes *attr); nuclear@67: void psys_destroy_attr(struct psys_attributes *attr); nuclear@67: nuclear@67: void psys_eval_attr(struct psys_attributes *attr, anm_time_t tm); nuclear@67: nuclear@67: int psys_load_attr(struct psys_attributes *attr, const char *fname); nuclear@67: int psys_load_attr_stream(struct psys_attributes *attr, FILE *fp); nuclear@67: nuclear@67: int psys_save_attr(struct psys_attributes *attr, const char *fname); nuclear@67: int psys_save_attr_stream(struct psys_attributes *attr, FILE *fp); nuclear@67: nuclear@67: #ifdef __cplusplus nuclear@67: } nuclear@67: #endif nuclear@67: nuclear@67: #endif /* PATTR_H_ */