本文整理汇总了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;
}
}
}
示例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;
}
示例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();
}
}