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.
Bu mesaja eklenen dosyaları görüntülemek için gerekli yetkilere sahip değilsiniz.
Cuellarjmcg

Kickstarter Backer
  • Mesajlar: 92

Nate

Fixed in 1.5.12, thanks!
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 12032

Pharan

Ah! This was what was tripping me up too. I just kept using the old loader.
Kullanıcı avatarı
Pharan
  • Mesajlar: 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!
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 12032

Pharan

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

Yeah, I can imagine it must have been quite a number of engineering decisions to make.
Kullanıcı avatarı
Pharan
  • Mesajlar: 5366

Søren

Yeah there is more greek in there than usual! :D
Kullanıcı avatarı
Søren

Shiu
  • Mesajlar: 2452


Dön Bugs