本文整理汇总了C++中CVehicle::GetRegPlate方法的典型用法代码示例。如果您正苦于以下问题:C++ CVehicle::GetRegPlate方法的具体用法?C++ CVehicle::GetRegPlate怎么用?C++ CVehicle::GetRegPlate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVehicle
的用法示例。
在下文中一共展示了CVehicle::GetRegPlate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Write
//.........这里部分代码省略.........
BitStream.Write ( &door );
}
}
// Write all the upgrades
CVehicleUpgrades* pUpgrades = pVehicle->GetUpgrades ();
unsigned char ucNumUpgrades = pUpgrades->Count ();
unsigned short* usSlotStates = pUpgrades->GetSlotStates ();
BitStream.Write ( ucNumUpgrades );
if ( ucNumUpgrades > 0 )
{
unsigned char ucSlot = 0;
for ( ; ucSlot < VEHICLE_UPGRADE_SLOTS ; ucSlot++ )
{
unsigned short usUpgrade = usSlotStates [ ucSlot ];
/*
* This is another retarded modification in an attempt to save
* 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 );