[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Troll] Things To Do



[Don't know if Kenn meant to send this directly to me or not but
figured I put my answers here anyway.]

> The file formats are little endian.  Without doing all of the bit 
> manipulation myself, there is no way for me to read them in Java.  Java 
> assumes all data is big endian (network order).

I was actually thinking of making Troll Bridge not care.  By putting a
16-bit number of a known value first, you can easily determine if the
file is the same endianess and compensate.  (And perhaps automactically
save a convert file.)  Granted that doesn't help you're situation.

Java should of put in a flag or something that allows you read as little
endian.  A lot of old file formats are little endian.

Big endian doesn't have as many advantages as you list.  Converting Troll
Bridge to a big endian machine would take all of two seconds to implement
BinaryReadFile and BinaryWriteFile.  Portability isn't helped because
someone has to do the conversion.  It also doesn't help network play
because the data in memory is going to have been converted to native mode
and translated again.  Besides I could just declare the network protocol
as little endian.  (Many windows games don't even have a protocol and
instead simply dump memory structure to the wire.)

Oops... Scratch that about only implementing BinaryReadFile and
BinaryWriteFile.  Secrets makes some assumations about the data.  (Plus
the misalignment bus error which I had intended this paragraph to be
about.)  Should do something about that.

I'm not too inclined to modify Troll Bridge to be big endian.

Dennis Payne
dulsi@identicalsoftware.com