mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
[godot] Make SpineObjectWrapper a RefCounted, fix up type hierarchy.
This commit is contained in:
parent
e807ef406c
commit
6ad83c94a8
@ -39,8 +39,8 @@ class SpineSkeleton;
|
||||
class SpineTimeline;
|
||||
class SpineSkeletonDataResource;
|
||||
|
||||
class SpineAnimation : public REFCOUNTED, public SpineObjectWrapper<SpineSkeletonDataResource, spine::Animation> {
|
||||
GDCLASS(SpineAnimation, REFCOUNTED);
|
||||
class SpineAnimation : public SpineObjectWrapper<SpineSkeletonDataResource, spine::Animation> {
|
||||
GDCLASS(SpineAnimation, SpineObjectWrapper)
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
@ -35,8 +35,8 @@
|
||||
|
||||
class SpineSkeletonDataResource;
|
||||
|
||||
class SpineAttachment : public REFCOUNTED, public SpineObjectWrapper<SpineSkeletonDataResource, spine::Attachment> {
|
||||
GDCLASS(SpineAttachment, REFCOUNTED)
|
||||
class SpineAttachment : public SpineObjectWrapper<SpineSkeletonDataResource, spine::Attachment> {
|
||||
GDCLASS(SpineAttachment, SpineObjectWrapper)
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
@ -38,8 +38,8 @@
|
||||
class SpineSkeleton;
|
||||
class SpineSprite;
|
||||
|
||||
class SpineBone : public REFCOUNTED, public SpineObjectWrapper<SpineSprite, spine::Bone> {
|
||||
GDCLASS(SpineBone, REFCOUNTED)
|
||||
class SpineBone : public SpineObjectWrapper<SpineSprite, spine::Bone> {
|
||||
GDCLASS(SpineBone, SpineObjectWrapper)
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
@ -36,8 +36,8 @@
|
||||
|
||||
class SpineSkeletonDataResource;
|
||||
|
||||
class SpineBoneData : public REFCOUNTED, public SpineObjectWrapper<SpineSkeletonDataResource, spine::BoneData> {
|
||||
GDCLASS(SpineBoneData, REFCOUNTED)
|
||||
class SpineBoneData : public SpineObjectWrapper<SpineSkeletonDataResource, spine::BoneData> {
|
||||
GDCLASS(SpineBoneData, SpineObjectWrapper)
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
@ -35,8 +35,8 @@
|
||||
|
||||
class SpineSkeletonDataResource;
|
||||
|
||||
class SpineConstraintData : public REFCOUNTED, public SpineObjectWrapper<SpineSkeletonDataResource, spine::ConstraintData> {
|
||||
GDCLASS(SpineConstraintData, REFCOUNTED)
|
||||
class SpineConstraintData : public SpineObjectWrapper<SpineSkeletonDataResource, spine::ConstraintData> {
|
||||
GDCLASS(SpineConstraintData, SpineObjectWrapper)
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
@ -36,8 +36,8 @@
|
||||
class SpineBone;
|
||||
class SpineSprite;
|
||||
|
||||
class SpineIkConstraint : public REFCOUNTED, public SpineObjectWrapper<SpineSprite, spine::IkConstraint> {
|
||||
GDCLASS(SpineIkConstraint, REFCOUNTED);
|
||||
class SpineIkConstraint : public SpineObjectWrapper<SpineSprite, spine::IkConstraint> {
|
||||
GDCLASS(SpineIkConstraint, SpineObjectWrapper)
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
33
spine-godot/spine_godot/SpineObjectWrapper.cpp
Normal file
33
spine-godot/spine_godot/SpineObjectWrapper.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated January 1, 2020. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2020, Esoteric Software LLC
|
||||
*
|
||||
* Integration of the Spine Runtimes into software or otherwise creating
|
||||
* derivative works of the Spine Runtimes is permitted under the terms and
|
||||
* conditions of Section 2 of the Spine Editor License Agreement:
|
||||
* http://esotericsoftware.com/spine-editor-license
|
||||
*
|
||||
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
* "Products"), provided that each user of the Products must obtain their own
|
||||
* Spine Editor license and redistribution of the Products in any form must
|
||||
* include this license and copyright notice.
|
||||
*
|
||||
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "SpineObjectWrapper.h"
|
||||
|
||||
|
||||
|
||||
@ -30,7 +30,9 @@
|
||||
#ifndef GODOT_SPINEOBJECTWRAPPER_H
|
||||
#define GODOT_SPINEOBJECTWRAPPER_H
|
||||
|
||||
template <typename OWNER, typename OBJECT> class SpineObjectWrapper {
|
||||
#include "SpineCommon.h"
|
||||
|
||||
template <typename OWNER, typename OBJECT> class SpineObjectWrapper: public REFCOUNTED {
|
||||
protected:
|
||||
Object *owner;
|
||||
OBJECT *spine_object;
|
||||
|
||||
@ -34,8 +34,8 @@
|
||||
#include "SpineSlot.h"
|
||||
#include <spine/PathConstraint.h>
|
||||
|
||||
class SpinePathConstraint : public REFCOUNTED, public SpineObjectWrapper<SpineSprite, spine::PathConstraint> {
|
||||
GDCLASS(SpinePathConstraint, REFCOUNTED);
|
||||
class SpinePathConstraint : public SpineObjectWrapper<SpineSprite, spine::PathConstraint> {
|
||||
GDCLASS(SpinePathConstraint, SpineObjectWrapper)
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
#include <spine/PathConstraintData.h>
|
||||
|
||||
class SpinePathConstraintData : public SpineConstraintData {
|
||||
GDCLASS(SpinePathConstraintData, SpineConstraintData);
|
||||
GDCLASS(SpinePathConstraintData, SpineConstraintData)
|
||||
|
||||
spine::PathConstraintData *get_spine_constraint_data() { return (spine::PathConstraintData *)get_spine_object(); }
|
||||
|
||||
|
||||
@ -36,8 +36,8 @@
|
||||
class SpineSkeletonDataResource;
|
||||
class SpineSprite;
|
||||
|
||||
class SpineSkin : public REFCOUNTED, public SpineObjectWrapper<SpineSkeletonDataResource, spine::Skin> {
|
||||
GDCLASS(SpineSkin, REFCOUNTED);
|
||||
class SpineSkin : public SpineObjectWrapper<SpineSkeletonDataResource, spine::Skin> {
|
||||
GDCLASS(SpineSkin, SpineObjectWrapper)
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
@ -35,12 +35,11 @@
|
||||
#include "SpineAttachment.h"
|
||||
#include "SpineBone.h"
|
||||
|
||||
// Breaks cyclic dependency.
|
||||
class SpineSkeleton;
|
||||
class SpineSprite;
|
||||
|
||||
class SpineSlot : public REFCOUNTED, public SpineObjectWrapper<SpineSprite, spine::Slot> {
|
||||
GDCLASS(SpineSlot, REFCOUNTED)
|
||||
class SpineSlot : public SpineObjectWrapper<SpineSprite, spine::Slot> {
|
||||
GDCLASS(SpineSlot, SpineObjectWrapper)
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
@ -36,8 +36,8 @@
|
||||
|
||||
class SpineSkeletonDataResource;
|
||||
|
||||
class SpineSlotData : public REFCOUNTED, public SpineObjectWrapper<SpineSkeletonDataResource, spine::SlotData> {
|
||||
GDCLASS(SpineSlotData, REFCOUNTED)
|
||||
class SpineSlotData : public SpineObjectWrapper<SpineSkeletonDataResource, spine::SlotData> {
|
||||
GDCLASS(SpineSlotData, SpineObjectWrapper)
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
@ -37,8 +37,8 @@
|
||||
|
||||
#include "SpineSprite.h"
|
||||
|
||||
class SpineTrackEntry : public REFCOUNTED, public SpineObjectWrapper<SpineSprite, spine::TrackEntry> {
|
||||
GDCLASS(SpineTrackEntry, REFCOUNTED);
|
||||
class SpineTrackEntry : public SpineObjectWrapper<SpineSprite, spine::TrackEntry> {
|
||||
GDCLASS(SpineTrackEntry, SpineObjectWrapper);
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
@ -35,8 +35,8 @@
|
||||
#include "SpineBone.h"
|
||||
#include <spine/TransformConstraint.h>
|
||||
|
||||
class SpineTransformConstraint : public REFCOUNTED, public SpineObjectWrapper<SpineSprite, spine::TransformConstraint> {
|
||||
GDCLASS(SpineTransformConstraint, REFCOUNTED)
|
||||
class SpineTransformConstraint : public SpineObjectWrapper<SpineSprite, spine::TransformConstraint> {
|
||||
GDCLASS(SpineTransformConstraint, SpineObjectWrapper)
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
#include <spine/TransformConstraintData.h>
|
||||
|
||||
class SpineTransformConstraintData : public SpineConstraintData {
|
||||
GDCLASS(SpineTransformConstraintData, SpineConstraintData);
|
||||
GDCLASS(SpineTransformConstraintData, SpineConstraintData)
|
||||
|
||||
spine::TransformConstraintData *get_spine_constraint_data() { return (spine::TransformConstraintData *) SpineConstraintData::get_spine_object(); }
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user