void TriggerNode::writeXml(Xml *xml) const { Node::writeXml(xml); xml->setChildData("group", group); if (intersectGroup) xml->setChildData("intersect_group", intersectGroup); Xml *parent = NULL; for (int i=0; i<TRIGGER_EVENT_COUNT; i++) { if (events[i].name == "") continue; if (parent == NULL) { parent = xml->addChild("events"); } Xml *event = parent->addChild("event"); event->setArg("type", getTriggerEventName(TriggerEventType(i))); event->setData(events[i].name); } }
void ParticleSystemNode::writeXml(Xml *xml) const { Node::writeXml(xml); Xml *child = NULL; xml->setChildData("emitter", int(emitter)); xml->setChildData("spawn_rate", spawnRate); // life_time child = xml->addChild("life_time"); child->setData(lifeTime); child->setArg("dispersion", lifeTimeDispersion); // size child = xml->addChild("size"); child->setData(size); child->setArg("dispersion", sizeDispersion); // growth child = xml->addChild("growth"); child->setData(growth); child->setArg("dispersion", growthDispersion); // speed child = xml->addChild("speed"); child->setData(speed); child->setArg("mag_dispersion", speedDispersion); child->setArg("dir_dispersion", directionDispersion); // src_color child = xml->addChild("src_color"); child->setData(srcColor); child->setArg("dispersion", srcColorDispersion); // dst_color child = xml->addChild("dst_color"); child->setData(dstColor); child->setArg("dispersion", dstColorDispersion); // gravity xml->setChildData("gravity", gravity); }