Editor: remove TOOLS_ENABLED guards

For code  inside editor/ `#ifdef TOOLS_ENABLED`
is always true so those checks are redundant.
This commit is contained in:
merumelu 2019-08-30 19:02:46 +02:00
parent ba854bbc7b
commit e2459479de
7 changed files with 1 additions and 46 deletions

View file

@ -28,8 +28,6 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/ /*************************************************************************/
#ifdef TOOLS_ENABLED
#include "collada.h" #include "collada.h"
#include <stdio.h> #include <stdio.h>
@ -2576,5 +2574,3 @@ Error Collada::load(const String &p_path, int p_flags) {
Collada::Collada() { Collada::Collada() {
} }
#endif

View file

@ -28,8 +28,6 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/ /*************************************************************************/
#ifdef TOOLS_ENABLED
#ifndef COLLADA_H #ifndef COLLADA_H
#define COLLADA_H #define COLLADA_H
@ -647,5 +645,3 @@ private: // private stuff
}; };
#endif // COLLADA_H #endif // COLLADA_H
#endif

View file

@ -1044,7 +1044,6 @@ void EditorInspectorSection::_notification(int p_what) {
Ref<Font> font = get_font("font", "Tree"); Ref<Font> font = get_font("font", "Tree");
Ref<Texture> arrow; Ref<Texture> arrow;
#ifdef TOOLS_ENABLED
if (foldable) { if (foldable) {
if (object->editor_is_section_unfolded(section)) { if (object->editor_is_section_unfolded(section)) {
arrow = get_icon("arrow_up", "Tree"); arrow = get_icon("arrow_up", "Tree");
@ -1052,7 +1051,6 @@ void EditorInspectorSection::_notification(int p_what) {
arrow = get_icon("arrow", "Tree"); arrow = get_icon("arrow", "Tree");
} }
} }
#endif
Size2 size = get_size(); Size2 size = get_size();
Point2 offset; Point2 offset;
@ -1087,7 +1085,6 @@ void EditorInspectorSection::_notification(int p_what) {
Ref<Texture> arrow; Ref<Texture> arrow;
#ifdef TOOLS_ENABLED
if (foldable) { if (foldable) {
if (object->editor_is_section_unfolded(section)) { if (object->editor_is_section_unfolded(section)) {
arrow = get_icon("arrow_up", "Tree"); arrow = get_icon("arrow_up", "Tree");
@ -1095,7 +1092,6 @@ void EditorInspectorSection::_notification(int p_what) {
arrow = get_icon("arrow", "Tree"); arrow = get_icon("arrow", "Tree");
} }
} }
#endif
Ref<Font> font = get_font("font", "Tree"); Ref<Font> font = get_font("font", "Tree");
@ -1155,7 +1151,6 @@ void EditorInspectorSection::setup(const String &p_section, const String &p_labe
vbox_added = true; vbox_added = true;
} }
#ifdef TOOLS_ENABLED
if (foldable) { if (foldable) {
_test_unfold(); _test_unfold();
if (object->editor_is_section_unfolded(section)) { if (object->editor_is_section_unfolded(section)) {
@ -1164,7 +1159,6 @@ void EditorInspectorSection::setup(const String &p_section, const String &p_labe
vbox->hide(); vbox->hide();
} }
} }
#endif
} }
void EditorInspectorSection::_gui_input(const Ref<InputEvent> &p_event) { void EditorInspectorSection::_gui_input(const Ref<InputEvent> &p_event) {
@ -1172,7 +1166,6 @@ void EditorInspectorSection::_gui_input(const Ref<InputEvent> &p_event) {
if (!foldable) if (!foldable)
return; return;
#ifdef TOOLS_ENABLED
Ref<InputEventMouseButton> mb = p_event; Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) { if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
@ -1191,7 +1184,6 @@ void EditorInspectorSection::_gui_input(const Ref<InputEvent> &p_event) {
vbox->hide(); vbox->hide();
} }
} }
#endif
} }
VBoxContainer *EditorInspectorSection::get_vbox() { VBoxContainer *EditorInspectorSection::get_vbox() {
@ -1205,11 +1197,9 @@ void EditorInspectorSection::unfold() {
_test_unfold(); _test_unfold();
#ifdef TOOLS_ENABLED
object->editor_set_section_unfold(section, true); object->editor_set_section_unfold(section, true);
vbox->show(); vbox->show();
update(); update();
#endif
} }
void EditorInspectorSection::fold() { void EditorInspectorSection::fold() {
@ -1219,11 +1209,9 @@ void EditorInspectorSection::fold() {
if (!vbox_added) if (!vbox_added)
return; //kinda pointless return; //kinda pointless
#ifdef TOOLS_ENABLED
object->editor_set_section_unfold(section, false); object->editor_set_section_unfold(section, false);
vbox->hide(); vbox->hide();
update(); update();
#endif
} }
void EditorInspectorSection::_bind_methods() { void EditorInspectorSection::_bind_methods() {

View file

@ -2540,7 +2540,7 @@ void EditorPropertyResource::update_property() {
if (res.is_valid() != assign->is_toggle_mode()) { if (res.is_valid() != assign->is_toggle_mode()) {
assign->set_toggle_mode(res.is_valid()); assign->set_toggle_mode(res.is_valid());
} }
#ifdef TOOLS_ENABLED
if (res.is_valid() && get_edited_object()->editor_is_section_unfolded(get_edited_property())) { if (res.is_valid() && get_edited_object()->editor_is_section_unfolded(get_edited_property())) {
if (!sub_inspector) { if (!sub_inspector) {
@ -2609,7 +2609,6 @@ void EditorPropertyResource::update_property() {
} }
} }
} }
#endif
} }
preview->set_texture(Ref<Texture>()); preview->set_texture(Ref<Texture>());

View file

@ -271,8 +271,6 @@ void EditorPropertyArray::update_property() {
edit->set_text(arrtype + " (size " + itos(array.call("size")) + ")"); edit->set_text(arrtype + " (size " + itos(array.call("size")) + ")");
#ifdef TOOLS_ENABLED
bool unfolded = get_edited_object()->editor_is_section_unfolded(get_edited_property()); bool unfolded = get_edited_object()->editor_is_section_unfolded(get_edited_property());
if (edit->is_pressed() != unfolded) { if (edit->is_pressed() != unfolded) {
edit->set_pressed(unfolded); edit->set_pressed(unfolded);
@ -397,7 +395,6 @@ void EditorPropertyArray::update_property() {
vbox = NULL; vbox = NULL;
} }
} }
#endif
} }
void EditorPropertyArray::_remove_pressed(int p_index) { void EditorPropertyArray::_remove_pressed(int p_index) {
@ -643,8 +640,6 @@ void EditorPropertyDictionary::update_property() {
edit->set_text("Dictionary (size " + itos(dict.size()) + ")"); edit->set_text("Dictionary (size " + itos(dict.size()) + ")");
#ifdef TOOLS_ENABLED
bool unfolded = get_edited_object()->editor_is_section_unfolded(get_edited_property()); bool unfolded = get_edited_object()->editor_is_section_unfolded(get_edited_property());
if (edit->is_pressed() != unfolded) { if (edit->is_pressed() != unfolded) {
edit->set_pressed(unfolded); edit->set_pressed(unfolded);
@ -959,7 +954,6 @@ void EditorPropertyDictionary::update_property() {
vbox = NULL; vbox = NULL;
} }
} }
#endif
} }
void EditorPropertyDictionary::_object_id_selected(const String &p_property, ObjectID p_id) { void EditorPropertyDictionary::_object_id_selected(const String &p_property, ObjectID p_id) {

View file

@ -1436,8 +1436,6 @@ bool ScriptTextEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_
return false; return false;
} }
#ifdef TOOLS_ENABLED
static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const Ref<Script> &script) { static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const Ref<Script> &script) {
if (p_edited_scene != p_current_node && p_current_node->get_owner() != p_edited_scene) if (p_edited_scene != p_current_node && p_current_node->get_owner() != p_edited_scene)
@ -1457,14 +1455,6 @@ static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const
return NULL; return NULL;
} }
#else
static Node *_find_script_node(Node *p_edited_scene, Node *p_current_node, const Ref<Script> &script) {
return NULL;
}
#endif
void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
Dictionary d = p_data; Dictionary d = p_data;

View file

@ -74,14 +74,6 @@
#define MIN_FOV 0.01 #define MIN_FOV 0.01
#define MAX_FOV 179 #define MAX_FOV 179
#ifdef TOOLS_ENABLED
#define get_global_gizmo_transform get_global_gizmo_transform
#define get_local_gizmo_transform get_local_gizmo_transform
#else
#define get_global_gizmo_transform get_global_transform
#define get_local_gizmo_transform get_transform
#endif
void SpatialEditorViewport::_update_camera(float p_interp_delta) { void SpatialEditorViewport::_update_camera(float p_interp_delta) {
bool is_orthogonal = camera->get_projection() == Camera::PROJECTION_ORTHOGONAL; bool is_orthogonal = camera->get_projection() == Camera::PROJECTION_ORTHOGONAL;