🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

asEP_ALLOW_IMPLICIT_HANDLE_TYPES

Started by
0 comments, last by WitchLord 10 years, 8 months ago

I know this option is experimental, but does it work at all? I'm trying to register a class with "@Name" and this option true, but it fails with asINVALID_NAME. token = ttHandle

as_scriptengine.cpp(1687)


// Make sure the name is not a reserved keyword
size_t tokenLen;
int token = tok.GetToken(name, typeName.GetLength(), &tokenLen);
if( token != ttIdentifier || typeName.GetLength() != tokenLen )
	return ConfigError(asINVALID_NAME, "RegisterObjectType", name, 0);

asEP_ALLOW_IMPLICIT_HANDLE_TYPES

This option is experimental. By turning it on script classes can be declared to always be treated as handles by declaring the class with @ before the name of the class. When this is done all variables of that type will be handles, and the assignment operator will always perform a handle assignment.

Advertisement

It is so experimental and poorly documented that not even I know exactly how it works. I had to take a peek at code to remember what it does. :)

This engine property currently only affects script classes. You cannot register application types to use the implicit handle feature.

To declare a script class to use implicit handle you write the script like this:

[source]

class@ MyClass {}

[/source]

Once the class is declared to use implicit handles, all variables and parameters declared of that type will be implicitly declared as handles, and the assignment operator will be implicitly treated as a handle assignment instead of an value assignment.

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 topic is closed to new replies.

Advertisement