From 6f4858f184870fe944cdf3cf7fdcb7eb83574d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 12 Nov 2021 13:34:25 +0100 Subject: [PATCH] Modules: Make sure to include `modules_enabled.gen.h` where needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #51677. Co-authored-by: Arkadiusz Marcin Kołek --- editor/editor_themes.cpp | 2 +- editor/plugin_config_dialog.cpp | 3 +- editor/rename_dialog.cpp | 1 + editor/rename_dialog.h | 2 +- editor/scene_tree_dock.cpp | 2 ++ editor/scene_tree_dock.h | 4 +-- main/tests/test_gdscript.cpp | 2 +- main/tests/test_string.cpp | 2 +- modules/gltf/gltf_document.cpp | 38 ++++++++++---------- modules/gltf/gltf_document.h | 3 +- modules/recast/navigation_mesh_generator.cpp | 2 +- scene/3d/room_manager.cpp | 2 +- scene/gui/rich_text_label.cpp | 10 +++--- scene/main/scene_tree.cpp | 4 +-- scene/register_scene_types.cpp | 2 ++ scene/resources/dynamic_font.cpp | 2 +- scene/resources/dynamic_font.h | 2 +- 17 files changed, 46 insertions(+), 37 deletions(-) diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index e01cd1be7bda..bd8f7d64e338 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -36,7 +36,7 @@ #include "editor_scale.h" #include "editor_settings.h" -#include "modules/modules_enabled.gen.h" +#include "modules/modules_enabled.gen.h" // For svg. #ifdef MODULE_SVG_ENABLED #include "modules/svg/image_loader_svg.h" #endif diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index 98be6aa5925c..e804efbd858f 100644 --- a/editor/plugin_config_dialog.cpp +++ b/editor/plugin_config_dialog.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "plugin_config_dialog.h" + #include "core/io/config_file.h" #include "core/os/dir_access.h" #include "editor/editor_node.h" @@ -37,7 +38,7 @@ #include "editor/project_settings_editor.h" #include "scene/gui/grid_container.h" -#include "modules/modules_enabled.gen.h" +#include "modules/modules_enabled.gen.h" // For gdscript. #ifdef MODULE_GDSCRIPT_ENABLED #include "modules/gdscript/gdscript.h" #endif diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp index 282b7d75db33..7811b69aa850 100644 --- a/editor/rename_dialog.cpp +++ b/editor/rename_dialog.cpp @@ -30,6 +30,7 @@ #include "rename_dialog.h" +#include "modules/modules_enabled.gen.h" // For regex. #ifdef MODULE_REGEX_ENABLED #include "core/print_string.h" diff --git a/editor/rename_dialog.h b/editor/rename_dialog.h index dd522c0657f7..0088d48e0c14 100644 --- a/editor/rename_dialog.h +++ b/editor/rename_dialog.h @@ -31,7 +31,7 @@ #ifndef RENAME_DIALOG_H #define RENAME_DIALOG_H -#include "modules/modules_enabled.gen.h" +#include "modules/modules_enabled.gen.h" // For regex. #ifdef MODULE_REGEX_ENABLED #include "scene/gui/check_box.h" diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index d1bd68b331f2..eb968d691dc2 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -48,6 +48,8 @@ #include "scene/property_utils.h" #include "scene/resources/packed_scene.h" +#include "modules/modules_enabled.gen.h" // For regex. + void SceneTreeDock::_nodes_drag_begin() { if (restore_script_editor_on_drag) { EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT); diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h index 1ec5c263ca7a..0bb324fbb29c 100644 --- a/editor/scene_tree_dock.h +++ b/editor/scene_tree_dock.h @@ -50,13 +50,14 @@ #include "scene/gui/tree.h" #include "scene_tree_editor.h" +#include "modules/modules_enabled.gen.h" // For regex. + class EditorNode; class SceneTreeDock : public VBoxContainer { GDCLASS(SceneTreeDock, VBoxContainer); enum Tool { - TOOL_NEW, TOOL_INSTANCE, TOOL_EXPAND_COLLAPSE, @@ -96,7 +97,6 @@ class SceneTreeDock : public VBoxContainer { TOOL_CREATE_3D_SCENE, TOOL_CREATE_USER_INTERFACE, TOOL_CREATE_FAVORITE, - }; enum { diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index 4a5cee6724f4..7b6e8d367ff2 100644 --- a/main/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -34,7 +34,7 @@ #include "core/os/main_loop.h" #include "core/os/os.h" -#include "modules/modules_enabled.gen.h" +#include "modules/modules_enabled.gen.h" // For gdscript. #ifdef MODULE_GDSCRIPT_ENABLED #include "modules/gdscript/gdscript.h" diff --git a/main/tests/test_string.cpp b/main/tests/test_string.cpp index 293483c5b7ee..0e3d58cf82b6 100644 --- a/main/tests/test_string.cpp +++ b/main/tests/test_string.cpp @@ -34,7 +34,7 @@ #include "core/os/os.h" #include "core/ustring.h" -#include "modules/modules_enabled.gen.h" +#include "modules/modules_enabled.gen.h" // For regex. #ifdef MODULE_REGEX_ENABLED #include "modules/regex/regex.h" #endif diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index dc6770270d78..049f0bfe1be4 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -29,9 +29,7 @@ /*************************************************************************/ #include "gltf_document.h" -#include "core/error_list.h" -#include "core/error_macros.h" -#include "core/variant.h" + #include "gltf_accessor.h" #include "gltf_animation.h" #include "gltf_camera.h" @@ -44,11 +42,9 @@ #include "gltf_state.h" #include "gltf_texture.h" -#include -#include - #include "core/bind/core_bind.h" #include "core/crypto/crypto_core.h" +#include "core/error_list.h" #include "core/error_macros.h" #include "core/io/json.h" #include "core/math/disjoint_set.h" @@ -58,15 +54,6 @@ #include "core/version_hash.gen.h" #include "drivers/png/png_driver_common.h" #include "editor/import/resource_importer_scene.h" -#ifdef MODULE_CSG_ENABLED -#include "modules/csg/csg_shape.h" -#endif // MODULE_CSG_ENABLED -#ifdef MODULE_GRIDMAP_ENABLED -#include "modules/gridmap/grid_map.h" -#endif // MODULE_GRIDMAP_ENABLED -#ifdef MODULE_REGEX_ENABLED -#include "modules/regex/regex.h" -#endif // MODULE_REGEX_ENABLED #include "scene/2d/node_2d.h" #include "scene/3d/bone_attachment.h" #include "scene/3d/camera.h" @@ -77,6 +64,21 @@ #include "scene/animation/animation_player.h" #include "scene/main/node.h" #include "scene/resources/surface_tool.h" + +#include "modules/modules_enabled.gen.h" // For csg, gridmap, regex. + +#ifdef MODULE_CSG_ENABLED +#include "modules/csg/csg_shape.h" +#endif // MODULE_CSG_ENABLED +#ifdef MODULE_GRIDMAP_ENABLED +#include "modules/gridmap/grid_map.h" +#endif // MODULE_GRIDMAP_ENABLED +#ifdef MODULE_REGEX_ENABLED +#include "modules/regex/regex.h" +#endif // MODULE_REGEX_ENABLED + +#include +#include #include Error GLTFDocument::serialize(Ref state, Node *p_root, const String &p_path) { @@ -5424,18 +5426,18 @@ void GLTFDocument::_convert_grid_map_to_gltf(GridMap *p_grid_map, GLTFNodeIndex state->nodes.push_back(new_gltf_node); Vector3 cell_location = cells[k]; int32_t cell = p_grid_map->get_cell_item( - Vector3(cell_location.x, cell_location.y, cell_location.z)); + cell_location.x, cell_location.y, cell_location.z); MeshInstance *import_mesh_node = memnew(MeshInstance); import_mesh_node->set_mesh(p_grid_map->get_mesh_library()->get_item_mesh(cell)); Transform cell_xform; cell_xform.basis.set_orthogonal_index( p_grid_map->get_cell_item_orientation( - Vector3(cell_location.x, cell_location.y, cell_location.z))); + cell_location.x, cell_location.y, cell_location.z)); cell_xform.basis.scale(Vector3(p_grid_map->get_cell_scale(), p_grid_map->get_cell_scale(), p_grid_map->get_cell_scale())); cell_xform.set_origin(p_grid_map->map_to_world( - Vector3(cell_location.x, cell_location.y, cell_location.z))); + cell_location.x, cell_location.y, cell_location.z)); Ref gltf_mesh; gltf_mesh.instance(); gltf_mesh = import_mesh_node; diff --git a/modules/gltf/gltf_document.h b/modules/gltf/gltf_document.h index a8c654f85df6..28a8a96ac5c0 100644 --- a/modules/gltf/gltf_document.h +++ b/modules/gltf/gltf_document.h @@ -31,7 +31,6 @@ #ifndef GLTF_DOCUMENT_H #define GLTF_DOCUMENT_H -#include "editor/import/resource_importer_scene.h" #include "gltf_animation.h" #include "scene/2d/node_2d.h" #include "scene/3d/bone_attachment.h" @@ -43,6 +42,8 @@ #include "scene/resources/material.h" #include "scene/resources/texture.h" +#include "modules/modules_enabled.gen.h" // For csg, gridmap. + class GLTFState; class GLTFSkin; class GLTFNode; diff --git a/modules/recast/navigation_mesh_generator.cpp b/modules/recast/navigation_mesh_generator.cpp index 118ee9d0c2e1..4ec88229de69 100644 --- a/modules/recast/navigation_mesh_generator.cpp +++ b/modules/recast/navigation_mesh_generator.cpp @@ -46,7 +46,7 @@ #include "scene/resources/shape.h" #include "scene/resources/sphere_shape.h" -#include "modules/modules_enabled.gen.h" +#include "modules/modules_enabled.gen.h" // For csg, gridmap. #ifdef MODULE_CSG_ENABLED #include "modules/csg/csg_shape.h" #endif diff --git a/scene/3d/room_manager.cpp b/scene/3d/room_manager.cpp index 395df10681b4..26b2d4222fac 100644 --- a/scene/3d/room_manager.cpp +++ b/scene/3d/room_manager.cpp @@ -48,7 +48,7 @@ #include "editor/plugins/spatial_editor_plugin.h" #endif -#include "modules/modules_enabled.gen.h" +#include "modules/modules_enabled.gen.h" // For csg. #ifdef MODULE_CSG_ENABLED #include "modules/csg/csg_shape.h" #endif diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 7cdcbaea5742..0d59700223ab 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -35,15 +35,15 @@ #include "core/os/os.h" #include "scene/scene_string_names.h" -#include "modules/modules_enabled.gen.h" -#ifdef MODULE_REGEX_ENABLED -#include "modules/regex/regex.h" -#endif - #ifdef TOOLS_ENABLED #include "editor/editor_scale.h" #endif +#include "modules/modules_enabled.gen.h" // For regex. +#ifdef MODULE_REGEX_ENABLED +#include "modules/regex/regex.h" +#endif + RichTextLabel::Item *RichTextLabel::_get_next_item(Item *p_item, bool p_free) { if (p_free) { if (p_item->subitems.size()) { diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 2dc6e3a7fba6..7b3dc332c699 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -30,8 +30,6 @@ #include "scene_tree.h" -#include "modules/modules_enabled.gen.h" - #include "core/io/marshalls.h" #include "core/io/resource_loader.h" #include "core/message_queue.h" @@ -52,6 +50,8 @@ #include "servers/physics_server.h" #include "viewport.h" +#include "modules/modules_enabled.gen.h" // For freetype. + #include #include diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index f93f8f249f56..d91665fc0abc 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -218,6 +218,8 @@ #include "scene/resources/occluder_shape.h" #endif +#include "modules/modules_enabled.gen.h" // For freetype. + static Ref resource_saver_text; static Ref resource_loader_text; diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index d6d405cc471a..b0fda110ee7b 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "modules/modules_enabled.gen.h" +#include "modules/modules_enabled.gen.h" // For freetype. #ifdef MODULE_FREETYPE_ENABLED #include "dynamic_font.h" diff --git a/scene/resources/dynamic_font.h b/scene/resources/dynamic_font.h index 9218fc51c461..cbce68ce938c 100644 --- a/scene/resources/dynamic_font.h +++ b/scene/resources/dynamic_font.h @@ -31,7 +31,7 @@ #ifndef DYNAMIC_FONT_H #define DYNAMIC_FONT_H -#include "modules/modules_enabled.gen.h" +#include "modules/modules_enabled.gen.h" // For freetype. #ifdef MODULE_FREETYPE_ENABLED #include "core/io/resource_loader.h"