mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[godot] Fix up formatter.
This commit is contained in:
parent
934034fce4
commit
4239af0a1a
@ -26,8 +26,8 @@ spotless {
|
||||
'spine-sfml/**/*.h',
|
||||
'spine-ue4/**/*.cpp',
|
||||
'spine-ue4/**/*.h',
|
||||
'spine-godot/godot/modules/spine_godot/*.cpp',
|
||||
'spine-godot/godot/modules/spine_godot/*.h'
|
||||
'spine-godot/spine_godot/*.cpp',
|
||||
'spine-godot/spine_godot/*.h'
|
||||
clangFormat("13.0.1").pathToExe("$System.env.CLANGFORMAT").style('file')
|
||||
}
|
||||
|
||||
|
||||
@ -59,8 +59,7 @@ void SpineAnimationTrack::_bind_methods() {
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "debug"), "set_debug", "get_debug");
|
||||
}
|
||||
|
||||
SpineAnimationTrack::SpineAnimationTrack():
|
||||
loop(false),
|
||||
SpineAnimationTrack::SpineAnimationTrack() : loop(false),
|
||||
track_index(-1),
|
||||
mix_duration(-1),
|
||||
hold_previous(false),
|
||||
|
||||
@ -103,7 +103,8 @@ void SpineBoneNode::_get_property_list(List<PropertyInfo>* list) const {
|
||||
Vector<String> bone_names;
|
||||
SpineSprite *sprite = find_parent_sprite();
|
||||
if (sprite) sprite->get_skeleton_data_res()->get_bone_names(bone_names);
|
||||
else bone_names.push_back(bone_name);
|
||||
else
|
||||
bone_names.push_back(bone_name);
|
||||
auto element = list->front();
|
||||
while (element) {
|
||||
auto property_info = element->get();
|
||||
|
||||
@ -90,7 +90,8 @@ protected:
|
||||
SpineObjectWrapper() : spine_owner(nullptr), spine_object(nullptr) {
|
||||
}
|
||||
|
||||
template <typename OWNER, typename OBJECT> void _set_spine_object_internal(const OWNER* _owner, OBJECT* _object) {
|
||||
template<typename OWNER, typename OBJECT>
|
||||
void _set_spine_object_internal(const OWNER *_owner, OBJECT *_object) {
|
||||
if (spine_owner) {
|
||||
ERR_PRINT("Owner already set.");
|
||||
return;
|
||||
@ -119,7 +120,8 @@ protected:
|
||||
|
||||
class SpineSprite;
|
||||
|
||||
template <typename OBJECT> class SpineSpriteOwnedObject: public SpineObjectWrapper {
|
||||
template<typename OBJECT>
|
||||
class SpineSpriteOwnedObject : public SpineObjectWrapper {
|
||||
public:
|
||||
void set_spine_object(const SpineSprite *_owner, OBJECT *_object) {
|
||||
_set_spine_object_internal(_owner, _object);
|
||||
@ -136,7 +138,8 @@ public:
|
||||
|
||||
class SpineSkeletonDataResource;
|
||||
|
||||
template <typename OBJECT> class SpineSkeletonDataResourceOwnedObject: public SpineObjectWrapper {
|
||||
template<typename OBJECT>
|
||||
class SpineSkeletonDataResourceOwnedObject : public SpineObjectWrapper {
|
||||
public:
|
||||
void set_spine_object(const SpineSkeletonDataResource *_owner, OBJECT *_object) {
|
||||
_set_spine_object_internal(_owner, _object);
|
||||
|
||||
@ -177,6 +177,7 @@ class SpineEditorPropertyAnimationMixes: public EditorProperty {
|
||||
void add_mix();
|
||||
void delete_mix(int idx);
|
||||
void update_mix_property(int index);
|
||||
|
||||
public:
|
||||
SpineEditorPropertyAnimationMixes();
|
||||
void setup(const Ref<SpineSkeletonDataResource> &_skeleton_data) { this->skeleton_data = _skeleton_data; };
|
||||
@ -194,6 +195,7 @@ class SpineEditorPropertyAnimationMix: public EditorProperty {
|
||||
|
||||
static void _bind_methods();
|
||||
void data_changed(const String &property, const Variant &value, const String &name, bool changing);
|
||||
|
||||
public:
|
||||
SpineEditorPropertyAnimationMix();
|
||||
void setup(SpineEditorPropertyAnimationMixes *mixes_property, const Ref<SpineSkeletonDataResource> &skeleton_data, int index);
|
||||
@ -207,6 +209,7 @@ class SpineSpriteInspectorPlugin: public EditorInspectorPlugin {
|
||||
|
||||
static void _bind_methods();
|
||||
void button_clicked(const String &button_name);
|
||||
|
||||
public:
|
||||
bool can_handle(Object *object) override;
|
||||
void parse_begin(Object *object) override;
|
||||
|
||||
@ -20,6 +20,7 @@ protected:
|
||||
String from;
|
||||
String to;
|
||||
float mix;
|
||||
|
||||
public:
|
||||
SpineAnimationMix();
|
||||
|
||||
|
||||
@ -86,6 +86,7 @@ protected:
|
||||
this->name = _name;
|
||||
this->attachment = _attachment;
|
||||
}
|
||||
|
||||
private:
|
||||
int slot_index;
|
||||
String name;
|
||||
|
||||
@ -44,7 +44,6 @@ void SpineSlotData::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_attachment_name", "v"), &SpineSlotData::set_attachment_name);
|
||||
ClassDB::bind_method(D_METHOD("get_blend_mode"), &SpineSlotData::get_blend_mode);
|
||||
ClassDB::bind_method(D_METHOD("set_blend_mode", "v"), &SpineSlotData::set_blend_mode);
|
||||
|
||||
}
|
||||
|
||||
int SpineSlotData::get_index() {
|
||||
|
||||
@ -100,7 +100,8 @@ void SpineSlotNode::_get_property_list(List<PropertyInfo>* list) const {
|
||||
Vector<String> slot_names;
|
||||
SpineSprite *sprite = cast_to<SpineSprite>(get_parent());
|
||||
if (sprite) sprite->get_skeleton_data_res()->get_slot_names(slot_names);
|
||||
else slot_names.push_back(slot_name);
|
||||
else
|
||||
slot_names.push_back(slot_name);
|
||||
auto element = list->front();
|
||||
while (element) {
|
||||
auto property_info = element->get();
|
||||
|
||||
@ -51,6 +51,7 @@ protected:
|
||||
bool _set(const StringName &property, const Variant &value);
|
||||
void on_world_transforms_changed(const Variant &_sprite);
|
||||
void update_transform(SpineSprite *sprite);
|
||||
|
||||
public:
|
||||
SpineSlotNode();
|
||||
|
||||
|
||||
@ -598,10 +598,18 @@ void SpineSprite::update_meshes(Ref<SpineSkeleton> skeleton_ref) {
|
||||
auto slot_node = nodes[0];
|
||||
if (slot_node) {
|
||||
switch (blend_mode) {
|
||||
case spine::BlendMode_Normal: custom_material = slot_node->get_normal_material(); break;
|
||||
case spine::BlendMode_Additive: custom_material = slot_node->get_additive_material(); break;
|
||||
case spine::BlendMode_Multiply: custom_material = slot_node->get_multiply_material(); break;
|
||||
case spine::BlendMode_Screen: custom_material = slot_node->get_screen_material(); break;
|
||||
case spine::BlendMode_Normal:
|
||||
custom_material = slot_node->get_normal_material();
|
||||
break;
|
||||
case spine::BlendMode_Additive:
|
||||
custom_material = slot_node->get_additive_material();
|
||||
break;
|
||||
case spine::BlendMode_Multiply:
|
||||
custom_material = slot_node->get_multiply_material();
|
||||
break;
|
||||
case spine::BlendMode_Screen:
|
||||
custom_material = slot_node->get_screen_material();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -609,16 +617,25 @@ void SpineSprite::update_meshes(Ref<SpineSkeleton> skeleton_ref) {
|
||||
// Else, check if we have a material on the sprite itself
|
||||
if (!custom_material.is_valid()) {
|
||||
switch (blend_mode) {
|
||||
case spine::BlendMode_Normal: custom_material = normal_material; break;
|
||||
case spine::BlendMode_Additive: custom_material = additive_material; break;
|
||||
case spine::BlendMode_Multiply: custom_material = multiply_material; break;
|
||||
case spine::BlendMode_Screen: custom_material = screen_material; break;
|
||||
case spine::BlendMode_Normal:
|
||||
custom_material = normal_material;
|
||||
break;
|
||||
case spine::BlendMode_Additive:
|
||||
custom_material = additive_material;
|
||||
break;
|
||||
case spine::BlendMode_Multiply:
|
||||
custom_material = multiply_material;
|
||||
break;
|
||||
case spine::BlendMode_Screen:
|
||||
custom_material = screen_material;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the custom material, or the default material
|
||||
if (custom_material.is_valid()) mesh_instance->set_material(custom_material);
|
||||
else mesh_instance->set_material(default_materials[slot->getData().getBlendMode()]);
|
||||
else
|
||||
mesh_instance->set_material(default_materials[slot->getData().getBlendMode()]);
|
||||
}
|
||||
skeleton_clipper->clipEnd(*slot);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user