From 2f48bf16e26ae4f3260cc9501b9d3de85897e794 Mon Sep 17 00:00:00 2001 From: Luke Ingram Date: Wed, 1 Oct 2025 11:35:20 -0400 Subject: [PATCH] [godot] Formatting fixes per latest format.sh --- spine-godot/spine_godot/SpineAnimation.cpp | 10 ++-- .../spine_godot/SpineAnimationTrack.cpp | 28 +++++----- .../spine_godot/SpineAtlasResource.cpp | 12 ++--- spine-godot/spine_godot/SpineAttachment.cpp | 10 ++-- spine-godot/spine_godot/SpineBone.cpp | 2 +- spine-godot/spine_godot/SpineBoneData.cpp | 10 ++-- .../spine_godot/SpineConstraintData.cpp | 10 ++-- spine-godot/spine_godot/SpineEditorPlugin.h | 2 +- spine-godot/spine_godot/SpineEventData.cpp | 10 ++-- spine-godot/spine_godot/SpineSkeleton.cpp | 2 +- .../spine_godot/SpineSkeletonDataResource.cpp | 52 +++++++++---------- spine-godot/spine_godot/SpineSkin.cpp | 10 ++-- spine-godot/spine_godot/SpineSlotData.cpp | 10 ++-- spine-godot/spine_godot/SpineSprite.cpp | 26 +++++----- 14 files changed, 98 insertions(+), 96 deletions(-) diff --git a/spine-godot/spine_godot/SpineAnimation.cpp b/spine-godot/spine_godot/SpineAnimation.cpp index 61a5545e6..3a0ece1e3 100644 --- a/spine-godot/spine_godot/SpineAnimation.cpp +++ b/spine-godot/spine_godot/SpineAnimation.cpp @@ -49,11 +49,11 @@ void SpineAnimation::_bind_methods() { String SpineAnimation::get_name() { SPINE_CHECK(get_spine_object(), "") String name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - name = String::utf8(get_spine_object()->getName().buffer()); - #else - name.parse_utf8(get_spine_object()->getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + name = String::utf8(get_spine_object()->getName().buffer()); +#else + name.parse_utf8(get_spine_object()->getName().buffer()); +#endif return name; } diff --git a/spine-godot/spine_godot/SpineAnimationTrack.cpp b/spine-godot/spine_godot/SpineAnimationTrack.cpp index 414333872..63faaa212 100644 --- a/spine-godot/spine_godot/SpineAnimationTrack.cpp +++ b/spine-godot/spine_godot/SpineAnimationTrack.cpp @@ -40,7 +40,7 @@ #ifdef TOOLS_ENABLED #include "editor/editor_node.h" -#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) #include "editor/animation/animation_player_editor_plugin.h" #include "editor/animation/animation_tree_editor_plugin.h" #else @@ -248,11 +248,11 @@ Ref SpineAnimationTrack::create_animation(spine::Animation *animation Ref animation_ref; INSTANTIATE(animation_ref); String name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - name = String::utf8(animation->getName().buffer()); - #else - name.parse_utf8(animation->getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + name = String::utf8(animation->getName().buffer()); +#else + name.parse_utf8(animation->getName().buffer()); +#endif animation_ref->set_name(name + (loop ? "" : "_looped")); #if VERSION_MAJOR > 3 // animation_ref->set_loop(!loop); @@ -302,11 +302,11 @@ void SpineAnimationTrack::update_animation_state(const Variant &variant_sprite) auto current_entry = animation_state->getCurrent(track_index); bool should_set_mix = mix_duration >= 0; String other_name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - if (current_entry) other_name = String::utf8(current_entry->getAnimation().getName().buffer()); - #else - if (current_entry) other_name.parse_utf8(current_entry->getAnimation().getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + if (current_entry) other_name = String::utf8(current_entry->getAnimation().getName().buffer()); +#else + if (current_entry) other_name.parse_utf8(current_entry->getAnimation().getName().buffer()); +#endif bool should_set_animation = !current_entry || (animation_name != other_name || current_entry->getLoop() != loop); if (should_set_animation) { @@ -441,11 +441,11 @@ void SpineAnimationTrack::update_animation_state(const Variant &variant_sprite) auto current_entry = animation_state->getCurrent(track_index); bool should_set_mix = mix_duration >= 0; String other_name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) if (current_entry) other_name = String::utf8(current_entry->getAnimation().getName().buffer()); - #else +#else if (current_entry) other_name.parse_utf8(current_entry->getAnimation().getName().buffer()); - #endif +#endif bool should_set_animation = !current_entry || (animation_name != other_name || current_entry->getLoop() != loop) || animation_changed; animation_changed = false; diff --git a/spine-godot/spine_godot/SpineAtlasResource.cpp b/spine-godot/spine_godot/SpineAtlasResource.cpp index e0763bf2c..bddac0dbf 100644 --- a/spine-godot/spine_godot/SpineAtlasResource.cpp +++ b/spine-godot/spine_godot/SpineAtlasResource.cpp @@ -51,7 +51,7 @@ #ifdef SPINE_GODOT_EXTENSION #include #else -#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) #include "editor/file_system/editor_file_system.h" #else #include "editor/editor_file_system.h" @@ -150,11 +150,11 @@ public: void load(spine::AtlasPage &page, const spine::String &path) override { String fixed_path; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - fixed_path = String::utf8(path.buffer()); - #else - fixed_path.parse_utf8(path.buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + fixed_path = String::utf8(path.buffer()); +#else + fixed_path.parse_utf8(path.buffer()); +#endif bool is_resource = fix_path(fixed_path); import_image_resource(fixed_path); diff --git a/spine-godot/spine_godot/SpineAttachment.cpp b/spine-godot/spine_godot/SpineAttachment.cpp index 87df45e74..73535ca8c 100644 --- a/spine-godot/spine_godot/SpineAttachment.cpp +++ b/spine-godot/spine_godot/SpineAttachment.cpp @@ -42,11 +42,11 @@ SpineAttachment::~SpineAttachment() { String SpineAttachment::get_attachment_name() { SPINE_CHECK(get_spine_object(), "") String name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - name = String::utf8(get_spine_object()->getName().buffer()); - #else - name.parse_utf8(get_spine_object()->getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + name = String::utf8(get_spine_object()->getName().buffer()); +#else + name.parse_utf8(get_spine_object()->getName().buffer()); +#endif return name; } diff --git a/spine-godot/spine_godot/SpineBone.cpp b/spine-godot/spine_godot/SpineBone.cpp index 6a40f723c..5d26ae690 100644 --- a/spine-godot/spine_godot/SpineBone.cpp +++ b/spine-godot/spine_godot/SpineBone.cpp @@ -223,5 +223,5 @@ void SpineBone::set_global_transform(Transform2D transform) { void SpineBone::update(Ref skeleton, SpineConstant::Physics physics) { SPINE_CHECK(get_spine_object(), ) SPINE_CHECK(skeleton.is_valid() && skeleton->get_spine_object(), ) - get_spine_object()->update(*skeleton->get_spine_object(), (spine::Physics)physics); + get_spine_object()->update(*skeleton->get_spine_object(), (spine::Physics) physics); } diff --git a/spine-godot/spine_godot/SpineBoneData.cpp b/spine-godot/spine_godot/SpineBoneData.cpp index a168ad7ca..0cd43f6af 100644 --- a/spine-godot/spine_godot/SpineBoneData.cpp +++ b/spine-godot/spine_godot/SpineBoneData.cpp @@ -54,11 +54,11 @@ int SpineBoneData::get_index() { String SpineBoneData::get_bone_name() { SPINE_CHECK(get_spine_object(), "") String name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - name = String::utf8(get_spine_object()->getName().buffer()); - #else - name.parse_utf8(get_spine_object()->getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + name = String::utf8(get_spine_object()->getName().buffer()); +#else + name.parse_utf8(get_spine_object()->getName().buffer()); +#endif return name; } diff --git a/spine-godot/spine_godot/SpineConstraintData.cpp b/spine-godot/spine_godot/SpineConstraintData.cpp index 863c8a06d..5816181ba 100644 --- a/spine-godot/spine_godot/SpineConstraintData.cpp +++ b/spine-godot/spine_godot/SpineConstraintData.cpp @@ -39,11 +39,11 @@ void SpineConstraintData::_bind_methods() { String SpineConstraintData::get_constraint_name() { SPINE_CHECK(get_spine_object(), "") String name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - name = String::utf8(get_spine_object()->getName().buffer()); - #else - name.parse_utf8(get_spine_object()->getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + name = String::utf8(get_spine_object()->getName().buffer()); +#else + name.parse_utf8(get_spine_object()->getName().buffer()); +#endif return name; } diff --git a/spine-godot/spine_godot/SpineEditorPlugin.h b/spine-godot/spine_godot/SpineEditorPlugin.h index 5b1b35a84..abad5b7d5 100644 --- a/spine-godot/spine_godot/SpineEditorPlugin.h +++ b/spine-godot/spine_godot/SpineEditorPlugin.h @@ -44,7 +44,7 @@ #include #else #include "editor/editor_node.h" -#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) #include "editor/inspector/editor_properties.h" #include "editor/inspector/editor_properties_array_dict.h" #else diff --git a/spine-godot/spine_godot/SpineEventData.cpp b/spine-godot/spine_godot/SpineEventData.cpp index 0df62af9a..6812d38df 100644 --- a/spine-godot/spine_godot/SpineEventData.cpp +++ b/spine-godot/spine_godot/SpineEventData.cpp @@ -49,11 +49,11 @@ void SpineEventData::_bind_methods() { String SpineEventData::get_event_name() { SPINE_CHECK(get_spine_object(), "") String name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - name = String::utf8(get_spine_object()->getName().buffer()); - #else - name.parse_utf8(get_spine_object()->getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + name = String::utf8(get_spine_object()->getName().buffer()); +#else + name.parse_utf8(get_spine_object()->getName().buffer()); +#endif return name; } diff --git a/spine-godot/spine_godot/SpineSkeleton.cpp b/spine-godot/spine_godot/SpineSkeleton.cpp index 388c41a06..19a990bc0 100644 --- a/spine-godot/spine_godot/SpineSkeleton.cpp +++ b/spine-godot/spine_godot/SpineSkeleton.cpp @@ -378,7 +378,7 @@ Array SpineSkeleton::get_sliders() { auto constraint = constraints[i]; if (!constraint->getRTTI().isExactly(spine::Slider::rtti) == false) continue; Ref slider_ref(memnew(SpineSlider)); - slider_ref->set_spine_object(sprite, (spine::Slider *)constraint); + slider_ref->set_spine_object(sprite, (spine::Slider *) constraint); result.append(slider_ref); } return result; diff --git a/spine-godot/spine_godot/SpineSkeletonDataResource.cpp b/spine-godot/spine_godot/SpineSkeletonDataResource.cpp index 636f4ddfe..dd6b9ab01 100644 --- a/spine-godot/spine_godot/SpineSkeletonDataResource.cpp +++ b/spine-godot/spine_godot/SpineSkeletonDataResource.cpp @@ -48,7 +48,7 @@ #ifdef SPINE_GODOT_EXTENSION #include #else -#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) #include "editor/file_system/editor_file_system.h" #else #include "editor/editor_file_system.h" @@ -347,11 +347,11 @@ void SpineSkeletonDataResource::get_animation_names(Vector &animation_na for (size_t i = 0; i < animations.size(); ++i) { auto animation = animations[i]; String name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - name = String::utf8(animation->getName().buffer()); - #else - name.parse_utf8(animation->getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + name = String::utf8(animation->getName().buffer()); +#else + name.parse_utf8(animation->getName().buffer()); +#endif animation_names.push_back(name); } } @@ -367,11 +367,11 @@ void SpineSkeletonDataResource::get_skin_names(Vector &skin_names) const for (size_t i = 0; i < skins.size(); ++i) { auto skin = skins[i]; String name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - name = String::utf8(skin->getName().buffer()); - #else - name.parse_utf8(skin->getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + name = String::utf8(skin->getName().buffer()); +#else + name.parse_utf8(skin->getName().buffer()); +#endif skin_names.push_back(name); } } @@ -387,11 +387,11 @@ void SpineSkeletonDataResource::get_slot_names(Vector &slot_names) { for (size_t i = 0; i < slots.size(); ++i) { auto slot = slots[i]; String name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - name = String::utf8(slot->getName().buffer()); - #else - name.parse_utf8(slot->getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + name = String::utf8(slot->getName().buffer()); +#else + name.parse_utf8(slot->getName().buffer()); +#endif slot_names.push_back(name); } } @@ -407,11 +407,11 @@ void SpineSkeletonDataResource::get_bone_names(Vector &bone_names) { for (size_t i = 0; i < bones.size(); ++i) { auto bone = bones[i]; String name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - name = String::utf8(bone->getName().buffer()); - #else - name.parse_utf8(bone->getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + name = String::utf8(bone->getName().buffer()); +#else + name.parse_utf8(bone->getName().buffer()); +#endif bone_names.push_back(name); } } @@ -559,11 +559,11 @@ Ref SpineSkeletonDataResource::find_physics_constrai String SpineSkeletonDataResource::get_skeleton_name() const { SPINE_CHECK(skeleton_data, "") String name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - name = String::utf8(skeleton_data->getName().buffer()); - #else - name.parse_utf8(skeleton_data->getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + name = String::utf8(skeleton_data->getName().buffer()); +#else + name.parse_utf8(skeleton_data->getName().buffer()); +#endif return name; } diff --git a/spine-godot/spine_godot/SpineSkin.cpp b/spine-godot/spine_godot/SpineSkin.cpp index 7fcf71747..32bc8a07f 100644 --- a/spine-godot/spine_godot/SpineSkin.cpp +++ b/spine-godot/spine_godot/SpineSkin.cpp @@ -125,11 +125,11 @@ Array SpineSkin::find_attachments_for_slot(int slot_index) { String SpineSkin::get_name() { SPINE_CHECK(get_spine_object(), "") String name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - name = String::utf8(get_spine_object()->getName().buffer()); - #else - name.parse_utf8(get_spine_object()->getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + name = String::utf8(get_spine_object()->getName().buffer()); +#else + name.parse_utf8(get_spine_object()->getName().buffer()); +#endif return name; } diff --git a/spine-godot/spine_godot/SpineSlotData.cpp b/spine-godot/spine_godot/SpineSlotData.cpp index 20e5fc308..f9a210094 100644 --- a/spine-godot/spine_godot/SpineSlotData.cpp +++ b/spine-godot/spine_godot/SpineSlotData.cpp @@ -54,11 +54,11 @@ int SpineSlotData::get_index() { String SpineSlotData::get_name() { SPINE_CHECK(get_spine_object(), String("")) String name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - name = String::utf8(get_spine_object()->getName().buffer()); - #else - name.parse_utf8(get_spine_object()->getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + name = String::utf8(get_spine_object()->getName().buffer()); +#else + name.parse_utf8(get_spine_object()->getName().buffer()); +#endif return name; } diff --git a/spine-godot/spine_godot/SpineSprite.cpp b/spine-godot/spine_godot/SpineSprite.cpp index 80fa9b66b..d542eb465 100644 --- a/spine-godot/spine_godot/SpineSprite.cpp +++ b/spine-godot/spine_godot/SpineSprite.cpp @@ -1124,7 +1124,8 @@ void SpineSprite::draw() { auto bounding_box = (spine::BoundingBoxAttachment *) attachment; auto vertices = &statics.scratch_vertices; vertices->setSize(bounding_box->getWorldVerticesLength(), 0); - bounding_box->computeWorldVertices(*skeleton->get_spine_object(), *slot, 0, bounding_box->getWorldVerticesLength(), vertices->buffer(), 0, 2); + bounding_box->computeWorldVertices(*skeleton->get_spine_object(), *slot, 0, bounding_box->getWorldVerticesLength(), vertices->buffer(), 0, + 2); size_t num_vertices = vertices->size() / 2; statics.scratch_points.resize((int) num_vertices); memcpy(statics.scratch_points.ptrw(), vertices->buffer(), num_vertices * 2 * sizeof(float)); @@ -1220,11 +1221,11 @@ void SpineSprite::draw() { Vector hover_text_lines; if (hovered_slot) { String name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - name = String::utf8(hovered_slot->getData().getName().buffer()); - #else - name.parse_utf8(hovered_slot->getData().getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + name = String::utf8(hovered_slot->getData().getName().buffer()); +#else + name.parse_utf8(hovered_slot->getData().getName().buffer()); +#endif hover_text_lines.push_back(String("Slot: ") + name); } @@ -1234,11 +1235,11 @@ void SpineSprite::draw() { draw_bone(hovered_bone, Color(debug_bones_color.r, debug_bones_color.g, debug_bones_color.b, 1)); debug_bones_thickness = thickness; String name; - #if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) - name = String::utf8(hovered_bone->getData().getName().buffer()); - #else - name.parse_utf8(hovered_bone->getData().getName().buffer()); - #endif +#if (VERSION_MAJOR >= 4 && VERSION_MINOR >= 5) + name = String::utf8(hovered_bone->getData().getName().buffer()); +#else + name.parse_utf8(hovered_bone->getData().getName().buffer()); +#endif hover_text_lines.push_back(String("Bone: ") + name); } @@ -1297,7 +1298,8 @@ void SpineSprite::draw() { } void SpineSprite::draw_bone(spine::Bone *bone, const Color &color) { - draw_set_transform(Vector2(bone->getAppliedPose().getWorldX(), bone->getAppliedPose().getWorldY()), spine::MathUtil::Deg_Rad * bone->getAppliedPose().getWorldRotationX(), + draw_set_transform(Vector2(bone->getAppliedPose().getWorldX(), bone->getAppliedPose().getWorldY()), + spine::MathUtil::Deg_Rad * bone->getAppliedPose().getWorldRotationX(), Vector2(bone->getAppliedPose().getWorldScaleX(), bone->getAppliedPose().getWorldScaleY())); float bone_length = bone->getData().getLength(); if (bone_length == 0) bone_length = debug_bones_thickness * 2;