• Runtimes
  • [cocos2d-x] binary format read

  • Modificato
Related Discussions
...

json format loading speed is too slow.
when will cocos2d-x binary format read?
can you java readFloat() function implementation to c or c++?
read 4 bytes then next? please help. T.T

I haven't ported the spine-libgdx binary format to all the runtimes yet because there are still a few features that might change the format (eg, bounding boxes). Until then, you could port it yourself. You can implement readFloat something like this:

unsigned char b1 = fgetc(_file);
unsigned char b2 = fgetc(_file);
unsigned char b3 = fgetc(_file);
unsigned char b4 = fgetc(_file);
union {
	int i;
	float f;
} intToFloat;
intToFloat.i = (long)((b1 << 24) + (b2 << 16) + (b3 << 8) + (b4 << 0));
float value = (float)intToFloat.f;

wow! very fast reply. thank you so much.
your implementation works well. thank you ^^