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


C++ SeekableReadStream::readSint32BE方法代码示例

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


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

示例1: parseOpcodeDefault

void parseOpcodeDefault(Instruction &instr, Common::SeekableReadStream &ncs) {
	instr.argCount = getDirectArgumentCount(instr.opcode);

	const OpcodeArgument * const args = getDirectArguments(instr.opcode);
	for (size_t i = 0; i < instr.argCount; i++) {
		instr.argTypes[i] = args[i];

		switch (instr.argTypes[i]) {
			case kOpcodeArgUint8:
				instr.args[i] = ncs.readByte();
				break;

			case kOpcodeArgUint16:
				instr.args[i] = ncs.readUint16BE();
				break;

			case kOpcodeArgSint16:
				instr.args[i] = ncs.readSint16BE();
				break;

			case kOpcodeArgSint32:
				instr.args[i] = ncs.readSint32BE();
				break;

			case kOpcodeArgUint32:
				instr.args[i] = (int32)ncs.readUint32BE();
				break;

			default:
				break;
		}
	}
}
开发者ID:asr1,项目名称:xoreos-tools,代码行数:33,代码来源:instruction.cpp

示例2: parseOpcodeConst

void parseOpcodeConst(Instruction &instr, Common::SeekableReadStream &ncs) {
	switch (instr.type) {
		case kInstTypeInt:
			instr.constValueInt = ncs.readSint32BE();
			break;

		case kInstTypeFloat:
			instr.constValueFloat = ncs.readIEEEFloatBE();
			break;

		case kInstTypeString:
		case kInstTypeResource:
			instr.constValueString = readStringQuoting(ncs, ncs.readUint16BE());
			break;

		case kInstTypeObject:
			instr.constValueObject = ncs.readUint32BE();
			break;

		default:
			throw Common::Exception("Illegal type for opcode CONST: 0x%02X", (uint8)instr.type);
	}

	instr.argTypes[0] = kOpcodeArgVariable;

	instr.argCount = 1;
}
开发者ID:asr1,项目名称:xoreos-tools,代码行数:27,代码来源:instruction.cpp

示例3: loadDataFromFile

void TimerManager::loadDataFromFile(Common::SeekableReadStream &file, int version) {
	const uint32 loadTime = _isPaused ? _pauseStart : _system->getMillis();

	if (version <= 7) {
		_nextRun = 0;
		for (int i = 0; i < 32; ++i) {
			uint8 enabled = file.readByte();
			int32 countdown = file.readSint32BE();
			uint32 nextRun = file.readUint32BE();

			Iterator timer = Common::find_if(_timers.begin(), _timers.end(), TimerEqual(i));
			if (timer != _timers.end()) {
				timer->enabled = enabled;
				timer->countdown = countdown;

				if (nextRun) {
					timer->nextRun = nextRun + loadTime;
					timer->lastUpdate = timer->nextRun - countdown * _vm->tickLength();
				} else {
					timer->nextRun = loadTime;
					timer->lastUpdate = loadTime - countdown * _vm->tickLength();
				}
			} else {
				warning("Loading timer data for non existing timer %d", i);
			}
		}
	} else {
		int entries = file.readByte();
		for (int i = 0; i < entries; ++i) {
			uint8 id = file.readByte();

			Iterator timer = Common::find_if(_timers.begin(), _timers.end(), TimerEqual(id));
			if (timer != _timers.end()) {
				timer->enabled = file.readByte();
				timer->countdown = file.readSint32BE();
				timer->lastUpdate = file.readSint32BE();
			} else {
				warning("Loading timer data for non existing timer %d", id);
				file.seek(7, SEEK_CUR);
			}
		}

		resync();
	}
}
开发者ID:havlenapetr,项目名称:Scummvm,代码行数:45,代码来源:timer.cpp


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