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


C++ UString::readLineASCII方法代码示例

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


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

示例1: load

void TXI::load(Common::SeekableReadStream &stream) {
	while (!stream.eos()) {
		Common::UString line;

		line.readLineASCII(stream);
		if (line.empty())
			break;

		if (_mode == kModeUpperLeftCoords) {
			std::sscanf(line.c_str(), "%f %f %f",
					&_features.upperLeftCoords[_curCoords].x,
					&_features.upperLeftCoords[_curCoords].y,
					&_features.upperLeftCoords[_curCoords].z);

			if (++_curCoords >= _features.upperLeftCoords.size())
				_mode = kModeNormal;
			continue;
		}
		if (_mode == kModeLowerRightCoords) {
			std::sscanf(line.c_str(), "%f %f %f",
					&_features.lowerRightCoords[_curCoords].x,
					&_features.lowerRightCoords[_curCoords].y,
					&_features.lowerRightCoords[_curCoords].z);

			if (++_curCoords >= _features.lowerRightCoords.size())
				_mode = kModeNormal;
			continue;
		}

		int skip = 0;
		TXICommand command = parseTXICommand(line, skip);

		if      (command == TXICommandAlphaMean)
			line.parse(_features.alphaMean, skip);
		else if (command == TXICommandArturoHeight)
			line.parse(_features.arturoHeight, skip);
		else if (command == TXICommandArturoWidth)
			line.parse(_features.arturoWidth, skip);
		else if (command == TXICommandBaselineHeight)
			line.parse(_features.baselineHeight, skip);
		else if (command == TXICommandBlending)
			_features.blending = parseBlending(line.c_str() + skip);
		else if (command == TXICommandBumpMapScaling)
			line.parse(_features.bumpMapScaling, skip);
		else if (command == TXICommandBumpMapTexture)
			_features.bumpMapTexture = line.c_str() + skip;
		else if (command == TXICommandBumpyShinyTexture)
			_features.bumpyShinyTexture = line.c_str() + skip;
		else if (command == TXICommandCanDownsample)
			line.parse(_features.canDownsample, skip);
		else if (command == TXICommandCaretIndent)
			line.parse(_features.caretIndent, skip);
		else if (command == TXICommandChannelScale)
			line.parse(_features.channelScale, skip);
		else if (command == TXICommandChannelTranslate)
			line.parse(_features.channelTranslate, skip);
		else if (command == TXICommandClamp)
			line.parse(_features.clamp, skip);
		else if (command == TXICommandCodepage)
			line.parse(_features.codepage, skip);
		else if (command == TXICommandCols)
			line.parse(_features.cols, skip);
		else if (command == TXICommandCompressTexture)
			line.parse(_features.compressTexture, skip);
		else if (command == TXICommandControllerScript)
			_features.controllerScript = line.c_str() + skip;
		else if (command == TXICommandCube)
			line.parse(_features.cube, skip);
		else if (command == TXICommandDBMapping)
			line.parse(_features.dbMapping, skip);
		else if (command == TXICommandDecal)
			line.parse(_features.decal, skip);
		else if (command == TXICommandDefaultBPP)
			line.parse(_features.defaultBPP, skip);
		else if (command == TXICommandDefaultHeight)
			line.parse(_features.defaultHeight, skip);
		else if (command == TXICommandDefaultWidth)
			line.parse(_features.defaultWidth, skip);
		else if (command == TXICommandDistort)
			line.parse(_features.distort, skip);
		else if (command == TXICommandDistortAngle)
			line.parse(_features.distortAngle, skip);
		else if (command == TXICommandDistortionAmplitude)
			line.parse(_features.distortionAmplitude, skip);
		else if (command == TXICommandDownsampleFactor)
			line.parse(_features.downsampleFactor, skip);
		else if (command == TXICommandDownsampleMax)
			line.parse(_features.downsampleMax, skip);
		else if (command == TXICommandDownsampleMin)
			line.parse(_features.downsampleMin, skip);
		else if (command == TXICommandEnvMapTexture)
			_features.envMapTexture = line.c_str() + skip;
		else if (command == TXICommandFileRange)
			line.parse(_features.fileRange, skip);
		else if (command == TXICommandFilter)
			line.parse(_features.filter, skip);
		else if (command == TXICommandFontHeight)
			line.parse(_features.fontHeight, skip);
		else if (command == TXICommandFontWidth)
			line.parse(_features.fontWidth, skip);
//.........这里部分代码省略.........
开发者ID:gitter-badger,项目名称:xoreos,代码行数:101,代码来源:txi.cpp


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