dungeon_crawler

annotate prototype/psys/pattr.h @ 75:b05ab29cd17d

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