Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up some Editor, OpenXR, VideoStream code #83683

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading