Open CorvusPrudens opened 3 years ago
Not a bad idea.
I've seen a few other generator-friendly glue code that's got a bunch of functions for different types -- i.e. AsFloat()
asInt()
asString()
, etc.
Afaik most things already cast to float without too much issue (i.e. Switch::Pressed() can be cast to float and it should resolve to 0/1), and for actual use within c++, it is still preferable from a performance perspective to work with integer types where possible.
Since the intended uses for the generated code is not only PD, it's not necessary (and maybe undesirable) to convert everything to a float.