ObjectDesc *copy_memory(DomainDesc * src, DomainDesc * dst, struct MemoryProxy_s *obj, u4_t * quota) { if (obj == NULL) return NULL; if (src == dst) return obj; if (src == domainZero) { MemoryProxyHandle handle = allocMemoryProxyInDomain(dst, obj2ClassDesc(obj), obj->mem, obj->size); ObjectDesc *o = unregisterObject(dst, handle); //printf("MEMADDR2: %p\n", o); addToRefTable(obj, o); return (ObjectDesc *) o; } #ifdef ALLOW_SHARING { MemoryProxyHandle handle = allocMemoryProxyInDomain(dst, obj2ClassDesc(obj), obj->mem, obj->size); ObjectDesc *o = unregisterObject(dst, handle); //printf("MEMADDR2: %p\n", o); addToRefTable(obj, o); return (ObjectDesc *) o; } #else exceptionHandlerMsg(THROW_RuntimeException, "Memory objects cannot be copied between domains in the current configuration"); #endif }
void GPBFile::addScenelessNode(Node* node) { addToRefTable(node); _nodes.push_back(node); // Nodes are normally written to file as part of a scene. // Nodes that don't belong to a scene need to be written on their own (outside a scene). // That is why node is added to the list of objects here. _objects.push_back(node); }
void GPBFile::addAnimation(Animation* animation) { _animations.add(animation); if (!_animationsAdded) { // The animations container should only be added once and only if the file has at least one animation. _animationsAdded = true; addToRefTable(&_animations); add(&_animations); } }
void GPBFile::addNode(Node* node) { addToRefTable(node); _nodes.push_back(node); }
void GPBFile::addMesh(Mesh* mesh) { addToRefTable(mesh); _geometry.push_back(mesh); }
void GPBFile::addLight(Light* light) { addToRefTable(light); _lights.push_back(light); }
void GPBFile::addCamera(Camera* camera) { addToRefTable(camera); _cameras.push_back(camera); }
void GPBFile::addScene(Scene* scene) { addToRefTable(scene); _objects.push_back(scene); }