-
Notifications
You must be signed in to change notification settings - Fork 69
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
Three new API functions #2566
Three new API functions #2566
Conversation
ksp_plugin/interface_external.cpp
Outdated
return m.Return( | ||
MakeStatus(Error::INVALID_ARGUMENT, "|plugin| must not be null")); | ||
} | ||
Instant const t = FromGameTime(*plugin, time); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move down, closer to the place where you need it.
ksp_plugin/interface_external.cpp
Outdated
return m.Return( | ||
MakeStatus(Error::INVALID_ARGUMENT, "|plugin| must not be null")); | ||
} | ||
Instant const t = FromGameTime(*plugin, time); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move down, closer to the place where you need it.
ksp_plugin/interface_external.cpp
Outdated
return m.Return( | ||
MakeStatus(Error::INVALID_ARGUMENT, "|plugin| must not be null")); | ||
} | ||
Instant const t = FromGameTime(*plugin, time); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move down, closer to the place where you need it.
ksp_plugin/interface_external.cpp
Outdated
.str())); | ||
} | ||
using Surface = Frame<enum class SurfaceTag>; | ||
auto const to_world_axes = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a real type instead of auto
.
retest this please |
Using the API requested with mockingbirdnest/Principia#2542 and added with mockingbirdnest/Principia#2566 Extracted the body, waypoint and vessel calculation shenanigans into a delegate Added a delegate with principia implementation and using that in case principia is detected
Principia doesn't guarantee that the values in the object passed from within the realms of it's inconceivable depths are, or will remain to be, fields or properties. So use the reflection method from their wiki, and care about possible performance considerations later. See also mockingbirdnest/Principia#2566
Fix #2542.
Tested in-game; if we want to add the test utility (a separate DLL which just calls those endpoints by reflection and dumps the output or exceptions to a window) we should do it in a separate pull request.
Note that despite the work on the UTF-8 marshalers we still lack the capability to produce strings as struct fields, so Status still lacks a message. This may be a lower-hanging fruit than it was when that TODO was written though.