void Weapon_Statistic::WriteLtx(CInifile& ini, LPCSTR sect) { ini.w_string(sect,"wpn_name",WName.c_str()); ini.w_string(sect,"wpn_inv_name",InvName.c_str()); ini.w_u32(sect,"wpn_dwNumBought",NumBought); ini.w_u32(sect,"wpn_dwRoundsFired",m_dwRoundsFired); ini.w_u32(sect,"wpn_dwBulletsFired",m_dwBulletsFired); ini.w_u32(sect,"wpn_dwHitsScored",m_dwHitsScored); ini.w_u32(sect,"wpn_dwKillsScored",m_dwKillsScored); ini.w_u16(sect,"wpn_dwExplosionKills", m_explosion_kills); ini.w_u16(sect,"wpn_dwBleedKills", m_bleed_kills); //---------------------------------------------- u32 NumHits = 0; u32 i = 0; for (i=0; i<m_Hits.size(); i++) { HitData& Hit = m_Hits[i]; if (Hit.Completed && Hit.count) NumHits++; }; ini.w_u32(sect,"NumHits",NumHits); u32 hits_size = m_Hits.size(); i = 0; u32 hit_number = 0; u8 hit_index = 0; while (i < hits_size) { HitData& Hit = m_Hits[i]; if (!Hit.Completed) { ++i; hit_index = 0; continue; } string512 save_prefix; xr_sprintf (save_prefix,"hit_%d_", hit_number); Hit.WriteLtx (ini, sect, save_prefix); ++hit_index; if (hit_index >= Hit.count) { hit_index = 0; ++i; } ++hit_number; }; };
void SAINode::SaveLTX(CInifile& ini, LPCSTR sect_name, ESceneAIMapTool* tools) { R_ASSERT2 (0, "dont use it !!!"); u32 id; u16 pl; NodePosition np; id = n1?(u32)n1->idx:InvalidNode; ini.w_u32 (sect_name,"n1", id); id = n2?(u32)n2->idx:InvalidNode; ini.w_u32 (sect_name,"n2", id); id = n3?(u32)n3->idx:InvalidNode; ini.w_u32 (sect_name,"n3", id); id = n4?(u32)n4->idx:InvalidNode; ini.w_u32 (sect_name,"n4", id); pl = pvCompress (Plane.n); ini.w_u16 (sect_name, "plane", pl); tools->PackPosition(np,Pos,tools->m_AIBBox,tools->m_Params); string256 buff; s16 x; u16 y; s16 z; sprintf (buff,"%i,%u,%i",np.x,np.y,np.z); ini.w_string (sect_name, "np", buff); ini.w_u8 (sect_name, "flag", flags.get()); }
void CPEDef::Save2(CInifile& ini) { ini.w_u16 ("_effect", "version", PED_VERSION); //. ini.w_string ("_effect", "name", m_Name.c_str()); ini.w_u32 ("_effect", "max_particles", m_MaxParticles); //.!! F.w (m_Actions.pointer(),m_Actions.size()); ini.w_u32 ("_effect", "flags", m_Flags.get()); if (m_Flags.is(dfSprite)) { ini.w_string ("sprite", "shader", m_ShaderName.c_str()); ini.w_string ("sprite", "texture", m_TextureName.c_str()); } if (m_Flags.is(dfFramed)) { ini.w_fvector2 ("frame", "tex_size", m_Frame.m_fTexSize); ini.w_fvector2 ("frame", "reserved", m_Frame.reserved); ini.w_s32 ("frame", "dim_x", m_Frame.m_iFrameDimX); ini.w_s32 ("frame", "frame_count", m_Frame.m_iFrameCount); ini.w_float ("frame", "speed", m_Frame.m_fSpeed); } if (m_Flags.is(dfTimeLimit)) { ini.w_float ("timelimit", "value", m_fTimeLimit); } if (m_Flags.is(dfCollision)) { ini.w_float ("collision", "one_minus_friction", m_fCollideOneMinusFriction); ini.w_float ("collision", "collide_resilence", m_fCollideResilience); ini.w_float ("collision", "collide_sqr_cutoff", m_fCollideSqrCutoff); } if (m_Flags.is(dfVelocityScale)) { ini.w_fvector3 ("velocity_scale", "value", m_VelocityScale); } if (m_Flags.is(dfAlignToPath)) { ini.w_fvector3 ("align_to_path", "default_rotation", m_APDefaultRotation); } #ifdef _EDITOR ini.w_u32 ("_effect", "action_count", m_EActionList.size()); u32 action_id = 0; for (EPAVecIt it=m_EActionList.begin(); it!=m_EActionList.end(); ++it,++action_id) { string256 sect; xr_sprintf (sect, sizeof(sect), "action_%04d", action_id); ini.w_u32 (sect, "action_type", (*it)->type); (*it)->Save2 (ini, sect); } #endif }
void HitData::WriteLtx(CInifile& ini, LPCSTR sect, LPCSTR prefix) { string512 buff; ini.w_fvector3(sect,strconcat(sizeof(buff), buff, prefix ,"pos_0"),Pos0); ini.w_fvector3(sect,strconcat(sizeof(buff), buff, prefix ,"pos_1"),Pos1); ini.w_u16(sect,strconcat(sizeof(buff), buff, prefix ,"BoneID"),BoneID); ini.w_bool(sect,strconcat(sizeof(buff), buff, prefix ,"Deadly"),Deadly); ini.w_string(sect,strconcat(sizeof(buff), buff, prefix ,"TargetName"),TargetName.c_str()); ini.w_string(sect,strconcat(sizeof(buff), buff, prefix ,"BoneName"),BoneName.c_str()); };