diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp index 79e01f42c..45e5c9d85 100644 --- a/editor/plugins/collision_shape_2d_editor_plugin.cpp +++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp @@ -44,14 +44,14 @@ #include "scene/2d/collision_shape_2d.h" #include "scene/main/node.h" #include "scene/main/scene_tree.h" -#include "scene/resources/capsule_shape_2d.h" -#include "scene/resources/circle_shape_2d.h" -#include "scene/resources/concave_polygon_shape_2d.h" -#include "scene/resources/convex_polygon_shape_2d.h" -#include "scene/resources/line_shape_2d.h" -#include "scene/resources/rectangle_shape_2d.h" -#include "scene/resources/segment_shape_2d.h" -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/capsule_shape_2d.h" +#include "scene/resources/shapes_2d/circle_shape_2d.h" +#include "scene/resources/shapes_2d/concave_polygon_shape_2d.h" +#include "scene/resources/shapes_2d/convex_polygon_shape_2d.h" +#include "scene/resources/shapes_2d/line_shape_2d.h" +#include "scene/resources/shapes_2d/rectangle_shape_2d.h" +#include "scene/resources/shapes_2d/segment_shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" #include "scene/resources/texture.h" void CollisionShape2DEditor::_node_removed(Node *p_node) { diff --git a/modules/navigation_geometry_parsers/geometry_parser_2d/staticbody2d_navigation_geometry_parser_2d.cpp b/modules/navigation_geometry_parsers/geometry_parser_2d/staticbody2d_navigation_geometry_parser_2d.cpp index 400357ae0..374a77420 100644 --- a/modules/navigation_geometry_parsers/geometry_parser_2d/staticbody2d_navigation_geometry_parser_2d.cpp +++ b/modules/navigation_geometry_parsers/geometry_parser_2d/staticbody2d_navigation_geometry_parser_2d.cpp @@ -33,12 +33,12 @@ #include "core/math/convex_hull.h" #include "scene/2d/mesh_instance_2d.h" #include "scene/2d/physics_body_2d.h" -#include "scene/resources/capsule_shape_2d.h" -#include "scene/resources/circle_shape_2d.h" -#include "scene/resources/concave_polygon_shape_2d.h" -#include "scene/resources/convex_polygon_shape_2d.h" -#include "scene/resources/rectangle_shape_2d.h" -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/capsule_shape_2d.h" +#include "scene/resources/shapes_2d/circle_shape_2d.h" +#include "scene/resources/shapes_2d/concave_polygon_shape_2d.h" +#include "scene/resources/shapes_2d/convex_polygon_shape_2d.h" +#include "scene/resources/shapes_2d/rectangle_shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" #include "scene/resources/navigation_mesh_source_geometry_data_2d.h" #include "scene/resources/navigation_polygon.h" diff --git a/modules/props_2d/prop_2d_instance_merger.h b/modules/props_2d/prop_2d_instance_merger.h index 90a78f08f..b20643f45 100644 --- a/modules/props_2d/prop_2d_instance_merger.h +++ b/modules/props_2d/prop_2d_instance_merger.h @@ -25,7 +25,7 @@ SOFTWARE. #include "prop_2d_instance.h" #include "scene/2d/node_2d.h" -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" #include "core/math/vector3.h" diff --git a/modules/props_2d/prop_2d_instance_prop_job.h b/modules/props_2d/prop_2d_instance_prop_job.h index b4aafff51..1121aa61a 100644 --- a/modules/props_2d/prop_2d_instance_prop_job.h +++ b/modules/props_2d/prop_2d_instance_prop_job.h @@ -24,7 +24,7 @@ SOFTWARE. #include "prop_2d_instance_job.h" -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" #include "modules/modules_enabled.gen.h" diff --git a/modules/terraman_2d/meshers/isometric/terrain_2d_mesher_isometric.cpp b/modules/terraman_2d/meshers/isometric/terrain_2d_mesher_isometric.cpp index 2746dece5..d77e02826 100644 --- a/modules/terraman_2d/meshers/isometric/terrain_2d_mesher_isometric.cpp +++ b/modules/terraman_2d/meshers/isometric/terrain_2d_mesher_isometric.cpp @@ -25,7 +25,7 @@ SOFTWARE. #include "core/math/math_funcs.h" #include "../../library/terrain_2d_material_cache.h" -#include "scene/resources/convex_polygon_shape_2d.h" +#include "scene/resources/shapes_2d/convex_polygon_shape_2d.h" void Terrain2DMesherIsometric::_add_chunk(Ref p_chunk) { Ref chunk = p_chunk; diff --git a/modules/terraman_2d/meshers/terrain_2d_mesher.cpp b/modules/terraman_2d/meshers/terrain_2d_mesher.cpp index 5796cafbd..d8f826d20 100644 --- a/modules/terraman_2d/meshers/terrain_2d_mesher.cpp +++ b/modules/terraman_2d/meshers/terrain_2d_mesher.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "../world/default/terrain_2d_chunk_default.h" #include "../world/terrain_2d_chunk.h" -#include "scene/resources/rectangle_shape_2d.h" +#include "scene/resources/shapes_2d/rectangle_shape_2d.h" #include "servers/physics_2d_server.h" #include "modules/modules_enabled.gen.h" diff --git a/modules/terraman_2d/meshers/terrain_2d_mesher.h b/modules/terraman_2d/meshers/terrain_2d_mesher.h index 4ca78f3c8..0875adc34 100644 --- a/modules/terraman_2d/meshers/terrain_2d_mesher.h +++ b/modules/terraman_2d/meshers/terrain_2d_mesher.h @@ -44,7 +44,7 @@ SOFTWARE. #include "../../mesh_data_resource/mesh_data_resource.h" #endif -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" #include "../library/terrain_2d_library.h" diff --git a/modules/terraman_2d/world/terrain_2d_chunk.h b/modules/terraman_2d/world/terrain_2d_chunk.h index f4db738cf..11fb5992e 100644 --- a/modules/terraman_2d/world/terrain_2d_chunk.h +++ b/modules/terraman_2d/world/terrain_2d_chunk.h @@ -49,7 +49,7 @@ SOFTWARE. #include "../../props_2d/props/prop_2d_data.h" #endif -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" #include "../library/terrain_2d_library.h" #include "../library/terrain_2d_surface.h" diff --git a/modules/tile_map/tile_set.h b/modules/tile_map/tile_set.h index 085a1bb9d..89df13003 100644 --- a/modules/tile_map/tile_set.h +++ b/modules/tile_map/tile_set.h @@ -36,9 +36,9 @@ #include "core/variant/array.h" #include "scene/2d/light_occluder_2d.h" #include "scene/2d/navigation_polygon_instance.h" -#include "scene/resources/convex_polygon_shape_2d.h" +#include "scene/resources/shapes_2d/convex_polygon_shape_2d.h" #include "scene/resources/navigation_polygon.h" -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" #include "scene/resources/texture.h" class TileSet : public Resource { diff --git a/modules/tile_map/tile_set_editor_plugin.h b/modules/tile_map/tile_set_editor_plugin.h index 5682094c6..643e27a5b 100644 --- a/modules/tile_map/tile_set_editor_plugin.h +++ b/modules/tile_map/tile_set_editor_plugin.h @@ -32,8 +32,8 @@ #include "editor/editor_node.h" #include "scene/2d/sprite.h" -#include "scene/resources/concave_polygon_shape_2d.h" -#include "scene/resources/convex_polygon_shape_2d.h" +#include "scene/resources/shapes_2d/concave_polygon_shape_2d.h" +#include "scene/resources/shapes_2d/convex_polygon_shape_2d.h" #include "tile_set.h" #define WORKSPACE_MARGIN Vector2(10, 10) diff --git a/scene/2d/collision_object_2d.h b/scene/2d/collision_object_2d.h index 2aab318bd..39553c195 100644 --- a/scene/2d/collision_object_2d.h +++ b/scene/2d/collision_object_2d.h @@ -31,7 +31,7 @@ /*************************************************************************/ #include "scene/2d/node_2d.h" -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" class CollisionObject2D : public Node2D { GDCLASS(CollisionObject2D, Node2D); diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp index 859780e3c..ba5a94fae 100644 --- a/scene/2d/collision_polygon_2d.cpp +++ b/scene/2d/collision_polygon_2d.cpp @@ -33,9 +33,9 @@ #include "collision_object_2d.h" #include "core/config/engine.h" #include "scene/2d/area_2d.h" -#include "scene/resources/concave_polygon_shape_2d.h" -#include "scene/resources/convex_polygon_shape_2d.h" -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/concave_polygon_shape_2d.h" +#include "scene/resources/shapes_2d/convex_polygon_shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" #include "thirdparty/misc/triangulator.h" diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp index 5ffc9d9af..7f7366cef 100644 --- a/scene/2d/collision_shape_2d.cpp +++ b/scene/2d/collision_shape_2d.cpp @@ -33,14 +33,14 @@ #include "collision_object_2d.h" #include "core/config/engine.h" #include "scene/2d/area_2d.h" -#include "scene/resources/capsule_shape_2d.h" -#include "scene/resources/circle_shape_2d.h" -#include "scene/resources/concave_polygon_shape_2d.h" -#include "scene/resources/convex_polygon_shape_2d.h" -#include "scene/resources/line_shape_2d.h" -#include "scene/resources/rectangle_shape_2d.h" -#include "scene/resources/segment_shape_2d.h" -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/capsule_shape_2d.h" +#include "scene/resources/shapes_2d/circle_shape_2d.h" +#include "scene/resources/shapes_2d/concave_polygon_shape_2d.h" +#include "scene/resources/shapes_2d/convex_polygon_shape_2d.h" +#include "scene/resources/shapes_2d/line_shape_2d.h" +#include "scene/resources/shapes_2d/rectangle_shape_2d.h" +#include "scene/resources/shapes_2d/segment_shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" void CollisionShape2D::_shape_changed() { update(); diff --git a/scene/2d/shape_cast_2d.cpp b/scene/2d/shape_cast_2d.cpp index 49d569977..c75462323 100644 --- a/scene/2d/shape_cast_2d.cpp +++ b/scene/2d/shape_cast_2d.cpp @@ -34,7 +34,7 @@ #include "core/config/engine.h" #include "scene/2d/collision_object_2d.h" #include "scene/2d/physics_body_2d.h" -#include "scene/resources/circle_shape_2d.h" +#include "scene/resources/shapes_2d/circle_shape_2d.h" #include "servers/physics_2d_server.h" void ShapeCast2D::set_target_position(const Vector2 &p_point) { diff --git a/scene/2d/shape_cast_2d.h b/scene/2d/shape_cast_2d.h index b017eac82..fd33ff9f2 100644 --- a/scene/2d/shape_cast_2d.h +++ b/scene/2d/shape_cast_2d.h @@ -32,7 +32,7 @@ #define SHAPE_CAST_2D_H #include "scene/2d/node_2d.h" -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" #include "scene/resources/world_2d.h" class CollisionObject2D; diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index 0b8d520a4..b6e754a7a 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -34,7 +34,7 @@ #include "core/input/input.h" #include "core/os/os.h" #include "scene/resources/bit_map.h" -#include "scene/resources/rectangle_shape_2d.h" +#include "scene/resources/shapes_2d/rectangle_shape_2d.h" #include "scene/resources/texture.h" #include "scene/scene_string_names.h" diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 969924231..d38a798c2 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -142,19 +142,19 @@ #include "scene/resources/bit_map.h" #include "scene/resources/box_shape.h" #include "scene/resources/capsule_shape.h" -#include "scene/resources/capsule_shape_2d.h" -#include "scene/resources/circle_shape_2d.h" +#include "scene/resources/shapes_2d/capsule_shape_2d.h" +#include "scene/resources/shapes_2d/circle_shape_2d.h" #include "scene/resources/concave_polygon_shape.h" -#include "scene/resources/concave_polygon_shape_2d.h" +#include "scene/resources/shapes_2d/concave_polygon_shape_2d.h" #include "scene/resources/convex_polygon_shape.h" -#include "scene/resources/convex_polygon_shape_2d.h" +#include "scene/resources/shapes_2d/convex_polygon_shape_2d.h" #include "scene/resources/cylinder_shape.h" #include "scene/resources/default_theme/default_theme.h" #include "scene/resources/dynamic_font.h" #include "scene/resources/gradient.h" #include "scene/resources/height_map_shape.h" #include "scene/resources/immediate_mesh.h" -#include "scene/resources/line_shape_2d.h" +#include "scene/resources/shapes_2d/line_shape_2d.h" #include "scene/resources/material.h" #include "scene/resources/mesh.h" #include "scene/resources/mesh_data_tool.h" @@ -170,9 +170,9 @@ #include "scene/resources/polygon_path_finder.h" #include "scene/resources/primitive_meshes.h" #include "scene/resources/ray_shape.h" -#include "scene/resources/rectangle_shape_2d.h" +#include "scene/resources/shapes_2d/rectangle_shape_2d.h" #include "scene/resources/resource_format_text.h" -#include "scene/resources/segment_shape_2d.h" +#include "scene/resources/shapes_2d/segment_shape_2d.h" #include "scene/resources/sky.h" #include "scene/resources/sphere_shape.h" diff --git a/scene/resources/SCsub b/scene/resources/SCsub index 64b92deb1..65f321a91 100644 --- a/scene/resources/SCsub +++ b/scene/resources/SCsub @@ -16,8 +16,14 @@ env.scene_sources += thirdparty_obj # Pandemonium source files scene_obj = [] - env.add_source_files(scene_obj, "*.cpp") + +shapes_2d_obj = [] +env.add_source_files(shapes_2d_obj, "shapes_2d/*.cpp") + +for o in shapes_2d_obj: + scene_obj.append(o) + env.scene_sources += scene_obj # Needed to force rebuilding the scene files when the thirdparty code is updated. diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/shapes_2d/capsule_shape_2d.cpp similarity index 100% rename from scene/resources/capsule_shape_2d.cpp rename to scene/resources/shapes_2d/capsule_shape_2d.cpp diff --git a/scene/resources/capsule_shape_2d.h b/scene/resources/shapes_2d/capsule_shape_2d.h similarity index 98% rename from scene/resources/capsule_shape_2d.h rename to scene/resources/shapes_2d/capsule_shape_2d.h index 27dd4e898..e09b4e081 100644 --- a/scene/resources/capsule_shape_2d.h +++ b/scene/resources/shapes_2d/capsule_shape_2d.h @@ -30,7 +30,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" class CapsuleShape2D : public Shape2D { GDCLASS(CapsuleShape2D, Shape2D); diff --git a/scene/resources/circle_shape_2d.cpp b/scene/resources/shapes_2d/circle_shape_2d.cpp similarity index 100% rename from scene/resources/circle_shape_2d.cpp rename to scene/resources/shapes_2d/circle_shape_2d.cpp diff --git a/scene/resources/circle_shape_2d.h b/scene/resources/shapes_2d/circle_shape_2d.h similarity index 98% rename from scene/resources/circle_shape_2d.h rename to scene/resources/shapes_2d/circle_shape_2d.h index 863022c16..d5a64e2ca 100644 --- a/scene/resources/circle_shape_2d.h +++ b/scene/resources/shapes_2d/circle_shape_2d.h @@ -30,7 +30,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" class CircleShape2D : public Shape2D { GDCLASS(CircleShape2D, Shape2D); diff --git a/scene/resources/concave_polygon_shape_2d.cpp b/scene/resources/shapes_2d/concave_polygon_shape_2d.cpp similarity index 100% rename from scene/resources/concave_polygon_shape_2d.cpp rename to scene/resources/shapes_2d/concave_polygon_shape_2d.cpp diff --git a/scene/resources/concave_polygon_shape_2d.h b/scene/resources/shapes_2d/concave_polygon_shape_2d.h similarity index 98% rename from scene/resources/concave_polygon_shape_2d.h rename to scene/resources/shapes_2d/concave_polygon_shape_2d.h index c7a3c0ce4..85bf03fc5 100644 --- a/scene/resources/concave_polygon_shape_2d.h +++ b/scene/resources/shapes_2d/concave_polygon_shape_2d.h @@ -30,7 +30,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" class ConcavePolygonShape2D : public Shape2D { GDCLASS(ConcavePolygonShape2D, Shape2D); diff --git a/scene/resources/convex_polygon_shape_2d.cpp b/scene/resources/shapes_2d/convex_polygon_shape_2d.cpp similarity index 100% rename from scene/resources/convex_polygon_shape_2d.cpp rename to scene/resources/shapes_2d/convex_polygon_shape_2d.cpp diff --git a/scene/resources/convex_polygon_shape_2d.h b/scene/resources/shapes_2d/convex_polygon_shape_2d.h similarity index 98% rename from scene/resources/convex_polygon_shape_2d.h rename to scene/resources/shapes_2d/convex_polygon_shape_2d.h index dfae28ffa..5abf2c1ad 100644 --- a/scene/resources/convex_polygon_shape_2d.h +++ b/scene/resources/shapes_2d/convex_polygon_shape_2d.h @@ -30,7 +30,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" class ConvexPolygonShape2D : public Shape2D { GDCLASS(ConvexPolygonShape2D, Shape2D); diff --git a/scene/resources/line_shape_2d.cpp b/scene/resources/shapes_2d/line_shape_2d.cpp similarity index 100% rename from scene/resources/line_shape_2d.cpp rename to scene/resources/shapes_2d/line_shape_2d.cpp diff --git a/scene/resources/line_shape_2d.h b/scene/resources/shapes_2d/line_shape_2d.h similarity index 98% rename from scene/resources/line_shape_2d.h rename to scene/resources/shapes_2d/line_shape_2d.h index d5ddfeb0f..ace327405 100644 --- a/scene/resources/line_shape_2d.h +++ b/scene/resources/shapes_2d/line_shape_2d.h @@ -30,7 +30,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" class LineShape2D : public Shape2D { GDCLASS(LineShape2D, Shape2D); diff --git a/scene/resources/rectangle_shape_2d.cpp b/scene/resources/shapes_2d/rectangle_shape_2d.cpp similarity index 100% rename from scene/resources/rectangle_shape_2d.cpp rename to scene/resources/shapes_2d/rectangle_shape_2d.cpp diff --git a/scene/resources/rectangle_shape_2d.h b/scene/resources/shapes_2d/rectangle_shape_2d.h similarity index 98% rename from scene/resources/rectangle_shape_2d.h rename to scene/resources/shapes_2d/rectangle_shape_2d.h index 65ef04947..3ad44f13e 100644 --- a/scene/resources/rectangle_shape_2d.h +++ b/scene/resources/shapes_2d/rectangle_shape_2d.h @@ -30,7 +30,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" class RectangleShape2D : public Shape2D { GDCLASS(RectangleShape2D, Shape2D); diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/shapes_2d/segment_shape_2d.cpp similarity index 100% rename from scene/resources/segment_shape_2d.cpp rename to scene/resources/shapes_2d/segment_shape_2d.cpp diff --git a/scene/resources/segment_shape_2d.h b/scene/resources/shapes_2d/segment_shape_2d.h similarity index 98% rename from scene/resources/segment_shape_2d.h rename to scene/resources/shapes_2d/segment_shape_2d.h index ac198c5c7..759c35acd 100644 --- a/scene/resources/segment_shape_2d.h +++ b/scene/resources/shapes_2d/segment_shape_2d.h @@ -30,7 +30,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "scene/resources/shape_2d.h" +#include "scene/resources/shapes_2d/shape_2d.h" class SegmentShape2D : public Shape2D { GDCLASS(SegmentShape2D, Shape2D); diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shapes_2d/shape_2d.cpp similarity index 100% rename from scene/resources/shape_2d.cpp rename to scene/resources/shapes_2d/shape_2d.cpp diff --git a/scene/resources/shape_2d.h b/scene/resources/shapes_2d/shape_2d.h similarity index 100% rename from scene/resources/shape_2d.h rename to scene/resources/shapes_2d/shape_2d.h