Hi!
i have this error message when i assign a texture that i made using TextureInfo with some blending.
07-23 12:37:17.193: I/jPCT-AE(16956): java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
07-23 12:37:17.193: I/jPCT-AE(16956): at com.threed.jpct.Object3D.setTexture(Object3D.java:3411)
07-23 12:37:17.193: I/jPCT-AE(16956): at com.nmare.puzzker.LoopPhase2.SetupPhase2(LoopPhase2.java:78)
07-23 12:37:17.193: I/jPCT-AE(16956): at com.nmare.puzzker.Gameloop.loop(Gameloop.java:290)
07-23 12:37:17.193: I/jPCT-AE(16956): at com.nmare.puzzker.Puzzker$MyRenderer.onDrawFrame(Puzzker.java:591)
07-23 12:37:17.193: I/jPCT-AE(16956): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
07-23 12:37:17.193: I/jPCT-AE(16956): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
This is weird, because in the reload session phase, at some other place i use the same function to do it and it work well.
if( game.CardState.Card[game.Table.Content[x][y]] == 2 ) {
Logger.log("Frozen OK");
game.card[game.Table.Content[x][y]].setTexture( game.FreezeCard.FreezeTexture( game.Table.Content[x][y] ) );
}
but in the gameloop, it give an error on
if( game.NextCardFrozen ) {
game.NextCardFrozen = false;
game.card[game.Deck.Deck[CardId]].setTexture( game.FreezeCard.FreezeTexture( game.Deck.Deck[CardId] ) );
}
after some debug, i can see that the error appear right after the game.FreezeCard.FreezeTexture function.
here the FreezeTexture class
public TextureInfo FreezeTexture( int CardId ) {
// Blend a texture to the card
TextureInfo ti = new TextureInfo( TextureManager.getInstance().getTextureID("frozencard"));
ti.add(TextureManager.getInstance().getTextureID("card" + Integer.toString( CardId+1 )) , TextureInfo.MODE_MODULATE );
return ti;
}
whats wrong? I never strip my objects because i have to change em alot.
Which version of jPCT-AE are you using? Have to tried to use the latest?
i have a version before december 2012...
But i found a soluce finnally.... i reload the .obj each time i need to change the texture. It give a small fps pike but this is a puzzle game so lag is not a problem.