Author Topic: crash while using textureinfo and blending  (Read 619 times)

Offline nmare

  • byte
  • *
  • Posts: 10
    • View Profile
    • Puzzker
crash while using textureinfo and blending
« on: July 23, 2013, 06:53:38 pm »

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.

Code: [Select]
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

Code: [Select]
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

Code: [Select]
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.

DevGeek studio
Indie Developer (android, opengl, databases)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: crash while using textureinfo and blending
« Reply #1 on: July 23, 2013, 09:46:31 pm »
Which version of jPCT-AE are you using? Have to tried to use the latest?

Offline nmare

  • byte
  • *
  • Posts: 10
    • View Profile
    • Puzzker
Re: crash while using textureinfo and blending
« Reply #2 on: July 23, 2013, 11:19:50 pm »

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.

DevGeek studio
Indie Developer (android, opengl, databases)