From 32a5fd05b6c3f66e2ff88cb63dcea8e63ec5f94a Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Wed, 20 Apr 2022 14:07:25 +0200 Subject: [PATCH] [godot] Clean-up includes. --- .../spine_godot/GodotSpineExtension.cpp | 1 - spine-godot/spine_godot/SpineAnimation.cpp | 1 - .../spine_godot/SpineAtlasResource.cpp | 7 +-- spine-godot/spine_godot/SpineBone.h | 57 +++++++++---------- spine-godot/spine_godot/SpineBoneData.h | 22 +++---- .../spine_godot/SpineCollisionShapeProxy.cpp | 1 - .../spine_godot/SpineCollisionShapeProxy.h | 2 +- .../spine_godot/SpineConstraintData.cpp | 2 +- spine-godot/spine_godot/SpineEditorPlugin.cpp | 25 ++++---- spine-godot/spine_godot/SpineEditorPlugin.h | 2 +- spine-godot/spine_godot/SpineSlot.h | 4 +- spine-godot/spine_godot/SpineSlotData.h | 2 +- spine-godot/spine_godot/SpineSprite.h | 5 +- .../spine_godot/SpineTransformConstraint.h | 1 + 14 files changed, 63 insertions(+), 69 deletions(-) diff --git a/spine-godot/spine_godot/GodotSpineExtension.cpp b/spine-godot/spine_godot/GodotSpineExtension.cpp index af91a2809..16cd4ff26 100644 --- a/spine-godot/spine_godot/GodotSpineExtension.cpp +++ b/spine-godot/spine_godot/GodotSpineExtension.cpp @@ -30,7 +30,6 @@ #include "GodotSpineExtension.h" #include "core/os/memory.h" #include "core/os/file_access.h" - #include spine::SpineExtension *spine::getDefaultExtension() { diff --git a/spine-godot/spine_godot/SpineAnimation.cpp b/spine-godot/spine_godot/SpineAnimation.cpp index 4ea17963d..458e17431 100644 --- a/spine-godot/spine_godot/SpineAnimation.cpp +++ b/spine-godot/spine_godot/SpineAnimation.cpp @@ -32,7 +32,6 @@ #include "SpineEvent.h" #include "SpineTimeline.h" #include "SpineCommon.h" - #include "core/method_bind_ext.gen.inc" void SpineAnimation::_bind_methods() { diff --git a/spine-godot/spine_godot/SpineAtlasResource.cpp b/spine-godot/spine_godot/SpineAtlasResource.cpp index 36c7f2537..1b760295f 100644 --- a/spine-godot/spine_godot/SpineAtlasResource.cpp +++ b/spine-godot/spine_godot/SpineAtlasResource.cpp @@ -27,11 +27,10 @@ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include "core/io/json.h" -#include "scene/resources/texture.h" - #include "SpineAtlasResource.h" #include "SpineRendererObject.h" +#include "core/io/json.h" +#include "scene/resources/texture.h" #include class GodotSpineTextureLoader : public spine::TextureLoader { @@ -88,7 +87,7 @@ public: normal_maps->append(normal_map); renderer_object->normal_map = normal_map; } - + page.setRendererObject((void *) renderer_object); page.width = texture->get_width(); page.height = texture->get_height(); diff --git a/spine-godot/spine_godot/SpineBone.h b/spine-godot/spine_godot/SpineBone.h index 4ae8d8e0b..b44c2a2d4 100644 --- a/spine-godot/spine_godot/SpineBone.h +++ b/spine-godot/spine_godot/SpineBone.h @@ -30,10 +30,9 @@ #ifndef GODOT_SPINEBONE_H #define GODOT_SPINEBONE_H -#include -#include - #include "SpineBoneData.h" +#include +#include class SpineSkeleton; class SpineSprite; @@ -73,7 +72,7 @@ public: void rotate_world(float degrees); float get_world_to_local_rotation_x(); - + float get_world_to_local_rotation_y(); Ref get_data(); @@ -85,106 +84,106 @@ public: Array get_children(); float get_x(); - + void set_x(float v); float get_y(); - + void set_y(float v); float get_rotation(); - + void set_rotation(float v); float get_scale_x(); - + void set_scale_x(float v); float get_scale_y(); - + void set_scale_y(float v); float get_shear_x(); - + void set_shear_x(float v); float get_shear_y(); - + void set_shear_y(float v); float get_applied_rotation(); - + void set_applied_rotation(float v); float get_a_x(); - + void set_a_x(float v); float get_a_y(); - + void set_a_y(float v); float get_a_scale_x(); - + void set_a_scale_x(float v); float get_a_scale_y(); - + void set_a_scale_y(float v); float get_a_shear_x(); - + void set_a_shear_x(float v); float get_a_shear_y(); - + void set_a_shear_y(float v); float get_a(); - + void set_a(float v); float get_b(); - + void set_b(float v); float get_c(); - + void set_c(float v); float get_d(); - + void set_d(float v); float get_world_x(); - + void set_world_x(float v); float get_world_y(); - + void set_world_y(float v); float get_world_rotation_x(); - + float get_world_rotation_y(); float get_world_scale_x(); - + float get_world_scale_y(); bool is_active(); - + void set_active(bool v); // External feature functions void apply_world_transform_2d(Variant o); Transform2D get_godot_transform(); - + void set_godot_transform(Transform2D trans); Transform2D get_godot_global_transform(); - + void set_godot_global_transform(Transform2D trans); }; diff --git a/spine-godot/spine_godot/SpineBoneData.h b/spine-godot/spine_godot/SpineBoneData.h index d4e0013c5..d6417eca1 100644 --- a/spine-godot/spine_godot/SpineBoneData.h +++ b/spine-godot/spine_godot/SpineBoneData.h @@ -30,8 +30,8 @@ #ifndef GODOT_SPINEBONEDATA_H #define GODOT_SPINEBONEDATA_H -#include "core/reference.h" #include "SpineConstant.h" +#include "core/reference.h" #include class SpineBoneData : public Reference { @@ -58,43 +58,43 @@ public: Ref get_parent(); float get_length(); - + void set_length(float v); float get_x(); - + void set_x(float v); float get_y(); - + void set_y(float v); float get_rotation(); - + void set_rotation(float v); float get_scale_x(); - + void set_scale_x(float v); float get_scale_y(); - + void set_scale_y(float v); float get_shear_x(); - + void set_shear_x(float v); float get_shear_y(); - + void set_shear_y(float v); SpineConstant::TransformMode get_transform_mode(); - + void set_transform_mode(SpineConstant::TransformMode v); bool is_skin_required(); - + void set_skin_required(bool v); Color get_color(); diff --git a/spine-godot/spine_godot/SpineCollisionShapeProxy.cpp b/spine-godot/spine_godot/SpineCollisionShapeProxy.cpp index 67dd917bc..ff8db0126 100644 --- a/spine-godot/spine_godot/SpineCollisionShapeProxy.cpp +++ b/spine-godot/spine_godot/SpineCollisionShapeProxy.cpp @@ -28,7 +28,6 @@ *****************************************************************************/ #include "SpineCollisionShapeProxy.h" - #include "SpineSprite.h" void SpineCollisionShapeProxy::_bind_methods() { diff --git a/spine-godot/spine_godot/SpineCollisionShapeProxy.h b/spine-godot/spine_godot/SpineCollisionShapeProxy.h index e306b864f..3d4078896 100644 --- a/spine-godot/spine_godot/SpineCollisionShapeProxy.h +++ b/spine-godot/spine_godot/SpineCollisionShapeProxy.h @@ -31,7 +31,7 @@ #define GODOT_SPINECOLLISIONSHAPEPROXY_H #include "scene/2d/collision_polygon_2d.h" -#include +#include class SpineSprite; class SpineAnimationState; diff --git a/spine-godot/spine_godot/SpineConstraintData.cpp b/spine-godot/spine_godot/SpineConstraintData.cpp index f09f8db98..7e953b835 100644 --- a/spine-godot/spine_godot/SpineConstraintData.cpp +++ b/spine-godot/spine_godot/SpineConstraintData.cpp @@ -28,8 +28,8 @@ *****************************************************************************/ #include "SpineConstraintData.h" -#include #include "SpineCommon.h" +#include void SpineConstraintData::_bind_methods() { ClassDB::bind_method(D_METHOD("get_constraint_name"), &SpineConstraintData::get_constraint_name); diff --git a/spine-godot/spine_godot/SpineEditorPlugin.cpp b/spine-godot/spine_godot/SpineEditorPlugin.cpp index f5be21b08..d82b679af 100644 --- a/spine-godot/spine_godot/SpineEditorPlugin.cpp +++ b/spine-godot/spine_godot/SpineEditorPlugin.cpp @@ -29,7 +29,6 @@ #ifdef TOOLS_ENABLED #include "SpineEditorPlugin.h" - #include "SpineAtlasResource.h" #include "SpineSkeletonFileResource.h" @@ -118,7 +117,7 @@ void SpineEditorPropertyAnimationMixes::add_mix() { mix->set_from(animation_names[0]); mix->set_to(animation_names[0]); mix->set_mix(0); - + Array mixes = skeleton_data->get_animation_mixes().duplicate(); mixes.push_back(mix); emit_changed(get_edited_property(), mixes); @@ -142,7 +141,7 @@ void SpineEditorPropertyAnimationMixes::update_property() { updating = true; mix_properties.clear(); - + if (container) { set_bottom_editor(nullptr); memdelete(container); @@ -154,14 +153,14 @@ void SpineEditorPropertyAnimationMixes::update_property() { updating = false; return; } - + Vector animation_names; skeleton_data->get_animation_names(animation_names); - + container = memnew(VBoxContainer); add_child(container); set_bottom_editor(container); - + Array mixes = skeleton_data->get_animation_mixes(); array_object->set_array(mixes); for (int i = 0; i < mixes.size(); i++) { @@ -171,7 +170,7 @@ void SpineEditorPropertyAnimationMixes::update_property() { auto hbox = memnew(HBoxContainer); hbox->set_h_size_flags(SIZE_EXPAND_FILL); container->add_child(hbox); - + auto mix_property = memnew(SpineEditorPropertyAnimationMix); mix_property->set_h_size_flags(SIZE_EXPAND_FILL); mix_property->set_name_split_ratio(0); @@ -180,7 +179,7 @@ void SpineEditorPropertyAnimationMixes::update_property() { mix_property->set_object_and_property(*array_object, property_name); mix_property->update_property(); mix_properties.push_back(mix_property); - + auto delete_button = memnew(Button); hbox->add_child(delete_button); delete_button->set_text("Remove"); @@ -228,7 +227,7 @@ void SpineEditorPropertyAnimationMix::data_changed(const String &property, Varia void SpineEditorPropertyAnimationMix::update_property() { if (updating) return; updating = true; - + if (container) { memdelete(container); container->queue_delete(); @@ -245,14 +244,14 @@ void SpineEditorPropertyAnimationMix::update_property() { updating = false; return; } - + Vector animation_names; skeleton_data->get_animation_names(animation_names); - + container = memnew(HBoxContainer); container->set_h_size_flags(SIZE_EXPAND_FILL); add_child(container); - + auto from_enum = memnew(EditorPropertyTextEnum); from_enum->set_h_size_flags(SIZE_EXPAND_FILL); from_enum->set_name_split_ratio(0); @@ -282,7 +281,7 @@ void SpineEditorPropertyAnimationMix::update_property() { mix_float->update_property(); mix_float->connect("property_changed", this, "data_changed"); container->add_child(mix_float); - + updating = false; } diff --git a/spine-godot/spine_godot/SpineEditorPlugin.h b/spine-godot/spine_godot/SpineEditorPlugin.h index 679166e9d..ed8e1fce9 100644 --- a/spine-godot/spine_godot/SpineEditorPlugin.h +++ b/spine-godot/spine_godot/SpineEditorPlugin.h @@ -32,8 +32,8 @@ #include "editor/editor_properties_array_dict.h" #ifdef TOOLS_ENABLED -#include "editor/editor_node.h" #include "SpineSprite.h" +#include "editor/editor_node.h" #include "editor/editor_properties.h" class SpineAtlasResourceImportPlugin : public EditorImportPlugin { diff --git a/spine-godot/spine_godot/SpineSlot.h b/spine-godot/spine_godot/SpineSlot.h index 36e182444..ced3af249 100644 --- a/spine-godot/spine_godot/SpineSlot.h +++ b/spine-godot/spine_godot/SpineSlot.h @@ -32,11 +32,11 @@ #include "SpineSlotData.h" #include "SpineAttachment.h" +#include "SpineBone.h" +// Breaks cyclic dependency. class SpineSkeleton; -class SpineBone; - class SpineSlot : public Reference { GDCLASS(SpineSlot, Reference); diff --git a/spine-godot/spine_godot/SpineSlotData.h b/spine-godot/spine_godot/SpineSlotData.h index 66af145e3..7959571ca 100644 --- a/spine-godot/spine_godot/SpineSlotData.h +++ b/spine-godot/spine_godot/SpineSlotData.h @@ -30,8 +30,8 @@ #ifndef GODOT_SPINESLOTDATA_H #define GODOT_SPINESLOTDATA_H -#include "core/object.h" #include "SpineBoneData.h" +#include "core/object.h" #include class SpineSlotData : public Reference { diff --git a/spine-godot/spine_godot/SpineSprite.h b/spine-godot/spine_godot/SpineSprite.h index 767b491f4..abf8cea3a 100644 --- a/spine-godot/spine_godot/SpineSprite.h +++ b/spine-godot/spine_godot/SpineSprite.h @@ -30,12 +30,11 @@ #ifndef GODOT_SPINESPRITE_H #define GODOT_SPINESPRITE_H -#include "scene/2d/node_2d.h" -#include "scene/resources/texture.h" - #include "SpineSkeleton.h" #include "SpineAnimationState.h" +#include "scene/2d/node_2d.h" #include "scene/2d/mesh_instance_2d.h" +#include "scene/resources/texture.h" class SpineSprite : public Node2D, public spine::AnimationStateListenerObject { GDCLASS(SpineSprite, Node2D); diff --git a/spine-godot/spine_godot/SpineTransformConstraint.h b/spine-godot/spine_godot/SpineTransformConstraint.h index 76295e487..ebd61b0f2 100644 --- a/spine-godot/spine_godot/SpineTransformConstraint.h +++ b/spine-godot/spine_godot/SpineTransformConstraint.h @@ -32,6 +32,7 @@ #include "SpineTransformConstraintData.h" #include "SpineBone.h" +#include class SpineTransformConstraint : public Reference { GDCLASS(SpineTransformConstraint, Reference);