X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=dust.c;fp=dust.c;h=691649d412b821b42f83766a3af059a361b6a4c3;hb=841f94c4182f8dff0253db9bae4922c3c9039a5f;hp=0000000000000000000000000000000000000000;hpb=3ef599c7104a20c4f5268dbefb6590aa3e285663;p=vor.git diff --git a/dust.c b/dust.c new file mode 100644 index 0000000..691649d --- /dev/null +++ b/dust.c @@ -0,0 +1,51 @@ +#include +#include + +#include "config.h" +#include "globals.h" +#include "dust.h" +#include "mt.h" + +struct dust_mote { + float x,y,z; + Uint16 color; +}; + +struct dust_mote motes[N_DUST_MOTES]; + +void +init_dust(void) +{ + int i, b; + for(i=0; iformat, b, b, b); + } +} + +void +move_dust(void) +{ + int i; + for(i=0; i= XSIZE) motes[i].x -= XSIZE; + else if(motes[i].x < 0) motes[i].x += XSIZE; + if(motes[i].y > YSIZE) motes[i].y -= YSIZE; + else if(motes[i].y < 0) motes[i].y += YSIZE; + } +} + +void +draw_dust(SDL_Surface *s) +{ + int i; + uint16_t *pixels = s->pixels; + for(i=0; ipitch/2*(int)motes[i].y + (int)motes[i].x] = motes[i].color; + } +}