From 0f7af4ea51744cda23c4d3c7481f9c332973d1d4 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 5 Jan 2017 09:16:00 -0300 Subject: -Changed most project settings in the engine, so they have major and minor categories. -Changed SectionedPropertyEditor to support this -Renamed Globals singleton to GlobalConfig, makes more sense. -Changed the logic behind persisten global settings, instead of the persist checkbox, a revert button is now available --- servers/physics_2d/broad_phase_2d_hash_grid.cpp | 6 +++--- servers/physics_2d/physics_2d_server_sw.cpp | 2 +- servers/physics_2d/physics_2d_server_wrap_mt.cpp | 12 ++++++------ servers/physics_2d/physics_2d_server_wrap_mt.h | 2 +- servers/physics_2d/space_2d_sw.cpp | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) (limited to 'servers/physics_2d') diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.cpp b/servers/physics_2d/broad_phase_2d_hash_grid.cpp index 82d7773574..efa12c37cb 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp +++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp @@ -683,12 +683,12 @@ BroadPhase2DSW *BroadPhase2DHashGrid::_create() { BroadPhase2DHashGrid::BroadPhase2DHashGrid() { - hash_table_size = GLOBAL_DEF("physics_2d/bp_hash_table_size",4096); + hash_table_size = GLOBAL_DEF("physics/2d/bp_hash_table_size",4096); hash_table_size = Math::larger_prime(hash_table_size); hash_table = memnew_arr( PosBin*, hash_table_size); - cell_size = GLOBAL_DEF("physics_2d/cell_size",128); - large_object_min_surface = GLOBAL_DEF("physics_2d/large_object_surface_treshold_in_cells",512); + cell_size = GLOBAL_DEF("physics/2d/cell_size",128); + large_object_min_surface = GLOBAL_DEF("physics/2d/large_object_surface_treshold_in_cells",512); for(int i=0;iget("physics_2d/thread_model"))==2; + using_threads=int(GlobalConfig::get_singleton()->get("physics/2d/thread_model"))==2; }; diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_2d_server_wrap_mt.cpp index 8a60af725f..8730bb9ee8 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp +++ b/servers/physics_2d/physics_2d_server_wrap_mt.cpp @@ -168,12 +168,12 @@ Physics2DServerWrapMT::Physics2DServerWrapMT(Physics2DServer* p_contained,bool p step_thread_up=false; alloc_mutex=Mutex::create(); - shape_pool_max_size=GLOBAL_DEF("core/thread_rid_pool_prealloc",20); - area_pool_max_size=GLOBAL_DEF("core/thread_rid_pool_prealloc",20); - body_pool_max_size=GLOBAL_DEF("core/thread_rid_pool_prealloc",20); - pin_joint_pool_max_size=GLOBAL_DEF("core/thread_rid_pool_prealloc",20); - groove_joint_pool_max_size=GLOBAL_DEF("core/thread_rid_pool_prealloc",20); - damped_spring_joint_pool_max_size=GLOBAL_DEF("core/thread_rid_pool_prealloc",20); + shape_pool_max_size=GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc"); + area_pool_max_size=GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc"); + body_pool_max_size=GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc"); + pin_joint_pool_max_size=GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc"); + groove_joint_pool_max_size=GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc"); + damped_spring_joint_pool_max_size=GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc"); if (!p_create_thread) { server_thread=Thread::get_caller_ID(); diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.h b/servers/physics_2d/physics_2d_server_wrap_mt.h index 71928d77a6..a8e150d8f2 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.h +++ b/servers/physics_2d/physics_2d_server_wrap_mt.h @@ -320,7 +320,7 @@ public: template static Physics2DServer* init_server() { - int tm = GLOBAL_DEF("physics_2d/thread_model",1); + int tm = GLOBAL_DEF("physics/2d/thread_model",1); if (tm==0) //single unsafe return memnew( T ); else if (tm==1) //single saef diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 42834ee4e4..8b277aa4b9 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -1329,9 +1329,9 @@ Space2DSW::Space2DSW() { contact_max_allowed_penetration= 0.3; constraint_bias = 0.2; - body_linear_velocity_sleep_treshold=GLOBAL_DEF("physics_2d/sleep_threashold_linear",2.0); - body_angular_velocity_sleep_treshold=GLOBAL_DEF("physics_2d/sleep_threshold_angular",(8.0 / 180.0 * Math_PI)); - body_time_to_sleep=GLOBAL_DEF("physics_2d/time_before_sleep",0.5); + body_linear_velocity_sleep_treshold=GLOBAL_DEF("physics/2d/sleep_threashold_linear",2.0); + body_angular_velocity_sleep_treshold=GLOBAL_DEF("physics/2d/sleep_threshold_angular",(8.0 / 180.0 * Math_PI)); + body_time_to_sleep=GLOBAL_DEF("physics/2d/time_before_sleep",0.5); broadphase = BroadPhase2DSW::create_func(); -- cgit v1.2.3