X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=dust.c;h=0e4daa263b935c8a3e49ad08551dceb1dd308999;hp=5ee9e2058345365bf0c2d1d8dcbe133511d20e25;hb=HEAD;hpb=51d56bfe5830a41e61f4ceefb75217f647d994fe diff --git a/dust.c b/dust.c index 5ee9e20..0e4daa2 100644 --- a/dust.c +++ b/dust.c @@ -1,9 +1,10 @@ #include #include -#include "config.h" +#include "vorconfig.h" #include "globals.h" #include "dust.h" +#include "float.h" #include "mt.h" struct dust_mote { @@ -27,27 +28,27 @@ init_dust(void) } void -move_dust(float ticks) +move_dust(void) { int i; - float xscroll = screendx * ticks; - float yscroll = screendy * ticks; + float xscroll = screendx * t_frame; + float yscroll = screendy * t_frame; + 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; + motes[i].y = fwrap(motes[i].y, YSIZE); } } void -draw_dust(SDL_Surface *s) +draw_dust(void) { int i; - uint16_t *pixels = s->pixels; + uint16_t *pixels = surf_screen->pixels; for(i=0; ipitch/2*(int)motes[i].y + (int)motes[i].x] = motes[i].color; + pixels[surf_screen->pitch/2*(int)motes[i].y + (int)motes[i].x] = motes[i].color; } }