diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/bullet/space_bullet.cpp | 9 | ||||
| -rw-r--r-- | modules/mono/csharp_script.cpp | 27 | ||||
| -rw-r--r-- | modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs | 2 | ||||
| -rw-r--r-- | modules/mono/editor/GodotSharpTools/Project/ProjectGenerator.cs | 2 | ||||
| -rw-r--r-- | modules/mono/editor/csharp_project.cpp | 9 | ||||
| -rw-r--r-- | modules/mono/editor/mono_bottom_panel.cpp | 8 | ||||
| -rw-r--r-- | modules/mono/mono_gd/gd_mono.cpp | 11 | 
7 files changed, 36 insertions, 32 deletions
diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp index ab841e4acf..6562b18b3c 100644 --- a/modules/bullet/space_bullet.cpp +++ b/modules/bullet/space_bullet.cpp @@ -678,11 +678,14 @@ void SpaceBullet::check_ghost_overlaps() {  		// For each overlapping  		for (i = ghostOverlaps.size() - 1; 0 <= i; --i) { +			bool hasOverlap = false;  			btCollisionObject *overlapped_bt_co = ghostOverlaps[i];  			RigidCollisionObjectBullet *otherObject = static_cast<RigidCollisionObjectBullet *>(overlapped_bt_co->getUserPointer()); -			if (!area->is_transform_changed() && !otherObject->is_transform_changed()) -				continue; +			if (!area->is_transform_changed() && !otherObject->is_transform_changed()) { +				hasOverlap = true; +				goto collision_found; +			}  			if (overlapped_bt_co->getUserIndex() == CollisionObjectBullet::TYPE_AREA) {  				if (!static_cast<AreaBullet *>(overlapped_bt_co->getUserPointer())->is_monitorable()) @@ -690,8 +693,6 @@ void SpaceBullet::check_ghost_overlaps() {  			} else if (overlapped_bt_co->getUserIndex() != CollisionObjectBullet::TYPE_RIGID_BODY)  				continue; -			bool hasOverlap = false; -  			// For each area shape  			for (y = area->get_shape_count() - 1; 0 <= y; --y) {  				if (!area->get_bt_shape(y)->isConvex()) diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 13f8385745..02220ab52f 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -608,30 +608,9 @@ struct CSharpScriptDepSort {  void CSharpLanguage::reload_all_scripts() {  #ifdef DEBUG_ENABLED - -	List<Ref<CSharpScript> > scripts; - -	{ -		SCOPED_MUTEX_LOCK(script_instances_mutex); - -		SelfList<CSharpScript> *elem = script_list.first(); -		while (elem) { -			if (elem->self()->get_path().is_resource_file()) { -				scripts.push_back(Ref<CSharpScript>(elem->self())); //cast to gdscript to avoid being erased by accident -			} -			elem = elem->next(); -		} -	} - -	//as scripts are going to be reloaded, must proceed without locking here - -	scripts.sort_custom<CSharpScriptDepSort>(); //update in inheritance dependency order - -	for (List<Ref<CSharpScript> >::Element *E = scripts.front(); E; E = E->next()) { -		E->get()->load_source_code(E->get()->get_path()); -		E->get()->reload(true); +	if (is_assembly_reloading_needed()) { +		reload_assemblies(false);  	} -  #endif  } @@ -829,7 +808,7 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) {  						CSharpScript::StateBackup &state_backup = scr->pending_reload_state[obj_id];  						// Backup placeholder script instance state before replacing it with a script instance -						obj->get_script_instance()->get_property_state(state_backup.properties); +						si->get_property_state(state_backup.properties);  						ScriptInstance *script_instance = scr->instance_create(obj); diff --git a/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs b/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs index 16beacb45c..4137f5eaef 100644 --- a/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs +++ b/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs @@ -257,7 +257,7 @@ namespace GodotSharpTools.Build              if (null == Parameters)                  throw new LoggerException("Log directory was not set."); -            string[] parameters = Parameters.Split(';'); +            string[] parameters = Parameters.Split(new[] { ';' });              string logDir = parameters[0]; diff --git a/modules/mono/editor/GodotSharpTools/Project/ProjectGenerator.cs b/modules/mono/editor/GodotSharpTools/Project/ProjectGenerator.cs index 2ce7837a27..9135006172 100644 --- a/modules/mono/editor/GodotSharpTools/Project/ProjectGenerator.cs +++ b/modules/mono/editor/GodotSharpTools/Project/ProjectGenerator.cs @@ -21,6 +21,7 @@ namespace GodotSharpTools.Project              mainGroup.AddProperty("DocumentationFile", Path.Combine("$(OutputPath)", "$(AssemblyName).xml"));              mainGroup.SetProperty("RootNamespace", "Godot");              mainGroup.SetProperty("ProjectGuid", CoreApiProjectGuid); +            mainGroup.SetProperty("BaseIntermediateOutputPath", "obj");              GenAssemblyInfoFile(root, dir, CoreApiProjectName,                                  new string[] { "[assembly: InternalsVisibleTo(\"" + EditorApiProjectName + "\")]" }, @@ -46,6 +47,7 @@ namespace GodotSharpTools.Project              mainGroup.AddProperty("DocumentationFile", Path.Combine("$(OutputPath)", "$(AssemblyName).xml"));              mainGroup.SetProperty("RootNamespace", "Godot");              mainGroup.SetProperty("ProjectGuid", EditorApiProjectGuid); +            mainGroup.SetProperty("BaseIntermediateOutputPath", "obj");              GenAssemblyInfoFile(root, dir, EditorApiProjectName); diff --git a/modules/mono/editor/csharp_project.cpp b/modules/mono/editor/csharp_project.cpp index 4397bb9b6a..beeff51bc2 100644 --- a/modules/mono/editor/csharp_project.cpp +++ b/modules/mono/editor/csharp_project.cpp @@ -228,6 +228,15 @@ Error generate_scripts_metadata(const String &p_project_path, const String &p_ou  	if (new_dict.size()) {  		String json = JSON::print(new_dict, "", false); +		String base_dir = p_output_path.get_base_dir(); + +		if (!DirAccess::exists(base_dir)) { +			DirAccessRef da = DirAccess::create(DirAccess::ACCESS_RESOURCES); + +			Error err = da->make_dir_recursive(base_dir); +			ERR_FAIL_COND_V(err != OK, ERR_CANT_CREATE); +		} +  		Error ferr;  		FileAccess *f = FileAccess::open(p_output_path, FileAccess::WRITE, &ferr);  		ERR_EXPLAIN("Cannot open file for writing: " + p_output_path); diff --git a/modules/mono/editor/mono_bottom_panel.cpp b/modules/mono/editor/mono_bottom_panel.cpp index feebdb380b..55a334bc4e 100644 --- a/modules/mono/editor/mono_bottom_panel.cpp +++ b/modules/mono/editor/mono_bottom_panel.cpp @@ -30,6 +30,9 @@  #include "mono_bottom_panel.h" +#include "editor/plugins/script_editor_plugin.h" +#include "editor/script_editor_debugger.h" +  #include "../csharp_script.h"  #include "../godotsharp_dirs.h"  #include "csharp_project.h" @@ -160,7 +163,12 @@ void MonoBottomPanel::_build_project_pressed() {  	bool build_success = GodotSharpBuilds::get_singleton()->build_project_blocking("Tools");  	if (build_success) { +		// Notify running game for hot-reload +		ScriptEditor::get_singleton()->get_debugger()->reload_scripts(); + +		// Hot-reload in the editor  		MonoReloadNode::get_singleton()->restart_reload_timer(); +  		if (CSharpLanguage::get_singleton()->is_assembly_reloading_needed()) {  			CSharpLanguage::get_singleton()->reload_assemblies(false);  		} diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index a422224fcb..42a6fe1ef8 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -130,9 +130,14 @@ void gdmono_debug_init() {  	}  #endif -	CharString da_args = String("--debugger-agent=transport=dt_socket,address=127.0.0.1:" + itos(da_port) + -								",embedding=1,server=y,suspend=" + (da_suspend ? "y,timeout=" + itos(da_timeout) : "n")) -								 .utf8(); +	CharString da_args = OS::get_singleton()->get_environment("GODOT_MONO_DEBUGGER_AGENT").utf8(); + +	if (da_args == "") { +		da_args = String("--debugger-agent=transport=dt_socket,address=127.0.0.1:" + itos(da_port) + +						 ",embedding=1,server=y,suspend=" + (da_suspend ? "y,timeout=" + itos(da_timeout) : "n")) +						  .utf8(); +	} +  	// --debugger-agent=help  	const char *options[] = {  		"--soft-breakpoints",  |