dungeon_crawler

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/prototype/psys/pattr.h	Sun Oct 07 02:04:00 2012 +0300
     1.3 @@ -0,0 +1,57 @@
     1.4 +#ifndef PATTR_H_
     1.5 +#define PATTR_H_
     1.6 +
     1.7 +#include "pstrack.h"
     1.8 +#include "rndval.h"
     1.9 +
    1.10 +/* the particle attributes vary from 0 to 1 during its lifetime */
    1.11 +struct psys_particle_attributes {
    1.12 +	struct psys_track3 color;
    1.13 +	struct psys_track alpha;
    1.14 +	struct psys_track size;
    1.15 +};
    1.16 +
    1.17 +struct psys_attributes {
    1.18 +	unsigned int tex;	/* OpenGL texture to use for the billboard */
    1.19 +
    1.20 +	struct psys_track3 spawn_range;	/* radius of emmiter */
    1.21 +	struct psys_track rate;			/* spawn rate particles per sec */
    1.22 +	struct psys_anm_rnd life;		/* particle life in seconds */
    1.23 +	struct psys_anm_rnd size;		/* base particle size */
    1.24 +	struct psys_anm_rnd3 dir;		/* particle shoot direction */
    1.25 +
    1.26 +	struct psys_track3 grav;		/* external force (usually gravity) */
    1.27 +	float drag;	/* I don't think this needs to animate */
    1.28 +
    1.29 +	/* particle attributes */
    1.30 +	struct psys_particle_attributes part_attr;
    1.31 +
    1.32 +	/* limits */
    1.33 +	int max_particles;
    1.34 +};
    1.35 +
    1.36 +#ifdef __cplusplus
    1.37 +extern "C" {
    1.38 +#endif
    1.39 +
    1.40 +void psys_texture_loader(unsigned int (*load)(const char*, void*), void (*unload)(unsigned int, void*), void *cls);
    1.41 +
    1.42 +struct psys_attributes *psys_create_attr(void);
    1.43 +void psys_free_attr(struct psys_attributes *attr);
    1.44 +
    1.45 +int psys_init_attr(struct psys_attributes *attr);
    1.46 +void psys_destroy_attr(struct psys_attributes *attr);
    1.47 +
    1.48 +void psys_eval_attr(struct psys_attributes *attr, anm_time_t tm);
    1.49 +
    1.50 +int psys_load_attr(struct psys_attributes *attr, const char *fname);
    1.51 +int psys_load_attr_stream(struct psys_attributes *attr, FILE *fp);
    1.52 +
    1.53 +int psys_save_attr(struct psys_attributes *attr, const char *fname);
    1.54 +int psys_save_attr_stream(struct psys_attributes *attr, FILE *fp);
    1.55 +
    1.56 +#ifdef __cplusplus
    1.57 +}
    1.58 +#endif
    1.59 +
    1.60 +#endif	/* PATTR_H_ */