libpsys

annotate src/pattr.h @ 14:4f36bbbcc82f

really started writting the parser... god I hate ad-hoc parsing...
author John Tsiombikas <nuclear@mutantstargoat.com>
date Mon, 10 Sep 2012 05:58:03 +0300
parents 9c24273f211b
children 66956b1e5e3f
rev   line source
nuclear@6 1 #ifndef PATTR_H_
nuclear@6 2 #define PATTR_H_
nuclear@6 3
nuclear@6 4 #include "pstrack.h"
nuclear@6 5 #include "rndval.h"
nuclear@6 6
nuclear@9 7 /* the particle attributes vary from 0 to 1 during its lifetime */
nuclear@9 8 struct psys_particle_attributes {
nuclear@9 9 struct psys_track3 color;
nuclear@9 10 struct psys_track alpha;
nuclear@9 11 struct psys_track size;
nuclear@9 12 };
nuclear@9 13
nuclear@6 14 struct psys_attributes {
nuclear@6 15 unsigned int tex; /* OpenGL texture to use for the billboard */
nuclear@6 16
nuclear@6 17 struct psys_track3 spawn_range; /* radius of emmiter */
nuclear@6 18 struct psys_track rate; /* spawn rate particles per sec */
nuclear@6 19 struct psys_anm_rnd life; /* particle life in seconds */
nuclear@6 20 struct psys_anm_rnd size; /* base particle size */
nuclear@6 21 struct psys_anm_rnd3 dir; /* particle shoot direction */
nuclear@6 22
nuclear@6 23 struct psys_track3 grav; /* external force (usually gravity) */
nuclear@9 24 float drag; /* I don't think this needs to animate */
nuclear@6 25
nuclear@9 26 /* particle attributes */
nuclear@9 27 struct psys_particle_attributes part_attr;
nuclear@6 28
nuclear@6 29 /* limits */
nuclear@6 30 int max_particles;
nuclear@6 31 };
nuclear@6 32
nuclear@11 33 #ifdef __cplusplus
nuclear@11 34 extern "C" {
nuclear@11 35 #endif
nuclear@11 36
nuclear@6 37 void psys_texture_loader(unsigned int (*load)(const char*, void*), void (*unload)(unsigned int, void*), void *cls);
nuclear@6 38
nuclear@6 39 int psys_init_attr(struct psys_attributes *attr);
nuclear@6 40 void psys_destroy_attr(struct psys_attributes *attr);
nuclear@6 41
nuclear@6 42 void psys_eval_attr(struct psys_attributes *attr, anm_time_t tm);
nuclear@6 43
nuclear@6 44 int psys_load_attr(struct psys_attributes *attr, const char *fname);
nuclear@6 45 int psys_load_attr_stream(struct psys_attributes *attr, FILE *fp);
nuclear@6 46
nuclear@6 47 int psys_save_attr(struct psys_attributes *attr, const char *fname);
nuclear@6 48 int psys_save_attr_stream(struct psys_attributes *attr, FILE *fp);
nuclear@6 49
nuclear@11 50 #ifdef __cplusplus
nuclear@11 51 }
nuclear@6 52 #endif
nuclear@11 53
nuclear@11 54 #endif /* PATTR_H_ */