Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
vor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
21570dd
)
oops, I wasn't using nrocks in my timing calculations. doh\!
author
Joshua Grams
<josh@qualdan.com>
Thu, 28 Apr 2005 22:16:30 +0000
(22:16 +0000)
committer
Joshua Grams
<josh@qualdan.com>
Thu, 28 Apr 2005 22:16:30 +0000
(22:16 +0000)
rocks.c
patch
|
blob
|
history
diff --git
a/rocks.c
b/rocks.c
index
7de0c2f
..
2a9c906
100644
(file)
--- a/
rocks.c
+++ b/
rocks.c
@@
-68,9
+68,11
@@
void
rock_timer_increments(float *ti)
{
float dx0,dx1, dy0,dy1;
rock_timer_increments(float *ti)
{
float dx0,dx1, dy0,dy1;
+ float hfactor, vfactor;
int i;
for(i=0; i<4; i++) ti[i] = 0;
int i;
for(i=0; i<4; i++) ti[i] = 0;
+ hfactor = nrocks/KH; vfactor = nrocks/KV;
dx0 = -RDX - screendx; dx1 = RDX - screendx;
dy0 = -RDY - screendy; dy1 = RDY - screendy;
dx0 = -RDX - screendx; dx1 = RDX - screendx;
dy0 = -RDY - screendy; dy1 = RDY - screendy;
@@
-84,6
+86,8
@@
rock_timer_increments(float *ti)
}
} else ti[LEFT] = (dx0+dx1)/2;
}
}
} else ti[LEFT] = (dx0+dx1)/2;
}
+ ti[LEFT] *= hfactor;
+ ti[RIGHT] *= hfactor;
if(dy0 != 0) {
if(dy0 < 0) {
if(dy0 != 0) {
if(dy0 < 0) {
@@
-94,6
+98,8
@@
rock_timer_increments(float *ti)
}
} else ti[TOP] = (dy0+dy1)/2;
}
}
} else ti[TOP] = (dy0+dy1)/2;
}
+ ti[TOP] *= vfactor;
+ ti[BOTTOM] *= vfactor;
}
void
}
void
@@
-146,7
+152,7
@@
new_rocks(void)
j++;
} while(x < -rockptr->image->w || x >= XSIZE
|| y < -rockptr->image->h || y >= YSIZE);
j++;
} while(x < -rockptr->image->w || x >= XSIZE
|| y < -rockptr->image->h || y >= YSIZE);
- if(j > 1) printf("had to try %d times.\n", j);
+ if(j > 1) fprintf(stderr, "had to try %d times.\n", j);
rockptr->active = 1;
}
rockptr->active = 1;
}