本文整理汇总了C++中CInifile::w_string方法的典型用法代码示例。如果您正苦于以下问题:C++ CInifile::w_string方法的具体用法?C++ CInifile::w_string怎么用?C++ CInifile::w_string使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CInifile
的用法示例。
在下文中一共展示了CInifile::w_string方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void time::save (CInifile& config)
{
config.w_string (m_identifier.c_str(),"ambient", m_ambient.c_str());
config.w_fvector3 (m_identifier.c_str(),"ambient_color", ambient);
config.w_string (m_identifier.c_str(),"clouds_texture", clouds_texture_name.c_str());
config.w_float (m_identifier.c_str(),"far_plane", far_plane);
config.w_float (m_identifier.c_str(),"fog_distance", fog_distance);
config.w_float (m_identifier.c_str(),"fog_density", fog_density);
config.w_fvector3 (m_identifier.c_str(),"fog_color", fog_color);
config.w_fvector3 (m_identifier.c_str(),"rain_color", rain_color);
config.w_float (m_identifier.c_str(),"rain_density", rain_density);
config.w_fvector3 (m_identifier.c_str(),"sky_color", sky_color);
config.w_float (m_identifier.c_str(),"sky_rotation", rad2deg(sky_rotation));
config.w_string (m_identifier.c_str(),"sky_texture", sky_texture_name.c_str());
config.w_fvector3 (m_identifier.c_str(),"sun_color", sun_color);
config.w_float (m_identifier.c_str(),"sun_shafts_intensity", m_fSunShaftsIntensity);
config.w_string (m_identifier.c_str(),"sun", m_sun.c_str());
config.w_string (m_identifier.c_str(),"thunderbolt_collection", m_thunderbolt_collection.c_str());
config.w_float (m_identifier.c_str(),"thunderbolt_duration", bolt_duration);
config.w_float (m_identifier.c_str(),"thunderbolt_period", bolt_period);
config.w_float (m_identifier.c_str(),"water_intensity", m_fWaterIntensity);
config.w_float (m_identifier.c_str(),"wind_direction", rad2deg(wind_direction));
config.w_float (m_identifier.c_str(),"wind_velocity", wind_velocity);
config.w_fvector4 (m_identifier.c_str(),"hemisphere_color", hemi_color);
config.w_float (m_identifier.c_str(),"sun_altitude", rad2deg(sun_dir.getH()));
config.w_float (m_identifier.c_str(),"sun_longitude", rad2deg(sun_dir.getP()));
config.w_fvector4 (m_identifier.c_str(),"clouds_color", clouds_color);
}
示例2: WriteLtx
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;
};
};
示例3: sizeof
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
}
示例4: WriteLtx
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());
};
示例5: float
void ambient::save (CInifile& config)
{
u32 count = 1;
LPSTR temp = 0;
{
sound_container_type::const_iterator b = m_sound_channels_ids.begin(), i = b;
sound_container_type::const_iterator e = m_sound_channels_ids.end();
for ( ; i != e; ++i)
count += (*i)->id().size() + 2;
temp = (LPSTR)_alloca(count*sizeof(char));
*temp = 0;
for (i = b; i != e; ++i) {
if (i == b) {
strcpy_s (temp, count, (*i)->id().c_str());
continue;
}
strcat_s (temp, count, ", ");
strcat_s (temp, count, (*i)->id().c_str());
}
}
config.w_string (m_load_section.c_str(), "sound_channels", temp);
config.w_float (m_load_section.c_str(), "min_effect_period", float(m_effect_period.x)/1000.f);
config.w_float (m_load_section.c_str(), "max_effect_period", float(m_effect_period.y)/1000.f);
{
count = 1;
effect_container_type::const_iterator b = m_effects_ids.begin(), i = b;
effect_container_type::const_iterator e = m_effects_ids.end();
for ( ; i != e; ++i)
count += (*i)->id().size() + 2;
temp = (LPSTR)_alloca(count*sizeof(char));
*temp = 0;
for (i = b; i != e; ++i) {
if (i == b) {
strcpy_s (temp, count, (*i)->id().c_str());
continue;
}
strcat_s (temp, count, ", ");
strcat_s (temp, count, (*i)->id().c_str());
}
}
config.w_string (m_load_section.c_str(), "effects", temp);
}
示例6: SaveLTX
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());
}
示例7: SaveLTX
void ESoundEnvironment::SaveLTX(CInifile& ini, LPCSTR sect_name)
{
inherited::SaveLTX (ini, sect_name);
ini.w_u32 (sect_name, "version", SOUND_ENV_VERSION);
ini.w_string (sect_name, "env_inner", m_EnvInner.c_str());
ini.w_string (sect_name, "env_outer", m_EnvOuter.c_str());
}
示例8: ebSaveToClick
void __fastcall TfrmBonePart::ebSaveToClick(TObject *Sender)
{
xr_string temp_fn;
if (EFS.GetSaveName( _import_, temp_fn) )
{
CInifile ini (temp_fn.c_str(), FALSE, FALSE, TRUE);
string64 buff;
for(int i=0; i<4; ++i)
{
sprintf (buff,"part_%d",i);
ini.w_string(buff, "partition_name", E[i]->Text.c_str());
if (T[i]->Items->Count)
{
for ( TElTreeItem* node = T[i]->Items->GetFirstNode(); node; node = node->GetNext())
ini.w_string(buff, AnsiString(node->Text).c_str(), NULL );
}
}
}
}
示例9: SaveLTX
//------------------------------------------------------------------------------------------------
// Level Options
//------------------------------------------------------------------------------------------------
void st_LevelOptions::SaveLTX( CInifile& ini )
{
LPCSTR section = "level_options";
ini.w_u32 (section, "version", CURRENT_LEVELOP_VERSION);
ini.w_string (section, "level_path", m_FNLevelPath.c_str());
ini.w_string (section, "level_prefix", m_LevelPrefix.c_str());
xr_string s = "\"";
s += m_BOPText.c_str();
s += "\"";
ini.w_string (section, "bop", s.c_str());
ini.w_string (section, "map_version", m_map_version.c_str());
ini.w_u32 (section, "version_bp", CURRENT_LEVELOP_BP_VERSION);
m_BuildParams.SaveLTX (ini);
ini.w_u8 (section, "light_hemi_quality", m_LightHemiQuality );
ini.w_u8 (section, "light_sun_quality", m_LightSunQuality );
m_mapUsage.SaveLTX(ini,section);
}
示例10: SaveLTX
void CGroupObject::SaveLTX(CInifile& ini, LPCSTR sect_name)
{
CCustomObject::SaveLTX(ini, sect_name);
ini.w_u32 (sect_name, "version", GROUPOBJ_CURRENT_VERSION);
ObjectList grp_lst;
GetObjects (grp_lst);
ObjectList::iterator it;
for(it=grp_lst.begin(); it!=grp_lst.end(); ++it)
(*it)->m_CO_Flags.set(CCustomObject::flObjectInGroup, FALSE);
Scene->SaveObjectsLTX(grp_lst, sect_name, "ingroup", ini);
for(it=grp_lst.begin(); it!=grp_lst.end(); ++it)
(*it)->m_CO_Flags.set(CCustomObject::flObjectInGroup, TRUE);
ini.w_string (sect_name, "ref_name", m_ReferenceName_.c_str());
}
示例11: SaveLTX
void ESoundSource::SaveLTX(CInifile& ini, LPCSTR sect_name)
{
inherited::SaveLTX (ini, sect_name);
ini.w_u32 (sect_name, "version", SOUND_SOURCE_VERSION);
ini.w_u32 (sect_name, "snd_type", m_Type);
ini.w_string (sect_name, "snd_name", m_WAVName.c_str());
ini.w_u32 (sect_name, "flags", m_Flags.get());
ini.w_fvector3 (sect_name, "snd_position", m_Params.position);
ini.w_float (sect_name, "volume", m_Params.volume);
ini.w_float (sect_name, "freq", m_Params.freq);
ini.w_float (sect_name, "min_dist", m_Params.min_distance);
ini.w_float (sect_name, "max_dist", m_Params.max_distance);
ini.w_float (sect_name, "max_ai_dist", m_Params.max_ai_distance);
ini.w_fvector2 (sect_name, "random_pause", m_RandomPause);
ini.w_fvector2 (sect_name, "active_time", m_ActiveTime);
ini.w_fvector2 (sect_name, "play_time", m_PlayTime);
}
示例12: SaveLTX
void ESceneToolBase::SaveLTX(CInifile& ini, int id)
{
ini.w_string ("modif", "name", m_ModifName.c_str());
ini.w_u32 ("modif", "time", m_ModifTime);
}