diff options
Diffstat (limited to 'servers/physics_2d')
-rw-r--r-- | servers/physics_2d/body_2d_sw.cpp | 2 | ||||
-rw-r--r-- | servers/physics_2d/physics_2d_server_wrap_mt.cpp | 2 | ||||
-rw-r--r-- | servers/physics_2d/physics_2d_server_wrap_mt.h | 6 | ||||
-rw-r--r-- | servers/physics_2d/space_2d_sw.cpp | 6 |
4 files changed, 6 insertions, 10 deletions
diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp index 5dff655ea1..b9ebd30021 100644 --- a/servers/physics_2d/body_2d_sw.cpp +++ b/servers/physics_2d/body_2d_sw.cpp @@ -608,7 +608,7 @@ void Body2DSW::call_queries() { set_force_integration_callback(0, StringName()); } else { Variant::CallError ce; - if (fi_callback->callback_udata.get_type()) { + if (fi_callback->callback_udata.get_type() != Variant::NIL) { obj->call(fi_callback->method, vp, 2, ce); diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_2d_server_wrap_mt.cpp index 71c00c0abf..c698290fd9 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp +++ b/servers/physics_2d/physics_2d_server_wrap_mt.cpp @@ -54,8 +54,6 @@ void Physics2DServerWrapMT::thread_loop() { server_thread = Thread::get_caller_id(); - OS::get_singleton()->make_rendering_thread(); - physics_2d_server->init(); exit = false; diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.h b/servers/physics_2d/physics_2d_server_wrap_mt.h index b61e1faad2..33a184ba3f 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.h +++ b/servers/physics_2d/physics_2d_server_wrap_mt.h @@ -327,11 +327,11 @@ public: static Physics2DServer *init_server() { int tm = GLOBAL_DEF("physics/2d/thread_model", 1); - if (tm == 0) //single unsafe + if (tm == 0) // single unsafe return memnew(T); - else if (tm == 1) //single saef + else if (tm == 1) // single safe return memnew(Physics2DServerWrapMT(memnew(T), false)); - else //single unsafe + else // multi threaded return memnew(Physics2DServerWrapMT(memnew(T), true)); } diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 7c89c43f36..2778775446 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -330,11 +330,9 @@ bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Transform2D & cbk.amount = 0; cbk.passed = 0; cbk.ptr = r_results; - CollisionSolver2DSW::CallbackResult cbkres = NULL; + CollisionSolver2DSW::CallbackResult cbkres = Physics2DServerSW::_shape_col_cbk; - Physics2DServerSW::CollCbkData *cbkptr = NULL; - cbkptr = &cbk; - cbkres = Physics2DServerSW::_shape_col_cbk; + Physics2DServerSW::CollCbkData *cbkptr = &cbk; for (int i = 0; i < amount; i++) { |