mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 02:06:03 +08:00
[c] Constructor nullability.
This commit is contained in:
parent
854b6f9a2a
commit
85aab233ee
@ -251,7 +251,7 @@ void spine_atlas_result_dispose(spine_atlas_result result) {
|
||||
spine_skeleton_data_result spine_skeleton_data_load_json(spine_atlas atlas, const char *skeletonData, const char *path) {
|
||||
if (!atlas || !skeletonData) return nullptr;
|
||||
_spine_skeleton_data_result *result = SpineExtension::calloc<_spine_skeleton_data_result>(1, __FILE__, __LINE__);
|
||||
SkeletonJson json((Atlas *) atlas);
|
||||
SkeletonJson json(*(Atlas *) atlas);
|
||||
json.setScale(1);
|
||||
|
||||
SkeletonData *data = json.readSkeletonData(skeletonData);
|
||||
@ -287,7 +287,7 @@ spine_skeleton_data_result spine_skeleton_data_load_json(spine_atlas atlas, cons
|
||||
spine_skeleton_data_result spine_skeleton_data_load_binary(spine_atlas atlas, const uint8_t *skeletonData, int32_t length, const char *path) {
|
||||
if (!atlas || !skeletonData) return nullptr;
|
||||
_spine_skeleton_data_result *result = SpineExtension::calloc<_spine_skeleton_data_result>(1, __FILE__, __LINE__);
|
||||
SkeletonBinary binary((Atlas *) atlas);
|
||||
SkeletonBinary binary(*(Atlas *) atlas);
|
||||
binary.setScale(1);
|
||||
|
||||
SkeletonData *data = binary.readSkeletonData((const unsigned char *) skeletonData, length);
|
||||
@ -345,8 +345,8 @@ spine_skeleton_drawable spine_skeleton_drawable_create(spine_skeleton_data skele
|
||||
_spine_skeleton_drawable *drawable = new (__FILE__, __LINE__) _spine_skeleton_drawable();
|
||||
|
||||
Skeleton *skeleton = new (__FILE__, __LINE__) Skeleton(*((SkeletonData *) skeletonData));
|
||||
AnimationStateData *stateData = new (__FILE__, __LINE__) AnimationStateData((SkeletonData *) skeletonData);
|
||||
AnimationState *state = new (__FILE__, __LINE__) AnimationState(stateData);
|
||||
AnimationStateData *stateData = new (__FILE__, __LINE__) AnimationStateData(*(SkeletonData *) skeletonData);
|
||||
AnimationState *state = new (__FILE__, __LINE__) AnimationState(*stateData);
|
||||
EventListener *listener = new (__FILE__, __LINE__) EventListener();
|
||||
state->setListener(listener);
|
||||
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_animation_state spine_animation_state_create(/*@null*/ spine_animation_state_data data) {
|
||||
return (spine_animation_state) new (__FILE__, __LINE__) AnimationState((AnimationStateData *) data);
|
||||
spine_animation_state spine_animation_state_create(spine_animation_state_data data) {
|
||||
return (spine_animation_state) new (__FILE__, __LINE__) AnimationState(*((AnimationStateData *) data));
|
||||
}
|
||||
|
||||
void spine_animation_state_dispose(spine_animation_state self) {
|
||||
@ -36,10 +36,9 @@ spine_track_entry spine_animation_state_set_animation_1(spine_animation_state se
|
||||
return (spine_track_entry) &_self->setAnimation(trackIndex, String(animationName), loop);
|
||||
}
|
||||
|
||||
spine_track_entry spine_animation_state_set_animation_2(spine_animation_state self, size_t trackIndex, /*@null*/ spine_animation animation,
|
||||
bool loop) {
|
||||
spine_track_entry spine_animation_state_set_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, bool loop) {
|
||||
AnimationState *_self = (AnimationState *) self;
|
||||
return (spine_track_entry) &_self->setAnimation(trackIndex, (Animation *) animation, loop);
|
||||
return (spine_track_entry) &_self->setAnimation(trackIndex, *((Animation *) animation), loop);
|
||||
}
|
||||
|
||||
spine_track_entry spine_animation_state_add_animation_1(spine_animation_state self, size_t trackIndex, const char *animationName, bool loop,
|
||||
@ -48,10 +47,10 @@ spine_track_entry spine_animation_state_add_animation_1(spine_animation_state se
|
||||
return (spine_track_entry) &_self->addAnimation(trackIndex, String(animationName), loop, delay);
|
||||
}
|
||||
|
||||
spine_track_entry spine_animation_state_add_animation_2(spine_animation_state self, size_t trackIndex, /*@null*/ spine_animation animation, bool loop,
|
||||
spine_track_entry spine_animation_state_add_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation, bool loop,
|
||||
float delay) {
|
||||
AnimationState *_self = (AnimationState *) self;
|
||||
return (spine_track_entry) &_self->addAnimation(trackIndex, (Animation *) animation, loop, delay);
|
||||
return (spine_track_entry) &_self->addAnimation(trackIndex, *((Animation *) animation), loop, delay);
|
||||
}
|
||||
|
||||
spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration) {
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SPINE_C_API spine_animation_state spine_animation_state_create(/*@null*/ spine_animation_state_data data);
|
||||
SPINE_C_API spine_animation_state spine_animation_state_create(spine_animation_state_data data);
|
||||
|
||||
SPINE_C_API void spine_animation_state_dispose(spine_animation_state self);
|
||||
|
||||
@ -19,12 +19,12 @@ SPINE_C_API void spine_animation_state_clear_tracks(spine_animation_state self);
|
||||
SPINE_C_API void spine_animation_state_clear_track(spine_animation_state self, size_t trackIndex);
|
||||
SPINE_C_API spine_track_entry spine_animation_state_set_animation_1(spine_animation_state self, size_t trackIndex, const char *animationName,
|
||||
bool loop);
|
||||
SPINE_C_API spine_track_entry spine_animation_state_set_animation_2(spine_animation_state self, size_t trackIndex,
|
||||
/*@null*/ spine_animation animation, bool loop);
|
||||
SPINE_C_API spine_track_entry spine_animation_state_set_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation,
|
||||
bool loop);
|
||||
SPINE_C_API spine_track_entry spine_animation_state_add_animation_1(spine_animation_state self, size_t trackIndex, const char *animationName,
|
||||
bool loop, float delay);
|
||||
SPINE_C_API spine_track_entry spine_animation_state_add_animation_2(spine_animation_state self, size_t trackIndex,
|
||||
/*@null*/ spine_animation animation, bool loop, float delay);
|
||||
SPINE_C_API spine_track_entry spine_animation_state_add_animation_2(spine_animation_state self, size_t trackIndex, spine_animation animation,
|
||||
bool loop, float delay);
|
||||
SPINE_C_API spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration);
|
||||
SPINE_C_API spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state self, size_t trackIndex, float mixDuration,
|
||||
float delay);
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_animation_state_data spine_animation_state_data_create(/*@null*/ spine_skeleton_data skeletonData) {
|
||||
return (spine_animation_state_data) new (__FILE__, __LINE__) AnimationStateData((SkeletonData *) skeletonData);
|
||||
spine_animation_state_data spine_animation_state_data_create(spine_skeleton_data skeletonData) {
|
||||
return (spine_animation_state_data) new (__FILE__, __LINE__) AnimationStateData(*((SkeletonData *) skeletonData));
|
||||
}
|
||||
|
||||
void spine_animation_state_data_dispose(spine_animation_state_data self) {
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SPINE_C_API spine_animation_state_data spine_animation_state_data_create(/*@null*/ spine_skeleton_data skeletonData);
|
||||
SPINE_C_API spine_animation_state_data spine_animation_state_data_create(spine_skeleton_data skeletonData);
|
||||
|
||||
SPINE_C_API void spine_animation_state_data_dispose(spine_animation_state_data self);
|
||||
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_atlas_attachment_loader spine_atlas_attachment_loader_create(/*@null*/ spine_atlas atlas) {
|
||||
return (spine_atlas_attachment_loader) new (__FILE__, __LINE__) AtlasAttachmentLoader((Atlas *) atlas);
|
||||
spine_atlas_attachment_loader spine_atlas_attachment_loader_create(spine_atlas atlas) {
|
||||
return (spine_atlas_attachment_loader) new (__FILE__, __LINE__) AtlasAttachmentLoader(*((Atlas *) atlas));
|
||||
}
|
||||
|
||||
void spine_atlas_attachment_loader_dispose(spine_atlas_attachment_loader self) {
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SPINE_C_API spine_atlas_attachment_loader spine_atlas_attachment_loader_create(/*@null*/ spine_atlas atlas);
|
||||
SPINE_C_API spine_atlas_attachment_loader spine_atlas_attachment_loader_create(spine_atlas atlas);
|
||||
|
||||
SPINE_C_API void spine_atlas_attachment_loader_dispose(spine_atlas_attachment_loader self);
|
||||
|
||||
|
||||
@ -3,9 +3,8 @@
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_deform_timeline spine_deform_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex,
|
||||
/*@null*/ spine_vertex_attachment attachment) {
|
||||
return (spine_deform_timeline) new (__FILE__, __LINE__) DeformTimeline(frameCount, bezierCount, slotIndex, (VertexAttachment *) attachment);
|
||||
spine_deform_timeline spine_deform_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex, spine_vertex_attachment attachment) {
|
||||
return (spine_deform_timeline) new (__FILE__, __LINE__) DeformTimeline(frameCount, bezierCount, slotIndex, *((VertexAttachment *) attachment));
|
||||
}
|
||||
|
||||
void spine_deform_timeline_dispose(spine_deform_timeline self) {
|
||||
|
||||
@ -10,7 +10,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
SPINE_C_API spine_deform_timeline spine_deform_timeline_create(size_t frameCount, size_t bezierCount, int slotIndex,
|
||||
/*@null*/ spine_vertex_attachment attachment);
|
||||
spine_vertex_attachment attachment);
|
||||
|
||||
SPINE_C_API void spine_deform_timeline_dispose(spine_deform_timeline self);
|
||||
|
||||
|
||||
@ -3,15 +3,16 @@
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_linked_mesh spine_linked_mesh_create(/*@null*/ spine_mesh_attachment mesh, const int skinIndex, size_t slotIndex, const char *parent,
|
||||
spine_linked_mesh spine_linked_mesh_create(spine_mesh_attachment mesh, const int skinIndex, size_t slotIndex, const char *parent,
|
||||
bool inheritTimelines) {
|
||||
return (spine_linked_mesh) new (__FILE__, __LINE__) LinkedMesh((MeshAttachment *) mesh, skinIndex, slotIndex, String(parent), inheritTimelines);
|
||||
return (spine_linked_mesh) new (__FILE__, __LINE__)
|
||||
LinkedMesh(*((MeshAttachment *) mesh), skinIndex, slotIndex, String(parent), inheritTimelines);
|
||||
}
|
||||
|
||||
spine_linked_mesh spine_linked_mesh_create2(/*@null*/ spine_mesh_attachment mesh, const char *skin, size_t slotIndex, const char *parent,
|
||||
spine_linked_mesh spine_linked_mesh_create2(spine_mesh_attachment mesh, const char *skin, size_t slotIndex, const char *parent,
|
||||
bool inheritTimelines) {
|
||||
return (spine_linked_mesh) new (__FILE__, __LINE__)
|
||||
LinkedMesh((MeshAttachment *) mesh, String(skin), slotIndex, String(parent), inheritTimelines);
|
||||
LinkedMesh(*((MeshAttachment *) mesh), String(skin), slotIndex, String(parent), inheritTimelines);
|
||||
}
|
||||
|
||||
void spine_linked_mesh_dispose(spine_linked_mesh self) {
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SPINE_C_API spine_linked_mesh spine_linked_mesh_create(/*@null*/ spine_mesh_attachment mesh, const int skinIndex, size_t slotIndex,
|
||||
const char *parent, bool inheritTimelines);
|
||||
SPINE_C_API spine_linked_mesh spine_linked_mesh_create2(/*@null*/ spine_mesh_attachment mesh, const char *skin, size_t slotIndex, const char *parent,
|
||||
SPINE_C_API spine_linked_mesh spine_linked_mesh_create(spine_mesh_attachment mesh, const int skinIndex, size_t slotIndex, const char *parent,
|
||||
bool inheritTimelines);
|
||||
SPINE_C_API spine_linked_mesh spine_linked_mesh_create2(spine_mesh_attachment mesh, const char *skin, size_t slotIndex, const char *parent,
|
||||
bool inheritTimelines);
|
||||
|
||||
SPINE_C_API void spine_linked_mesh_dispose(spine_linked_mesh self);
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_sequence_timeline spine_sequence_timeline_create(size_t frameCount, int slotIndex, /*@null*/ spine_attachment attachment) {
|
||||
return (spine_sequence_timeline) new (__FILE__, __LINE__) SequenceTimeline(frameCount, slotIndex, (Attachment *) attachment);
|
||||
spine_sequence_timeline spine_sequence_timeline_create(size_t frameCount, int slotIndex, spine_attachment attachment) {
|
||||
return (spine_sequence_timeline) new (__FILE__, __LINE__) SequenceTimeline(frameCount, slotIndex, *((Attachment *) attachment));
|
||||
}
|
||||
|
||||
void spine_sequence_timeline_dispose(spine_sequence_timeline self) {
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SPINE_C_API spine_sequence_timeline spine_sequence_timeline_create(size_t frameCount, int slotIndex, /*@null*/ spine_attachment attachment);
|
||||
SPINE_C_API spine_sequence_timeline spine_sequence_timeline_create(size_t frameCount, int slotIndex, spine_attachment attachment);
|
||||
|
||||
SPINE_C_API void spine_sequence_timeline_dispose(spine_sequence_timeline self);
|
||||
|
||||
|
||||
@ -3,12 +3,12 @@
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_skeleton_binary spine_skeleton_binary_create(/*@null*/ spine_atlas atlas) {
|
||||
return (spine_skeleton_binary) new (__FILE__, __LINE__) SkeletonBinary((Atlas *) atlas);
|
||||
spine_skeleton_binary spine_skeleton_binary_create(spine_atlas atlas) {
|
||||
return (spine_skeleton_binary) new (__FILE__, __LINE__) SkeletonBinary(*((Atlas *) atlas));
|
||||
}
|
||||
|
||||
spine_skeleton_binary spine_skeleton_binary_create2(/*@null*/ spine_attachment_loader attachmentLoader, bool ownsLoader) {
|
||||
return (spine_skeleton_binary) new (__FILE__, __LINE__) SkeletonBinary((AttachmentLoader *) attachmentLoader, ownsLoader);
|
||||
spine_skeleton_binary spine_skeleton_binary_create2(spine_attachment_loader attachmentLoader, bool ownsLoader) {
|
||||
return (spine_skeleton_binary) new (__FILE__, __LINE__) SkeletonBinary(*((AttachmentLoader *) attachmentLoader), ownsLoader);
|
||||
}
|
||||
|
||||
void spine_skeleton_binary_dispose(spine_skeleton_binary self) {
|
||||
|
||||
@ -9,8 +9,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SPINE_C_API spine_skeleton_binary spine_skeleton_binary_create(/*@null*/ spine_atlas atlas);
|
||||
SPINE_C_API spine_skeleton_binary spine_skeleton_binary_create2(/*@null*/ spine_attachment_loader attachmentLoader, bool ownsLoader);
|
||||
SPINE_C_API spine_skeleton_binary spine_skeleton_binary_create(spine_atlas atlas);
|
||||
SPINE_C_API spine_skeleton_binary spine_skeleton_binary_create2(spine_attachment_loader attachmentLoader, bool ownsLoader);
|
||||
|
||||
SPINE_C_API void spine_skeleton_binary_dispose(spine_skeleton_binary self);
|
||||
|
||||
|
||||
@ -3,12 +3,12 @@
|
||||
|
||||
using namespace spine;
|
||||
|
||||
spine_skeleton_json spine_skeleton_json_create(/*@null*/ spine_atlas atlas) {
|
||||
return (spine_skeleton_json) new (__FILE__, __LINE__) SkeletonJson((Atlas *) atlas);
|
||||
spine_skeleton_json spine_skeleton_json_create(spine_atlas atlas) {
|
||||
return (spine_skeleton_json) new (__FILE__, __LINE__) SkeletonJson(*((Atlas *) atlas));
|
||||
}
|
||||
|
||||
spine_skeleton_json spine_skeleton_json_create2(/*@null*/ spine_attachment_loader attachmentLoader, bool ownsLoader) {
|
||||
return (spine_skeleton_json) new (__FILE__, __LINE__) SkeletonJson((AttachmentLoader *) attachmentLoader, ownsLoader);
|
||||
spine_skeleton_json spine_skeleton_json_create2(spine_attachment_loader attachmentLoader, bool ownsLoader) {
|
||||
return (spine_skeleton_json) new (__FILE__, __LINE__) SkeletonJson(*((AttachmentLoader *) attachmentLoader), ownsLoader);
|
||||
}
|
||||
|
||||
void spine_skeleton_json_dispose(spine_skeleton_json self) {
|
||||
|
||||
@ -9,8 +9,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SPINE_C_API spine_skeleton_json spine_skeleton_json_create(/*@null*/ spine_atlas atlas);
|
||||
SPINE_C_API spine_skeleton_json spine_skeleton_json_create2(/*@null*/ spine_attachment_loader attachmentLoader, bool ownsLoader);
|
||||
SPINE_C_API spine_skeleton_json spine_skeleton_json_create(spine_atlas atlas);
|
||||
SPINE_C_API spine_skeleton_json spine_skeleton_json_create2(spine_attachment_loader attachmentLoader, bool ownsLoader);
|
||||
|
||||
SPINE_C_API void spine_skeleton_json_dispose(spine_skeleton_json self);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user