summaryrefslogtreecommitdiff
path: root/src/simulation/Simulation.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-04-16 12:58:20 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-04-16 12:58:20 (GMT)
commit465cb12af436a65871bd149174da0e7479d108bd (patch)
tree31cbd7443d6b56697b7eee145fd8acfd122b354a /src/simulation/Simulation.cpp
parenta0506495ad71a18ba2976d31d437dfd6bd8241f8 (diff)
downloadpowder-465cb12af436a65871bd149174da0e7479d108bd.zip
powder-465cb12af436a65871bd149174da0e7479d108bd.tar.gz
Newtonian gravity working
Diffstat (limited to 'src/simulation/Simulation.cpp')
-rw-r--r--src/simulation/Simulation.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index 764d29d..7fdd6d6 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -8,6 +8,9 @@
#include "Gravity.h"
#include "SaveLoader.h"
+#undef LUACONSOLE
+//#include "cat/LuaScriptHelper.h"
+
int Simulation::Load(unsigned char * data, int dataLength)
{
return SaveLoader::Load(data, dataLength, this, true, 0, 0);
@@ -3269,7 +3272,16 @@ void Simulation::update_particles()//doesn't update the particles themselves, bu
#endif
if(!sys_pause||framerender)
+ {
air->update_air();
+ grav->gravity_update_async();
+
+ //Get updated buffer pointers for gravity
+ gravx = grav->gravx;
+ gravy = grav->gravy;
+ gravp = grav->gravp;
+ gravmap = grav->gravmap;
+ }
memset(pmap, 0, sizeof(pmap));
memset(photons, 0, sizeof(photons));
@@ -3424,4 +3436,6 @@ Simulation::Simulation():
init_can_move();
clear_sim();
+
+ grav->gravity_mask();
}