|
From: Kevin S. <kt...@te...> - 2003-01-12 20:28:53
|
On Sun, 2003-01-12 at 07:45, nl...@nl... wrote: > With regard to adding float support to attribedit, should new classes > TypeFloat32 and GUIElementFloat be added, or should the existing > TypeFixed32/GUIElementFixed be renamed to TypeScalar32/GUIElementScalar > with the actual type (fixed/float/double) being defined at compile time > depending on the WF scalar type? This is the first I have thought all of this through, so I could miss something: Hmmm, that is an interesting question, both answers make sense in different contexts. From a general attribute editor point of view (not specific to WF), AttribEdit ought to be able to edit both types simultaneously. (or maybe not, if a system supports floats, who would want to use the fixed type?).=20 I don't want a 'Scalar' Attribute in the oad .iff files because I want the .iff file to be self describing (one should be able to tell the actual type of a field by its name). So in the .iff file I think we should add a type 'FLOT' and a type 'DOBL'.=20 Given that, it would probably make sense to have levelcon be able to convert floats to fixed point if building a level file for the fixed point version of the engine.=20 Given THAT, maybe AttribEdit should ALWAYS edit floats (or doubles), and leave it to the level converted to truncate it to fixed if needed. To do that would require updating the oad generation process to ouput 'DOBL' for the oad files (but still mark them as fixed in the in game structures (if building fixed point)). > The latter choice would mean that there is only ONE scalar type per > level - no mixing of fixed, float, and double would be possible. The > former choice would allow mixing of fixed, float, and double attributes > in a level. Since it is a compile time switch in the engine I agree there should only be fixed or float in the level (and the whole game for that matter). However, there might be some value to supporting multiple precisions at once (float vs double) (and 32 bit fixed vs 64 bit fixed, which we do have internally in WF).=20 I can't think of a reason to have Attribedit support fixed any longer, just float & double. (Since the only purpose of the fixed point code was for speed on systems which don't support floating point). In summary I think the tools should all work only in floating point, the engine should be buildable for fixed or float, and iff2lvl should convert as appropriate. so I am suggesting: * add 'FLOT' & 'DOBL' support to iffcomp.=20 * add ability to edit 'FLOT' and 'DOBL' to AttribEdit * add ability to read 'FLOT' and 'DOBL' chunks to iff2lvl (and output fixed point) * modify oad file generation to output 'FLOT' instead of 'F32' (and consider adding a double precision scalar type which would output 'DOBL') * finally, add a switch to iff2lvl to output floating point data in the=20 lvl file and change the .ht file generation to generate headers which specify floats (both of these would occur based on the SCALAR_TYPE switch). =20 --=20 Kevin Seghetti: E-Mail: kt...@te..., HTTP: www.tenetti.org GPG public key: http://tenetti.org/phpwiki/index.php/KevinSeghettiGPGKey Check out www.worldfoundry.org for my GPL'ed 3D video game engine |