Cuellarjmcg

Hello there,

I updated my project to use the new DrawOrder feature, and exported it as a json file to my game (I'm using latest libgdx and spine runtime).

However, when I try to load the json file, with readSkeletonData, an exception occurs:
Exception in thread "LWJGL Application" java.lang.ArrayIndexOutOfBoundsException: -1
at com.esotericsoftware.spine.SkeletonJson.readAnimation(SkeletonJson.java:323)
at com.esotericsoftware.spine.SkeletonJson.readSkeletonData(SkeletonJson.java:152)
At this line:
for (int i = slotCount - 1; i >= 0; i--)
if (drawOrder[i] == -1) drawOrder[i] = unchanged[--unchangedIndex];
The var "unchangedIndex", at some point, has the value of -1, which then throws the exception.

I attach my updated project file, hope it helps.

Thanks in advance.
添付ファイルを見るにはパーミッションが必要です
Cuellarjmcg

Kickstarter Backer
  • 記事: 92

Nate

Fixed in 1.5.12, thanks!
アバター
Nate

Nate
  • 記事: 9642

Pharan

Ah! This was what was tripping me up too. I just kept using the old loader.
アバター
Pharan
  • 記事: 5366

Nate

It happened because the project was saved before the draw order changed slightly, so the offsets were computed incorrectly. Sorry about that! The previous approach to doing the offsets was flawed. Some draw order changes would fail. Now it should be bulletproof. Figuring out which slots have changed position so I don't have to store them all was tricky!
アバター
Nate

Nate
  • 記事: 9642

Pharan

Re-exported: Now it works! Thanks, Nate!

Yeah, I can imagine it must have been quite a number of engineering decisions to make.
アバター
Pharan
  • 記事: 5366

Søren

Yeah there is more greek in there than usual! :D
アバター
Søren

Shiu
  • 記事: 2396


Return to Bugs