Ok I tried to open the tow file, and I when over the code,
There is a compatibility problem between 2.08 and 2.24 so the data cannot be read correctly
I did read the make file, and the x86 file in the PC in both 32 and 64 bit data, and there is not alignment bug.
This is what I did , I made the Mac Build for 2.24 and I will make the Linux too,
You will have to upgrade to 2.24 and re save your serialize data, the upgrade should be painless.
The doing it again and see if it work,
Just to make sure this is how you need to write you serialize/deserialize callbacks
- Code: Select all
// for litle indians,
static void SerializeFile (void* serializeHandle, const void* buffer, int size)
{
_ASSERTE ((size % 4) == 0);
fwrite (buffer, size, 1, (FILE*) serializeHandle);
}
static void DeSerializeFile (void* serializeHandle, void* buffer, int size)
{
_ASSERTE ((size % 4) == 0);
fread (buffer, size, 1, (FILE*) serializeHandle);
}
// for big indian serialization
static void SerializeFile (void* serializeHandle, const void* buffer, int size)
{
_ASSERTE ((size % 4) == 0);
const int* ptr = (int*)buffer;
for (int i = 0; i < int (size/sizeof (int)); i ++) {
int data = SWAP_INT32(ptr[i]);
fwrite (&data, sizeof (int), 1, (FILE*) serializeHandle);
}
}
static void DeSerializeFile (void* serializeHandle, void* buffer, int size)
{
_ASSERTE ((size % 4) == 0);
fread (buffer, size, 1, (FILE*) serializeHandle);
SWAP_FLOAT32_ARRAY (buffer, size);
}
This will make file that are independent of the platform, therefore you can read then in Linux, Mac or PC.
I am a believer that data should be independent of the Platform.
Here are the archive for pc and Mac 2.24
http://www.newtondynamics.com/downloads/NewtonWin-2.24.rarhttp://www.newtondynamics.com/downloads/NewtonMac-2.24.zipUnfortunately I am not in the position to produce file for testing because I am in the process of changing the demo to use the Native GUI of the OS in every platform.
After I decided to use WxWidget and Collada, the SDK grew by about 80 megabytes compresses, and the demo in teh SDK are too complex with all for the average Newton User.
As result must people are no updating to the latest version and stop at the last 2.08 which does not use so many this party external libraries.
I am changing all that so that the only third party libraries are libraries that are part of the SDK, like tinysml, and glew, bu every thong else will be native and minimal.
For that I am making a newton file format, and an editor, and because of that some demos do no work.
However the newto libraries do work.
Please upgrade to 2.24 and generate the file again, and see if it works.