Hi again!! (You're gonna hate me heh) :P
I have a C++ class method registered in AngelScript like this:
if (ScriptMgr::RegisterObjectMethod(_className, "bool AddEntity(const IsoSprite@+, int col, int row, int layer)",asMETHODPR(IsoMap, AddEntity, (IsoSprite*, int, int, int), bool),asCALL_THISCALL) < 0)
return false;
So I want to pass a reference to an object in AngelScript with this code:
IsoMap _iso;
IsoSprite[] _sprite;
.
.
.
_iso.AddEntity(@_sprite[0], col, row, 0);
But i have an error that says "Invalid reference".
So, I had to do something like this:
IsoMap _iso;
IsoSprite@[] _sprite;
.
.
for (int i=0; i < 100; i++) {
IsoSprite sprtemp;
@_sprite = @sprtemp;
if (!_sprite.Load("data/iso/residencia1.spr"))
return false;
}
_iso.AddEntity(_sprite[0], col, row, 0);
Well, is there a way to do that without all of this?
I've tried also registering the class with ∈, but it copies the object so when i try to modify some of the properties in AngelScript, in C++ the object stills the same because it is a copy of the original.
Thanks a lot!!
=====================================Regards,Juan Pablo (McKrackeN) Bettini Psychoban Official Site:http://www.psychoban.comPsychoban on iTunes App Store:http://itunes.apple.com/us/app/psychoban/id378692853?mt=8