libpsys

view 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
line source
1 #ifndef PATTR_H_
2 #define PATTR_H_
4 #include "pstrack.h"
5 #include "rndval.h"
7 /* the particle attributes vary from 0 to 1 during its lifetime */
8 struct psys_particle_attributes {
9 struct psys_track3 color;
10 struct psys_track alpha;
11 struct psys_track size;
12 };
14 struct psys_attributes {
15 unsigned int tex; /* OpenGL texture to use for the billboard */
17 struct psys_track3 spawn_range; /* radius of emmiter */
18 struct psys_track rate; /* spawn rate particles per sec */
19 struct psys_anm_rnd life; /* particle life in seconds */
20 struct psys_anm_rnd size; /* base particle size */
21 struct psys_anm_rnd3 dir; /* particle shoot direction */
23 struct psys_track3 grav; /* external force (usually gravity) */
24 float drag; /* I don't think this needs to animate */
26 /* particle attributes */
27 struct psys_particle_attributes part_attr;
29 /* limits */
30 int max_particles;
31 };
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
37 void psys_texture_loader(unsigned int (*load)(const char*, void*), void (*unload)(unsigned int, void*), void *cls);
39 int psys_init_attr(struct psys_attributes *attr);
40 void psys_destroy_attr(struct psys_attributes *attr);
42 void psys_eval_attr(struct psys_attributes *attr, anm_time_t tm);
44 int psys_load_attr(struct psys_attributes *attr, const char *fname);
45 int psys_load_attr_stream(struct psys_attributes *attr, FILE *fp);
47 int psys_save_attr(struct psys_attributes *attr, const char *fname);
48 int psys_save_attr_stream(struct psys_attributes *attr, FILE *fp);
50 #ifdef __cplusplus
51 }
52 #endif
54 #endif /* PATTR_H_ */