From 7fe9e7cbdf559545c317a38a6f1c8b293e8ad8a0 Mon Sep 17 00:00:00 2001 From: badlogic Date: Tue, 26 Apr 2022 13:34:03 +0200 Subject: [PATCH] [godot] (u)int64_t -> int --- spine-godot/spine_godot/SpineAnimation.cpp | 2 +- spine-godot/spine_godot/SpineAnimationState.cpp | 12 ++++++------ spine-godot/spine_godot/SpineAnimationState.h | 12 ++++++------ spine-godot/spine_godot/SpineConstraintData.cpp | 6 +++--- spine-godot/spine_godot/SpineConstraintData.h | 4 ++-- spine-godot/spine_godot/SpineEditorPlugin.cpp | 6 +++--- spine-godot/spine_godot/SpineEditorPlugin.h | 4 ++-- spine-godot/spine_godot/SpineSkin.cpp | 10 +++++----- spine-godot/spine_godot/SpineSkin.h | 10 +++++----- spine-godot/spine_godot/SpineTimeline.cpp | 2 +- 10 files changed, 34 insertions(+), 34 deletions(-) diff --git a/spine-godot/spine_godot/SpineAnimation.cpp b/spine-godot/spine_godot/SpineAnimation.cpp index d41e00104..65754eef3 100644 --- a/spine-godot/spine_godot/SpineAnimation.cpp +++ b/spine-godot/spine_godot/SpineAnimation.cpp @@ -96,7 +96,7 @@ bool SpineAnimation::has_timeline(Array ids) { property_ids.setSize(ids.size(), 0); for (int i = 0; i < property_ids.size(); ++i) { - property_ids[i] = (int64_t) ids[i]; + property_ids[i] = (spine::PropertyId) ids[i]; } return animation->hasTimeline(property_ids); } diff --git a/spine-godot/spine_godot/SpineAnimationState.cpp b/spine-godot/spine_godot/SpineAnimationState.cpp index e8c76c7a0..8e035c8f7 100644 --- a/spine-godot/spine_godot/SpineAnimationState.cpp +++ b/spine-godot/spine_godot/SpineAnimationState.cpp @@ -76,12 +76,12 @@ void SpineAnimationState::clear_tracks() { animation_state->clearTracks(); } -void SpineAnimationState::clear_track(uint64_t track_id) { +void SpineAnimationState::clear_track(int track_id) { SPINE_CHECK(animation_state,) animation_state->clearTrack(track_id); } -Ref SpineAnimationState::set_animation(const String &animation_name, bool loop, uint64_t track) { +Ref SpineAnimationState::set_animation(const String &animation_name, bool loop, int track) { SPINE_CHECK(animation_state, nullptr) auto skeleton_data = animation_state->getData()->getSkeletonData(); auto animation = skeleton_data->findAnimation(animation_name.utf8().ptr()); @@ -95,7 +95,7 @@ Ref SpineAnimationState::set_animation(const String &animation_ return track_entry_ref; } -Ref SpineAnimationState::add_animation(const String &animation_name, float delay, bool loop, uint64_t track) { +Ref SpineAnimationState::add_animation(const String &animation_name, float delay, bool loop, int track) { SPINE_CHECK(animation_state, nullptr) auto skeleton_data = animation_state->getData()->getSkeletonData(); auto animation = skeleton_data->findAnimation(animation_name.utf8().ptr()); @@ -109,14 +109,14 @@ Ref SpineAnimationState::add_animation(const String &animation_ return track_entry_ref; } -Ref SpineAnimationState::set_empty_animation(uint64_t track_id, float mix_duration) { +Ref SpineAnimationState::set_empty_animation(int track_id, float mix_duration) { SPINE_CHECK(animation_state, nullptr) auto track_entry = animation_state->setEmptyAnimation(track_id, mix_duration); Ref track_entry_ref(memnew(SpineTrackEntry)); track_entry_ref->set_spine_object(track_entry); return track_entry_ref; } -Ref SpineAnimationState::add_empty_animation(uint64_t track_id, float mix_duration, float delay) { +Ref SpineAnimationState::add_empty_animation(int track_id, float mix_duration, float delay) { SPINE_CHECK(animation_state, nullptr) auto track_entry = animation_state->addEmptyAnimation(track_id, mix_duration, delay); Ref track_entry_ref(memnew(SpineTrackEntry)); @@ -128,7 +128,7 @@ void SpineAnimationState::set_empty_animations(float mix_duration) { animation_state->setEmptyAnimations(mix_duration); } -Ref SpineAnimationState::get_current(uint64_t track_index) { +Ref SpineAnimationState::get_current(int track_index) { SPINE_CHECK(animation_state, nullptr) auto track_entry = animation_state->getCurrent(track_index); if (!track_entry) return nullptr; diff --git a/spine-godot/spine_godot/SpineAnimationState.h b/spine-godot/spine_godot/SpineAnimationState.h index 3272ebafe..a033db534 100644 --- a/spine-godot/spine_godot/SpineAnimationState.h +++ b/spine-godot/spine_godot/SpineAnimationState.h @@ -58,19 +58,19 @@ public: void clear_tracks(); - void clear_track(uint64_t track_id); + void clear_track(int track_id); - Ref set_animation(const String &animation_name, bool loop, uint64_t track_id); + Ref set_animation(const String &animation_name, bool loop, int track_id); - Ref add_animation(const String &animation_name, float delay, bool loop, uint64_t track_id); + Ref add_animation(const String &animation_name, float delay, bool loop, int track_id); - Ref set_empty_animation(uint64_t track_id, float mix_duration); + Ref set_empty_animation(int track_id, float mix_duration); - Ref add_empty_animation(uint64_t track_id, float mix_duration, float delay); + Ref add_empty_animation(int track_id, float mix_duration, float delay); void set_empty_animations(float mix_duration); - Ref get_current(uint64_t track_index); + Ref get_current(int track_index); float get_time_scale(); diff --git a/spine-godot/spine_godot/SpineConstraintData.cpp b/spine-godot/spine_godot/SpineConstraintData.cpp index d5b67574f..41c4a2f22 100644 --- a/spine-godot/spine_godot/SpineConstraintData.cpp +++ b/spine-godot/spine_godot/SpineConstraintData.cpp @@ -47,12 +47,12 @@ String SpineConstraintData::get_constraint_name() { return constraint_data->getName().buffer(); } -uint64_t SpineConstraintData::get_order() { +int SpineConstraintData::get_order() { SPINE_CHECK(constraint_data, 0) - return constraint_data->getOrder(); + return (int)constraint_data->getOrder(); } -void SpineConstraintData::set_order(uint64_t v) { +void SpineConstraintData::set_order(int v) { SPINE_CHECK(constraint_data,) constraint_data->setOrder(v); } diff --git a/spine-godot/spine_godot/SpineConstraintData.h b/spine-godot/spine_godot/SpineConstraintData.h index a13993dec..c9d9395a1 100644 --- a/spine-godot/spine_godot/SpineConstraintData.h +++ b/spine-godot/spine_godot/SpineConstraintData.h @@ -54,9 +54,9 @@ public: String get_constraint_name(); - uint64_t get_order(); + int get_order(); - void set_order(uint64_t v); + void set_order(int v); bool is_skin_required(); diff --git a/spine-godot/spine_godot/SpineEditorPlugin.cpp b/spine-godot/spine_godot/SpineEditorPlugin.cpp index a111439a6..adae9c90a 100644 --- a/spine-godot/spine_godot/SpineEditorPlugin.cpp +++ b/spine-godot/spine_godot/SpineEditorPlugin.cpp @@ -129,7 +129,7 @@ void SpineEditorPropertyAnimationMixes::add_mix() { emit_changed(get_edited_property(), mixes); } -void SpineEditorPropertyAnimationMixes::delete_mix(int64_t idx) { +void SpineEditorPropertyAnimationMixes::delete_mix(int idx) { if (!skeleton_data.is_valid() || !skeleton_data->is_skeleton_data_loaded() || updating) return; auto mixes = skeleton_data->get_animation_mixes().duplicate(); @@ -141,9 +141,9 @@ void SpineEditorPropertyAnimationMixes::delete_mix(int64_t idx) { emit_changed(get_edited_property(), mixes); } -void SpineEditorPropertyAnimationMixes::update_mix_property(int64_t index) { +void SpineEditorPropertyAnimationMixes::update_mix_property(int index) { if (index < 0 || index > mix_properties.size()) return; - mix_properties[(int)index]->update_property(); + mix_properties[index]->update_property(); } void SpineEditorPropertyAnimationMixes::update_property() { diff --git a/spine-godot/spine_godot/SpineEditorPlugin.h b/spine-godot/spine_godot/SpineEditorPlugin.h index d525058c4..26cce5638 100644 --- a/spine-godot/spine_godot/SpineEditorPlugin.h +++ b/spine-godot/spine_godot/SpineEditorPlugin.h @@ -168,8 +168,8 @@ class SpineEditorPropertyAnimationMixes: public EditorProperty { static void _bind_methods(); void add_mix(); - void delete_mix(int64_t idx); - void update_mix_property(int64_t index); + void delete_mix(int idx); + void update_mix_property(int index); public: SpineEditorPropertyAnimationMixes(); void setup(const Ref &_skeleton_data) { this->skeleton_data = _skeleton_data; }; diff --git a/spine-godot/spine_godot/SpineSkin.cpp b/spine-godot/spine_godot/SpineSkin.cpp index df44fba0c..fde3b64b1 100644 --- a/spine-godot/spine_godot/SpineSkin.cpp +++ b/spine-godot/spine_godot/SpineSkin.cpp @@ -64,12 +64,12 @@ Ref SpineSkin::init(const String &name) { return this; } -void SpineSkin::set_attachment(uint64_t slot_index, const String &name, Ref attachment) { +void SpineSkin::set_attachment(int slot_index, const String &name, Ref attachment) { SPINE_CHECK(skin,) skin->setAttachment(slot_index, SPINE_STRING(name), attachment.is_valid() ? attachment->get_spine_object() : nullptr); } -Ref SpineSkin::get_attachment(uint64_t slot_index, const String &name) { +Ref SpineSkin::get_attachment(int slot_index, const String &name) { SPINE_CHECK(skin, nullptr) auto attachment = skin->getAttachment(slot_index, SPINE_STRING(name)); if (attachment) return nullptr; @@ -78,12 +78,12 @@ Ref SpineSkin::get_attachment(uint64_t slot_index, const String return attachment_ref; } -void SpineSkin::remove_attachment(uint64_t slot_index, const String &name) { +void SpineSkin::remove_attachment(int slot_index, const String &name) { SPINE_CHECK(skin,) skin->removeAttachment(slot_index, SPINE_STRING(name)); } -Array SpineSkin::find_names_for_slot(uint64_t slot_index) { +Array SpineSkin::find_names_for_slot(int slot_index) { Array result; SPINE_CHECK(skin, result) spine::Vector names; @@ -95,7 +95,7 @@ Array SpineSkin::find_names_for_slot(uint64_t slot_index) { return result; } -Array SpineSkin::find_attachments_for_slot(uint64_t slot_index) { +Array SpineSkin::find_attachments_for_slot(int slot_index) { Array result; SPINE_CHECK(skin, result) spine::Vector attachments; diff --git a/spine-godot/spine_godot/SpineSkin.h b/spine-godot/spine_godot/SpineSkin.h index 6f7716f2f..ef038a40d 100644 --- a/spine-godot/spine_godot/SpineSkin.h +++ b/spine-godot/spine_godot/SpineSkin.h @@ -52,15 +52,15 @@ public: Ref init(const String &name); - void set_attachment(uint64_t slot_index, const String &name, Ref attachment); + void set_attachment(int slot_index, const String &name, Ref attachment); - Ref get_attachment(uint64_t slot_index, const String &name); + Ref get_attachment(int slot_index, const String &name); - void remove_attachment(uint64_t slot_index, const String &name); + void remove_attachment(int slot_index, const String &name); - Array find_names_for_slot(uint64_t slot_index); + Array find_names_for_slot(int slot_index); - Array find_attachments_for_slot(uint64_t slot_index); + Array find_attachments_for_slot(int slot_index); String get_name(); diff --git a/spine-godot/spine_godot/SpineTimeline.cpp b/spine-godot/spine_godot/SpineTimeline.cpp index 604ac0699..6528b0e04 100644 --- a/spine-godot/spine_godot/SpineTimeline.cpp +++ b/spine-godot/spine_godot/SpineTimeline.cpp @@ -90,7 +90,7 @@ Array SpineTimeline::get_property_ids() { auto &ids = timeline->getPropertyIds(); result.resize((int)ids.size()); for (int i = 0; i < result.size(); ++i) { - result[i] = (int64_t) ids[i]; + result[i] = (spine::PropertyId) ids[i]; } return result; }