Implements support for registering types and functions in AngelScript externally.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -55,6 +55,19 @@ public:
|
||||
return _typeDatabase;
|
||||
}
|
||||
|
||||
void RegisterType(const char* type) {
|
||||
int r = _engine->RegisterObjectType(type, 0, asOBJ_REF | asOBJ_NOCOUNT);
|
||||
Assert(r >= 0);
|
||||
}
|
||||
void RegisterTypeMethod(const char* type, const char* decl, void*(func)(void*)) {
|
||||
int r = _engine->RegisterObjectMethod(type, decl, asFunctionPtr(func), asCALL_CDECL_OBJFIRST);
|
||||
Assert(r >= 0);
|
||||
}
|
||||
void RegisterGlobalMethod(const char* decl, void*(func)(void*)) {
|
||||
auto r = _engine->RegisterGlobalFunction("decl", asFunctionPtr(func), asCALL_CDECL);
|
||||
Assert(r >= 0);
|
||||
}
|
||||
|
||||
asITypeInfo* GetBaseType(const ConstString& name) {
|
||||
asITypeInfo* t = nullptr;
|
||||
if (!_baseTypes.TryGet(name, t)) {
|
||||
|
||||
Reference in New Issue
Block a user