本文整理汇总了C++中CInifile::r_u32方法的典型用法代码示例。如果您正苦于以下问题:C++ CInifile::r_u32方法的具体用法?C++ CInifile::r_u32怎么用?C++ CInifile::r_u32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CInifile
的用法示例。
在下文中一共展示了CInifile::r_u32方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadLTX
//------------------------------------------------------------------------------
bool CGroupObject::LoadLTX(CInifile& ini, LPCSTR sect_name)
{
u32 version = ini.r_u32(sect_name, "version");
if (version<0x0011)
{
ELog.DlgMsg( mtError, "CGroupObject: unsupported file version. Object can't load.");
return false;
}
CCustomObject::LoadLTX(ini, sect_name);
Flags32 tmp_flags;tmp_flags.zero();
if(version<0x0012)
tmp_flags.assign(ini.r_u32(sect_name, "flags") );
// objects
if(/*IsOpened()*/ tmp_flags.test((1<<0)))
{ //old opened group save format
ELog.DlgMsg( mtError, "old opened group save format");
return false;
/*
u32 cnt = ini.r_u32 (sect_name, "objects_in_group_count");
shared_str tmp;
string128 buff;
for (u32 k=0; k<cnt; ++k)
{
m_ObjectsInGroup.resize (m_ObjectsInGroup.size()+1);
sprintf (buff,"objects_in_group_%d",k);
m_ObjectsInGroup.back().ObjectName = ini.r_string(sect_name, buff);
}
*/
}else
{
Scene->ReadObjectsLTX (ini, sect_name, "ingroup", AppendObjectLoadCB, 0);
}
VERIFY(m_ObjectsInGroup.size());
SetRefName(ini.r_string (sect_name, "ref_name")) ;
if (!m_ReferenceName_.size())
ELog.Msg (mtError,"ERROR: group '%s' - has empty reference. Corrupted file?", Name);
if(version<0x0012)
{
for (ObjectsInGroup::iterator it=m_ObjectsInGroup.begin(); it!=m_ObjectsInGroup.end(); ++it)
if(it->pObject)
{
it->pObject->m_CO_Flags.set(flObjectInGroup, TRUE);
it->pObject->m_CO_Flags.set(flObjectInGroupUnique, TRUE);
}
}
return true;
}
示例2: LoadLTX
//----------------------------------------------------
bool ESceneSpawnTool::LoadLTX(CInifile& ini)
{
u32 version = ini.r_u32("main","version");
if( version!=SPAWN_TOOLS_VERSION )
{
ELog.DlgMsg( mtError, "%s tools: Unsupported version.",ClassDesc());
return false;
}
inherited::LoadLTX (ini);
m_Flags.assign (ini.r_u32("main","flags"));
return true;
}
示例3: PDomainEnum
void PDomain::Load2(CInifile& ini, const shared_str& sect)
{
type = PDomainEnum(ini.r_u32(sect,"type"));
v[0] = ini.r_fvector3(sect,"v0");
v[1] = ini.r_fvector3(sect,"v1");
v[2] = ini.r_fvector3(sect,"v2");
}
示例4: LoadLTX
bool CEditShape::LoadLTX(CInifile& ini, LPCSTR sect_name)
{
u32 vers = ini.r_u32(sect_name, "version");
inherited::LoadLTX (ini, sect_name);
u32 count = ini.r_u32 (sect_name, "shapes_count");
if(vers>0x0001)
m_shape_type = ini.r_u8 (sect_name, "shape_type");
string128 buff;
shapes.resize (count);
for(u32 i=0; i<count; ++i)
{
sprintf (buff,"shape_type_%d", i);
shapes[i].type = ini.r_u8(sect_name, buff);
if(shapes[i].type==CShapeData::cfSphere)
{
sprintf (buff,"shape_center_%d", i);
shapes[i].data.sphere.P = ini.r_fvector3 (sect_name, buff);
sprintf (buff,"shape_radius_%d", i);
shapes[i].data.sphere.R = ini.r_float (sect_name, buff);
}else
{
R_ASSERT (shapes[i].type==CShapeData::cfBox);
sprintf (buff,"shape_matrix_i_%d", i);
shapes[i].data.box.i = ini.r_fvector3 (sect_name, buff);
sprintf (buff,"shape_matrix_j_%d", i);
shapes[i].data.box.j = ini.r_fvector3 (sect_name, buff);
sprintf (buff,"shape_matrix_k_%d", i);
shapes[i].data.box.k = ini.r_fvector3 (sect_name, buff);
sprintf (buff,"shape_matrix_c_%d", i);
shapes[i].data.box.c = ini.r_fvector3 (sect_name, buff);
}
}
ComputeBounds();
return true;
}
示例5: LoadLTX
//----------------------------------------------------
bool ESoundSource::LoadLTX(CInifile& ini, LPCSTR sect_name)
{
u32 version = ini.r_u32(sect_name, "version");
if(version!=SOUND_SOURCE_VERSION)
{
ELog.Msg( mtError, "ESoundSource: Unsupported version.");
return false;
}
inherited::LoadLTX (ini, sect_name);
m_Type = ini.r_u32 (sect_name, "snd_type");
m_WAVName = ini.r_string (sect_name, "snd_name");
m_Flags.assign (ini.r_u32 (sect_name, "flags"));
m_Params.position = ini.r_fvector3 (sect_name, "snd_position");
m_Params.volume = ini.r_float (sect_name, "volume");
m_Params.freq = ini.r_float (sect_name, "freq");
m_Params.min_distance=ini.r_float (sect_name, "min_dist");
m_Params.max_distance= ini.r_float (sect_name, "max_dist");
m_Params.max_ai_distance=ini.r_float (sect_name, "max_ai_dist");
m_RandomPause = ini.r_fvector2 (sect_name, "random_pause");
m_ActiveTime = ini.r_fvector2 (sect_name, "active_time");
m_PlayTime = ini.r_fvector2 (sect_name, "play_time");
ResetSource ();
switch (m_Type)
{
case stStaticSource:
if (m_Flags.is(flPlaying)) Play();
//. if (m_Flags.is(flSimulating)) Simulate();
break;
default: THROW;
}
return true;
}
示例6: LoadLTX
//----------------------------------------------------
bool ESceneWayTool::LoadLTX(CInifile& ini)
{
u32 version = ini.r_u32("main","version");
if( version!=WAY_TOOLS_VERSION )
{
ELog.DlgMsg( mtError, "%s tools: Unsupported version.",ClassDesc());
return false;
}
inherited::LoadLTX(ini);
return true;
}
示例7: LoadLTX
//----------------------------------------------------
bool ESoundEnvironment::LoadLTX(CInifile& ini, LPCSTR sect_name)
{
u32 version = ini.r_u32(sect_name, "version");
if(version!=SOUND_ENV_VERSION)
{
ELog.DlgMsg (mtError, "ESoundSource: Unsupported version.");
return false;
}
inherited::LoadLTX (ini, sect_name);
return true;
}
示例8: ReadObjectLTX
//----------------------------------------------------
bool EScene::ReadObjectLTX(CInifile& ini, LPCSTR sect_name, CCustomObject*& O)
{
ObjClassID clsid = OBJCLASS_DUMMY;
clsid = ObjClassID(ini.r_u32(sect_name,"clsid"));
O = GetOTool(clsid)->CreateObject(0,0);
bool bRes = O->LoadLTX(ini, sect_name);
if (!bRes)
xr_delete (O);
return bRes;
}
示例9: ReadLTX
void st_LevelOptions::ReadLTX(CInifile& ini)
{
LPCSTR section = "level_options";
u32 vers_op = ini.r_u32(section, "version");
if( vers_op < 0x00000008 )
{
ELog.DlgMsg( mtError, "Skipping bad version of level options." );
return;
}
m_FNLevelPath = ini.r_string (section, "level_path");
m_LevelPrefix = ini.r_string (section, "level_prefix");
m_BOPText = ini.r_string_wb (section, "bop");
if(vers_op > 0x0000000B)
m_map_version = ini.r_string (section, "map_version");
m_BuildParams.LoadLTX(ini);
m_LightHemiQuality = ini.r_u8(section, "light_hemi_quality" );
m_LightSunQuality = ini.r_u8(section, "light_sun_quality" );
m_mapUsage.SetDefaults ();
if(vers_op > 0x0000000A)
{
m_mapUsage.LoadLTX (ini,section,false);
}else
{
m_mapUsage.m_GameType.set (eGameIDDeathmatch , ini.r_s32(section, "usage_deathmatch"));
m_mapUsage.m_GameType.set (eGameIDTeamDeathmatch, ini.r_s32(section, "usage_teamdeathmatch"));
m_mapUsage.m_GameType.set (eGameIDArtefactHunt, ini.r_s32(section, "usage_artefacthunt"));
if(vers_op > 0x00000008)
{
m_mapUsage.m_GameType.set (eGameIDCaptureTheArtefact, ini.r_s32(section, "usage_captretheartefact"));
m_mapUsage.m_GameType.set (eGameIDTeamDominationZone, ini.r_s32(section, "usage_team_domination_zone"));
if(vers_op==0x00000009)
m_mapUsage.m_GameType.set(eGameIDDominationZone, ini.r_s32(section, "domination_zone"));
else
m_mapUsage.m_GameType.set(eGameIDDominationZone, ini.r_s32(section, "usage_domination_zone"));
}
}
}
示例10: ReadObjectsLTX
bool EScene::ReadObjectsLTX(CInifile& ini, LPCSTR sect_name_parent, LPCSTR sect_name_prefix, TAppendObject on_append, SPBItem* pb)
{
string128 buff;
R_ASSERT (on_append);
sprintf (buff, "%s_count", sect_name_prefix);
u32 count = ini.r_u32(sect_name_parent, buff);
bool bRes = true;
for(u32 i=0; i<count; ++i)
{
sprintf (buff, "%s_%s_%d", sect_name_parent, sect_name_prefix, i);
CCustomObject* obj = NULL;
if(ReadObjectLTX(ini, buff, obj))
{
LPCSTR obj_name = obj->Name;
CCustomObject* existing = FindObjectByName(obj_name,obj->ClassID);
if(existing)
{
if(g_frmConflictLoadObject->m_result!=2 && g_frmConflictLoadObject->m_result!=4 && g_frmConflictLoadObject->m_result!=6)
{
g_frmConflictLoadObject->m_existing_object = existing;
g_frmConflictLoadObject->m_new_object = obj;
g_frmConflictLoadObject->Prepare ();
g_frmConflictLoadObject->ShowModal ();
}
switch(g_frmConflictLoadObject->m_result)
{
case 1: //Overwrite
case 2: //Overwrite All
{
bool res = RemoveObject (existing, true, true);
if(!res)
Msg("! RemoveObject [%s] failed", existing->Name);
else
xr_delete(existing);
}break;
case 3: //Insert new
case 4: //Insert new All
{
string256 buf;
GenObjectName (obj->ClassID, buf, obj->Name);
obj->Name = buf;
}break;
case 0: //Cancel
case 5: //Skip
case 6: //Skip All
{
xr_delete(obj);
}break;
} //switch
} //if exist
if (obj && !on_append(obj))
xr_delete(obj);}
else
bRes = false;
if (pb)
pb->Inc();
}
return bRes;
}
示例11: sizeof
BOOL CPEDef::Load2(CInifile& ini)
{
//. u16 version = ini.r_u16("_effect", "version");
m_MaxParticles = ini.r_u32("_effect", "max_particles");
m_Flags.assign (ini.r_u32("_effect", "flags"));
if (m_Flags.is(dfSprite))
{
m_ShaderName = ini.r_string ("sprite", "shader");
m_TextureName = ini.r_string ("sprite", "texture");
}
if (m_Flags.is(dfFramed))
{
m_Frame.m_fTexSize = ini.r_fvector2 ("frame", "tex_size");
m_Frame.reserved = ini.r_fvector2 ("frame", "reserved");
m_Frame.m_iFrameDimX = ini.r_s32 ("frame", "dim_x");
m_Frame.m_iFrameCount = ini.r_s32 ("frame", "frame_count");
m_Frame.m_fSpeed = ini.r_float ("frame", "speed");
}
if (m_Flags.is(dfTimeLimit))
{
m_fTimeLimit = ini.r_float ("timelimit", "value");
}
if (m_Flags.is(dfCollision))
{
m_fCollideOneMinusFriction = ini.r_float ("collision", "one_minus_friction");
m_fCollideResilience = ini.r_float ("collision", "collide_resilence");
m_fCollideSqrCutoff = ini.r_float ("collision", "collide_sqr_cutoff");
}
if (m_Flags.is(dfVelocityScale))
{
m_VelocityScale = ini.r_fvector3 ("velocity_scale", "value");
}
if (m_Flags.is(dfAlignToPath))
{
m_APDefaultRotation = ini.r_fvector3 ("align_to_path", "default_rotation");
}
#ifdef _EDITOR
if(pCreateEAction)
{
u32 count = ini.r_u32("_effect", "action_count");
m_EActionList.resize(count);
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);
PAPI::PActionEnum type = (PAPI::PActionEnum)(ini.r_u32(sect,"action_type"));
(*it) = pCreateEAction(type);
(*it)->Load2 (ini, sect);
}
Compile (m_EActionList);
}
#endif
return TRUE;
}
示例12: LoadLTX
bool ESceneToolBase::LoadLTX(CInifile& ini)
{
m_ModifName = ini.r_string("modif", "name");
m_ModifTime = ini.r_u32("modif", "time");
return true;
}