本文整理汇总了C++中CVehicle::GetTrainDirection方法的典型用法代码示例。如果您正苦于以下问题:C++ CVehicle::GetTrainDirection方法的具体用法?C++ CVehicle::GetTrainDirection怎么用?C++ CVehicle::GetTrainDirection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVehicle
的用法示例。
在下文中一共展示了CVehicle::GetTrainDirection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Write
//.........这里部分代码省略.........
* a byte. We're apparently subtracting 1000 so we can store the
* information in a single byte instead of two. This only gives us
* a maximum of 256 vehicle slots.
*
* --slush
* -- ChrML: Ehm, GTA only has 17 upgrade slots... This is a valid optimization.
*/
if ( usUpgrade )
BitStream.Write ( static_cast < unsigned char > ( usSlotStates [ ucSlot ] - 1000 ) );
}
}
// Get the vehicle's reg plate as 8 bytes of chars with the not used bytes
// nulled.
const char* cszRegPlate = pVehicle->GetRegPlate ();
BitStream.Write ( cszRegPlate, 8 );
// Light override
SOverrideLightsSync overrideLights;
overrideLights.data.ucOverride = pVehicle->GetOverrideLights ();
BitStream.Write ( &overrideLights );
// Grab various vehicle flags
BitStream.WriteBit ( pVehicle->IsLandingGearDown () );
BitStream.WriteBit ( pVehicle->IsSirenActive () );
BitStream.WriteBit ( pVehicle->IsFuelTankExplodable () );
BitStream.WriteBit ( pVehicle->IsEngineOn () );
BitStream.WriteBit ( pVehicle->IsLocked () );
BitStream.WriteBit ( pVehicle->AreDoorsUndamageable () );
BitStream.WriteBit ( pVehicle->IsDamageProof () );
BitStream.WriteBit ( pVehicle->IsFrozen () );
BitStream.WriteBit ( pVehicle->IsDerailed () );
BitStream.WriteBit ( pVehicle->IsDerailable () );
BitStream.WriteBit ( pVehicle->GetTrainDirection () );
BitStream.WriteBit ( pVehicle->IsTaxiLightOn () );
// Write alpha
SEntityAlphaSync alpha;
alpha.data.ucAlpha = pVehicle->GetAlpha ();
BitStream.Write ( &alpha );
// Write headlight color
SColor color = pVehicle->GetHeadLightColor ();
if ( color.R != 255 || color.G != 255 || color.B != 255 )
{
BitStream.WriteBit ( true );
BitStream.Write ( color.R );
BitStream.Write ( color.G );
BitStream.Write ( color.B );
}
else
BitStream.WriteBit ( false );
// Write handling
if ( g_pGame->GetHandlingManager()->HasModelHandlingChanged ( static_cast < eVehicleTypes > ( pVehicle->GetModel() ) )
|| pVehicle->HasHandlingChanged() )
{
BitStream.WriteBit ( true );
SVehicleHandlingSync handling;
CHandlingEntry* pEntry = pVehicle->GetHandlingData ();
handling.data.fMass = pEntry->GetMass ();
handling.data.fTurnMass = pEntry->GetTurnMass ();
handling.data.fDragCoeff = pEntry->GetDragCoeff ();
handling.data.vecCenterOfMass = pEntry->GetCenterOfMass ();
handling.data.ucPercentSubmerged = pEntry->GetPercentSubmerged ();