示例#1
0
	Resource *ResBuffer::create(CreateResourceContext &context)
	{
		ResBuffer *rs = new ResBuffer();
		string file = context.node.attribute("file").value();

		rs->setName(Resource::extractID(context.node, file, ""));
		rs->init((*context.folder + file).c_str());
		setNode(rs, context.node);

		return rs;
	}
	Resource *ResBuffer::create(CreateResourceContext &context)
	{
		ResBuffer *rs = new ResBuffer();
		pugi::xml_node node = context.walker.getNode();
		string file = node.attribute("file").value();

		rs->setName(Resource::extractID(node, file, ""));
		rs->init(context.walker.getPath("file").c_str());
		setNode(rs, node);

		return rs;
	}