mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34: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 SpineTimeline;
|
||||||
class SpineSkeletonDataResource;
|
class SpineSkeletonDataResource;
|
||||||
|
|
||||||
class SpineAnimation : public REFCOUNTED, public SpineObjectWrapper<SpineSkeletonDataResource, spine::Animation> {
|
class SpineAnimation : public SpineObjectWrapper<SpineSkeletonDataResource, spine::Animation> {
|
||||||
GDCLASS(SpineAnimation, REFCOUNTED);
|
GDCLASS(SpineAnimation, SpineObjectWrapper)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|||||||
@ -35,8 +35,8 @@
|
|||||||
|
|
||||||
class SpineSkeletonDataResource;
|
class SpineSkeletonDataResource;
|
||||||
|
|
||||||
class SpineAttachment : public REFCOUNTED, public SpineObjectWrapper<SpineSkeletonDataResource, spine::Attachment> {
|
class SpineAttachment : public SpineObjectWrapper<SpineSkeletonDataResource, spine::Attachment> {
|
||||||
GDCLASS(SpineAttachment, REFCOUNTED)
|
GDCLASS(SpineAttachment, SpineObjectWrapper)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|||||||
@ -38,8 +38,8 @@
|
|||||||
class SpineSkeleton;
|
class SpineSkeleton;
|
||||||
class SpineSprite;
|
class SpineSprite;
|
||||||
|
|
||||||
class SpineBone : public REFCOUNTED, public SpineObjectWrapper<SpineSprite, spine::Bone> {
|
class SpineBone : public SpineObjectWrapper<SpineSprite, spine::Bone> {
|
||||||
GDCLASS(SpineBone, REFCOUNTED)
|
GDCLASS(SpineBone, SpineObjectWrapper)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|||||||
@ -36,8 +36,8 @@
|
|||||||
|
|
||||||
class SpineSkeletonDataResource;
|
class SpineSkeletonDataResource;
|
||||||
|
|
||||||
class SpineBoneData : public REFCOUNTED, public SpineObjectWrapper<SpineSkeletonDataResource, spine::BoneData> {
|
class SpineBoneData : public SpineObjectWrapper<SpineSkeletonDataResource, spine::BoneData> {
|
||||||
GDCLASS(SpineBoneData, REFCOUNTED)
|
GDCLASS(SpineBoneData, SpineObjectWrapper)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|||||||
@ -35,8 +35,8 @@
|
|||||||
|
|
||||||
class SpineSkeletonDataResource;
|
class SpineSkeletonDataResource;
|
||||||
|
|
||||||
class SpineConstraintData : public REFCOUNTED, public SpineObjectWrapper<SpineSkeletonDataResource, spine::ConstraintData> {
|
class SpineConstraintData : public SpineObjectWrapper<SpineSkeletonDataResource, spine::ConstraintData> {
|
||||||
GDCLASS(SpineConstraintData, REFCOUNTED)
|
GDCLASS(SpineConstraintData, SpineObjectWrapper)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|||||||
@ -36,8 +36,8 @@
|
|||||||
class SpineBone;
|
class SpineBone;
|
||||||
class SpineSprite;
|
class SpineSprite;
|
||||||
|
|
||||||
class SpineIkConstraint : public REFCOUNTED, public SpineObjectWrapper<SpineSprite, spine::IkConstraint> {
|
class SpineIkConstraint : public SpineObjectWrapper<SpineSprite, spine::IkConstraint> {
|
||||||
GDCLASS(SpineIkConstraint, REFCOUNTED);
|
GDCLASS(SpineIkConstraint, SpineObjectWrapper)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
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
|
#ifndef GODOT_SPINEOBJECTWRAPPER_H
|
||||||
#define 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:
|
protected:
|
||||||
Object *owner;
|
Object *owner;
|
||||||
OBJECT *spine_object;
|
OBJECT *spine_object;
|
||||||
|
|||||||
@ -34,8 +34,8 @@
|
|||||||
#include "SpineSlot.h"
|
#include "SpineSlot.h"
|
||||||
#include <spine/PathConstraint.h>
|
#include <spine/PathConstraint.h>
|
||||||
|
|
||||||
class SpinePathConstraint : public REFCOUNTED, public SpineObjectWrapper<SpineSprite, spine::PathConstraint> {
|
class SpinePathConstraint : public SpineObjectWrapper<SpineSprite, spine::PathConstraint> {
|
||||||
GDCLASS(SpinePathConstraint, REFCOUNTED);
|
GDCLASS(SpinePathConstraint, SpineObjectWrapper)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
#include <spine/PathConstraintData.h>
|
#include <spine/PathConstraintData.h>
|
||||||
|
|
||||||
class SpinePathConstraintData : public SpineConstraintData {
|
class SpinePathConstraintData : public SpineConstraintData {
|
||||||
GDCLASS(SpinePathConstraintData, SpineConstraintData);
|
GDCLASS(SpinePathConstraintData, SpineConstraintData)
|
||||||
|
|
||||||
spine::PathConstraintData *get_spine_constraint_data() { return (spine::PathConstraintData *)get_spine_object(); }
|
spine::PathConstraintData *get_spine_constraint_data() { return (spine::PathConstraintData *)get_spine_object(); }
|
||||||
|
|
||||||
|
|||||||
@ -36,8 +36,8 @@
|
|||||||
class SpineSkeletonDataResource;
|
class SpineSkeletonDataResource;
|
||||||
class SpineSprite;
|
class SpineSprite;
|
||||||
|
|
||||||
class SpineSkin : public REFCOUNTED, public SpineObjectWrapper<SpineSkeletonDataResource, spine::Skin> {
|
class SpineSkin : public SpineObjectWrapper<SpineSkeletonDataResource, spine::Skin> {
|
||||||
GDCLASS(SpineSkin, REFCOUNTED);
|
GDCLASS(SpineSkin, SpineObjectWrapper)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|||||||
@ -35,12 +35,11 @@
|
|||||||
#include "SpineAttachment.h"
|
#include "SpineAttachment.h"
|
||||||
#include "SpineBone.h"
|
#include "SpineBone.h"
|
||||||
|
|
||||||
// Breaks cyclic dependency.
|
|
||||||
class SpineSkeleton;
|
class SpineSkeleton;
|
||||||
class SpineSprite;
|
class SpineSprite;
|
||||||
|
|
||||||
class SpineSlot : public REFCOUNTED, public SpineObjectWrapper<SpineSprite, spine::Slot> {
|
class SpineSlot : public SpineObjectWrapper<SpineSprite, spine::Slot> {
|
||||||
GDCLASS(SpineSlot, REFCOUNTED)
|
GDCLASS(SpineSlot, SpineObjectWrapper)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|||||||
@ -36,8 +36,8 @@
|
|||||||
|
|
||||||
class SpineSkeletonDataResource;
|
class SpineSkeletonDataResource;
|
||||||
|
|
||||||
class SpineSlotData : public REFCOUNTED, public SpineObjectWrapper<SpineSkeletonDataResource, spine::SlotData> {
|
class SpineSlotData : public SpineObjectWrapper<SpineSkeletonDataResource, spine::SlotData> {
|
||||||
GDCLASS(SpineSlotData, REFCOUNTED)
|
GDCLASS(SpineSlotData, SpineObjectWrapper)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|||||||
@ -37,8 +37,8 @@
|
|||||||
|
|
||||||
#include "SpineSprite.h"
|
#include "SpineSprite.h"
|
||||||
|
|
||||||
class SpineTrackEntry : public REFCOUNTED, public SpineObjectWrapper<SpineSprite, spine::TrackEntry> {
|
class SpineTrackEntry : public SpineObjectWrapper<SpineSprite, spine::TrackEntry> {
|
||||||
GDCLASS(SpineTrackEntry, REFCOUNTED);
|
GDCLASS(SpineTrackEntry, SpineObjectWrapper);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|||||||
@ -35,8 +35,8 @@
|
|||||||
#include "SpineBone.h"
|
#include "SpineBone.h"
|
||||||
#include <spine/TransformConstraint.h>
|
#include <spine/TransformConstraint.h>
|
||||||
|
|
||||||
class SpineTransformConstraint : public REFCOUNTED, public SpineObjectWrapper<SpineSprite, spine::TransformConstraint> {
|
class SpineTransformConstraint : public SpineObjectWrapper<SpineSprite, spine::TransformConstraint> {
|
||||||
GDCLASS(SpineTransformConstraint, REFCOUNTED)
|
GDCLASS(SpineTransformConstraint, SpineObjectWrapper)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
#include <spine/TransformConstraintData.h>
|
#include <spine/TransformConstraintData.h>
|
||||||
|
|
||||||
class SpineTransformConstraintData : public SpineConstraintData {
|
class SpineTransformConstraintData : public SpineConstraintData {
|
||||||
GDCLASS(SpineTransformConstraintData, SpineConstraintData);
|
GDCLASS(SpineTransformConstraintData, SpineConstraintData)
|
||||||
|
|
||||||
spine::TransformConstraintData *get_spine_constraint_data() { return (spine::TransformConstraintData *) SpineConstraintData::get_spine_object(); }
|
spine::TransformConstraintData *get_spine_constraint_data() { return (spine::TransformConstraintData *) SpineConstraintData::get_spine_object(); }
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user