Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom attachments #20

Merged
merged 13 commits into from
Nov 12, 2023
Prev Previous commit
Next Next commit
temp patch spine_c to refcount
brandon-reinhart committed Oct 23, 2023
commit 97023c096eb7fad6a824459147b468354b901c25
13 changes: 13 additions & 0 deletions src/c/spine_c.rs
Original file line number Diff line number Diff line change
@@ -24428,6 +24428,10 @@ pub unsafe extern "C" fn spSlot_create(
}
#[no_mangle]
pub unsafe extern "C" fn spSlot_dispose(mut self_0: *mut spSlot) {
if (*self_0).attachment != std::ptr::null_mut() {
spAttachment_dispose((*self_0).attachment);
}

_spFree((*self_0).deform as *mut c_void);
_spFree((*self_0).darkColor as *mut c_void);
_spFree(self_0 as *mut c_void);
@@ -24449,6 +24453,15 @@ pub unsafe extern "C" fn spSlot_setAttachment(
if attachment == (*self_0).attachment {
return;
}

if attachment != std::ptr::null_mut() {
(*attachment).refCount += 1;
}

if (*self_0).attachment != std::ptr::null_mut() {
spAttachment_dispose((*self_0).attachment);
}

if isVertexAttachment(attachment) == 0
|| isVertexAttachment((*self_0).attachment) == 0
|| (*(attachment as *mut spVertexAttachment)).timelineAttachment