diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-04-25 19:41:45 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-04-25 19:41:45 (GMT) |
| commit | b26648e6aeb80f22c70e7ab551a3417bcdae8c6b (patch) | |
| tree | e1fce618b2d4b45a6b6b36495fddba919bf28c25 /src/main.c | |
| parent | 24f59050204017c641749c59a69e40d53074c028 (diff) | |
| download | powder-b26648e6aeb80f22c70e7ab551a3417bcdae8c6b.zip powder-b26648e6aeb80f22c70e7ab551a3417bcdae8c6b.tar.gz | |
Fix pause with gravity and test deuterium improvements
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -1540,7 +1540,6 @@ int main(int argc, char *argv[]) memset(vid_buf, 0, (XRES+BARSIZE)*YRES*PIXELSIZE); } #endif - draw_grav(vid_buf); //Can't be too sure (Limit the cursor size) if (bsx>1180) @@ -1552,21 +1551,23 @@ int main(int argc, char *argv[]) if (bsy<0) bsy = 0; - memset(gravmap, 0, sizeof(gravmap)); //Clear the old gravmap - update_particles(vid_buf); //update everything - pthread_mutex_lock(&gravmutex); result = grav_ready; - //pthread_mutex_unlock(&gravmutex); if(result) //Did the gravity thread finish? { memcpy(th_gravmap, gravmap, sizeof(gravmap)); //Move our current gravmap to be processed other thread memcpy(gravy, th_gravy, sizeof(gravy)); //Hmm, Gravy memcpy(gravx, th_gravx, sizeof(gravx)); //Move the processed velocity maps to be used - grav_ready = 0; //Tell the other thread that we're ready for it to continue + if (!sys_pause||framerender) //Only update if not paused + grav_ready = 0; //Tell the other thread that we're ready for it to continue } pthread_mutex_unlock(&gravmutex); - //update_grav(); + + if (!sys_pause||framerender) //Only update if not paused + memset(gravmap, 0, sizeof(gravmap)); //Clear the old gravmap + + draw_grav(vid_buf); + update_particles(vid_buf); //update everything draw_parts(vid_buf); //draw particles if (cmode==CM_PERS) |
