🎉 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!
Standart array - erase, push_back
If you wish to implement them yourself, it shouldn't be too difficult. You just need to modify the as_arrayobject.cpp file, to add the new methods and register them.
static void ArrayObjectPushBack(void *element, asCArrayObject *self){ ...}r = engine->RegisterSpecialObjectMethod(asDEFAULT_ARRAY, "void push_back(?????)", asFUNCTION(ArrayObjectPushBack), asCALL_CDECL_OBJLAST); asASSERT( r >= 0 );
????? - how to define the correct type?
Hmm, I believe I've rushed my answer. It is not so easy after all to add this support. The built-in array object is quite tightly integrated with the compiler. Each method on the array object is registered to take a simple reference to an int value, but the compiler knows to pass the correct type to the array object by checking how the variable with the array type has been declared.
I plan on moving the built-in array object out of the engine, and instead create a standard add-on for registering it. When that is done it will be easy to register the needed methods. Unfortunately it will still be a while before I can complete this enhancement.
I plan on moving the built-in array object out of the engine, and instead create a standard add-on for registering it. When that is done it will be easy to register the needed methods. Unfortunately it will still be a while before I can complete this enhancement.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement