Allow AS_ALLOW_UNSAFE_REFERENCES to be chosen at run-time?
Hi All,
I'm currently using angelscript with AS_ALLOW_UNSAFE_REFERENCES defined due to the need to implement a "quick & dirty" scripting interface. Ideally I'd like a way to use this setting without having to recompile & modify the project settings from their defaults. The main problem is that I have to go in and modify the SDK when I ideally want to treat it as read-only - this becomes a pain as I'm directly referencing the 2.7.0 tag from my own subversion repository.
Having looked at the places AS_ALLOW_UNSAFE_REFERENCES is used it looks like a fairly straightforward task to change this to a run-time flag. What about asIScriptEngine::SetAllowUnsafeReferences(bool allow)?
Cheers,
Will Wilson.
I'm starting to think this might actually be a good solution. Though I have to be careful to make sure code compiled with the option turned on will be compatible with code compiled with the option turned off (or if they are not compatible the engine must detect that and throw an error if it is tried.)
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
This could be a property of the engine that's specified when you create it. It seems like too fundamental of a property to allow mixing both styles inside the same engine.
Yes, you're probably right. I'll see if there is a way to mix the two safely, but if not I'll make it a static property set at creation time as you suggested.
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 Deyja
This could be a property of the engine that's specified when you create it.
Hi,
I think that would be great. Changing it during runtime doesn't make to much sense for me at all. But setting it during engine initialization would be perfect.
Bye,
Martin
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement