summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml16
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp14
-rw-r--r--editor/plugins/script_text_editor.cpp89
-rw-r--r--editor/plugins/script_text_editor.h5
-rw-r--r--modules/gdnative/gdnative.cpp18
-rw-r--r--modules/gdnative/gdnative.h2
-rw-r--r--platform/x11/context_gl_x11.cpp2
-rw-r--r--scene/2d/particles_2d.cpp1
-rw-r--r--scene/3d/gi_probe.cpp1
-rw-r--r--scene/3d/particles.cpp1
-rw-r--r--scene/3d/soft_body.cpp1
-rw-r--r--scene/animation/skeleton_ik.cpp3
-rw-r--r--scene/main/scene_tree.cpp5
-rw-r--r--servers/visual/visual_server_raster.cpp2
14 files changed, 114 insertions, 46 deletions
diff --git a/.travis.yml b/.travis.yml
index 09d8cad07e..b52e40200f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -28,17 +28,17 @@ matrix:
packages:
- clang-format-8
- - name: Linux editor (debug, GCC 8, with Mono)
- env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc-8 MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" EXTRA_ARGS="module_mono_enabled=yes mono_glue=no warnings=extra werror=yes"
+ - name: Linux editor (debug, GCC 9, with Mono)
+ env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc-9 MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" EXTRA_ARGS="module_mono_enabled=yes mono_glue=no warnings=extra werror=yes"
os: linux
- compiler: gcc-8
+ compiler: gcc-9
addons:
apt:
sources:
- mono
- ubuntu-toolchain-r-test
packages:
- - &gcc8_deps [gcc-8, g++-8]
+ - &gcc9_deps [gcc-9, g++-9]
- &linux_deps [libasound2-dev, libgl1-mesa-dev, libglu1-mesa-dev, libx11-dev, libxcursor-dev, libxi-dev, libxinerama-dev, libxrandr-dev]
- &linux_mono_deps [mono-devel, msbuild, nuget]
@@ -75,16 +75,16 @@ matrix:
os: osx
compiler: clang
- - name: Linux headless editor (release_debug, GCC 8)
- env: PLATFORM=server TOOLS=yes TARGET=release_debug CACHE_NAME=${PLATFORM}-tools-gcc-8 MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" EXTRA_ARGS="warnings=extra werror=yes"
+ - name: Linux headless editor (release_debug, GCC 9)
+ env: PLATFORM=server TOOLS=yes TARGET=release_debug CACHE_NAME=${PLATFORM}-tools-gcc-9 MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" EXTRA_ARGS="warnings=extra werror=yes"
os: linux
- compiler: gcc-8
+ compiler: gcc-9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- - *gcc8_deps
+ - *gcc9_deps
- *linux_deps
- name: Linux export template (release_debug, GCC 5, without 3D support)
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 91c0693538..c2fde148e2 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -4990,6 +4990,20 @@ bool RasterizerSceneGLES3::free(RID p_rid) {
reflection_probe_instance_owner.free(p_rid);
memdelete(reflection_instance);
+ } else if (environment_owner.owns(p_rid)) {
+
+ Environment *environment = environment_owner.get(p_rid);
+
+ environment_owner.free(p_rid);
+ memdelete(environment);
+
+ } else if (gi_probe_instance_owner.owns(p_rid)) {
+
+ GIProbeInstance *gi_probe_instance = gi_probe_instance_owner.get(p_rid);
+
+ gi_probe_instance_owner.free(p_rid);
+ memdelete(gi_probe_instance);
+
} else {
return false;
}
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index f705970d79..2cfa759e3b 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -646,19 +646,20 @@ void ScriptTextEditor::_validate_script() {
void ScriptTextEditor::_update_bookmark_list() {
- bookmarks_menu->get_popup()->clear();
+ bookmarks_menu->clear();
+ bookmarks_menu->set_size(Size2(1, 1));
- bookmarks_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_bookmark"), BOOKMARK_TOGGLE);
- bookmarks_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/remove_all_bookmarks"), BOOKMARK_REMOVE_ALL);
- bookmarks_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_bookmark"), BOOKMARK_GOTO_NEXT);
- bookmarks_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV);
+ bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_bookmark"), BOOKMARK_TOGGLE);
+ bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/remove_all_bookmarks"), BOOKMARK_REMOVE_ALL);
+ bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_bookmark"), BOOKMARK_GOTO_NEXT);
+ bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV);
Array bookmark_list = code_editor->get_text_edit()->get_bookmarks_array();
if (bookmark_list.size() == 0) {
return;
}
- bookmarks_menu->get_popup()->add_separator();
+ bookmarks_menu->add_separator();
for (int i = 0; i < bookmark_list.size(); i++) {
String line = code_editor->get_text_edit()->get_line(bookmark_list[i]).strip_edges();
@@ -667,17 +668,17 @@ void ScriptTextEditor::_update_bookmark_list() {
line = line.substr(0, 50);
}
- bookmarks_menu->get_popup()->add_item(String::num((int)bookmark_list[i] + 1) + " - \"" + line + "\"");
- bookmarks_menu->get_popup()->set_item_metadata(bookmarks_menu->get_popup()->get_item_count() - 1, bookmark_list[i]);
+ bookmarks_menu->add_item(String::num((int)bookmark_list[i] + 1) + " - \"" + line + "\"");
+ bookmarks_menu->set_item_metadata(bookmarks_menu->get_item_count() - 1, bookmark_list[i]);
}
}
void ScriptTextEditor::_bookmark_item_pressed(int p_idx) {
if (p_idx < 4) { // Any item before the separator.
- _edit_option(bookmarks_menu->get_popup()->get_item_id(p_idx));
+ _edit_option(bookmarks_menu->get_item_id(p_idx));
} else {
- code_editor->goto_line(bookmarks_menu->get_popup()->get_item_metadata(p_idx));
+ code_editor->goto_line(bookmarks_menu->get_item_metadata(p_idx));
}
}
@@ -792,6 +793,44 @@ void ScriptTextEditor::_code_complete_script(const String &p_code, List<String>
}
}
+void ScriptTextEditor::_update_breakpoint_list() {
+
+ breakpoints_menu->clear();
+ breakpoints_menu->set_size(Size2(1, 1));
+
+ breakpoints_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_breakpoint"), DEBUG_TOGGLE_BREAKPOINT);
+ breakpoints_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/remove_all_breakpoints"), DEBUG_REMOVE_ALL_BREAKPOINTS);
+ breakpoints_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_breakpoint"), DEBUG_GOTO_NEXT_BREAKPOINT);
+ breakpoints_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_breakpoint"), DEBUG_GOTO_PREV_BREAKPOINT);
+
+ Array breakpoint_list = code_editor->get_text_edit()->get_breakpoints_array();
+ if (breakpoint_list.size() == 0) {
+ return;
+ }
+
+ breakpoints_menu->add_separator();
+
+ for (int i = 0; i < breakpoint_list.size(); i++) {
+ String line = code_editor->get_text_edit()->get_line(breakpoint_list[i]).strip_edges();
+ // Limit the size of the line if too big.
+ if (line.length() > 50) {
+ line = line.substr(0, 50);
+ }
+
+ breakpoints_menu->add_item(String::num((int)breakpoint_list[i] + 1) + " - \"" + line + "\"");
+ breakpoints_menu->set_item_metadata(breakpoints_menu->get_item_count() - 1, breakpoint_list[i]);
+ }
+}
+
+void ScriptTextEditor::_breakpoint_item_pressed(int p_idx) {
+
+ if (p_idx < 4) { // Any item before the separator.
+ _edit_option(breakpoints_menu->get_item_id(p_idx));
+ } else {
+ code_editor->goto_line(breakpoints_menu->get_item_metadata(p_idx));
+ }
+}
+
void ScriptTextEditor::_breakpoint_toggled(int p_row) {
ScriptEditor::get_singleton()->get_debugger()->set_breakpoint(script->get_path(), p_row + 1, code_editor->get_text_edit()->is_line_set_as_breakpoint(p_row));
@@ -1298,6 +1337,8 @@ void ScriptTextEditor::_bind_methods() {
ClassDB::bind_method("_update_bookmark_list", &ScriptTextEditor::_update_bookmark_list);
ClassDB::bind_method("_bookmark_item_pressed", &ScriptTextEditor::_bookmark_item_pressed);
ClassDB::bind_method("_load_theme_settings", &ScriptTextEditor::_load_theme_settings);
+ ClassDB::bind_method("_update_breakpoint_list", &ScriptTextEditor::_update_breakpoint_list);
+ ClassDB::bind_method("_breakpoint_item_pressed", &ScriptTextEditor::_breakpoint_item_pressed);
ClassDB::bind_method("_breakpoint_toggled", &ScriptTextEditor::_breakpoint_toggled);
ClassDB::bind_method("_lookup_connections", &ScriptTextEditor::_lookup_connections);
ClassDB::bind_method("_update_connected_methods", &ScriptTextEditor::_update_connected_methods);
@@ -1705,11 +1746,6 @@ ScriptTextEditor::ScriptTextEditor() {
edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/auto_indent"), EDIT_AUTO_INDENT);
edit_menu->get_popup()->connect("id_pressed", this, "_edit_option");
edit_menu->get_popup()->add_separator();
- edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_breakpoint"), DEBUG_TOGGLE_BREAKPOINT);
- edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/remove_all_breakpoints"), DEBUG_REMOVE_ALL_BREAKPOINTS);
- edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_breakpoint"), DEBUG_GOTO_NEXT_BREAKPOINT);
- edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_breakpoint"), DEBUG_GOTO_PREV_BREAKPOINT);
- edit_menu->get_popup()->add_separator();
PopupMenu *convert_case = memnew(PopupMenu);
convert_case->set_name("convert_case");
@@ -1749,13 +1785,26 @@ ScriptTextEditor::ScriptTextEditor() {
edit_hb->add_child(edit_menu);
- bookmarks_menu = memnew(MenuButton);
- edit_hb->add_child(bookmarks_menu);
- bookmarks_menu->set_text(TTR("Bookmarks"));
- bookmarks_menu->set_switch_on_hover(true);
+ MenuButton *goto_menu = memnew(MenuButton);
+ edit_hb->add_child(goto_menu);
+ goto_menu->set_text(TTR("Go To"));
+ goto_menu->set_switch_on_hover(true);
+
+ bookmarks_menu = memnew(PopupMenu);
+ bookmarks_menu->set_name("Bookmarks");
+ goto_menu->get_popup()->add_child(bookmarks_menu);
+ goto_menu->get_popup()->add_submenu_item(TTR("Bookmarks"), "Bookmarks");
_update_bookmark_list();
bookmarks_menu->connect("about_to_show", this, "_update_bookmark_list");
- bookmarks_menu->get_popup()->connect("index_pressed", this, "_bookmark_item_pressed");
+ bookmarks_menu->connect("index_pressed", this, "_bookmark_item_pressed");
+
+ breakpoints_menu = memnew(PopupMenu);
+ breakpoints_menu->set_name("Breakpoints");
+ goto_menu->get_popup()->add_child(breakpoints_menu);
+ goto_menu->get_popup()->add_submenu_item(TTR("Breakpoints"), "Breakpoints");
+ _update_breakpoint_list();
+ breakpoints_menu->connect("about_to_show", this, "_update_breakpoint_list");
+ breakpoints_menu->connect("index_pressed", this, "_breakpoint_item_pressed");
quick_open = memnew(ScriptEditorQuickOpen);
add_child(quick_open);
diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h
index f83f1ea759..b53383b117 100644
--- a/editor/plugins/script_text_editor.h
+++ b/editor/plugins/script_text_editor.h
@@ -70,7 +70,8 @@ class ScriptTextEditor : public ScriptEditorBase {
MenuButton *edit_menu;
MenuButton *search_menu;
- MenuButton *bookmarks_menu;
+ PopupMenu *bookmarks_menu;
+ PopupMenu *breakpoints_menu;
PopupMenu *highlighter_menu;
PopupMenu *context_menu;
@@ -143,6 +144,8 @@ class ScriptTextEditor : public ScriptEditorBase {
protected:
static void _code_complete_scripts(void *p_ud, const String &p_code, List<String> *r_options, bool &r_force);
+ void _update_breakpoint_list();
+ void _breakpoint_item_pressed(int p_idx);
void _breakpoint_toggled(int p_row);
void _validate_script(); // No longer virtual.
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp
index a27935bfe2..4eb9a2a0a3 100644
--- a/modules/gdnative/gdnative.cpp
+++ b/modules/gdnative/gdnative.cpp
@@ -48,7 +48,7 @@ static const bool default_reloadable = true;
// Defined in gdnative_api_struct.gen.cpp
extern const godot_gdnative_core_api_struct api_struct;
-Map<String, Vector<Ref<GDNative> > > *GDNativeLibrary::loaded_libraries = NULL;
+Map<String, Vector<Ref<GDNative> > > GDNativeLibrary::loaded_libraries;
GDNativeLibrary::GDNativeLibrary() {
config_file.instance();
@@ -57,10 +57,6 @@ GDNativeLibrary::GDNativeLibrary() {
load_once = default_load_once;
singleton = default_singleton;
reloadable = default_reloadable;
-
- if (GDNativeLibrary::loaded_libraries == NULL) {
- GDNativeLibrary::loaded_libraries = memnew((Map<String, Vector<Ref<GDNative> > >));
- }
}
GDNativeLibrary::~GDNativeLibrary() {
@@ -318,10 +314,10 @@ bool GDNative::initialize() {
#endif
if (library->should_load_once()) {
- if (GDNativeLibrary::loaded_libraries->has(lib_path)) {
+ if (GDNativeLibrary::loaded_libraries.has(lib_path)) {
// already loaded. Don't load again.
// copy some of the stuff instead
- this->native_handle = (*GDNativeLibrary::loaded_libraries)[lib_path][0]->native_handle;
+ this->native_handle = GDNativeLibrary::loaded_libraries[lib_path][0]->native_handle;
initialized = true;
return true;
}
@@ -377,11 +373,11 @@ bool GDNative::initialize() {
initialized = true;
- if (library->should_load_once() && !GDNativeLibrary::loaded_libraries->has(lib_path)) {
+ if (library->should_load_once() && !GDNativeLibrary::loaded_libraries.has(lib_path)) {
Vector<Ref<GDNative> > gdnatives;
gdnatives.resize(1);
gdnatives.write[0] = Ref<GDNative>(this);
- GDNativeLibrary::loaded_libraries->insert(lib_path, gdnatives);
+ GDNativeLibrary::loaded_libraries.insert(lib_path, gdnatives);
}
return true;
@@ -395,7 +391,7 @@ bool GDNative::terminate() {
}
if (library->should_load_once()) {
- Vector<Ref<GDNative> > *gdnatives = &(*GDNativeLibrary::loaded_libraries)[library->get_current_library_path()];
+ Vector<Ref<GDNative> > *gdnatives = &GDNativeLibrary::loaded_libraries[library->get_current_library_path()];
if (gdnatives->size() > 1) {
// there are other GDNative's still using this library, so we actually don't terminate
gdnatives->erase(Ref<GDNative>(this));
@@ -405,7 +401,7 @@ bool GDNative::terminate() {
// we're the last one, terminate!
gdnatives->clear();
// whew this looks scary, but all it does is remove the entry completely
- GDNativeLibrary::loaded_libraries->erase(GDNativeLibrary::loaded_libraries->find(library->get_current_library_path()));
+ GDNativeLibrary::loaded_libraries.erase(GDNativeLibrary::loaded_libraries.find(library->get_current_library_path()));
}
}
diff --git a/modules/gdnative/gdnative.h b/modules/gdnative/gdnative.h
index 005d1d2bff..408af26753 100644
--- a/modules/gdnative/gdnative.h
+++ b/modules/gdnative/gdnative.h
@@ -47,7 +47,7 @@ class GDNative;
class GDNativeLibrary : public Resource {
GDCLASS(GDNativeLibrary, Resource);
- static Map<String, Vector<Ref<GDNative> > > *loaded_libraries;
+ static Map<String, Vector<Ref<GDNative> > > loaded_libraries;
friend class GDNativeLibraryResourceLoader;
friend class GDNative;
diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp
index 9718b03164..d70b947fcc 100644
--- a/platform/x11/context_gl_x11.cpp
+++ b/platform/x11/context_gl_x11.cpp
@@ -145,6 +145,7 @@ Error ContextGL_X11::initialize() {
break;
}
}
+ XFree(fbc);
ERR_FAIL_COND_V(!fbconfig, ERR_UNCONFIGURED);
swa.background_pixmap = None;
@@ -159,6 +160,7 @@ Error ContextGL_X11::initialize() {
vi = glXGetVisualFromFBConfig(x11_display, fbc[0]);
fbconfig = fbc[0];
+ XFree(fbc);
}
int (*oldHandler)(Display *, XErrorEvent *) = XSetErrorHandler(&ctxErrorHandler);
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp
index 7759897420..93c12f0103 100644
--- a/scene/2d/particles_2d.cpp
+++ b/scene/2d/particles_2d.cpp
@@ -410,6 +410,7 @@ Particles2D::Particles2D() {
particles = VS::get_singleton()->particles_create();
+ one_shot = false; // Needed so that set_emitting doesn't access uninitialized values
set_emitting(true);
set_one_shot(false);
set_amount(8);
diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp
index 414e932f61..a04f156d80 100644
--- a/scene/3d/gi_probe.cpp
+++ b/scene/3d/gi_probe.cpp
@@ -571,4 +571,5 @@ GIProbe::GIProbe() {
}
GIProbe::~GIProbe() {
+ VS::get_singleton()->free(gi_probe);
}
diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp
index 2bcd0eaa46..00a168fc39 100644
--- a/scene/3d/particles.cpp
+++ b/scene/3d/particles.cpp
@@ -411,6 +411,7 @@ Particles::Particles() {
particles = VS::get_singleton()->particles_create();
set_base(particles);
+ one_shot = false; // Needed so that set_emitting doesn't access uninitialized values
set_emitting(true);
set_one_shot(false);
set_amount(8);
diff --git a/scene/3d/soft_body.cpp b/scene/3d/soft_body.cpp
index a9d96292a1..b9f6865298 100644
--- a/scene/3d/soft_body.cpp
+++ b/scene/3d/soft_body.cpp
@@ -712,6 +712,7 @@ SoftBody::SoftBody() :
}
SoftBody::~SoftBody() {
+ PhysicsServer::get_singleton()->free(physics_rid);
}
void SoftBody::reset_softbody_pin() {
diff --git a/scene/animation/skeleton_ik.cpp b/scene/animation/skeleton_ik.cpp
index 43c4b2aa51..7a1b10792b 100644
--- a/scene/animation/skeleton_ik.cpp
+++ b/scene/animation/skeleton_ik.cpp
@@ -406,6 +406,7 @@ void SkeletonIK::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
skeleton = Object::cast_to<Skeleton>(get_parent());
+ set_process_priority(1);
reload_chain();
} break;
case NOTIFICATION_INTERNAL_PROCESS: {
@@ -431,8 +432,6 @@ SkeletonIK::SkeletonIK() :
skeleton(NULL),
target_node_override(NULL),
task(NULL) {
-
- set_process_priority(1);
}
SkeletonIK::~SkeletonIK() {
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index 0e7cec57a4..0940a59a82 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -453,9 +453,6 @@ void SceneTree::init() {
//_quit=false;
initialized = true;
- input_handled = false;
-
- pause = false;
root->_set_tree(this);
MainLoop::init();
@@ -1986,6 +1983,8 @@ SceneTree::SceneTree() {
idle_process_time = 1;
root = NULL;
+ input_handled = false;
+ pause = false;
current_frame = 0;
current_event = 0;
tree_changed_name = "tree_changed";
diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp
index d45bda72b7..7aded4e816 100644
--- a/servers/visual/visual_server_raster.cpp
+++ b/servers/visual/visual_server_raster.cpp
@@ -77,6 +77,8 @@ void VisualServerRaster::free(RID p_rid) {
return;
if (VSG::scene->free(p_rid))
return;
+ if (VSG::scene_render->free(p_rid))
+ return;
}
/* EVENT QUEUING */