Author Topic: About defaultToKeepPixels  (Read 6364 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: About defaultToKeepPixels
« Reply #15 on: October 06, 2012, 10:55:50 pm »
If you really want the keep the gui textures in memory for whatever reason, then don't flush and use replaceTexture() to reload all other textures instead. That will keep the ids.

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: About defaultToKeepPixels
« Reply #16 on: October 06, 2012, 11:35:37 pm »
it works ;)

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: About defaultToKeepPixels
« Reply #17 on: October 07, 2012, 01:08:55 am »
Egon, what means this error? When I simply ignore it (try-catch) textures are loaded and everything works, but it is not right... and it seems method "onSurfaceChanged" is called many times after change context, is it right?
Code: [Select]
10-07 01:02:49.237: E/AndroidRuntime(8963): FATAL EXCEPTION: GLThread 7583
10-07 01:02:49.237: E/AndroidRuntime(8963): java.lang.RuntimeException: [ 1349564569196 ] - ERROR: java.lang.NullPointerException
10-07 01:02:49.237: E/AndroidRuntime(8963): at com.threed.jpct.GLRenderer.rescale32(GLRenderer.java:1061)
10-07 01:02:49.237: E/AndroidRuntime(8963): at com.threed.jpct.GLRenderer.buildMipmap(GLRenderer.java:983)
10-07 01:02:49.237: E/AndroidRuntime(8963): at com.threed.jpct.GLRenderer.convertTexture(GLRenderer.java:935)
10-07 01:02:49.237: E/AndroidRuntime(8963): at com.threed.jpct.GLRenderer.upload(GLRenderer.java:1603)
10-07 01:02:49.237: E/AndroidRuntime(8963): at com.threed.jpct.TextureManager.preWarm(TextureManager.java:297)
10-07 01:02:49.237: E/AndroidRuntime(8963): at cz.chladek.mygame.util.TextureLoader.loadTextures(TextureLoader.java:149)
10-07 01:02:49.237: E/AndroidRuntime(8963): at cz.chladek.mygame.AppActivity$MyRenderer.onSurfaceCreated(AppActivity.java:525)
10-07 01:02:49.237: E/AndroidRuntime(8963): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1494)
10-07 01:02:49.237: E/AndroidRuntime(8963): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
10-07 01:02:49.237: E/AndroidRuntime(8963): at com.threed.jpct.Logger.log(Logger.java:189)
10-07 01:02:49.237: E/AndroidRuntime(8963): at com.threed.jpct.Logger.log(Logger.java:136)
10-07 01:02:49.237: E/AndroidRuntime(8963): at cz.chladek.mygame.util.TextureLoader.loadTextures(TextureLoader.java:154)
10-07 01:02:49.237: E/AndroidRuntime(8963): at cz.chladek.mygame.AppActivity$MyRenderer.onSurfaceCreated(AppActivity.java:525)
10-07 01:02:49.237: E/AndroidRuntime(8963): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1494)
10-07 01:02:49.237: E/AndroidRuntime(8963): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: About defaultToKeepPixels
« Reply #18 on: October 07, 2012, 10:35:42 am »
Looks like it tries to create mipmaps for a texture that has no pixels. Maybe you haven't replaced all textures without pixels when calling preWarm().

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: About defaultToKeepPixels
« Reply #19 on: October 07, 2012, 10:44:49 am »
Yes, I replace one texture and upload it. I can not replace all textures at once, because it causes OutOfMemory error...
« Last Edit: October 07, 2012, 10:47:01 am by Thomas. »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: About defaultToKeepPixels
« Reply #20 on: October 07, 2012, 04:53:49 pm »
I see...i should simply exclude textures without pixels from the prewarming.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: About defaultToKeepPixels
« Reply #21 on: October 07, 2012, 08:25:27 pm »
Please try this jar instead: http://jpct.de/download/beta/jpct_ae.jar

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: About defaultToKeepPixels
« Reply #22 on: October 07, 2012, 09:29:33 pm »
thanks ;)