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


C++ Reader::Int32方法代码示例

本文整理汇总了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);
	}
}
开发者ID:Ash-Bash,项目名称:pioneer-horizons,代码行数:33,代码来源:BinaryConverter.cpp

示例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();
}
开发者ID:lwho,项目名称:pioneer,代码行数:7,代码来源:Missile.cpp

示例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());
	}
}
开发者ID:MeteoricGames,项目名称:pioneer,代码行数:25,代码来源:ShipAICmdParagon.cpp

示例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();
}
开发者ID:GizmoR13,项目名称:pioneer,代码行数:8,代码来源:Player.cpp

示例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();
}
开发者ID:unavowed,项目名称:pioneer,代码行数:8,代码来源:Missile.cpp

示例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();
}
开发者ID:AmesianX,项目名称:pioneer,代码行数:9,代码来源:Projectile.cpp

示例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();
}
开发者ID:Snaar,项目名称:pioneer,代码行数:9,代码来源:Player.cpp

示例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();
}
开发者ID:Thargoid,项目名称:pioneer,代码行数:10,代码来源:Projectile.cpp

示例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();
}
开发者ID:NeuralKernel,项目名称:pioneer,代码行数:10,代码来源:ShipController.cpp

示例10: Load

void Planet::Load(Serializer::Reader &rd)
{
	Body::Load(rd);
	pos = rd.Vector3d();
	sbody = Serializer::LookupSystemBody(rd.Int32());
	Init();
}
开发者ID:Snaar,项目名称:pioneer,代码行数:7,代码来源:Planet.cpp

示例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);
	}
}
开发者ID:Ash-Bash,项目名称:pioneer-horizons,代码行数:25,代码来源:BinaryConverter.cpp

示例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();
}
开发者ID:Sunsetjoy,项目名称:pioneer,代码行数:7,代码来源:ShipCpanelMultiFuncDisplays.cpp

示例13: Load

AICommand::AICommand(Serializer::Reader &rd, CmdName name)
{
	m_cmdName = name;
	m_fuelEconomy = rd.Float();
	m_shipIndex = rd.Int32();
	m_child = Load(rd);
}
开发者ID:GizmoR13,项目名称:pioneer,代码行数:7,代码来源:ShipAICmd.cpp

示例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;
}
开发者ID:tnicoll,项目名称:pioneer,代码行数:31,代码来源:Body.cpp

示例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();
}	
开发者ID:AaronSenese,项目名称:pioneer,代码行数:7,代码来源:Body.cpp


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