dungeon_crawler

view prototype/psys/pattr.h @ 67:2560a7ab0243

internalized libanim, libimago2, and libpsys
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 07 Oct 2012 02:04:00 +0300
parents
children
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 struct psys_attributes *psys_create_attr(void);
40 void psys_free_attr(struct psys_attributes *attr);
42 int psys_init_attr(struct psys_attributes *attr);
43 void psys_destroy_attr(struct psys_attributes *attr);
45 void psys_eval_attr(struct psys_attributes *attr, anm_time_t tm);
47 int psys_load_attr(struct psys_attributes *attr, const char *fname);
48 int psys_load_attr_stream(struct psys_attributes *attr, FILE *fp);
50 int psys_save_attr(struct psys_attributes *attr, const char *fname);
51 int psys_save_attr_stream(struct psys_attributes *attr, FILE *fp);
53 #ifdef __cplusplus
54 }
55 #endif
57 #endif /* PATTR_H_ */