Christian Mayer writes:

 > THat's nice, but the 'problem' with fgGetBool is still existant (and
 > it's getting worse as we are using the property system more and more).

fgGetBool may be taking longer because it's accessing a property
that's not typed as a bool.  If you have this in an init file

  <my-prop>false</my-prop>

or this on the command line

  -prop:/my-prop=false

the property is stored as a string with type 'unknown' until someone
ties it to something or sets its value (either of which will change
the type).  That means that it will be converted from a char * string
to bool every time it is accessed.  The fix is to use

  <my-prop type="bool">false</my-prop>

to give a hint to the property manager that the value can be stored as
a bool.

It might be worth adding another optimization to the property manager
to cache previously-converted values -- I'll have to think about that
(it won't work at all with tied properties, of course).


All the best,


David

-- 
David Megginson
[EMAIL PROTECTED]


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to