[godot] Clean-up includes.

This commit is contained in:
Mario Zechner 2022-04-20 14:07:25 +02:00
parent 85d0e7f7c1
commit 32a5fd05b6
14 changed files with 63 additions and 69 deletions

View File

@ -30,7 +30,6 @@
#include "GodotSpineExtension.h"
#include "core/os/memory.h"
#include "core/os/file_access.h"
#include <spine/SpineString.h>
spine::SpineExtension *spine::getDefaultExtension() {

View File

@ -32,7 +32,6 @@
#include "SpineEvent.h"
#include "SpineTimeline.h"
#include "SpineCommon.h"
#include "core/method_bind_ext.gen.inc"
void SpineAnimation::_bind_methods() {

View File

@ -27,11 +27,10 @@
* 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 "SpineRendererObject.h"
#include "core/io/json.h"
#include "scene/resources/texture.h"
#include <spine/TextureLoader.h>
class GodotSpineTextureLoader : public spine::TextureLoader {
@ -88,7 +87,7 @@ public:
normal_maps->append(normal_map);
renderer_object->normal_map = normal_map;
}
page.setRendererObject((void *) renderer_object);
page.width = texture->get_width();
page.height = texture->get_height();

View File

@ -30,10 +30,9 @@
#ifndef GODOT_SPINEBONE_H
#define GODOT_SPINEBONE_H
#include <scene/2d/node_2d.h>
#include <spine/spine.h>
#include "SpineBoneData.h"
#include <scene/2d/node_2d.h>
#include <spine/Bone.h>
class SpineSkeleton;
class SpineSprite;
@ -73,7 +72,7 @@ public:
void rotate_world(float degrees);
float get_world_to_local_rotation_x();
float get_world_to_local_rotation_y();
Ref<SpineBoneData> get_data();
@ -85,106 +84,106 @@ public:
Array get_children();
float get_x();
void set_x(float v);
float get_y();
void set_y(float v);
float get_rotation();
void set_rotation(float v);
float get_scale_x();
void set_scale_x(float v);
float get_scale_y();
void set_scale_y(float v);
float get_shear_x();
void set_shear_x(float v);
float get_shear_y();
void set_shear_y(float v);
float get_applied_rotation();
void set_applied_rotation(float v);
float get_a_x();
void set_a_x(float v);
float get_a_y();
void set_a_y(float v);
float get_a_scale_x();
void set_a_scale_x(float v);
float get_a_scale_y();
void set_a_scale_y(float v);
float get_a_shear_x();
void set_a_shear_x(float v);
float get_a_shear_y();
void set_a_shear_y(float v);
float get_a();
void set_a(float v);
float get_b();
void set_b(float v);
float get_c();
void set_c(float v);
float get_d();
void set_d(float v);
float get_world_x();
void set_world_x(float v);
float get_world_y();
void set_world_y(float v);
float get_world_rotation_x();
float get_world_rotation_y();
float get_world_scale_x();
float get_world_scale_y();
bool is_active();
void set_active(bool v);
// External feature functions
void apply_world_transform_2d(Variant o);
Transform2D get_godot_transform();
void set_godot_transform(Transform2D trans);
Transform2D get_godot_global_transform();
void set_godot_global_transform(Transform2D trans);
};

View File

@ -30,8 +30,8 @@
#ifndef GODOT_SPINEBONEDATA_H
#define GODOT_SPINEBONEDATA_H
#include "core/reference.h"
#include "SpineConstant.h"
#include "core/reference.h"
#include <spine/BoneData.h>
class SpineBoneData : public Reference {
@ -58,43 +58,43 @@ public:
Ref<SpineBoneData> get_parent();
float get_length();
void set_length(float v);
float get_x();
void set_x(float v);
float get_y();
void set_y(float v);
float get_rotation();
void set_rotation(float v);
float get_scale_x();
void set_scale_x(float v);
float get_scale_y();
void set_scale_y(float v);
float get_shear_x();
void set_shear_x(float v);
float get_shear_y();
void set_shear_y(float v);
SpineConstant::TransformMode get_transform_mode();
void set_transform_mode(SpineConstant::TransformMode v);
bool is_skin_required();
void set_skin_required(bool v);
Color get_color();

View File

@ -28,7 +28,6 @@
*****************************************************************************/
#include "SpineCollisionShapeProxy.h"
#include "SpineSprite.h"
void SpineCollisionShapeProxy::_bind_methods() {

View File

@ -31,7 +31,7 @@
#define GODOT_SPINECOLLISIONSHAPEPROXY_H
#include "scene/2d/collision_polygon_2d.h"
#include <spine/spine.h>
#include <spine/Slot.h>
class SpineSprite;
class SpineAnimationState;

View File

@ -28,8 +28,8 @@
*****************************************************************************/
#include "SpineConstraintData.h"
#include <spine/ConstraintData.h>
#include "SpineCommon.h"
#include <spine/ConstraintData.h>
void SpineConstraintData::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_constraint_name"), &SpineConstraintData::get_constraint_name);

View File

@ -29,7 +29,6 @@
#ifdef TOOLS_ENABLED
#include "SpineEditorPlugin.h"
#include "SpineAtlasResource.h"
#include "SpineSkeletonFileResource.h"
@ -118,7 +117,7 @@ void SpineEditorPropertyAnimationMixes::add_mix() {
mix->set_from(animation_names[0]);
mix->set_to(animation_names[0]);
mix->set_mix(0);
Array mixes = skeleton_data->get_animation_mixes().duplicate();
mixes.push_back(mix);
emit_changed(get_edited_property(), mixes);
@ -142,7 +141,7 @@ void SpineEditorPropertyAnimationMixes::update_property() {
updating = true;
mix_properties.clear();
if (container) {
set_bottom_editor(nullptr);
memdelete(container);
@ -154,14 +153,14 @@ void SpineEditorPropertyAnimationMixes::update_property() {
updating = false;
return;
}
Vector<String> animation_names;
skeleton_data->get_animation_names(animation_names);
container = memnew(VBoxContainer);
add_child(container);
set_bottom_editor(container);
Array mixes = skeleton_data->get_animation_mixes();
array_object->set_array(mixes);
for (int i = 0; i < mixes.size(); i++) {
@ -171,7 +170,7 @@ void SpineEditorPropertyAnimationMixes::update_property() {
auto hbox = memnew(HBoxContainer);
hbox->set_h_size_flags(SIZE_EXPAND_FILL);
container->add_child(hbox);
auto mix_property = memnew(SpineEditorPropertyAnimationMix);
mix_property->set_h_size_flags(SIZE_EXPAND_FILL);
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->update_property();
mix_properties.push_back(mix_property);
auto delete_button = memnew(Button);
hbox->add_child(delete_button);
delete_button->set_text("Remove");
@ -228,7 +227,7 @@ void SpineEditorPropertyAnimationMix::data_changed(const String &property, Varia
void SpineEditorPropertyAnimationMix::update_property() {
if (updating) return;
updating = true;
if (container) {
memdelete(container);
container->queue_delete();
@ -245,14 +244,14 @@ void SpineEditorPropertyAnimationMix::update_property() {
updating = false;
return;
}
Vector<String> animation_names;
skeleton_data->get_animation_names(animation_names);
container = memnew(HBoxContainer);
container->set_h_size_flags(SIZE_EXPAND_FILL);
add_child(container);
auto from_enum = memnew(EditorPropertyTextEnum);
from_enum->set_h_size_flags(SIZE_EXPAND_FILL);
from_enum->set_name_split_ratio(0);
@ -282,7 +281,7 @@ void SpineEditorPropertyAnimationMix::update_property() {
mix_float->update_property();
mix_float->connect("property_changed", this, "data_changed");
container->add_child(mix_float);
updating = false;
}

View File

@ -32,8 +32,8 @@
#include "editor/editor_properties_array_dict.h"
#ifdef TOOLS_ENABLED
#include "editor/editor_node.h"
#include "SpineSprite.h"
#include "editor/editor_node.h"
#include "editor/editor_properties.h"
class SpineAtlasResourceImportPlugin : public EditorImportPlugin {

View File

@ -32,11 +32,11 @@
#include "SpineSlotData.h"
#include "SpineAttachment.h"
#include "SpineBone.h"
// Breaks cyclic dependency.
class SpineSkeleton;
class SpineBone;
class SpineSlot : public Reference {
GDCLASS(SpineSlot, Reference);

View File

@ -30,8 +30,8 @@
#ifndef GODOT_SPINESLOTDATA_H
#define GODOT_SPINESLOTDATA_H
#include "core/object.h"
#include "SpineBoneData.h"
#include "core/object.h"
#include <spine/SlotData.h>
class SpineSlotData : public Reference {

View File

@ -30,12 +30,11 @@
#ifndef GODOT_SPINESPRITE_H
#define GODOT_SPINESPRITE_H
#include "scene/2d/node_2d.h"
#include "scene/resources/texture.h"
#include "SpineSkeleton.h"
#include "SpineAnimationState.h"
#include "scene/2d/node_2d.h"
#include "scene/2d/mesh_instance_2d.h"
#include "scene/resources/texture.h"
class SpineSprite : public Node2D, public spine::AnimationStateListenerObject {
GDCLASS(SpineSprite, Node2D);

View File

@ -32,6 +32,7 @@
#include "SpineTransformConstraintData.h"
#include "SpineBone.h"
#include <spine/TransformConstraint.h>
class SpineTransformConstraint : public Reference {
GDCLASS(SpineTransformConstraint, Reference);