本文整理汇总了C++中serializer::Reader::Int32方法的典型用法代码示例。如果您正苦于以下问题:C++ Reader::Int32方法的具体用法?C++ Reader::Int32怎么用?C++ Reader::Int32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类serializer::Reader
的用法示例。
在下文中一共展示了Reader::Int32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadAnimations
void BinaryConverter::LoadAnimations(Serializer::Reader &rd)
{
//load channels and PRS keys
const Uint32 numAnims = rd.Int32();
for (Uint32 i = 0; i < numAnims; i++) {
const std::string animName = rd.String();
const double duration = rd.Double();
Animation *anim = new Animation(animName, duration);
const Uint32 numChans = rd.Int32();
for (Uint32 j = 0; j < numChans; j++) {
const std::string tgtName = rd.String();
MatrixTransform* tgtNode = dynamic_cast<MatrixTransform*>(m_model->m_root->FindNode(tgtName));
anim->m_channels.push_back(AnimationChannel(tgtNode));
auto& chan = anim->m_channels.back();
for (Uint32 numKeys = rd.Int32(); numKeys > 0; numKeys--) {
const double ktime = rd.Double();
const vector3f kpos = rd.Vector3f();
chan.positionKeys.push_back(PositionKey(ktime, kpos));
}
for (Uint32 numKeys = rd.Int32(); numKeys > 0; numKeys--) {
const double ktime = rd.Double();
const Quaternionf krot = rd.RdQuaternionf();
chan.rotationKeys.push_back(RotationKey(ktime, krot));
}
for (Uint32 numKeys = rd.Int32(); numKeys > 0; numKeys--) {
const double ktime = rd.Double();
const vector3f kscale = rd.Vector3f();
chan.scaleKeys.push_back(ScaleKey(ktime, kscale));
}
}
m_model->m_animations.push_back(anim);
}
}
示例2: Load
void Missile::Load(Serializer::Reader &rd, Space *space)
{
Ship::Load(rd, space);
m_ownerIndex = rd.Int32();
m_power = rd.Int32();
m_armed = rd.Bool();
}
示例3: AICommand
AIParagonCmdGoTo::AIParagonCmdGoTo(Serializer::Reader &rd) : AICommand(rd, CMD_PARAGON_GOTO)
{
m_targetFrameIndex = rd.Int32();
m_targetPosition = rd.Vector3d();
m_toTransit = rd.Bool();
if(Game::s_loadedGameVersion >= 77) { // Save game upgrade: 76 -> 77
m_targetOrient = matrix3x3d::FromVectors(
rd.Vector3d(), rd.Vector3d(), rd.Vector3d());
m_startPO.pos = rd.Vector3d();
m_startPO.xaxis = rd.Vector3d();
m_startPO.yaxis = rd.Vector3d();
m_startPO.zaxis = rd.Vector3d();
m_endPO.pos = rd.Vector3d();
m_endPO.xaxis = rd.Vector3d();
m_endPO.yaxis = rd.Vector3d();
m_endPO.zaxis = rd.Vector3d();
m_speedLimit = rd.Double();
m_arrivalSpeed = rd.Double();
m_mode = static_cast<EGoToMode>(rd.Int32());
}
}
示例4: Load
void Player::Load(Serializer::Reader &rd, Space *space)
{
Pi::player = this;
Ship::Load(rd, space);
MarketAgent::Load(rd);
m_killCount = rd.Int32();
m_knownKillCount = rd.Int32();
}
示例5: Load
void Missile::Load(Serializer::Reader &rd)
{
Ship::Load(rd);
m_ownerIndex = rd.Int32();
m_targetIndex = rd.Int32();
m_distToTarget = rd.Double();
m_power = rd.Int32();
}
示例6: Load
void Projectile::Load(Serializer::Reader &rd, Space *space)
{
Body::Load(rd, space);
m_baseVel = rd.Vector3d();
m_dirVel = rd.Vector3d();
m_age = rd.Float();
m_type = rd.Int32();
m_parentIndex = rd.Int32();
}
示例7: Load
void Player::Load(Serializer::Reader &rd)
{
Pi::player = this;
Ship::Load(rd);
m_flightControlState = static_cast<FlightControlState>(rd.Int32());
m_setSpeed = rd.Double();
m_killCount = rd.Int32();
m_knownKillCount = rd.Int32();
}
示例8: Load
void Projectile::Load(Serializer::Reader &rd, Space *space)
{
Body::Load(rd, space);
for (int i=0; i<16; i++) m_orient[i] = rd.Double();
m_baseVel = rd.Vector3d();
m_dirVel = rd.Vector3d();
m_age = rd.Float();
m_type = rd.Int32();
m_parentIndex = rd.Int32();
}
示例9: Load
void PlayerShipController::Load(Serializer::Reader &rd)
{
m_flightControlState = static_cast<FlightControlState>(rd.Int32());
m_setSpeed = rd.Double();
m_lowThrustPower = rd.Float();
//figure out actual bodies in PostLoadFixup - after Space body index has been built
m_combatTargetIndex = rd.Int32();
m_navTargetIndex = rd.Int32();
m_setSpeedTargetIndex = rd.Int32();
}
示例10: Load
void Planet::Load(Serializer::Reader &rd)
{
Body::Load(rd);
pos = rd.Vector3d();
sbody = Serializer::LookupSystemBody(rd.Int32());
Init();
}
示例11: LoadMaterials
void BinaryConverter::LoadMaterials(Serializer::Reader &rd)
{
for (Uint32 numMats = rd.Int32(); numMats > 0; numMats--) {
MaterialDefinition m("");
m.name = rd.String();
m.tex_diff = rd.String();
m.tex_spec = rd.String();
m.tex_glow = rd.String();
m.tex_ambi = rd.String();
m.tex_norm = rd.String();
m.diffuse = rd.Color4UB();
m.specular = rd.Color4UB();
m.ambient = rd.Color4UB();
m.emissive = rd.Color4UB();
m.shininess = rd.Int16();
m.opacity = rd.Int16();
m.alpha_test = rd.Bool();
m.unlit = rd.Bool();
m.use_pattern = rd.Bool();
if (m.use_pattern) m_patternsUsed = true;
ConvertMaterialDefinition(m);
}
}
示例12: Load
void ScannerWidget::Load(Serializer::Reader &rd)
{
m_mode = ScannerMode(rd.Int32());
m_currentRange = rd.Float();
m_manualRange = rd.Float();
m_targetRange = rd.Float();
}
示例13: Load
AICommand::AICommand(Serializer::Reader &rd, CmdName name)
{
m_cmdName = name;
m_fuelEconomy = rd.Float();
m_shipIndex = rd.Int32();
m_child = Load(rd);
}
示例14: Star
Body *Body::Unserialize(Serializer::Reader &_rd, Space *space)
{
Serializer::Reader rd = _rd.RdSection("Body");
Body *b = 0;
Object::Type type = Object::Type(rd.Int32());
switch (type) {
case Object::STAR:
b = new Star(); break;
case Object::PLANET:
b = new Planet();
break;
case Object::SPACESTATION:
b = new SpaceStation(); break;
case Object::SHIP:
b = new Ship(); break;
case Object::PLAYER:
b = new Player(); break;
case Object::MISSILE:
b = new Missile(); break;
case Object::PROJECTILE:
b = new Projectile(); break;
case Object::CARGOBODY:
b = new CargoBody(); break;
case Object::HYPERSPACECLOUD:
b = new HyperspaceCloud(); break;
default:
assert(0);
}
b->Load(rd, space);
return b;
}
示例15: Load
void Body::Load(Serializer::Reader &rd, Space *space)
{
m_frame = space->GetFrameByIndex(rd.Int32());
m_label = rd.String();
m_dead = rd.Bool();
m_hasDoubleFrame = rd.Bool();
}