AngelScript 2.10.0 released
Are we going to get a truly uniform interface for setting arguments that can handle all types the same way?
Globals already have this kind of interface.
Quote:
Is there any real difference between GetArgAddress & GetArgObject and between SetReturnAddress & SetReturnObject? I have a feeling this is the reason for my problem...
Yes there is. GetArgAddress and SetReturnAddress is the raw access to the pointer value, it doesn't add or release references. GetArgObject and SetReturnObject is more intelligent and will increase references of object handles, and in case of object values it will create copies of the object as necessary.
Deyja:
If you don't feel there is a need to upgrade then it's perfectly fine to continue with the version you're using.
I'm continously improving the interface to make it easier to use, currently the GetArgPointer and GetReturnPointer is the best interface if you want a uniform interface. It gives you the address of the location where the value is stored, and let's you set the value as needed. It may not be perfect yet, but let me know how I can make it better and I'll see what I can do.
Regards,
Andreas
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
Quote:You misconstrue. It's not that I don't need or want to, it's just that I haven't bothered.
If you don't feel there is a need to upgrade then it's perfectly fine to continue with the version you're using.
Quote:
I'm continously improving the interface to make it easier to use, currently the GetArgPointer and GetReturnPointer is the best interface if you want a uniform interface. It gives you the address of the location where the value is stored, and let's you set the value as needed. It may not be perfect yet, but let me know how I can make it better and I'll see what I can do.
The issue, if I remember the behavior you described in another thread, is that these functions treat primitive and object types differently. In one case, they return a pointer to the value, and in the other, they return a pointer to a pointer.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
Quote:
Original post by WitchLord
Yes there is. GetArgAddress and SetReturnAddress is the raw access to the pointer value, it doesn't add or release references. GetArgObject and SetReturnObject is more intelligent and will increase references of object handles, and in case of object values it will create copies of the object as necessary.
And what about properties being registered like
engine->RegisterObjectType("signal_t", 0, asOBJ_REF | asOBJ_NOHANDLE);
should I use GetArgAddress/SetReturnAddress or GetArgObject/SetReturnObject to access "signal_t" type variables?
This combination of flags is only useful for singletons, where a global property is registered from the application to give the script access to the singleton's methods and properties.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
Is this an unwanted AS behaviour?
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game