internal
| 5643 | |
| 5644 | // internal |
| 5645 | void asCScriptEngine::ConstructScriptObjectCopy(void *mem, void *obj, asCObjectType *type) |
| 5646 | { |
| 5647 | if( type == 0 || mem == 0 || obj == 0 ) return; |
| 5648 | |
| 5649 | // This function is only meant to be used for value types |
| 5650 | asASSERT( type->flags & asOBJ_VALUE ); |
| 5651 | |
| 5652 | // Call the copy constructor if available, else call the default constructor followed by the opAssign |
| 5653 | int funcIndex = type->beh.copyconstruct; |
| 5654 | if( funcIndex ) |
| 5655 | { |
| 5656 | CallObjectMethod(mem, obj, funcIndex); |
| 5657 | } |
| 5658 | else |
| 5659 | { |
| 5660 | funcIndex = type->beh.construct; |
| 5661 | if( funcIndex ) |
| 5662 | CallObjectMethod(mem, funcIndex); |
| 5663 | |
| 5664 | AssignScriptObject(mem, obj, type); |
| 5665 | } |
| 5666 | } |
| 5667 | |
| 5668 | // interface |
| 5669 | int asCScriptEngine::AssignScriptObject(void *dstObj, void *srcObj, const asITypeInfo *type) |