当前位置: 首页>>代码示例>>C++>>正文


C++ PropertyBag::getFileName方法代码示例

本文整理汇总了C++中PropertyBag::getFileName方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyBag::getFileName方法的具体用法?C++ PropertyBag::getFileName怎么用?C++ PropertyBag::getFileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PropertyBag的用法示例。


在下文中一共展示了PropertyBag::getFileName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: load

void ComponentExitMapOnUse::load(const PropertyBag &data)
{
	resetMembers();
	nextMap = data.getFileName("nextMap");
	sfxOnFail = data.getFileName("sfxOnFailed");
	requiresCoins = data.getBool("requiresCoins");
}
开发者ID:foxostro,项目名称:heroman,代码行数:7,代码来源:ComponentExitMapOnUse.cpp

示例2: load

void ActorSet::load(const PropertyBag &objects, World *_world)
{
	ASSERT(_world!=0, "world was null");
	world = _world;

	for(size_t i=0, n=objects.getNumInstances("object"); i<n; ++i)
	{
		const tuple<OBJECT_ID, ActorPtr> t = create();
		const ActorPtr object = t.get<1>();

		const PropertyBag decl = objects.getBag("object", i);
		const FileName templateFile = decl.getFileName("template");
		const vec3 initialPosition = decl.getVec3("position");
		const PropertyBag templateData = PropertyBag::fromFile(templateFile);
		const PropertyBag base = templateData.getBag("components");

		ComponentDataSet s = ComponentDataSet::load(base, decl);

		// get actor name
		object->actorName = "(no name)";
		templateData.get("name", object->actorName);

		object->load(s, initialPosition, vec3(0,0,0), world);
		object->setParentBlackBoard(this);
	}
}
开发者ID:foxostro,项目名称:heroman,代码行数:26,代码来源:ActorSet.cpp

示例3: load

void ComponentRenderAsModel::load(const PropertyBag &data)
{
	resetMembers();
	const FileName modelFileName = data.getFileName("model");
	loadModel(modelFileName);
	data.get("independentModelOrientation", independentModelOrientation);
}
开发者ID:foxostro,项目名称:heroman,代码行数:7,代码来源:ComponentRenderAsModel.cpp

示例4: setup

void Font::setup(const PropertyBag &data)
{
	fontSize.clear();
	fontSize[Font::SizeHuge]   = data.getFloat("huge");
	fontSize[Font::SizeLarge]  = data.getFloat("large");
	fontSize[Font::SizeNormal] = data.getFloat("normal");
	fontSize[Font::SizeSmall]  = data.getFloat("small");

	spacing = data.getFloat("spacing");
	lineHeight = data.getFloat("lineHeight");

	loadFontImage(data.getFileName("image"));
}
开发者ID:foxostro,项目名称:heroman,代码行数:13,代码来源:Font.cpp

示例5: animationSequence

AnimationController*
ModelLoaderSingle::loadFromFile(const FileName &fileName,
							    TextureFactory &textureFactory) const
{
	PropertyBag xml = PropertyBag::fromFile(fileName);

	const FileName directory = fileName.getPath();

	// Winding of polygons, either "CCW" or "CW"
	string polygonWinding = "CW";
	xml.get("polygonWinding", polygonWinding);

	// Allocate a blank animation controller
	AnimationController *controller = new AnimationController();

	// Get key frames from the first source
	PropertyBag fileBag = xml.getBag("model", 0);
	const FileName file = directory.append(fileBag.getFileName("file"));
	FileName skinName;
	if(fileBag.get("skin", skinName))
	{
		skinName = directory.append(skinName);
	}
	vector<KeyFrame> keyFrames = loadKeyFrames(file, skinName, textureFactory);

	// Get the rest of the key frames
	for(size_t i = 1, numMD3 = xml.getNumInstances("model"); i<numMD3; ++i)
	{
		PropertyBag fileBag = xml.getBag("model", i);
		const FileName file = directory.append(fileBag.getFileName("file"));
		FileName skinName;
		if(fileBag.get("skin", skinName))
		{
			skinName = directory.append(skinName);
		}

		vector<KeyFrame> k = loadKeyFrames(file, skinName, textureFactory);

		for(size_t i=0; i<k.size(); ++i)
		{
			KeyFrame &keyFrame = keyFrames[i];

			keyFrame.merge(k[i]);

			// set polygon windings according to data file
			setPolygonWinding(keyFrame, polygonWinding);
		}
	}

	// Build the animations from these keyframes
	for(size_t i = 0, numAnimations = xml.getNumInstances("animation");
		i<numAnimations;
		++i)
	{
		PropertyBag animation;
		string name;
		bool looping=false;
		int start=0;
		float priority=0;
		int length=0;
		float fps=0;

		xml.get("animation", animation, i);
		animation.get("name", name);
		animation.get("priority", priority);
		animation.get("looping", looping);
		animation.get("start", start);
		animation.get("length", length);
		animation.get("fps", fps);

		// Add it to the controller
		AnimationSequence animationSequence(keyFrames,
		                                    name,
											priority,
											looping,
											start,
											length,
											fps);
		controller->addAnimation(animationSequence);
	}

	return controller;
}
开发者ID:foxostro,项目名称:heroman,代码行数:83,代码来源:ModelLoaderSingle.cpp


注:本文中的PropertyBag::getFileName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。