mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[godot] (u)int64_t -> int
This commit is contained in:
parent
dfd2fc057a
commit
7fe9e7cbdf
@ -96,7 +96,7 @@ bool SpineAnimation::has_timeline(Array ids) {
|
|||||||
property_ids.setSize(ids.size(), 0);
|
property_ids.setSize(ids.size(), 0);
|
||||||
|
|
||||||
for (int i = 0; i < property_ids.size(); ++i) {
|
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);
|
return animation->hasTimeline(property_ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,12 +76,12 @@ void SpineAnimationState::clear_tracks() {
|
|||||||
animation_state->clearTracks();
|
animation_state->clearTracks();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpineAnimationState::clear_track(uint64_t track_id) {
|
void SpineAnimationState::clear_track(int track_id) {
|
||||||
SPINE_CHECK(animation_state,)
|
SPINE_CHECK(animation_state,)
|
||||||
animation_state->clearTrack(track_id);
|
animation_state->clearTrack(track_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<SpineTrackEntry> SpineAnimationState::set_animation(const String &animation_name, bool loop, uint64_t track) {
|
Ref<SpineTrackEntry> SpineAnimationState::set_animation(const String &animation_name, bool loop, int track) {
|
||||||
SPINE_CHECK(animation_state, nullptr)
|
SPINE_CHECK(animation_state, nullptr)
|
||||||
auto skeleton_data = animation_state->getData()->getSkeletonData();
|
auto skeleton_data = animation_state->getData()->getSkeletonData();
|
||||||
auto animation = skeleton_data->findAnimation(animation_name.utf8().ptr());
|
auto animation = skeleton_data->findAnimation(animation_name.utf8().ptr());
|
||||||
@ -95,7 +95,7 @@ Ref<SpineTrackEntry> SpineAnimationState::set_animation(const String &animation_
|
|||||||
return track_entry_ref;
|
return track_entry_ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<SpineTrackEntry> SpineAnimationState::add_animation(const String &animation_name, float delay, bool loop, uint64_t track) {
|
Ref<SpineTrackEntry> SpineAnimationState::add_animation(const String &animation_name, float delay, bool loop, int track) {
|
||||||
SPINE_CHECK(animation_state, nullptr)
|
SPINE_CHECK(animation_state, nullptr)
|
||||||
auto skeleton_data = animation_state->getData()->getSkeletonData();
|
auto skeleton_data = animation_state->getData()->getSkeletonData();
|
||||||
auto animation = skeleton_data->findAnimation(animation_name.utf8().ptr());
|
auto animation = skeleton_data->findAnimation(animation_name.utf8().ptr());
|
||||||
@ -109,14 +109,14 @@ Ref<SpineTrackEntry> SpineAnimationState::add_animation(const String &animation_
|
|||||||
return track_entry_ref;
|
return track_entry_ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<SpineTrackEntry> SpineAnimationState::set_empty_animation(uint64_t track_id, float mix_duration) {
|
Ref<SpineTrackEntry> SpineAnimationState::set_empty_animation(int track_id, float mix_duration) {
|
||||||
SPINE_CHECK(animation_state, nullptr)
|
SPINE_CHECK(animation_state, nullptr)
|
||||||
auto track_entry = animation_state->setEmptyAnimation(track_id, mix_duration);
|
auto track_entry = animation_state->setEmptyAnimation(track_id, mix_duration);
|
||||||
Ref<SpineTrackEntry> track_entry_ref(memnew(SpineTrackEntry));
|
Ref<SpineTrackEntry> track_entry_ref(memnew(SpineTrackEntry));
|
||||||
track_entry_ref->set_spine_object(track_entry);
|
track_entry_ref->set_spine_object(track_entry);
|
||||||
return track_entry_ref;
|
return track_entry_ref;
|
||||||
}
|
}
|
||||||
Ref<SpineTrackEntry> SpineAnimationState::add_empty_animation(uint64_t track_id, float mix_duration, float delay) {
|
Ref<SpineTrackEntry> SpineAnimationState::add_empty_animation(int track_id, float mix_duration, float delay) {
|
||||||
SPINE_CHECK(animation_state, nullptr)
|
SPINE_CHECK(animation_state, nullptr)
|
||||||
auto track_entry = animation_state->addEmptyAnimation(track_id, mix_duration, delay);
|
auto track_entry = animation_state->addEmptyAnimation(track_id, mix_duration, delay);
|
||||||
Ref<SpineTrackEntry> track_entry_ref(memnew(SpineTrackEntry));
|
Ref<SpineTrackEntry> track_entry_ref(memnew(SpineTrackEntry));
|
||||||
@ -128,7 +128,7 @@ void SpineAnimationState::set_empty_animations(float mix_duration) {
|
|||||||
animation_state->setEmptyAnimations(mix_duration);
|
animation_state->setEmptyAnimations(mix_duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<SpineTrackEntry> SpineAnimationState::get_current(uint64_t track_index) {
|
Ref<SpineTrackEntry> SpineAnimationState::get_current(int track_index) {
|
||||||
SPINE_CHECK(animation_state, nullptr)
|
SPINE_CHECK(animation_state, nullptr)
|
||||||
auto track_entry = animation_state->getCurrent(track_index);
|
auto track_entry = animation_state->getCurrent(track_index);
|
||||||
if (!track_entry) return nullptr;
|
if (!track_entry) return nullptr;
|
||||||
|
|||||||
@ -58,19 +58,19 @@ public:
|
|||||||
|
|
||||||
void clear_tracks();
|
void clear_tracks();
|
||||||
|
|
||||||
void clear_track(uint64_t track_id);
|
void clear_track(int track_id);
|
||||||
|
|
||||||
Ref<SpineTrackEntry> set_animation(const String &animation_name, bool loop, uint64_t track_id);
|
Ref<SpineTrackEntry> set_animation(const String &animation_name, bool loop, int track_id);
|
||||||
|
|
||||||
Ref<SpineTrackEntry> add_animation(const String &animation_name, float delay, bool loop, uint64_t track_id);
|
Ref<SpineTrackEntry> add_animation(const String &animation_name, float delay, bool loop, int track_id);
|
||||||
|
|
||||||
Ref<SpineTrackEntry> set_empty_animation(uint64_t track_id, float mix_duration);
|
Ref<SpineTrackEntry> set_empty_animation(int track_id, float mix_duration);
|
||||||
|
|
||||||
Ref<SpineTrackEntry> add_empty_animation(uint64_t track_id, float mix_duration, float delay);
|
Ref<SpineTrackEntry> add_empty_animation(int track_id, float mix_duration, float delay);
|
||||||
|
|
||||||
void set_empty_animations(float mix_duration);
|
void set_empty_animations(float mix_duration);
|
||||||
|
|
||||||
Ref<SpineTrackEntry> get_current(uint64_t track_index);
|
Ref<SpineTrackEntry> get_current(int track_index);
|
||||||
|
|
||||||
float get_time_scale();
|
float get_time_scale();
|
||||||
|
|
||||||
|
|||||||
@ -47,12 +47,12 @@ String SpineConstraintData::get_constraint_name() {
|
|||||||
return constraint_data->getName().buffer();
|
return constraint_data->getName().buffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t SpineConstraintData::get_order() {
|
int SpineConstraintData::get_order() {
|
||||||
SPINE_CHECK(constraint_data, 0)
|
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,)
|
SPINE_CHECK(constraint_data,)
|
||||||
constraint_data->setOrder(v);
|
constraint_data->setOrder(v);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,9 +54,9 @@ public:
|
|||||||
|
|
||||||
String get_constraint_name();
|
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();
|
bool is_skin_required();
|
||||||
|
|
||||||
|
|||||||
@ -129,7 +129,7 @@ void SpineEditorPropertyAnimationMixes::add_mix() {
|
|||||||
emit_changed(get_edited_property(), mixes);
|
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;
|
if (!skeleton_data.is_valid() || !skeleton_data->is_skeleton_data_loaded() || updating) return;
|
||||||
|
|
||||||
auto mixes = skeleton_data->get_animation_mixes().duplicate();
|
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);
|
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;
|
if (index < 0 || index > mix_properties.size()) return;
|
||||||
mix_properties[(int)index]->update_property();
|
mix_properties[index]->update_property();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpineEditorPropertyAnimationMixes::update_property() {
|
void SpineEditorPropertyAnimationMixes::update_property() {
|
||||||
|
|||||||
@ -168,8 +168,8 @@ class SpineEditorPropertyAnimationMixes: public EditorProperty {
|
|||||||
|
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
void add_mix();
|
void add_mix();
|
||||||
void delete_mix(int64_t idx);
|
void delete_mix(int idx);
|
||||||
void update_mix_property(int64_t index);
|
void update_mix_property(int index);
|
||||||
public:
|
public:
|
||||||
SpineEditorPropertyAnimationMixes();
|
SpineEditorPropertyAnimationMixes();
|
||||||
void setup(const Ref<SpineSkeletonDataResource> &_skeleton_data) { this->skeleton_data = _skeleton_data; };
|
void setup(const Ref<SpineSkeletonDataResource> &_skeleton_data) { this->skeleton_data = _skeleton_data; };
|
||||||
|
|||||||
@ -64,12 +64,12 @@ Ref<SpineSkin> SpineSkin::init(const String &name) {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpineSkin::set_attachment(uint64_t slot_index, const String &name, Ref<SpineAttachment> attachment) {
|
void SpineSkin::set_attachment(int slot_index, const String &name, Ref<SpineAttachment> attachment) {
|
||||||
SPINE_CHECK(skin,)
|
SPINE_CHECK(skin,)
|
||||||
skin->setAttachment(slot_index, SPINE_STRING(name), attachment.is_valid() ? attachment->get_spine_object() : nullptr);
|
skin->setAttachment(slot_index, SPINE_STRING(name), attachment.is_valid() ? attachment->get_spine_object() : nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<SpineAttachment> SpineSkin::get_attachment(uint64_t slot_index, const String &name) {
|
Ref<SpineAttachment> SpineSkin::get_attachment(int slot_index, const String &name) {
|
||||||
SPINE_CHECK(skin, nullptr)
|
SPINE_CHECK(skin, nullptr)
|
||||||
auto attachment = skin->getAttachment(slot_index, SPINE_STRING(name));
|
auto attachment = skin->getAttachment(slot_index, SPINE_STRING(name));
|
||||||
if (attachment) return nullptr;
|
if (attachment) return nullptr;
|
||||||
@ -78,12 +78,12 @@ Ref<SpineAttachment> SpineSkin::get_attachment(uint64_t slot_index, const String
|
|||||||
return attachment_ref;
|
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,)
|
SPINE_CHECK(skin,)
|
||||||
skin->removeAttachment(slot_index, SPINE_STRING(name));
|
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;
|
Array result;
|
||||||
SPINE_CHECK(skin, result)
|
SPINE_CHECK(skin, result)
|
||||||
spine::Vector<spine::String> names;
|
spine::Vector<spine::String> names;
|
||||||
@ -95,7 +95,7 @@ Array SpineSkin::find_names_for_slot(uint64_t slot_index) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Array SpineSkin::find_attachments_for_slot(uint64_t slot_index) {
|
Array SpineSkin::find_attachments_for_slot(int slot_index) {
|
||||||
Array result;
|
Array result;
|
||||||
SPINE_CHECK(skin, result)
|
SPINE_CHECK(skin, result)
|
||||||
spine::Vector<spine::Attachment *> attachments;
|
spine::Vector<spine::Attachment *> attachments;
|
||||||
|
|||||||
@ -52,15 +52,15 @@ public:
|
|||||||
|
|
||||||
Ref<SpineSkin> init(const String &name);
|
Ref<SpineSkin> init(const String &name);
|
||||||
|
|
||||||
void set_attachment(uint64_t slot_index, const String &name, Ref<SpineAttachment> attachment);
|
void set_attachment(int slot_index, const String &name, Ref<SpineAttachment> attachment);
|
||||||
|
|
||||||
Ref<SpineAttachment> get_attachment(uint64_t slot_index, const String &name);
|
Ref<SpineAttachment> 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();
|
String get_name();
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,7 @@ Array SpineTimeline::get_property_ids() {
|
|||||||
auto &ids = timeline->getPropertyIds();
|
auto &ids = timeline->getPropertyIds();
|
||||||
result.resize((int)ids.size());
|
result.resize((int)ids.size());
|
||||||
for (int i = 0; i < result.size(); ++i) {
|
for (int i = 0; i < result.size(); ++i) {
|
||||||
result[i] = (int64_t) ids[i];
|
result[i] = (spine::PropertyId) ids[i];
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user