X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=dust.c;h=4eeeb8b034a23f1c4ef8e2c3998801998528eb7e;hp=b336696035da9c1cbd7248114d023487d600e551;hb=fe549d406b589b1c3db83aeea28c911292a5968e;hpb=badd0f9bfc6dad829073e606c1953572ece1b06b diff --git a/dust.c b/dust.c index b336696..4eeeb8b 100644 --- a/dust.c +++ b/dust.c @@ -4,6 +4,7 @@ #include "config.h" #include "globals.h" #include "dust.h" +#include "float.h" #include "mt.h" struct dust_mote { @@ -27,18 +28,18 @@ init_dust(void) } void -move_dust(void) +move_dust(float ticks) { int i; - float xscroll = screendx * t_frame; - float yscroll = screendy * t_frame; + float xscroll = screendx * ticks; + float yscroll = screendy * ticks; + 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); } }