diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-05-26 01:30:36 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-05-26 01:30:36 -0300 |
commit | b1b7826ea7e04a3eb4d9b3d011e9a2a8dff5db03 (patch) | |
tree | 92bfc368ed51986c7bc192dbfe6c10022193ad8b /servers/physics_2d/physics_2d_server_wrap_mt.cpp | |
parent | 9df77d276593ef7082e3971d1c180b8f74b0cb2e (diff) |
oops, previous commit was not working
it is working now
Diffstat (limited to 'servers/physics_2d/physics_2d_server_wrap_mt.cpp')
-rw-r--r-- | servers/physics_2d/physics_2d_server_wrap_mt.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_2d_server_wrap_mt.cpp index 0ee78afbaa..c5f023f162 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp +++ b/servers/physics_2d/physics_2d_server_wrap_mt.cpp @@ -61,7 +61,12 @@ void Physics2DServerWrapMT::step(float p_step) { void Physics2DServerWrapMT::sync() { - step_sem->wait(); + if (step_sem) { + if (first_frame) + first_frame=false; + else + step_sem->wait(); //must not wait if a step was not issued + } physics_2d_server->sync();; } @@ -147,6 +152,9 @@ Physics2DServerWrapMT::Physics2DServerWrapMT(Physics2DServer* p_contained,bool p } else { server_thread=0; } + + main_thread = Thread::get_caller_ID(); + first_frame=true; } |