diff --git a/defold-spine/commonsrc/vertices.cpp b/defold-spine/commonsrc/vertices.cpp index 4cac557..0520d13 100644 --- a/defold-spine/commonsrc/vertices.cpp +++ b/defold-spine/commonsrc/vertices.cpp @@ -303,6 +303,11 @@ void MergeDrawDescs(const dmArray& src, dmArray& d dst.SetCapacity(src.Size()); dst.SetSize(src.Size()); + if (src.Size() == 0) + { + return; + } + SpineDrawDesc* current_draw_desc = dst.Begin(); *current_draw_desc = src[0]; diff --git a/defold-spine/plugins/lib/arm64-osx/libSpineExt.dylib b/defold-spine/plugins/lib/arm64-osx/libSpineExt.dylib index f420f80..a9d106e 100644 Binary files a/defold-spine/plugins/lib/arm64-osx/libSpineExt.dylib and b/defold-spine/plugins/lib/arm64-osx/libSpineExt.dylib differ diff --git a/defold-spine/plugins/lib/x86_64-linux/libSpineExt.so b/defold-spine/plugins/lib/x86_64-linux/libSpineExt.so index 862ee36..ebe7dfb 100644 Binary files a/defold-spine/plugins/lib/x86_64-linux/libSpineExt.so and b/defold-spine/plugins/lib/x86_64-linux/libSpineExt.so differ diff --git a/defold-spine/plugins/lib/x86_64-osx/libSpineExt.dylib b/defold-spine/plugins/lib/x86_64-osx/libSpineExt.dylib index 9b4f8f1..c248434 100644 Binary files a/defold-spine/plugins/lib/x86_64-osx/libSpineExt.dylib and b/defold-spine/plugins/lib/x86_64-osx/libSpineExt.dylib differ diff --git a/defold-spine/plugins/lib/x86_64-win32/libSpineExt.dll b/defold-spine/plugins/lib/x86_64-win32/libSpineExt.dll index ffc1164..e5a07cf 100644 Binary files a/defold-spine/plugins/lib/x86_64-win32/libSpineExt.dll and b/defold-spine/plugins/lib/x86_64-win32/libSpineExt.dll differ diff --git a/defold-spine/plugins/share/pluginSpineExt.jar b/defold-spine/plugins/share/pluginSpineExt.jar index 89843db..3c11955 100644 Binary files a/defold-spine/plugins/share/pluginSpineExt.jar and b/defold-spine/plugins/share/pluginSpineExt.jar differ diff --git a/defold-spine/src/comp_spine_model.cpp b/defold-spine/src/comp_spine_model.cpp index 41829ce..8572470 100644 --- a/defold-spine/src/comp_spine_model.cpp +++ b/defold-spine/src/comp_spine_model.cpp @@ -912,20 +912,23 @@ namespace dmSpine if (use_inherit_blend) { uint32_t draw_desc_count = world->m_DrawDescBuffer.Size(); - dmArray scratch_draw_descs; - MergeDrawDescs(world->m_DrawDescBuffer, scratch_draw_descs); + if (draw_desc_count > 0) + { + dmArray scratch_draw_descs; + MergeDrawDescs(world->m_DrawDescBuffer, scratch_draw_descs); - uint32_t merged_size = scratch_draw_descs.Size(); - uint32_t ro_count_begin = world->m_RenderObjects.Size(); - world->m_RenderObjects.SetSize(world->m_RenderObjects.Size() + merged_size); + uint32_t merged_size = scratch_draw_descs.Size(); + uint32_t ro_count_begin = world->m_RenderObjects.Size(); + world->m_RenderObjects.SetSize(world->m_RenderObjects.Size() + merged_size); - for (int i = 0; i < merged_size; ++i) - { - dmRender::RenderObject& ro = world->m_RenderObjects[ro_count_begin + i]; - FillRenderObject(world, render_context, ro, first->m_RenderConstants, texture, material, - SpineBlendModeToRenderBlendMode((spBlendMode) scratch_draw_descs[i].m_BlendMode), - scratch_draw_descs[i].m_VertexStart, - scratch_draw_descs[i].m_VertexCount); + for (int i = 0; i < merged_size; ++i) + { + dmRender::RenderObject& ro = world->m_RenderObjects[ro_count_begin + i]; + FillRenderObject(world, render_context, ro, first->m_RenderConstants, texture, material, + SpineBlendModeToRenderBlendMode((spBlendMode) scratch_draw_descs[i].m_BlendMode), + scratch_draw_descs[i].m_VertexStart, + scratch_draw_descs[i].m_VertexCount); + } } } else