Advertisement

template with handle

Started by August 21, 2009 02:51 AM
3 comments, last by WitchLord 15 years, 3 months ago
Hey, I just wonder if I can use array<clsA@> inside script? Also, if I use Vector template to register a reference class clsA, what should I register as:

RegisterVector<clsA>(clsA[], clsA, pScriptEngine); 
or

RegisterVector<clsA*>(clsA[], clsA, pScriptEngine);
Cheers
I assume you're talking about the new script array template add-on. Yes, you can use array<clsA@>.

The RegisterVector template is based on std::vector and won't perform the proper reference counting necessary to do an array of object handles.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement
Quote: Original post by WitchLord
I assume you're talking about the new script array template add-on. Yes, you can use array<clsA@>.

The RegisterVector template is based on std::vector and won't perform the proper reference counting necessary to do an array of object handles.



clsShape@ shape; // passed with executeStringarray<clsShape@> shapes; // executeString return -1.


Anything wrong?
Looks like it is a scenario I missed testing when developing the template support. Most likely it's just a parser problem and should be easily fixed. I'll let you know as soon as I have the fix.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I've fixed this bug in revision 472. Thanks.

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