本文整理汇总了C++中IReader::r_u8方法的典型用法代码示例。如果您正苦于以下问题:C++ IReader::r_u8方法的具体用法?C++ IReader::r_u8怎么用?C++ IReader::r_u8使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IReader
的用法示例。
在下文中一共展示了IReader::r_u8方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void CActorCondition::load(IReader &input_packet)
{
inherited::load (input_packet);
load_data (m_fAlcohol, input_packet);
load_data (m_condition_flags, input_packet);
load_data (m_fSatiety, input_packet);
load_data (m_curr_medicine_influence.fHealth, input_packet);
load_data (m_curr_medicine_influence.fPower, input_packet);
load_data (m_curr_medicine_influence.fSatiety, input_packet);
load_data (m_curr_medicine_influence.fRadiation, input_packet);
load_data (m_curr_medicine_influence.fWoundsHeal, input_packet);
load_data (m_curr_medicine_influence.fMaxPowerUp, input_packet);
load_data (m_curr_medicine_influence.fAlcohol, input_packet);
load_data (m_curr_medicine_influence.fTimeTotal, input_packet);
load_data (m_curr_medicine_influence.fTimeCurrent, input_packet);
u8 cntr = input_packet.r_u8();
for(; cntr>0; cntr--)
{
SBooster B;
B.m_type = (EBoostParams)input_packet.r_u8();
B.fBoostValue = input_packet.r_float();
B.fBoostTime = input_packet.r_float();
m_booster_influences[B.m_type] = B;
BoostParameters(B);
}
}
示例2: Read
void st_LevelOptions::Read(IReader& F)
{
R_ASSERT(F.find_chunk(CHUNK_LO_VERSION));
DWORD vers = F.r_u32( );
if( vers < 0x00000008 )
{
ELog.DlgMsg( mtError, "Skipping bad version of level options." );
return;
}
R_ASSERT(F.find_chunk(CHUNK_LO_NAMES));
F.r_stringZ (m_FNLevelPath);
if (F.find_chunk(CHUNK_LO_PREFIX)) F.r_stringZ (m_LevelPrefix);
R_ASSERT(F.find_chunk(CHUNK_LO_BOP));
F.r_stringZ (m_BOPText);
if (F.find_chunk(CHUNK_LO_MAP_VER))
F.r_stringZ (m_map_version);
vers = 0;
if (F.find_chunk(CHUNK_LO_BP_VERSION))
vers = F.r_u32( );
if (CURRENT_LEVELOP_BP_VERSION==vers){
if (F.find_chunk(CHUNK_BUILD_PARAMS))
F.r(&m_BuildParams, sizeof(m_BuildParams));
}else{
ELog.DlgMsg (mtError, "Skipping bad version of build params.");
m_BuildParams.Init();
}
if (F.find_chunk(CHUNK_LIGHT_QUALITY))
{
m_LightHemiQuality = F.r_u8();
m_LightSunQuality = F.r_u8();
}
if (F.find_chunk(CHUNK_MAP_USAGE))
{
if(vers > 0x00000008)
{
m_mapUsage.m_GameType.assign (F.r_u16());
}else
{
m_mapUsage.m_GameType.zero ();
m_mapUsage.m_GameType.set (eGameIDDeathmatch , F.r_s32());
m_mapUsage.m_GameType.set (eGameIDTeamDeathmatch, F.r_s32());
m_mapUsage.m_GameType.set (eGameIDArtefactHunt, F.r_s32());
}
}
}
示例3: Load
bool ESceneLightTools::Load(IReader& F)
{
u16 version = 0;
if(F.r_chunk(CHUNK_VERSION,&version))
if( version!=LIGHT_TOOLS_VERSION ){
ELog.DlgMsg( mtError, "%s tools: Unsupported version.",ClassDesc());
return false;
}
if (!inherited::Load(F)) return false;
if (F.find_chunk(CHUNK_FLAGS))
m_Flags.assign (F.r_u32());
if (F.find_chunk(CHUNK_SUN_SHADOW)){
F.r_u8 ();
F.r_fvector2 (m_SunShadowDir);
}
if (F.find_chunk(CHUNK_LCONTROLS_LAST))
lcontrol_last_idx = F.r_u32();
IReader* R = F.open_chunk(CHUNK_LCONTROLS);
if (R){
while (!R->eof()){
shared_str l_name;
R->r_stringZ(l_name);
u32 l_idx = R->r_u32();
AppendLightControl(l_name.c_str(),&l_idx);
}
R->close ();
}
return true;
}
示例4:
void CWound::load (IReader &input_packet)
{
m_iBoneNum = (u8)input_packet.r_u8();
for(int i=0; i<ALife::eHitTypeMax; i++){
m_Wounds[i] = input_packet.r_float_q8 (0.f, WOUND_MAX);
VERIFY(m_Wounds[i]>=0.0f && m_Wounds[i]<=WOUND_MAX);
}
}
示例5: load
void SHeliBodyState::load(IReader &input_packet)
{
type = (EHeliBodyState)input_packet.r_s16();
b_looking_at_point = !!input_packet.r_u8();
currBodyHPB.x = input_packet.r_float();
currBodyHPB.y = input_packet.r_float();
currBodyHPB.z = input_packet.r_float();
}
示例6:
void CCustomZone::load (IReader &input_packet)
{
inherited::load (input_packet);
CCustomZone::EZoneState temp = static_cast<CCustomZone::EZoneState>(input_packet.r_u8());
if (temp == eZoneStateDisabled)
m_eZoneState = eZoneStateDisabled;
else
m_eZoneState = eZoneStateIdle;
}
示例7: load
void CInventoryItem::load(IReader &packet)
{
m_eItemPlace = (EItemPlace)packet.r_u8();
m_fCondition = packet.r_float();
SetSlot (packet.r_u8());
if (GetSlot() == 255)
SetSlot (NO_ACTIVE_SLOT);
u8 tmp = packet.r_u8();
if (!tmp)
return;
if (!object().PPhysicsShell()) {
object().setup_physic_shell ();
object().PPhysicsShell()->Disable();
}
object().PHLoadState(packet);
object().PPhysicsShell()->Disable();
}
示例8: LoadColorIndices
bool EDetailManager::LoadColorIndices(IReader& F)
{
VERIFY (objects.empty());
VERIFY (m_ColorIndices.empty());
bool bRes = true;
// objects
IReader* OBJ = F.open_chunk(DETMGR_CHUNK_OBJECTS);
if (OBJ){
IReader* O = OBJ->open_chunk(0);
for (int count=1; O; count++) {
EDetail* DO = xr_new<EDetail>();
if (DO->Load(*O)) objects.push_back(DO);
else bRes = false;
O->close();
O = OBJ->open_chunk(count);
}
OBJ->close();
}
// color index map
R_ASSERT (F.find_chunk(DETMGR_CHUNK_COLOR_INDEX));
int cnt = F.r_u8();
string256 buf;
u32 index;
int ref_cnt;
for (int k=0; k<cnt; k++){
index = F.r_u32();
ref_cnt = F.r_u8();
for (int j=0; j<ref_cnt; j++){
F.r_stringZ (buf,sizeof(buf));
EDetail* DO = FindDOByName(buf);
if (DO) m_ColorIndices[index].push_back(DO);
else bRes=false;
}
}
InvalidateCache ();
return bRes;
}
示例9:
void CInventoryOwner::load (IReader &input_packet)
{
u8 active_slot = input_packet.r_u8();
if(active_slot == u8(-1))
inventory().SetActiveSlot(NO_ACTIVE_SLOT);
else
inventory().Activate_deffered(active_slot, Device.dwFrame);
m_tmp_active_slot_num = active_slot;
CharacterInfo().load(input_packet);
load_data (m_game_name, input_packet);
load_data (m_money, input_packet);
}
示例10: LoadStream
void SAINode::LoadStream(IReader& F, ESceneAIMapTool* tools)
{
u32 id;
u16 pl;
NodePosition np;
F.r (&id,3); n1 = (SAINode*)tools->UnpackLink(id);
F.r (&id,3); n2 = (SAINode*)tools->UnpackLink(id);
F.r (&id,3); n3 = (SAINode*)tools->UnpackLink(id);
F.r (&id,3); n4 = (SAINode*)tools->UnpackLink(id);
pl = F.r_u16(); pvDecompress(Plane.n,pl);
F.r (&np,sizeof(np)); tools->UnpackPosition(Pos,np,tools->m_AIBBox,tools->m_Params);
Plane.build (Pos,Plane.n);
flags.assign (F.r_u8());
}
示例11: LoadStream
bool CEditShape::LoadStream(IReader& F)
{
R_ASSERT(F.find_chunk(SHAPE_CHUNK_VERSION));
u16 vers = F.r_u16();
inherited::LoadStream (F);
R_ASSERT(F.find_chunk(SHAPE_CHUNK_SHAPES));
shapes.resize (F.r_u32());
F.r (shapes.begin(),shapes.size()*sizeof(shape_def));
if(F.find_chunk(SHAPE_CHUNK_DATA))
m_shape_type = F.r_u8();
ComputeBounds();
return true;
}
示例12: load
void CInventoryOwner::load(IReader &input_packet) {
CActor* pOurActor = smart_cast<CActor*>(this);
u8 active_slot = input_packet.r_u8();
if (pOurActor && pOurActor->GetHolderID() == u16(-1)) {
if(active_slot == u8(-1)) {
inventory().SetActiveSlot(NO_ACTIVE_SLOT);
}
else {
inventory().Activate_deffered(active_slot, Device.dwFrame);
}
}
m_tmp_active_slot_num = active_slot;
CharacterInfo().load(input_packet);
load_data(m_game_name, input_packet);
load_data(m_money, input_packet);
}
示例13: load
void CInventoryItem::load(IReader &packet)
{
m_eItemPlace = (EItemPlace)packet.r_u8 () ;
u16 tmp = packet.r_u16 ();
if(CSE_ALifeInventoryItem::FLAG_NO_POSITION==tmp)
{
return;
}
if(!object().PPhysicsShell())
{
//. object().processing_activate();
object().setup_physic_shell ();
object().PPhysicsShell()->Disable();
}
object().PHLoadState(packet);
object().PPhysicsShell()->Disable();
}
示例14: load
void CInventoryItem::load(IReader &packet)
{
m_ItemCurrPlace.value = packet.r_u16();
m_fCondition = packet.r_float();
//-- load_data( m_upgrades, packet );
//-- install_loaded_upgrades();
u8 tmp = packet.r_u8();
if (!tmp)
return;
if (!object().PPhysicsShell()) {
object().setup_physic_shell ();
object().PPhysicsShell()->Disable();
}
object().PHLoadState(packet);
object().PPhysicsShell()->Disable();
}
示例15: Load
void STextureParams::Load(IReader& F)
{
R_ASSERT(F.find_chunk(THM_CHUNK_TEXTUREPARAM));
F.r (&fmt,sizeof(ETFormat));
flags.assign(F.r_u32());
border_color= F.r_u32();
fade_color = F.r_u32();
fade_amount = F.r_u32();
mip_filter = F.r_u32();
width = F.r_u32();
height = F.r_u32();
if (F.find_chunk(THM_CHUNK_TEXTURE_TYPE)){
type = (ETType)F.r_u32();
}
if (F.find_chunk(THM_CHUNK_DETAIL_EXT)){
F.r_stringZ(detail_name);
detail_scale = F.r_float();
}
if (F.find_chunk(THM_CHUNK_MATERIAL)){
material = (ETMaterial)F.r_u32 ();
material_weight = F.r_float ();
}
if (F.find_chunk(THM_CHUNK_BUMP)){
bump_virtual_height = F.r_float ();
bump_mode = (ETBumpMode)F.r_u32 ();
if (bump_mode<STextureParams::tbmNone){
bump_mode = STextureParams::tbmNone; //.. временно (до полного убирания Autogen)
}
F.r_stringZ (bump_name);
}
if (F.find_chunk(THM_CHUNK_EXT_NORMALMAP))
F.r_stringZ (ext_normal_map_name);
if (F.find_chunk(THM_CHUNK_FADE_DELAY))
fade_delay = F.r_u8();
}