On 5/21/06, Samuel Mimram <[EMAIL PROTECTED]> wrote:
> The new level caching system causes xmoto to break for the second time
> its run.

Hmm, initially I had the problem with i386 on linux too (it worked
fine on Windows), but finally got it to work on both Windows and linu
i386.

If it's related to that problem, the cause is in src/VFileIO.cpp (in
the bottom):

...

void FS::writeFloat_LE(FileHandle *pfh,float v) {
   writeInt_LE(pfh,*((int *)&v));
   //unsigned char *pc=(unsigned char *)&v;
   //for(int i=0;i<4;i++)
   //  writeByte(pfh,pc[i]);
}

...

float FS::readFloat_LE(FileHandle *pfh) {
  float res;

   unsigned char *pc=(unsigned char *)&res;
   for(int i=0;i<4;i++)
   pc[i]=readByte(pfh);

   return res;
}

...

readFloat_LE() simply returns zero always, which causes the "null
vector normalize" exception later.

If one comes up with versions of the above functions that work on all
systems, my best guess is that the bug will go away. Unfortunately I
don't have a 64-bit system at hand, so I can't test it.

Actually I thought sizeof(int) == sizeof(float) on amd64? If that
isn't the case, there's an obvious reason to the problem. :)

> Workarund: Delete ~/.xmoto/LCache each time you run Xmoto

A more permanent workaround is to set "LevelCache" to "false" in
~/.xmoto/config.dat.

--
Regards,
Rasmus Neckelmann

Reply via email to