mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[godot] Clean-up includes.
This commit is contained in:
parent
85d0e7f7c1
commit
32a5fd05b6
@ -30,7 +30,6 @@
|
|||||||
#include "GodotSpineExtension.h"
|
#include "GodotSpineExtension.h"
|
||||||
#include "core/os/memory.h"
|
#include "core/os/memory.h"
|
||||||
#include "core/os/file_access.h"
|
#include "core/os/file_access.h"
|
||||||
|
|
||||||
#include <spine/SpineString.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
spine::SpineExtension *spine::getDefaultExtension() {
|
spine::SpineExtension *spine::getDefaultExtension() {
|
||||||
|
|||||||
@ -32,7 +32,6 @@
|
|||||||
#include "SpineEvent.h"
|
#include "SpineEvent.h"
|
||||||
#include "SpineTimeline.h"
|
#include "SpineTimeline.h"
|
||||||
#include "SpineCommon.h"
|
#include "SpineCommon.h"
|
||||||
|
|
||||||
#include "core/method_bind_ext.gen.inc"
|
#include "core/method_bind_ext.gen.inc"
|
||||||
|
|
||||||
void SpineAnimation::_bind_methods() {
|
void SpineAnimation::_bind_methods() {
|
||||||
|
|||||||
@ -27,11 +27,10 @@
|
|||||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* 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 "SpineAtlasResource.h"
|
||||||
#include "SpineRendererObject.h"
|
#include "SpineRendererObject.h"
|
||||||
|
#include "core/io/json.h"
|
||||||
|
#include "scene/resources/texture.h"
|
||||||
#include <spine/TextureLoader.h>
|
#include <spine/TextureLoader.h>
|
||||||
|
|
||||||
class GodotSpineTextureLoader : public spine::TextureLoader {
|
class GodotSpineTextureLoader : public spine::TextureLoader {
|
||||||
@ -88,7 +87,7 @@ public:
|
|||||||
normal_maps->append(normal_map);
|
normal_maps->append(normal_map);
|
||||||
renderer_object->normal_map = normal_map;
|
renderer_object->normal_map = normal_map;
|
||||||
}
|
}
|
||||||
|
|
||||||
page.setRendererObject((void *) renderer_object);
|
page.setRendererObject((void *) renderer_object);
|
||||||
page.width = texture->get_width();
|
page.width = texture->get_width();
|
||||||
page.height = texture->get_height();
|
page.height = texture->get_height();
|
||||||
|
|||||||
@ -30,10 +30,9 @@
|
|||||||
#ifndef GODOT_SPINEBONE_H
|
#ifndef GODOT_SPINEBONE_H
|
||||||
#define GODOT_SPINEBONE_H
|
#define GODOT_SPINEBONE_H
|
||||||
|
|
||||||
#include <scene/2d/node_2d.h>
|
|
||||||
#include <spine/spine.h>
|
|
||||||
|
|
||||||
#include "SpineBoneData.h"
|
#include "SpineBoneData.h"
|
||||||
|
#include <scene/2d/node_2d.h>
|
||||||
|
#include <spine/Bone.h>
|
||||||
|
|
||||||
class SpineSkeleton;
|
class SpineSkeleton;
|
||||||
class SpineSprite;
|
class SpineSprite;
|
||||||
@ -73,7 +72,7 @@ public:
|
|||||||
void rotate_world(float degrees);
|
void rotate_world(float degrees);
|
||||||
|
|
||||||
float get_world_to_local_rotation_x();
|
float get_world_to_local_rotation_x();
|
||||||
|
|
||||||
float get_world_to_local_rotation_y();
|
float get_world_to_local_rotation_y();
|
||||||
|
|
||||||
Ref<SpineBoneData> get_data();
|
Ref<SpineBoneData> get_data();
|
||||||
@ -85,106 +84,106 @@ public:
|
|||||||
Array get_children();
|
Array get_children();
|
||||||
|
|
||||||
float get_x();
|
float get_x();
|
||||||
|
|
||||||
void set_x(float v);
|
void set_x(float v);
|
||||||
|
|
||||||
float get_y();
|
float get_y();
|
||||||
|
|
||||||
void set_y(float v);
|
void set_y(float v);
|
||||||
|
|
||||||
float get_rotation();
|
float get_rotation();
|
||||||
|
|
||||||
void set_rotation(float v);
|
void set_rotation(float v);
|
||||||
|
|
||||||
float get_scale_x();
|
float get_scale_x();
|
||||||
|
|
||||||
void set_scale_x(float v);
|
void set_scale_x(float v);
|
||||||
|
|
||||||
float get_scale_y();
|
float get_scale_y();
|
||||||
|
|
||||||
void set_scale_y(float v);
|
void set_scale_y(float v);
|
||||||
|
|
||||||
float get_shear_x();
|
float get_shear_x();
|
||||||
|
|
||||||
void set_shear_x(float v);
|
void set_shear_x(float v);
|
||||||
|
|
||||||
float get_shear_y();
|
float get_shear_y();
|
||||||
|
|
||||||
void set_shear_y(float v);
|
void set_shear_y(float v);
|
||||||
|
|
||||||
float get_applied_rotation();
|
float get_applied_rotation();
|
||||||
|
|
||||||
void set_applied_rotation(float v);
|
void set_applied_rotation(float v);
|
||||||
|
|
||||||
float get_a_x();
|
float get_a_x();
|
||||||
|
|
||||||
void set_a_x(float v);
|
void set_a_x(float v);
|
||||||
|
|
||||||
float get_a_y();
|
float get_a_y();
|
||||||
|
|
||||||
void set_a_y(float v);
|
void set_a_y(float v);
|
||||||
|
|
||||||
float get_a_scale_x();
|
float get_a_scale_x();
|
||||||
|
|
||||||
void set_a_scale_x(float v);
|
void set_a_scale_x(float v);
|
||||||
|
|
||||||
float get_a_scale_y();
|
float get_a_scale_y();
|
||||||
|
|
||||||
void set_a_scale_y(float v);
|
void set_a_scale_y(float v);
|
||||||
|
|
||||||
float get_a_shear_x();
|
float get_a_shear_x();
|
||||||
|
|
||||||
void set_a_shear_x(float v);
|
void set_a_shear_x(float v);
|
||||||
|
|
||||||
float get_a_shear_y();
|
float get_a_shear_y();
|
||||||
|
|
||||||
void set_a_shear_y(float v);
|
void set_a_shear_y(float v);
|
||||||
|
|
||||||
float get_a();
|
float get_a();
|
||||||
|
|
||||||
void set_a(float v);
|
void set_a(float v);
|
||||||
|
|
||||||
float get_b();
|
float get_b();
|
||||||
|
|
||||||
void set_b(float v);
|
void set_b(float v);
|
||||||
|
|
||||||
float get_c();
|
float get_c();
|
||||||
|
|
||||||
void set_c(float v);
|
void set_c(float v);
|
||||||
|
|
||||||
float get_d();
|
float get_d();
|
||||||
|
|
||||||
void set_d(float v);
|
void set_d(float v);
|
||||||
|
|
||||||
float get_world_x();
|
float get_world_x();
|
||||||
|
|
||||||
void set_world_x(float v);
|
void set_world_x(float v);
|
||||||
|
|
||||||
float get_world_y();
|
float get_world_y();
|
||||||
|
|
||||||
void set_world_y(float v);
|
void set_world_y(float v);
|
||||||
|
|
||||||
float get_world_rotation_x();
|
float get_world_rotation_x();
|
||||||
|
|
||||||
float get_world_rotation_y();
|
float get_world_rotation_y();
|
||||||
|
|
||||||
float get_world_scale_x();
|
float get_world_scale_x();
|
||||||
|
|
||||||
float get_world_scale_y();
|
float get_world_scale_y();
|
||||||
|
|
||||||
bool is_active();
|
bool is_active();
|
||||||
|
|
||||||
void set_active(bool v);
|
void set_active(bool v);
|
||||||
|
|
||||||
// External feature functions
|
// External feature functions
|
||||||
void apply_world_transform_2d(Variant o);
|
void apply_world_transform_2d(Variant o);
|
||||||
|
|
||||||
Transform2D get_godot_transform();
|
Transform2D get_godot_transform();
|
||||||
|
|
||||||
void set_godot_transform(Transform2D trans);
|
void set_godot_transform(Transform2D trans);
|
||||||
|
|
||||||
Transform2D get_godot_global_transform();
|
Transform2D get_godot_global_transform();
|
||||||
|
|
||||||
void set_godot_global_transform(Transform2D trans);
|
void set_godot_global_transform(Transform2D trans);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -30,8 +30,8 @@
|
|||||||
#ifndef GODOT_SPINEBONEDATA_H
|
#ifndef GODOT_SPINEBONEDATA_H
|
||||||
#define GODOT_SPINEBONEDATA_H
|
#define GODOT_SPINEBONEDATA_H
|
||||||
|
|
||||||
#include "core/reference.h"
|
|
||||||
#include "SpineConstant.h"
|
#include "SpineConstant.h"
|
||||||
|
#include "core/reference.h"
|
||||||
#include <spine/BoneData.h>
|
#include <spine/BoneData.h>
|
||||||
|
|
||||||
class SpineBoneData : public Reference {
|
class SpineBoneData : public Reference {
|
||||||
@ -58,43 +58,43 @@ public:
|
|||||||
Ref<SpineBoneData> get_parent();
|
Ref<SpineBoneData> get_parent();
|
||||||
|
|
||||||
float get_length();
|
float get_length();
|
||||||
|
|
||||||
void set_length(float v);
|
void set_length(float v);
|
||||||
|
|
||||||
float get_x();
|
float get_x();
|
||||||
|
|
||||||
void set_x(float v);
|
void set_x(float v);
|
||||||
|
|
||||||
float get_y();
|
float get_y();
|
||||||
|
|
||||||
void set_y(float v);
|
void set_y(float v);
|
||||||
|
|
||||||
float get_rotation();
|
float get_rotation();
|
||||||
|
|
||||||
void set_rotation(float v);
|
void set_rotation(float v);
|
||||||
|
|
||||||
float get_scale_x();
|
float get_scale_x();
|
||||||
|
|
||||||
void set_scale_x(float v);
|
void set_scale_x(float v);
|
||||||
|
|
||||||
float get_scale_y();
|
float get_scale_y();
|
||||||
|
|
||||||
void set_scale_y(float v);
|
void set_scale_y(float v);
|
||||||
|
|
||||||
float get_shear_x();
|
float get_shear_x();
|
||||||
|
|
||||||
void set_shear_x(float v);
|
void set_shear_x(float v);
|
||||||
|
|
||||||
float get_shear_y();
|
float get_shear_y();
|
||||||
|
|
||||||
void set_shear_y(float v);
|
void set_shear_y(float v);
|
||||||
|
|
||||||
SpineConstant::TransformMode get_transform_mode();
|
SpineConstant::TransformMode get_transform_mode();
|
||||||
|
|
||||||
void set_transform_mode(SpineConstant::TransformMode v);
|
void set_transform_mode(SpineConstant::TransformMode v);
|
||||||
|
|
||||||
bool is_skin_required();
|
bool is_skin_required();
|
||||||
|
|
||||||
void set_skin_required(bool v);
|
void set_skin_required(bool v);
|
||||||
|
|
||||||
Color get_color();
|
Color get_color();
|
||||||
|
|||||||
@ -28,7 +28,6 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "SpineCollisionShapeProxy.h"
|
#include "SpineCollisionShapeProxy.h"
|
||||||
|
|
||||||
#include "SpineSprite.h"
|
#include "SpineSprite.h"
|
||||||
|
|
||||||
void SpineCollisionShapeProxy::_bind_methods() {
|
void SpineCollisionShapeProxy::_bind_methods() {
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
#define GODOT_SPINECOLLISIONSHAPEPROXY_H
|
#define GODOT_SPINECOLLISIONSHAPEPROXY_H
|
||||||
|
|
||||||
#include "scene/2d/collision_polygon_2d.h"
|
#include "scene/2d/collision_polygon_2d.h"
|
||||||
#include <spine/spine.h>
|
#include <spine/Slot.h>
|
||||||
|
|
||||||
class SpineSprite;
|
class SpineSprite;
|
||||||
class SpineAnimationState;
|
class SpineAnimationState;
|
||||||
|
|||||||
@ -28,8 +28,8 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "SpineConstraintData.h"
|
#include "SpineConstraintData.h"
|
||||||
#include <spine/ConstraintData.h>
|
|
||||||
#include "SpineCommon.h"
|
#include "SpineCommon.h"
|
||||||
|
#include <spine/ConstraintData.h>
|
||||||
|
|
||||||
void SpineConstraintData::_bind_methods() {
|
void SpineConstraintData::_bind_methods() {
|
||||||
ClassDB::bind_method(D_METHOD("get_constraint_name"), &SpineConstraintData::get_constraint_name);
|
ClassDB::bind_method(D_METHOD("get_constraint_name"), &SpineConstraintData::get_constraint_name);
|
||||||
|
|||||||
@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
#include "SpineEditorPlugin.h"
|
#include "SpineEditorPlugin.h"
|
||||||
|
|
||||||
#include "SpineAtlasResource.h"
|
#include "SpineAtlasResource.h"
|
||||||
#include "SpineSkeletonFileResource.h"
|
#include "SpineSkeletonFileResource.h"
|
||||||
|
|
||||||
@ -118,7 +117,7 @@ void SpineEditorPropertyAnimationMixes::add_mix() {
|
|||||||
mix->set_from(animation_names[0]);
|
mix->set_from(animation_names[0]);
|
||||||
mix->set_to(animation_names[0]);
|
mix->set_to(animation_names[0]);
|
||||||
mix->set_mix(0);
|
mix->set_mix(0);
|
||||||
|
|
||||||
Array mixes = skeleton_data->get_animation_mixes().duplicate();
|
Array mixes = skeleton_data->get_animation_mixes().duplicate();
|
||||||
mixes.push_back(mix);
|
mixes.push_back(mix);
|
||||||
emit_changed(get_edited_property(), mixes);
|
emit_changed(get_edited_property(), mixes);
|
||||||
@ -142,7 +141,7 @@ void SpineEditorPropertyAnimationMixes::update_property() {
|
|||||||
updating = true;
|
updating = true;
|
||||||
|
|
||||||
mix_properties.clear();
|
mix_properties.clear();
|
||||||
|
|
||||||
if (container) {
|
if (container) {
|
||||||
set_bottom_editor(nullptr);
|
set_bottom_editor(nullptr);
|
||||||
memdelete(container);
|
memdelete(container);
|
||||||
@ -154,14 +153,14 @@ void SpineEditorPropertyAnimationMixes::update_property() {
|
|||||||
updating = false;
|
updating = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector<String> animation_names;
|
Vector<String> animation_names;
|
||||||
skeleton_data->get_animation_names(animation_names);
|
skeleton_data->get_animation_names(animation_names);
|
||||||
|
|
||||||
container = memnew(VBoxContainer);
|
container = memnew(VBoxContainer);
|
||||||
add_child(container);
|
add_child(container);
|
||||||
set_bottom_editor(container);
|
set_bottom_editor(container);
|
||||||
|
|
||||||
Array mixes = skeleton_data->get_animation_mixes();
|
Array mixes = skeleton_data->get_animation_mixes();
|
||||||
array_object->set_array(mixes);
|
array_object->set_array(mixes);
|
||||||
for (int i = 0; i < mixes.size(); i++) {
|
for (int i = 0; i < mixes.size(); i++) {
|
||||||
@ -171,7 +170,7 @@ void SpineEditorPropertyAnimationMixes::update_property() {
|
|||||||
auto hbox = memnew(HBoxContainer);
|
auto hbox = memnew(HBoxContainer);
|
||||||
hbox->set_h_size_flags(SIZE_EXPAND_FILL);
|
hbox->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||||
container->add_child(hbox);
|
container->add_child(hbox);
|
||||||
|
|
||||||
auto mix_property = memnew(SpineEditorPropertyAnimationMix);
|
auto mix_property = memnew(SpineEditorPropertyAnimationMix);
|
||||||
mix_property->set_h_size_flags(SIZE_EXPAND_FILL);
|
mix_property->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||||
mix_property->set_name_split_ratio(0);
|
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->set_object_and_property(*array_object, property_name);
|
||||||
mix_property->update_property();
|
mix_property->update_property();
|
||||||
mix_properties.push_back(mix_property);
|
mix_properties.push_back(mix_property);
|
||||||
|
|
||||||
auto delete_button = memnew(Button);
|
auto delete_button = memnew(Button);
|
||||||
hbox->add_child(delete_button);
|
hbox->add_child(delete_button);
|
||||||
delete_button->set_text("Remove");
|
delete_button->set_text("Remove");
|
||||||
@ -228,7 +227,7 @@ void SpineEditorPropertyAnimationMix::data_changed(const String &property, Varia
|
|||||||
void SpineEditorPropertyAnimationMix::update_property() {
|
void SpineEditorPropertyAnimationMix::update_property() {
|
||||||
if (updating) return;
|
if (updating) return;
|
||||||
updating = true;
|
updating = true;
|
||||||
|
|
||||||
if (container) {
|
if (container) {
|
||||||
memdelete(container);
|
memdelete(container);
|
||||||
container->queue_delete();
|
container->queue_delete();
|
||||||
@ -245,14 +244,14 @@ void SpineEditorPropertyAnimationMix::update_property() {
|
|||||||
updating = false;
|
updating = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector<String> animation_names;
|
Vector<String> animation_names;
|
||||||
skeleton_data->get_animation_names(animation_names);
|
skeleton_data->get_animation_names(animation_names);
|
||||||
|
|
||||||
container = memnew(HBoxContainer);
|
container = memnew(HBoxContainer);
|
||||||
container->set_h_size_flags(SIZE_EXPAND_FILL);
|
container->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||||
add_child(container);
|
add_child(container);
|
||||||
|
|
||||||
auto from_enum = memnew(EditorPropertyTextEnum);
|
auto from_enum = memnew(EditorPropertyTextEnum);
|
||||||
from_enum->set_h_size_flags(SIZE_EXPAND_FILL);
|
from_enum->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||||
from_enum->set_name_split_ratio(0);
|
from_enum->set_name_split_ratio(0);
|
||||||
@ -282,7 +281,7 @@ void SpineEditorPropertyAnimationMix::update_property() {
|
|||||||
mix_float->update_property();
|
mix_float->update_property();
|
||||||
mix_float->connect("property_changed", this, "data_changed");
|
mix_float->connect("property_changed", this, "data_changed");
|
||||||
container->add_child(mix_float);
|
container->add_child(mix_float);
|
||||||
|
|
||||||
updating = false;
|
updating = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,8 +32,8 @@
|
|||||||
#include "editor/editor_properties_array_dict.h"
|
#include "editor/editor_properties_array_dict.h"
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
#include "editor/editor_node.h"
|
|
||||||
#include "SpineSprite.h"
|
#include "SpineSprite.h"
|
||||||
|
#include "editor/editor_node.h"
|
||||||
#include "editor/editor_properties.h"
|
#include "editor/editor_properties.h"
|
||||||
|
|
||||||
class SpineAtlasResourceImportPlugin : public EditorImportPlugin {
|
class SpineAtlasResourceImportPlugin : public EditorImportPlugin {
|
||||||
|
|||||||
@ -32,11 +32,11 @@
|
|||||||
|
|
||||||
#include "SpineSlotData.h"
|
#include "SpineSlotData.h"
|
||||||
#include "SpineAttachment.h"
|
#include "SpineAttachment.h"
|
||||||
|
#include "SpineBone.h"
|
||||||
|
|
||||||
|
// Breaks cyclic dependency.
|
||||||
class SpineSkeleton;
|
class SpineSkeleton;
|
||||||
|
|
||||||
class SpineBone;
|
|
||||||
|
|
||||||
class SpineSlot : public Reference {
|
class SpineSlot : public Reference {
|
||||||
GDCLASS(SpineSlot, Reference);
|
GDCLASS(SpineSlot, Reference);
|
||||||
|
|
||||||
|
|||||||
@ -30,8 +30,8 @@
|
|||||||
#ifndef GODOT_SPINESLOTDATA_H
|
#ifndef GODOT_SPINESLOTDATA_H
|
||||||
#define GODOT_SPINESLOTDATA_H
|
#define GODOT_SPINESLOTDATA_H
|
||||||
|
|
||||||
#include "core/object.h"
|
|
||||||
#include "SpineBoneData.h"
|
#include "SpineBoneData.h"
|
||||||
|
#include "core/object.h"
|
||||||
#include <spine/SlotData.h>
|
#include <spine/SlotData.h>
|
||||||
|
|
||||||
class SpineSlotData : public Reference {
|
class SpineSlotData : public Reference {
|
||||||
|
|||||||
@ -30,12 +30,11 @@
|
|||||||
#ifndef GODOT_SPINESPRITE_H
|
#ifndef GODOT_SPINESPRITE_H
|
||||||
#define GODOT_SPINESPRITE_H
|
#define GODOT_SPINESPRITE_H
|
||||||
|
|
||||||
#include "scene/2d/node_2d.h"
|
|
||||||
#include "scene/resources/texture.h"
|
|
||||||
|
|
||||||
#include "SpineSkeleton.h"
|
#include "SpineSkeleton.h"
|
||||||
#include "SpineAnimationState.h"
|
#include "SpineAnimationState.h"
|
||||||
|
#include "scene/2d/node_2d.h"
|
||||||
#include "scene/2d/mesh_instance_2d.h"
|
#include "scene/2d/mesh_instance_2d.h"
|
||||||
|
#include "scene/resources/texture.h"
|
||||||
|
|
||||||
class SpineSprite : public Node2D, public spine::AnimationStateListenerObject {
|
class SpineSprite : public Node2D, public spine::AnimationStateListenerObject {
|
||||||
GDCLASS(SpineSprite, Node2D);
|
GDCLASS(SpineSprite, Node2D);
|
||||||
|
|||||||
@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
#include "SpineTransformConstraintData.h"
|
#include "SpineTransformConstraintData.h"
|
||||||
#include "SpineBone.h"
|
#include "SpineBone.h"
|
||||||
|
#include <spine/TransformConstraint.h>
|
||||||
|
|
||||||
class SpineTransformConstraint : public Reference {
|
class SpineTransformConstraint : public Reference {
|
||||||
GDCLASS(SpineTransformConstraint, Reference);
|
GDCLASS(SpineTransformConstraint, Reference);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user