Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
vor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* float.h (fwrap, fclip): new file.
[vor.git]
/
dust.c
diff --git
a/dust.c
b/dust.c
index
691649d
..
4eeeb8b
100644
(file)
--- a/
dust.c
+++ b/
dust.c
@@
-4,6
+4,7
@@
#include "config.h"
#include "globals.h"
#include "dust.h"
#include "config.h"
#include "globals.h"
#include "dust.h"
+#include "float.h"
#include "mt.h"
struct dust_mote {
#include "mt.h"
struct dust_mote {
@@
-27,16
+28,18
@@
init_dust(void)
}
void
}
void
-move_dust(void)
+move_dust(float ticks)
{
int i;
{
int i;
+ float xscroll = screendx * ticks;
+ float yscroll = screendy * ticks;
+
for(i=0; i<N_DUST_MOTES; i++) {
motes[i].x -= xscroll / (1.3 + motes[i].z);
for(i=0; i<N_DUST_MOTES; i++) {
motes[i].x -= xscroll / (1.3 + motes[i].z);
+ motes[i].x = fwrap(motes[i].x, XSIZE);
+
motes[i].y -= yscroll / (1.3 + motes[i].z);
motes[i].y -= yscroll / (1.3 + motes[i].z);
- if(motes[i].y >= 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);
}
}
}
}