Prevent gravity vel-maps from flipping when paused

This commit is contained in:
Simon Robertshaw 2011-07-24 14:31:24 +01:00
parent fbb72e4f32
commit e7907f9ea3

View File

@ -1896,21 +1896,21 @@ int main(int argc, char *argv[])
memcpy(gravx, th_gravx, sizeof(gravx)); //Move the processed velocity maps to be used memcpy(gravx, th_gravx, sizeof(gravx)); //Move the processed velocity maps to be used
memcpy(gravp, th_gravp, sizeof(gravp)); memcpy(gravp, th_gravp, sizeof(gravp));
//Switch the full size gravmaps, we don't really need the two above any more
float *tmpf;
tmpf = gravyf;
gravyf = th_gravyf;
th_gravyf = tmpf;
tmpf = gravxf;
gravxf = th_gravxf;
th_gravxf = tmpf;
tmpf = gravpf;
gravpf = th_gravpf;
th_gravpf = tmpf;
if (!sys_pause||framerender){ //Only update if not paused if (!sys_pause||framerender){ //Only update if not paused
//Switch the full size gravmaps, we don't really need the two above any more
float *tmpf;
tmpf = gravyf;
gravyf = th_gravyf;
th_gravyf = tmpf;
tmpf = gravxf;
gravxf = th_gravxf;
th_gravxf = tmpf;
tmpf = gravpf;
gravpf = th_gravpf;
th_gravpf = tmpf;
grav_ready = 0; //Tell the other thread that we're ready for it to continue grav_ready = 0; //Tell the other thread that we're ready for it to continue
pthread_cond_signal(&gravcv); pthread_cond_signal(&gravcv);
} }
@ -2674,6 +2674,7 @@ int main(int argc, char *argv[])
} }
} }
mx = x; mx = x;
my = y; my = y;
if (b && !bq && x>=(XRES-19-new_message_len)*sdl_scale && if (b && !bq && x>=(XRES-19-new_message_len)*sdl_scale &&