summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-10-28 23:29:01 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-10-28 23:29:01 (GMT)
commit4bfb65d247a1f215494bf670c3fb333f110412b5 (patch)
tree30f34b58db4798b9ffb3d0f221b573f93a7ea09d /src
parent4386fb238e82c4e258aee4889ee2c8a87a345422 (diff)
downloadpowder-4bfb65d247a1f215494bf670c3fb333f110412b5.zip
powder-4bfb65d247a1f215494bf670c3fb333f110412b5.tar.gz
Ensure grav vel maps are cleared when stopping/starting gravity calculation
Diffstat (limited to 'src')
-rw-r--r--src/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index bdccf1d..9be4bd7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1471,6 +1471,9 @@ void start_grav_async()
pthread_create(&gravthread, NULL, update_grav_async, NULL); //Start asynchronous gravity simulation
ngrav_enable = 1;
}
+ memset(gravyf, 0, sizeof(gravyf));
+ memset(gravxf, 0, sizeof(gravxf));
+ memset(gravpf, 0, sizeof(gravpf));
}
void stop_grav_async()
@@ -1486,6 +1489,9 @@ void stop_grav_async()
memset(gravx, 0, sizeof(gravx)); //Clear the grav velocities
ngrav_enable = 0;
}
+ memset(gravyf, 0, sizeof(gravyf));
+ memset(gravxf, 0, sizeof(gravxf));
+ memset(gravpf, 0, sizeof(gravpf));
}
#ifdef RENDERER