👼Script: Added partial support for AngelScript maximum portability mode - #3444
👼Script: Added partial support for AngelScript maximum portability mode#3444EMN-CSharp wants to merge 8 commits into
Conversation
Generated with support for functions with up to 8 parameters for now.
…nes! I initially implemented generic bindings for Turbojet to do some initial testing, since it has just a few methods :)
Added this for making testing easier.
|
|
||
| #include "InputEngine.h" | ||
|
|
||
| #define REGISTER_NATIVE_OR_GENERIC(native, generic) if (max_portability) generic(engine); else native(engine); |
There was a problem hiding this comment.
Generic and native bindings can't be mixed - if actually compiled on a platform not supporting natives, their registrations will probably error out, but either way we shouldn't try to mix them at all.
Please remake this in the angelscript-addons convention, and where generic bindings aren't available, just register nothing (you may log a warning to Angelscript.log).
void RegisterActor(asIScriptEngine * engine)
{
RegisterActorCommon();
if (strstr(asGetLibraryOptions(), "AS_MAX_PORTABILITY"))
RegisterActorGeneric(engine);
else
RegisterActorNative(engine);
}
You can place these funcs as inline into 'AngelScriptBindings.h' I suppose.
|
I tested using the cvar and everything seems to be running fine. However, currently there are mixed native/generic bindings which wouldn't work on actual non-native platform, see above. |
|
Yes, I'm aware of that. I mixed generic and native bindings because I wanted to test with all the bindings available, I'll change it tonight. |
Now only one of them is registered, unless diag_angelscript_generic_bind_test is set to true. Other changes: - Renamed all Register*() functions for native bindings to Register*Native(). - Renamed CVar diag_force_generic_as_bindings to diag_angelscript_generic_bind_test.
Ported bindings: - `AircraftEngineClass` - `AutopilotClass` - `DashBoardManagerClass` - `EngineClass` - `ScrewpropClass` - `TurbopropClass` - `VehicleAIClass`
This PR adds all the basic components needed for supporting AngelScript in maximum portability mode, and implements the first generic bindings for
BeamClass,GameScriptClassandTurbojetClass(I did the first tests withTurbojetsince it has just a few methods :) ).