Here is Log without repeated messages:
08-26 22:36:23.967: I/jPCT-AE(5183): Loading Texture...
08-26 22:36:23.967: I/jPCT-AE(5183): Texture loaded...16384 bytes/64*64 pixels!
...
08-26 22:36:26.697: I/jPCT-AE(5183): Loading Texture...
08-26 22:36:26.707: I/jPCT-AE(5183): Texture loaded...16384 bytes/64*64 pixels!
08-26 22:36:27.227: I/nav(5183): Loglevel:3
08-26 22:36:27.237: I/jPCT-AE(5183): Adding Lightsource: 0
08-26 22:36:27.257: I/jPCT-AE(5183): Normal vectors calculated in 9ms!
08-26 22:36:27.277: I/jPCT-AE(5183): Normal vectors calculated in 4ms!
...
08-26 22:36:27.897: I/jPCT-AE(5183): Normal vectors calculated in 1ms!
[b]08-26 22:36:27.917: I/nav(5183): World Serialization...[/b]
08-26 22:36:28.207: D/dalvikvm(5183): GC_CONCURRENT freed 1023K, 28% free 12267K/17031K, paused 2ms+5ms
08-26 22:36:28.777: D/serialize(5183): 863
[b]08-26 22:36:28.777: I/nav(5183): World deserialization ...[/b]
08-26 22:36:29.387: D/dalvikvm(5183): GC_CONCURRENT freed 1647K, 27% free 12539K/17031K, paused 2ms+4ms
08-26 22:36:29.687: I/jPCT-AE(5183): Adding Lightsource: 0
08-26 22:36:29.687: D/deserialize(5183): 913
08-26 22:36:29.707: I/ActivityManager(157): START {cmp=pl.potiopa/.activity.MapActivity} from pid 5183
08-26 22:36:29.727: I/ActivityManager(157): START {cmp=pl.potiopa/.activity.MapActivity} from pid 518308-26 22:36:29.837: I/jPCT-AE(5183): GLRenderer created with id 0 on Thread[GLThread 221,5,main]
08-26 22:36:29.837: I/jPCT-AE(5183): OpenGL vendor: ARM
08-26 22:36:29.837: I/jPCT-AE(5183): OpenGL renderer: Mali-400 MP
08-26 22:36:29.837: I/jPCT-AE(5183): OpenGL version: OpenGL ES-CM 1.1
08-26 22:36:29.837: I/jPCT-AE(5183): OpenGL renderer initialized (using 2/8 texture stages)
08-26 22:36:29.837: I/jPCT-AE(5183): Memory usage before compacting: 13248 KB used out of 17031 KB. Max. memory available to the VM is 49152 KB.
08-26 22:36:30.347: I/jPCT-AE(5183): Memory usage after compacting: 12308 KB used out of 17031 KB. Max. memory available to the VM is 49152 KB.
08-26 22:36:30.347: I/jPCT-AE(5183): Subobject of object 0/object2 compiled to flat fixed point data using 48/48 vertices in 1ms!
08-26 22:36:30.347: I/jPCT-AE(5183): Processing and uploading vertices of subobject of object 0/object2 took 1ms
08-26 22:36:30.347: I/jPCT-AE(5183): Object 0/object2 compiled to 1 subobjects in 2ms!
08-26 22:36:30.347: I/jPCT-AE(5183): Object 'object2' uses one texture set!
08-26 22:36:30.347: I/jPCT-AE(5183): Subobject of object 1/object3 compiled to flat fixed point data using 36/36 vertices in 0ms!
08-26 22:36:30.347: I/jPCT-AE(5183): Processing and uploading vertices of subobject of object 1/object3 took 1ms
08-26 22:36:30.347: I/jPCT-AE(5183): Object 1/object3 compiled to 1 subobjects in 1ms!
08-26 22:36:30.347: I/jPCT-AE(5183): Object 'object3' uses one texture set!
...
08-26 22:36:30.577: I/jPCT-AE(5183): Subobject of object 67/object69 compiled to flat fixed point data using 48/48 vertices in 1ms!
08-26 22:36:30.577: I/jPCT-AE(5183): Processing and uploading vertices of subobject of object 67/object69 took 2ms
08-26 22:36:30.577: I/jPCT-AE(5183): Object 67/object69 compiled to 1 subobjects in 4ms!
08-26 22:36:30.577: I/jPCT-AE(5183): Object 'object69' uses one texture set!
08-26 22:36:30.577: I/jPCT-AE(5183): Allocating native memory for 16*16 texture(true/false/false/false/): 1024 bytes!
08-26 22:36:30.587: I/jPCT-AE(5183): New texture's id is: 1
08-26 22:36:30.587: I/jPCT-AE(5183): New texture uploaded: com.threed.jpct.Texture@410e24d0 in thread Thread[GLThread 221,5,main]
08-26 22:36:30.587: I/jPCT-AE(5183): Creating buffers...
08-26 22:36:30.587: I/jPCT-AE(5183): VBO created for object 'object2'
08-26 22:36:30.587: I/jPCT-AE(5183): Allocating native memory for 64*64 texture(true/false/false/false/): 16384 bytes!
08-26 22:36:30.587: I/jPCT-AE(5183): New texture's id is: 2
...
08-26 22:36:30.607: I/jPCT-AE(5183): Allocating native memory for 64*64 texture(true/false/false/false/): 16384 bytes!
08-26 22:36:30.607: I/jPCT-AE(5183): New texture's id is: 6
08-26 22:36:30.607: I/jPCT-AE(5183): New texture uploaded: com.threed.jpct.Texture@41073c88 in thread Thread[GLThread 221,5,main]
08-26 22:36:30.607: I/jPCT-AE(5183): Creating buffers...
08-26 22:36:30.607: I/jPCT-AE(5183): VBO created for object 'object16'
Serialization code:
public boolean serialize(World world, File file) {
try {
Log.i("nav", "World Serialization...");
file.createNewFile();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(world);
byte[] array = baos.toByteArray();
oos.close();
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file));
bos.write(array, 0, array.length);
bos.close();
return true;
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return false;
}
Deserialization code:
public World deserialize(File file) {
try {
Log.i("nav", "World deserialization ...");
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
ObjectInputStream ois = new ObjectInputStream(bis);
World world = (World) ois.readObject();
ois.close();
return world;
} catch (Exception x) {
x.printStackTrace();
throw new RuntimeException(x);
}
// return null;
}
Here is a metod adding lights to the world:
public void setLights(World world) {
world.removeAllLights();
world.setAmbientLight(50, 50, 50);
Light sun = new Light(world);
sun.setIntensity(100, 100, 100);
SimpleVector sv = new SimpleVector(100f,-100f,50f);
sun.setPosition(sv);
}
Normally I run this method only once before serialization. But now I don’t know what’s going on, therefore in the example this method I run before serialization and after deserialization. There isn’t differences between it.
What do you think about it?
Thanks