Skip to content

Commit

Permalink
some reloadable fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriySalnikov committed Sep 14, 2023
1 parent 1693f7d commit 06f1ed8
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 40 deletions.
1 change: 0 additions & 1 deletion .github/actions/compile_gdextension/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ runs:
run: |
echo "::group::🛠️ GDExtesion Compilation 🛠️"
cd godot-cpp
git apply --ignore-space-change --ignore-whitespace ../patches/always_build_fix.patch
git apply --ignore-space-change --ignore-whitespace ../patches/godot_cpp_exclude_unused_classes.patch
git apply --ignore-space-change --ignore-whitespace ../patches/1165.patch
git apply --ignore-space-change --ignore-whitespace ../patches/unity_build.patch
Expand Down
3 changes: 2 additions & 1 deletion addons/debug_draw_3d/debug_draw_3d.gdextension
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[configuration]

entry_symbol = "debug_draw_3d_library_init"
compatibility_minimum = "4.1"
compatibility_minimum = "4.2"
reloadable = true

[dependencies]

Expand Down
3 changes: 1 addition & 2 deletions dev_build_godot_cpp.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ cd godot-cpp
::set api=custom_api_file="../api.json"
set api=

git apply --ignore-space-change --ignore-whitespace ../patches/always_build_fix.patch
git apply --ignore-space-change --ignore-whitespace ../patches/godot_cpp_exclude_unused_classes.patch
git apply --ignore-space-change --ignore-whitespace ../patches/1165.patch
git apply --ignore-space-change --ignore-whitespace ../patches/unity_build.patch
git apply --ignore-space-change --ignore-whitespace ../patches/debug_string.patch
::git apply --ignore-space-change --ignore-whitespace ../patches/debug_string.patch

title win x64 debug dev
scons platform=windows target=editor arch=x86_64 dev_build=yes debug_symbols=yes generate_bindings=yes %api%
Expand Down
3 changes: 3 additions & 0 deletions examples_dd3d/DebugDrawDemoScene.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ func _on_Button_pressed() -> void:
process_priority = 1
script = ExtResource("1")
custom_font = ExtResource("2_aedbq")
zylann_example = true
start_culling_distance = 55.0
text_groups_position = 2
text_groups_default_font_size = 15
Expand Down Expand Up @@ -414,6 +415,7 @@ transform = Transform3D(1, -2.7352e-06, 2.60722e-07, 3.30799e-06, 1, 0, -3.51517
[node name="HitTest" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.48967, -1.03227, 9.524)
visible = false
[node name="StaticBody" type="StaticBody3D" parent="HitTest"]
Expand Down Expand Up @@ -462,6 +464,7 @@ libraries = {
[node name="LagTest" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10.4482, -1.49353, -0.450473)
visible = false
size = Vector3(2, 2, 2)
material = SubResource("1")
Expand Down
15 changes: 0 additions & 15 deletions patches/always_build_fix.patch

This file was deleted.

3 changes: 0 additions & 3 deletions src/2d/debug_draw_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,9 @@ DebugDraw2D::~DebugDraw2D() {
custom_canvas->queue_redraw();

if (!IS_EDITOR_HINT()) {
if (UtilityFunctions::is_instance_valid(_canvas_layer))
_canvas_layer->queue_free();
if (UtilityFunctions::is_instance_valid(default_canvas))
default_canvas->queue_free();

_canvas_layer = nullptr;
default_canvas = nullptr;
}
#endif
Expand Down
1 change: 0 additions & 1 deletion src/2d/debug_draw_2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class DebugDraw2D : public Object {
DebugDrawManager *root_node = nullptr;

// 2d
CanvasLayer *_canvas_layer = nullptr;
bool _canvas_need_update = true;
Ref<Font> _font;

Expand Down
10 changes: 0 additions & 10 deletions src/3d/debug_geometry_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ DebugGeometryContainer::~DebugGeometryContainer() {

geometry_pool.clear_pool();
geometry_pool.clear_pool();

RenderingServer *rs = RS();
rs->free_rid(immediate_mesh_storage.instance);
immediate_mesh_storage.mesh.unref();
immediate_mesh_storage.material.unref();

for (auto &i : multi_mesh_storage) {
rs->free_rid(i.instance);
i.mesh.unref();
}
}

void DebugGeometryContainer::CreateMMI(InstanceType type, const String &name, Ref<ArrayMesh> mesh) {
Expand Down
9 changes: 3 additions & 6 deletions src/debug_draw_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,15 @@ void DebugDrawManager::_integrate_into_engine() {
f->store_string(Utils::get_scene_tree_as_string(res->get_parent()->get_parent()));
*/
} else {
// Create canvas item and canvas layer
auto _canvas_layer = memnew(CanvasLayer);
_canvas_layer->set_layer(64);
debug_draw_2d_singleton->_canvas_layer = _canvas_layer;
set_layer(64);

auto default_canvas = memnew(Control);
default_canvas->set_name("DebugDrawDefaultCanvas");
((Control *)default_canvas)->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
((Control *)default_canvas)->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
debug_draw_2d_singleton->default_canvas = default_canvas;

add_child(_canvas_layer);
_canvas_layer->add_child(default_canvas);
add_child(default_canvas);
}

debug_draw_2d_singleton->set_custom_canvas(debug_draw_2d_singleton->custom_canvas);
Expand All @@ -183,6 +179,7 @@ DebugDrawManager::DebugDrawManager() {

DebugDrawManager::~DebugDrawManager() {
UNASSIGN_SINGLETON(DebugDrawManager);
_exit_tree();
}

void DebugDrawManager::init() {
Expand Down

0 comments on commit 06f1ed8

Please sign in to comment.