#shorter types(2)
4 messages in this thread
Jonas,
Just wondering if you had heard anything about using the shorter types with
3DS's data structures… (ie. using 'char flags' instead of 'unsigned long
flags' in struct FaceIO)
doug
Doug,
see msg. 87348.
but here it is again..
—————————————
Answered by Grant. Member of the development team.
> The flags variable in the FaceIO type is an unsigned long
> (32 bits), the only valid values for that are 1 | 2 | 4, only 3
> bits, shouldn't an unsigned char be used instead? Just
> curious but there are more of these types of, well, wasted
> space, and I was wondering if there was actually more
> data in those vars than is documented. Basically, can I
> use the shorter types in my code without worrying?
>
> Just curious…
> doug
>
>
No, the internal code to 3DS expects the data to be at that size. If you change
the type definitions to more efficient sizes, 3DS will not be able to make
sense of the data.
Jonas and Grant,
I'm not proposing to change the type declarations for the FaceIO struct,
just my own copies of the info for my external code. I just wanted to know if
there is any pertinent data in the high order bits…
Type conversions should not affect the operation of 3DS…
Am I wrong? (I am very close to a major deadline…)
doug
Only the low order byte of the flags field, and the low order byte of the
materials field, are actually used by 3D Studio. The internal code to 3D
Studio actually casts them to these values anyway.
Ciao,
Grant