- Изменено
Error with new "Sprites Sequence" in spine-cocos2dx.cpp
When loading json or skel, the variable region==0x00
spine-cocos2dx.cpp line 43
static void setAttachmentVertices(RegionAttachment *attachment) {
AtlasRegion *region = (AtlasRegion *) attachment->getRendererObject();
AttachmentVertices *attachmentVertices = new AttachmentVertices((Texture2D *) region->page->getRendererObject(), 4, quadTriangles, 6);
P.S. Runtime is of course the latest from github.
I had the same problem :rofl:
Sorry for that. I have to rewrite the way how spine-cocos2d-x handles mesh generation for the renderer. See https://github.com/EsotericSoftware/spine-runtimes/issues/2166.
This is now fixed in the 4.1 and 4.2-beta branches. Thanks for reporting!
Thank you. It's almost good. But after playing the sequence, there is still an error here:
SequenceTimeline.cpp line 74 (slotAttachment==0)
Attachment* slotAttachment = slot->getAttachment();
if (slotAttachment != _attachment) {
if (!slotAttachment->getRTTI().instanceOf(VertexAttachment::rtti) || ((VertexAttachment*)[b][u]slotAttachment[/u][/b])->getTimelineAttachment() != _attachment) return;
I took your bomb asset and plugged it into the latest spine-cocos2dx example. I tried all animations in looping mode. I did not get any crash. Plesae provide code for me to reproduce the issue.
I changed the Sequence type to "Once", since the explosion should play once. Perhaps this is the reason.
I have added the verification, otherwise I will get a crash. But I'm not sure if it working good, for example, if there are any memory leaks
Attachment* slotAttachment = slot->getAttachment();
if (slotAttachment && (slotAttachment != _attachment)) {
if (!slotAttachment->getRTTI().instanceOf(VertexAttachment::rtti) || ((VertexAttachment*)slotAttachment)->getTimelineAttachment() != _attachment) return;
Cheers! This is now fixed in both the 4.1 and 4.2-beta branches.