diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-12-24 18:22:58 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-12-24 18:22:58 (GMT) |
| commit | 835d9f1f3d962fab290c39959b159245a315c984 (patch) | |
| tree | f2a65c70b0aaa2ec7f9e452474bbc87e6553dd87 /src/gravity.c | |
| parent | b6d9d8d6085f09401f7bc6fd667719f29b506e1d (diff) | |
| download | powder-835d9f1f3d962fab290c39959b159245a315c984.zip powder-835d9f1f3d962fab290c39959b159245a315c984.tar.gz | |
Fix crash with clear_sim if gravity not initialised, fix renderer
Diffstat (limited to 'src/gravity.c')
| -rw-r--r-- | src/gravity.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/gravity.c b/src/gravity.c index 7e7b37c..5fe13f9 100644 --- a/src/gravity.c +++ b/src/gravity.c @@ -10,17 +10,17 @@ #endif -float *gravmap;//Maps to be used by the main thread -float *gravp; -float *gravy; -float *gravx; -unsigned *gravmask; +float *gravmap = NULL;//Maps to be used by the main thread +float *gravp = NULL; +float *gravy = NULL; +float *gravx = NULL; +unsigned *gravmask = NULL; -float *th_ogravmap;// Maps to be processed by the gravity thread -float *th_gravmap; -float *th_gravx; -float *th_gravy; -float *th_gravp; +float *th_ogravmap = NULL;// Maps to be processed by the gravity thread +float *th_gravmap = NULL; +float *th_gravx = NULL; +float *th_gravy = NULL; +float *th_gravp = NULL; int gravwl_timeout = 0; int gravityMode = 0; // starts enabled in "vertical" mode... @@ -454,6 +454,8 @@ void gravity_mask() unsigned maskvalue; mask_el *t_mask_el = NULL; mask_el *c_mask_el = NULL; + if(!gravmask) + return; memset(checkmap, 0, sizeof(checkmap)); for(x = 0; x < XRES/CELL; x++) { |
