-
Notifications
You must be signed in to change notification settings - Fork 14
[LeGo] add support for local variables #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Heyo, thanks for the PR. I immediately noticed that you made a breaking change by (a) altering the return type of I ask because switching to C++20 might be a non-trivial change for downstream users of ZenKit, so I'd like to avoid it if reasonably possible. Also, I would like to avoid breaking existing APIs without warning. |
Yeah, some CoM/LeGo scripts, that are now available are on critical path. One of those would be
It's 5 yeas old standard... |
|
That performance increase is indeed very compelling. I'll check C++20 against the C-wrapper at least, before just enabling it. You're right, C++20 is an old standard by now but a lot of ZenKit still uses the old C++17-style SFINAE patterns and such, so there will be some more clean up to do after I upgrade to it :) That's probably a good thing though |
This commit introduces a breaking change: ZenKit-CAPI no longer supports C++20. Instead, it must be compiled with a C++20-capable compiler. This change has been introduced in order to facilitate GothicKit/ZenKit#118. There are no API changes.
This PR introduces api to work with local variables in form of
set_local_variables_enableis intended to be called fromlocal()call override in LeGo based mod.Since engine has to wait for
local()call, it mean on very first invocation we wont know for sure, if particular function has intent to use local-variables.During runtime, if function annotated with
has_local_variables_enabled, is called:local()used.C++20 update
Since work with local variables is on critical path (frame-function in lego, timers and anim8-animations), performance is important. For that sake have had to use
std::spanforfind_locals_for_function, as well as forfind_parameters_for_function.I hope C++20 is fine (and minor api break) - it's 5 years old already and should be widely supported.