fixed one wrong afrand

This commit is contained in:
laochailan 2012-08-09 16:38:37 +02:00
parent d595309ba5
commit 3835fe7a6e
4 changed files with 6 additions and 4 deletions

View file

@ -128,7 +128,7 @@ int collision_item(Item *i) {
inline void spawn_item(complex pos, Type type) {
tsrand_fill(2);
create_item(pos, 5*cexp(I*tsrand_a(0)/frand(1)*M_PI*2), type);
create_item(pos, 5*cexp(I*tsrand_a(0)/afrand(1)*M_PI*2), type);
}
void spawn_items(complex pos, int point, int power, int bomb, int life) {

View file

@ -45,7 +45,7 @@ inline double frand(void) {
return tsrand()/(double)TSRAND_MAX;
}
inline double nfrand() {
inline double nfrand(void) {
return frand() * 2 - 1;
}

View file

@ -24,8 +24,8 @@ int tsrand_p(RandomState *rnd);
inline void tsrand_seed(uint32_t seed);
inline int tsrand(void);
inline double frand();
inline double nfrand();
inline double frand(void);
inline double nfrand(void);
void tsrand_fill_p(RandomState *rnd, int amount);
inline void tsrand_fill(int amount);

View file

@ -539,6 +539,8 @@ void stage_loop(StageInfo* info, StageRule start, StageRule end, StageRule draw,
stage_draw(info, draw, shaderrules, endtime);
tsrand_switch(&global.rand_game);
// print_state_checksum();
SDL_GL_SwapBuffers();
frame_rate(&global.lasttime);
}