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
  • 전체글: 11543

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
  • 전체글: 11543

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
  • 전체글: 2444


다시 돌아감: Bugs