Skip to content

Commit

Permalink
Merge pull request #83683 from YuriSizov/random-cleanup
Browse files Browse the repository at this point in the history
Clean up some Editor, OpenXR, VideoStream code
  • Loading branch information
akien-mga committed Oct 20, 2023
2 parents f68fa0f + cd31407 commit 46efe48
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 33 deletions.
56 changes: 27 additions & 29 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6728,49 +6728,47 @@ int EditorNode::execute_and_show_output(const String &p_title, const String &p_p
}

EditorNode::EditorNode() {
EditorPropertyNameProcessor *epnp = memnew(EditorPropertyNameProcessor);
add_child(epnp);
DEV_ASSERT(!singleton);
singleton = this;

PortableCompressedTexture2D::set_keep_all_compressed_buffers(true);
Input::get_singleton()->set_use_accumulated_input(true);
Resource::_get_local_scene_func = _resource_get_edited_scene;

RenderingServer::get_singleton()->set_debug_generate_wireframes(true);
{
PortableCompressedTexture2D::set_keep_all_compressed_buffers(true);
RenderingServer::get_singleton()->set_debug_generate_wireframes(true);

AudioServer::get_singleton()->set_enable_tagging_used_audio_streams(true);
AudioServer::get_singleton()->set_enable_tagging_used_audio_streams(true);

// No navigation server by default if in editor.
if (NavigationServer3D::get_singleton()->get_debug_enabled()) {
NavigationServer3D::get_singleton()->set_active(true);
} else {
NavigationServer3D::get_singleton()->set_active(false);
}
// No navigation by default if in editor.
if (NavigationServer3D::get_singleton()->get_debug_enabled()) {
NavigationServer3D::get_singleton()->set_active(true);
} else {
NavigationServer3D::get_singleton()->set_active(false);
}

// No physics by default if in editor.
PhysicsServer3D::get_singleton()->set_active(false);
PhysicsServer2D::get_singleton()->set_active(false);
// No physics by default if in editor.
PhysicsServer3D::get_singleton()->set_active(false);
PhysicsServer2D::get_singleton()->set_active(false);

// No scripting by default if in editor.
ScriptServer::set_scripting_enabled(false);
// No scripting by default if in editor (except for tool).
ScriptServer::set_scripting_enabled(false);

Input::get_singleton()->set_use_accumulated_input(true);
if (!DisplayServer::get_singleton()->is_touchscreen_available()) {
// Only if no touchscreen ui hint, disable emulation just in case.
Input::get_singleton()->set_emulate_touch_from_mouse(false);
}
DisplayServer::get_singleton()->cursor_set_custom_image(Ref<Resource>());
}

EditorHelp::generate_doc();
SceneState::set_disable_placeholders(true);
ResourceLoader::clear_translation_remaps(); // Using no remaps if in editor.
ResourceLoader::clear_path_remaps();
ResourceLoader::set_create_missing_resources_if_class_unavailable(true);

Input *id = Input::get_singleton();

if (id) {
if (!DisplayServer::get_singleton()->is_touchscreen_available() && Input::get_singleton()) {
// Only if no touchscreen ui hint, disable emulation just in case.
id->set_emulate_touch_from_mouse(false);
}
DisplayServer::get_singleton()->cursor_set_custom_image(Ref<Resource>());
}

DEV_ASSERT(!singleton);
singleton = this;
EditorPropertyNameProcessor *epnp = memnew(EditorPropertyNameProcessor);
add_child(epnp);

EditorUndoRedoManager::get_singleton()->connect("version_changed", callable_mp(this, &EditorNode::_update_undo_redo_allowed));
EditorUndoRedoManager::get_singleton()->connect("history_changed", callable_mp(this, &EditorNode::_update_undo_redo_allowed));
Expand Down
3 changes: 1 addition & 2 deletions modules/openxr/editor/openxr_interaction_profile_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
void OpenXRInteractionProfileEditorBase::_bind_methods() {
ClassDB::bind_method(D_METHOD("_add_binding", "action", "path"), &OpenXRInteractionProfileEditorBase::_add_binding);
ClassDB::bind_method(D_METHOD("_remove_binding", "action", "path"), &OpenXRInteractionProfileEditorBase::_remove_binding);
ClassDB::bind_method(D_METHOD("_update_interaction_profile"), &OpenXRInteractionProfileEditorBase::_update_interaction_profile);
}

void OpenXRInteractionProfileEditorBase::_notification(int p_what) {
Expand All @@ -63,7 +62,7 @@ void OpenXRInteractionProfileEditorBase::_notification(int p_what) {
void OpenXRInteractionProfileEditorBase::_do_update_interaction_profile() {
if (!is_dirty) {
is_dirty = true;
call_deferred("_update_interaction_profile");
callable_mp(this, &OpenXRInteractionProfileEditorBase::_update_interaction_profile).call_deferred();
}
}

Expand Down
3 changes: 1 addition & 2 deletions scene/resources/video_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ class VideoStream : public Resource {
OBJ_SAVE_TYPE(VideoStream);

protected:
static void
_bind_methods();
static void _bind_methods();

GDVIRTUAL0R(Ref<VideoStreamPlayback>, _instantiate_playback);

Expand Down

0 comments on commit 46efe48

Please sign in to comment.