Author Topic: ArrayIndexOutOfBoundsException in Loader.loadJAW  (Read 7081 times)

Offline Uija

  • int
  • **
  • Posts: 52
    • View Profile
ArrayIndexOutOfBoundsException in Loader.loadJAW
« on: July 22, 2005, 03:18:57 pm »
Hi there...
when I load a 100x100 big Terrain with Loader.loadJAW I get an Exception:
Code: [Select]

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10000
at com.threed.jpct.Loader.loadJAW(Unknown Source)
at com.threed.jpct.Loader.loadJAW(Unknown Source)
at client.Uija3d.<init>(Uija3d.java:67)
at client.Uija3d.main(Uija3d.java:175)

Output befor the Exception is:
Code: [Select]
Loading file map.jaw
Expanding buffers...1000000 bytes
File map.jaw loaded...568780 bytes
Parsing Objectfile!


Is this intended as it might be to slow with that many polygones or is it just an unknown error?

~Jens

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
ArrayIndexOutOfBoundsException in Loader.loadJAW
« Reply #1 on: July 22, 2005, 03:32:46 pm »
That's a hard coded, undocumented  limitation in the loader... :oops:
The code of the jaw-loader is around 6 years old and i've never touched it since then. There is a configuration variable for it, but it's not public. I'll try to get this fixed somehow in the next version or at least exit more gracefully than with an ArrayOutOfBounds from deep inside the Loader.
JAW isn't a very good format anyway...
(3DS and ASC have such limitations too, but they are implied by the format specs themselves).

Offline Uija

  • int
  • **
  • Posts: 52
    • View Profile
ArrayIndexOutOfBoundsException in Loader.loadJAW
« Reply #2 on: July 22, 2005, 03:43:36 pm »
I have written a commandline converter from png to jaw. I took jaw because it was the easiest one ;)
Perhaps I should read some infos about the other fields in ASC and use that one ;)

Offline Uija

  • int
  • **
  • Posts: 52
    • View Profile
ArrayIndexOutOfBoundsException in Loader.loadJAW
« Reply #3 on: July 22, 2005, 04:36:57 pm »
I converted the tool to ASC Output and works fine. thanks for the hint.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
ArrayIndexOutOfBoundsException in Loader.loadJAW
« Reply #4 on: July 22, 2005, 05:14:13 pm »
ASC is better anyway. However, i've updated the pre-release JAR of 1.07 with a quick fix for the JAW problem. It can be found here: http://www.jpct.net/download/jpct107a2.jar