mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[cpp] Fix inconsistens getters/setters wrt nullability
This commit is contained in:
parent
65b138411c
commit
a0bcb01a2a
@ -88,9 +88,9 @@ void spine_mesh_attachment_set_path(spine_mesh_attachment self, const char *inVa
|
|||||||
return (spine_texture_region) _self->getRegion();
|
return (spine_texture_region) _self->getRegion();
|
||||||
}
|
}
|
||||||
|
|
||||||
void spine_mesh_attachment_set_region(spine_mesh_attachment self, spine_texture_region region) {
|
void spine_mesh_attachment_set_region(spine_mesh_attachment self, /*@null*/ spine_texture_region region) {
|
||||||
MeshAttachment *_self = (MeshAttachment *) self;
|
MeshAttachment *_self = (MeshAttachment *) self;
|
||||||
_self->setRegion(*((TextureRegion *) region));
|
_self->setRegion((TextureRegion *) region);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@null*/ spine_sequence spine_mesh_attachment_get_sequence(spine_mesh_attachment self) {
|
/*@null*/ spine_sequence spine_mesh_attachment_get_sequence(spine_mesh_attachment self) {
|
||||||
|
|||||||
@ -30,7 +30,7 @@ SPINE_C_API spine_color spine_mesh_attachment_get_color(spine_mesh_attachment se
|
|||||||
SPINE_C_API const char *spine_mesh_attachment_get_path(spine_mesh_attachment self);
|
SPINE_C_API const char *spine_mesh_attachment_get_path(spine_mesh_attachment self);
|
||||||
SPINE_C_API void spine_mesh_attachment_set_path(spine_mesh_attachment self, const char *inValue);
|
SPINE_C_API void spine_mesh_attachment_set_path(spine_mesh_attachment self, const char *inValue);
|
||||||
SPINE_C_API /*@null*/ spine_texture_region spine_mesh_attachment_get_region(spine_mesh_attachment self);
|
SPINE_C_API /*@null*/ spine_texture_region spine_mesh_attachment_get_region(spine_mesh_attachment self);
|
||||||
SPINE_C_API void spine_mesh_attachment_set_region(spine_mesh_attachment self, spine_texture_region region);
|
SPINE_C_API void spine_mesh_attachment_set_region(spine_mesh_attachment self, /*@null*/ spine_texture_region region);
|
||||||
SPINE_C_API /*@null*/ spine_sequence spine_mesh_attachment_get_sequence(spine_mesh_attachment self);
|
SPINE_C_API /*@null*/ spine_sequence spine_mesh_attachment_get_sequence(spine_mesh_attachment self);
|
||||||
SPINE_C_API void spine_mesh_attachment_set_sequence(spine_mesh_attachment self, /*@null*/ spine_sequence sequence);
|
SPINE_C_API void spine_mesh_attachment_set_sequence(spine_mesh_attachment self, /*@null*/ spine_sequence sequence);
|
||||||
SPINE_C_API /*@null*/ spine_mesh_attachment spine_mesh_attachment_get_parent_mesh(spine_mesh_attachment self);
|
SPINE_C_API /*@null*/ spine_mesh_attachment spine_mesh_attachment_get_parent_mesh(spine_mesh_attachment self);
|
||||||
|
|||||||
@ -123,9 +123,9 @@ void spine_region_attachment_set_path(spine_region_attachment self, const char *
|
|||||||
return (spine_texture_region) _self->getRegion();
|
return (spine_texture_region) _self->getRegion();
|
||||||
}
|
}
|
||||||
|
|
||||||
void spine_region_attachment_set_region(spine_region_attachment self, spine_texture_region region) {
|
void spine_region_attachment_set_region(spine_region_attachment self, /*@null*/ spine_texture_region region) {
|
||||||
RegionAttachment *_self = (RegionAttachment *) self;
|
RegionAttachment *_self = (RegionAttachment *) self;
|
||||||
_self->setRegion(*((TextureRegion *) region));
|
_self->setRegion((TextureRegion *) region);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@null*/ spine_sequence spine_region_attachment_get_sequence(spine_region_attachment self) {
|
/*@null*/ spine_sequence spine_region_attachment_get_sequence(spine_region_attachment self) {
|
||||||
|
|||||||
@ -37,7 +37,7 @@ SPINE_C_API spine_color spine_region_attachment_get_color(spine_region_attachmen
|
|||||||
SPINE_C_API const char *spine_region_attachment_get_path(spine_region_attachment self);
|
SPINE_C_API const char *spine_region_attachment_get_path(spine_region_attachment self);
|
||||||
SPINE_C_API void spine_region_attachment_set_path(spine_region_attachment self, const char *inValue);
|
SPINE_C_API void spine_region_attachment_set_path(spine_region_attachment self, const char *inValue);
|
||||||
SPINE_C_API /*@null*/ spine_texture_region spine_region_attachment_get_region(spine_region_attachment self);
|
SPINE_C_API /*@null*/ spine_texture_region spine_region_attachment_get_region(spine_region_attachment self);
|
||||||
SPINE_C_API void spine_region_attachment_set_region(spine_region_attachment self, spine_texture_region region);
|
SPINE_C_API void spine_region_attachment_set_region(spine_region_attachment self, /*@null*/ spine_texture_region region);
|
||||||
SPINE_C_API /*@null*/ spine_sequence spine_region_attachment_get_sequence(spine_region_attachment self);
|
SPINE_C_API /*@null*/ spine_sequence spine_region_attachment_get_sequence(spine_region_attachment self);
|
||||||
SPINE_C_API void spine_region_attachment_set_sequence(spine_region_attachment self, /*@null*/ spine_sequence sequence);
|
SPINE_C_API void spine_region_attachment_set_sequence(spine_region_attachment self, /*@null*/ spine_sequence sequence);
|
||||||
SPINE_C_API spine_array_float spine_region_attachment_get_offset(spine_region_attachment self);
|
SPINE_C_API spine_array_float spine_region_attachment_get_offset(spine_region_attachment self);
|
||||||
|
|||||||
@ -83,7 +83,7 @@ namespace spine {
|
|||||||
|
|
||||||
TextureRegion *getRegion();
|
TextureRegion *getRegion();
|
||||||
|
|
||||||
void setRegion(TextureRegion ®ion);
|
void setRegion(TextureRegion *region);
|
||||||
|
|
||||||
Sequence *getSequence();
|
Sequence *getSequence();
|
||||||
|
|
||||||
|
|||||||
@ -104,7 +104,7 @@ namespace spine {
|
|||||||
|
|
||||||
TextureRegion *getRegion();
|
TextureRegion *getRegion();
|
||||||
|
|
||||||
void setRegion(TextureRegion ®ion);
|
void setRegion(TextureRegion *region);
|
||||||
|
|
||||||
Sequence *getSequence();
|
Sequence *getSequence();
|
||||||
|
|
||||||
|
|||||||
@ -61,7 +61,7 @@ RegionAttachment *AtlasAttachmentLoader::newRegionAttachment(Skin &skin, const S
|
|||||||
} else {
|
} else {
|
||||||
AtlasRegion *region = findRegion(path);
|
AtlasRegion *region = findRegion(path);
|
||||||
if (!region) return NULL;
|
if (!region) return NULL;
|
||||||
attachment->setRegion(*region);
|
attachment->setRegion(region);
|
||||||
}
|
}
|
||||||
return attachment;
|
return attachment;
|
||||||
}
|
}
|
||||||
@ -75,7 +75,7 @@ MeshAttachment *AtlasAttachmentLoader::newMeshAttachment(Skin &skin, const Strin
|
|||||||
} else {
|
} else {
|
||||||
AtlasRegion *region = findRegion(path);
|
AtlasRegion *region = findRegion(path);
|
||||||
if (!region) return NULL;
|
if (!region) return NULL;
|
||||||
attachment->setRegion(*region);
|
attachment->setRegion(region);
|
||||||
}
|
}
|
||||||
return attachment;
|
return attachment;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -157,8 +157,8 @@ TextureRegion *MeshAttachment::getRegion() {
|
|||||||
return _region;
|
return _region;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeshAttachment::setRegion(TextureRegion ®ion) {
|
void MeshAttachment::setRegion(TextureRegion *region) {
|
||||||
_region = ®ion;
|
_region = region;
|
||||||
}
|
}
|
||||||
|
|
||||||
Sequence *MeshAttachment::getSequence() {
|
Sequence *MeshAttachment::getSequence() {
|
||||||
@ -220,7 +220,7 @@ Attachment &MeshAttachment::copy() {
|
|||||||
if (_parentMesh) return newLinkedMesh();
|
if (_parentMesh) return newLinkedMesh();
|
||||||
|
|
||||||
MeshAttachment *copy = new (__FILE__, __LINE__) MeshAttachment(getName());
|
MeshAttachment *copy = new (__FILE__, __LINE__) MeshAttachment(getName());
|
||||||
copy->setRegion(*_region);
|
copy->setRegion(_region);
|
||||||
copy->setSequence(_sequence != NULL ? &_sequence->copy() : NULL);
|
copy->setSequence(_sequence != NULL ? &_sequence->copy() : NULL);
|
||||||
copy->_path = _path;
|
copy->_path = _path;
|
||||||
copy->_color.set(_color);
|
copy->_color.set(_color);
|
||||||
@ -240,7 +240,7 @@ Attachment &MeshAttachment::copy() {
|
|||||||
|
|
||||||
MeshAttachment &MeshAttachment::newLinkedMesh() {
|
MeshAttachment &MeshAttachment::newLinkedMesh() {
|
||||||
MeshAttachment *copy = new (__FILE__, __LINE__) MeshAttachment(getName());
|
MeshAttachment *copy = new (__FILE__, __LINE__) MeshAttachment(getName());
|
||||||
copy->setRegion(*_region);
|
copy->setRegion(_region);
|
||||||
copy->_path = _path;
|
copy->_path = _path;
|
||||||
copy->_color.set(_color);
|
copy->_color.set(_color);
|
||||||
copy->_timelineAttachment = this->_timelineAttachment;
|
copy->_timelineAttachment = this->_timelineAttachment;
|
||||||
|
|||||||
@ -242,8 +242,8 @@ TextureRegion *RegionAttachment::getRegion() {
|
|||||||
return _region;
|
return _region;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegionAttachment::setRegion(TextureRegion ®ion) {
|
void RegionAttachment::setRegion(TextureRegion *region) {
|
||||||
_region = ®ion;
|
_region = region;
|
||||||
}
|
}
|
||||||
|
|
||||||
Sequence *RegionAttachment::getSequence() {
|
Sequence *RegionAttachment::getSequence() {
|
||||||
|
|||||||
@ -65,7 +65,7 @@ void Sequence::apply(SlotPose *slot, Attachment *attachment) {
|
|||||||
if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) {
|
if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) {
|
||||||
RegionAttachment *regionAttachment = static_cast<RegionAttachment *>(attachment);
|
RegionAttachment *regionAttachment = static_cast<RegionAttachment *>(attachment);
|
||||||
if (regionAttachment->getRegion() != region) {
|
if (regionAttachment->getRegion() != region) {
|
||||||
regionAttachment->setRegion(*region);
|
regionAttachment->setRegion(region);
|
||||||
regionAttachment->updateRegion();
|
regionAttachment->updateRegion();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ void Sequence::apply(SlotPose *slot, Attachment *attachment) {
|
|||||||
if (attachment->getRTTI().isExactly(MeshAttachment::rtti)) {
|
if (attachment->getRTTI().isExactly(MeshAttachment::rtti)) {
|
||||||
MeshAttachment *meshAttachment = static_cast<MeshAttachment *>(attachment);
|
MeshAttachment *meshAttachment = static_cast<MeshAttachment *>(attachment);
|
||||||
if (meshAttachment->getRegion() != region) {
|
if (meshAttachment->getRegion() != region) {
|
||||||
meshAttachment->setRegion(*region);
|
meshAttachment->setRegion(region);
|
||||||
meshAttachment->updateRegion();
|
meshAttachment->updateRegion();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user