|
![](/i/fill.gif) |
clipka wrote:
> Anyone else who thinks this would be a neat idea?
It's a neat idea! ;)
I feel a bit queasy about the syntax though, it doesn't
look right for SDL (or most other languages I know). A few
alternative suggestions
#writeb(fOut, "int16be", someVal1, someVal2)
-> my favourite
#write(fOut, "int16be", someVal1, someVal2)
-> on the unfounded assumption noone has ever written
a #write statement with multiple values where the first
one ist the string literal "int16be". Behavior could
also depend on #version directive, or, with Tim's
suggestion regarding #fopen, whether fOut refers
to a binary file.
#writeb(fOut, "%hu%hu", someVal1, someVal2) or
-> well ...
#write(fOut, (int16be) someVal1, (int16be) someVal2)
-> with active suspension of disbelief you can pretend
it's a cast to select from overloaded #write's ;)
Also, maybe it should be uint instead of int in case
you wish to add signed integers later?
Post a reply to this message
|
![](/i/fill.gif) |