Skip to content

Commit fc16e3d

Browse files
committed
Correct files to comply with xr_ini
1 parent ef3c96d commit fc16e3d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+161
-163
lines changed

src/Layers/xrRender/ModelPool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ void CModelPool::Prefetch()
396396
string256 section;
397397
strconcat(sizeof(section), section, "prefetch_visuals_", g_pGamePersistent->m_game_params.m_game_type);
398398
CInifile::Sect& sect = pSettings->r_section(section);
399-
for (CInifile::SectCIt I = sect.Data.begin(); I != sect.Data.end(); I++)
399+
for (auto I = sect.Data.cbegin(); I != sect.Data.cend(); I++)
400400
{
401401
const CInifile::Item& item = *I;
402402
dxRender_Visual* V = Create(item.first.c_str());

src/Layers/xrRender/Texture.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ bool is_enough_address_space_available() { return true; }
3030
int get_texture_load_lod(LPCSTR fn)
3131
{
3232
CInifile::Sect& sect = pSettings->r_section("reduce_lod_texture_list");
33-
CInifile::SectCIt it_ = sect.Data.begin();
34-
CInifile::SectCIt it_e_ = sect.Data.end();
33+
auto it_ = sect.Data.cbegin();
34+
auto it_e_ = sect.Data.cend();
3535

36-
CInifile::SectCIt it = it_;
37-
CInifile::SectCIt it_e = it_e_;
36+
auto it = it_;
37+
auto it_e = it_e_;
3838

3939
static bool enough_address_space_available = is_enough_address_space_available();
4040

src/Layers/xrRenderDX10/dx10Texture.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ void fix_texture_name(LPSTR fn)
2121
int get_texture_load_lod(LPCSTR fn)
2222
{
2323
CInifile::Sect& sect = pSettings->r_section("reduce_lod_texture_list");
24-
CInifile::SectCIt it_ = sect.Data.begin();
25-
CInifile::SectCIt it_e_ = sect.Data.end();
24+
auto it_ = sect.Data.cbegin();
25+
auto it_e_ = sect.Data.cend();
2626

2727
ENGINE_API bool is_enough_address_space_available();
2828
static bool enough_address_space_available = is_enough_address_space_available();
2929

30-
CInifile::SectCIt it = it_;
31-
CInifile::SectCIt it_e = it_e_;
30+
auto it = it_;
31+
auto it_e = it_e_;
3232

3333
for (; it != it_e; ++it)
3434
{

src/utils/mp_configs_verifyer/configs_dump_verifyer.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static char* search_info_section(u8* buffer, u32 buffer_size)
3737
--rbegin;
3838
--r_size;
3939
} while (r_size > 0);
40-
return NULL;
40+
return nullptr;
4141
}
4242

4343
bool const configs_verifyer::verify_dsign(u8* data, u32 data_size, sha_checksum_t& sha_checksum)
@@ -64,7 +64,7 @@ bool const configs_verifyer::verify_dsign(u8* data, u32 data_size, sha_checksum_
6464
u32 dst_size = static_cast<u32>((data + data_size) - (u8*)dst_buffer);
6565
u32 src_data_size = data_size - dst_size;
6666

67-
LPCSTR add_str = NULL;
67+
LPCSTR add_str = nullptr;
6868
STRCONCAT(add_str, tmp_ini.r_string(cd_info_secion, cd_player_name_key),
6969
tmp_ini.r_string(cd_info_secion, cd_player_digest_key), tmp_ini.r_string(cd_info_secion, cd_creation_date));
7070

@@ -84,14 +84,14 @@ bool const configs_verifyer::verify_dsign(u8* data, u32 data_size, sha_checksum_
8484

8585
LPCSTR configs_verifyer::get_section_diff(CInifile::Sect* sect_ptr, CInifile& active_params, string256& dst_diff)
8686
{
87-
LPCSTR diff_str = NULL;
87+
pcstr diff_str = nullptr;
8888
bool tmp_active_param = false;
8989
if (!strncmp(sect_ptr->Name.c_str(), "ap_", 3))
9090
{
9191
tmp_active_param = true;
9292
}
9393

94-
for (CInifile::SectCIt cit = sect_ptr->Data.begin(), ciet = sect_ptr->Data.end(); cit != ciet; ++cit)
94+
for (auto cit = sect_ptr->Data.cbegin(), ciet = sect_ptr->Data.cend(); cit != ciet; ++cit)
9595
{
9696
shared_str const& tmp_value = cit->second;
9797
shared_str real_value;
@@ -102,7 +102,7 @@ LPCSTR configs_verifyer::get_section_diff(CInifile::Sect* sect_ptr, CInifile& ac
102102
real_value = active_params.r_string(sect_ptr->Name.c_str(), cit->first.c_str());
103103
if (tmp_value != real_value)
104104
{
105-
LPCSTR tmp_key_str = NULL;
105+
pcstr tmp_key_str = nullptr;
106106
STRCONCAT(tmp_key_str, sect_ptr->Name.c_str(), "::", cit->first.c_str());
107107
STRCONCAT(diff_str, tmp_key_str, " = ", tmp_value.c_str(), ",right = ", real_value.c_str());
108108
strncpy_s(dst_diff, diff_str, sizeof(dst_diff) - 1);
@@ -122,21 +122,21 @@ LPCSTR configs_verifyer::get_section_diff(CInifile::Sect* sect_ptr, CInifile& ac
122122
real_value = pSettings->r_string(sect_ptr->Name.c_str(), cit->first.c_str());
123123
if (tmp_value != real_value)
124124
{
125-
LPCSTR tmp_key_str = NULL;
125+
pcstr tmp_key_str = nullptr;
126126
STRCONCAT(tmp_key_str, sect_ptr->Name.c_str(), "::", cit->first.c_str());
127127
STRCONCAT(diff_str, tmp_key_str, " = ", tmp_value.c_str(), ",right = ", real_value.c_str());
128128
strncpy_s(dst_diff, diff_str, sizeof(dst_diff) - 1);
129129
dst_diff[sizeof(dst_diff) - 1] = 0;
130130
return dst_diff;
131131
}
132132
}
133-
return NULL;
133+
return nullptr;
134134
}
135135

136136
LPCSTR configs_verifyer::get_diff(CInifile& received, CInifile& active_params, string256& dst_diff)
137137
{
138-
LPCSTR diff_str = NULL;
139-
for (CInifile::RootIt sit = received.sections().begin(), siet = received.sections().end(); sit != siet; ++sit)
138+
pcstr diff_str = nullptr;
139+
for (auto sit = received.sections().begin(), siet = received.sections().end(); sit != siet; ++sit)
140140
{
141141
CInifile::Sect* tmp_sect = *sit;
142142
if (tmp_sect->Name == cd_info_secion)
@@ -163,7 +163,7 @@ bool const configs_verifyer::verify(u8* data, u32 data_size, string256& diff)
163163
}
164164
IReader tmp_reader(data, data_size);
165165
CInifile tmp_ini(&tmp_reader);
166-
CInifile tmp_active_params(NULL, FALSE, FALSE, FALSE);
166+
CInifile tmp_active_params(nullptr, FALSE, FALSE, FALSE);
167167

168168
string16 tmp_digit;
169169
u32 ap_index = 1;
@@ -189,7 +189,7 @@ bool const configs_verifyer::verify(u8* data, u32 data_size, string256& diff)
189189
return false;
190190
}
191191

192-
LPCSTR add_str = NULL;
192+
LPCSTR add_str = nullptr;
193193
STRCONCAT(add_str, tmp_ini.r_string(cd_info_secion, cd_player_name_key),
194194
tmp_ini.r_string(cd_info_secion, cd_player_digest_key), tmp_ini.r_string(cd_info_secion, cd_creation_date));
195195

src/utils/xrCompress/xrCompress.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ void xrCompressor::OpenPack(LPCSTR tgt_folder, int num)
353353
{
354354
CMemoryWriter W;
355355
CInifile::Sect& S = config_ltx->r_section("header");
356-
CInifile::SectCIt it = S.Data.begin();
357-
CInifile::SectCIt it_e = S.Data.end();
356+
auto it = S.Data.cbegin();
357+
auto it_e = S.Data.cend();
358358
string4096 buff;
359359
xr_sprintf(buff, "[%s]", S.Name.c_str());
360360
W.w_string(buff);
@@ -507,9 +507,9 @@ bool xrCompressor::IsFolderAccepted(CInifile& ltx, LPCSTR path, BOOL& recurse)
507507
if (ltx.section_exist("exclude_folders"))
508508
{
509509
CInifile::Sect& ef_sect = ltx.r_section("exclude_folders");
510-
for (CInifile::SectCIt ef_it = ef_sect.Data.begin(); ef_it != ef_sect.Data.end(); ef_it++)
510+
for (auto ef_it = ef_sect.Data.cbegin(); ef_it != ef_sect.Data.cend(); ef_it++)
511511
{
512-
recurse = CInifile::IsBOOL(ef_it->second.c_str());
512+
recurse = CInifile::isBool(ef_it->second.c_str());
513513
if (recurse)
514514
{
515515
if (path == strstr(path, ef_it->first.c_str()))
@@ -539,9 +539,9 @@ void xrCompressor::ProcessLTX(CInifile& ltx)
539539
{
540540
CInifile::Sect& if_sect = ltx.r_section("include_folders");
541541

542-
for (CInifile::SectCIt if_it = if_sect.Data.begin(); if_it != if_sect.Data.end(); ++if_it)
542+
for (auto if_it = if_sect.Data.cbegin(); if_it != if_sect.Data.cend(); ++if_it)
543543
{
544-
BOOL ifRecurse = CInifile::IsBOOL(if_it->second.c_str());
544+
BOOL ifRecurse = CInifile::isBool(if_it->second.c_str());
545545
u32 folder_mask = FS_ListFolders | (ifRecurse ? 0 : FS_RootOnly);
546546

547547
string_path path;
@@ -598,7 +598,7 @@ void xrCompressor::ProcessLTX(CInifile& ltx)
598598
if (ltx.section_exist("include_files"))
599599
{
600600
CInifile::Sect& if_sect = ltx.r_section("include_files");
601-
for (CInifile::SectCIt if_it = if_sect.Data.begin(); if_it != if_sect.Data.end(); ++if_it)
601+
for (auto if_it = if_sect.Data.cbegin(); if_it != if_sect.Data.cend(); ++if_it)
602602
{
603603
files_list->push_back(xr_strdup(if_it->first.c_str()));
604604
}

src/xrCore/Animation/SkeletonMotions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ void CPartition::load(IKinematics* V, LPCSTR model_name)
4343
xr_sprintf(buff, sizeof(buff), "part_%d", i);
4444

4545
CInifile::Sect S = ini.r_section(buff);
46-
CInifile::SectCIt it = S.Data.begin();
47-
CInifile::SectCIt it_e = S.Data.end();
46+
auto it = S.Data.cbegin();
47+
auto it_e = S.Data.cend();
4848
if (S.Data.size())
4949
{
5050
P[i].bones.clear_not_free();

src/xrCore/LocatorAPI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,11 +729,11 @@ void CLocatorAPI::_initialize(u32 flags, pcstr target_folder, pcstr fs_name)
729729
u32 fl = 0;
730730
_GetItem(temp, 0, b_v, _delimiter);
731731

732-
if (CInifile::IsBOOL(b_v))
732+
if (CInifile::isBool(b_v))
733733
fl |= FS_Path::flRecurse;
734734

735735
_GetItem(temp, 1, b_v, _delimiter);
736-
if (CInifile::IsBOOL(b_v))
736+
if (CInifile::isBool(b_v))
737737
fl |= FS_Path::flNotif;
738738

739739
_GetItem(temp, 2, root, _delimiter);

src/xrEngine/IGame_ObjectPool.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ void IGame_ObjectPool::prefetch()
1818
// prefetch objects
1919
strconcat(sizeof(section), section, "prefetch_objects_", g_pGamePersistent->m_game_params.m_game_type);
2020
CInifile::Sect const& sect = pSettings->r_section(section);
21-
for (CInifile::SectCIt I = sect.Data.begin(); I != sect.Data.end(); I++)
21+
for (const auto& item : sect.Data)
2222
{
23-
const CInifile::Item& item = *I;
2423
CLASS_ID CLS = pSettings->r_clsid(item.first.c_str(), "class");
2524
p_count++;
2625
IGameObject* pObject = smart_cast<IGameObject*>(NEW_INSTANCE(CLS));

src/xrEngine/xr_efflensflare.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void CLensFlareDescriptor::load(CInifile* pIni, LPCSTR sect)
100100
AddFlare(r, o, p, name, S);
101101
}
102102
}
103-
m_Flags.set(flGradient, CInifile::IsBOOL(pIni->r_string(sect, "gradient")));
103+
m_Flags.set(flGradient, CInifile::isBool(pIni->r_string(sect, "gradient")));
104104
if (m_Flags.is(flGradient))
105105
{
106106
LPCSTR S = pIni->r_string(sect, "gradient_shader");

src/xrGame/ActorHelmet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ bool CHelmet::install_upgrade_impl(LPCSTR section, bool test)
156156
result |= process_if_exists(
157157
section, "telepatic_protection", &CInifile::r_float, m_HitTypeProtection[ALife::eHitTypeTelepatic], test);
158158
result |= process_if_exists(section, "chemical_burn_protection", &CInifile::r_float,
159-
m_HitTypeProtection[ALife::eHitTypeChemicalBurn], test);
159+
m_HitTypeProtection[ALife::eHitTypeChemicalBurn], test);
160160
result |= process_if_exists(
161161
section, "explosion_protection", &CInifile::r_float, m_HitTypeProtection[ALife::eHitTypeExplosion], test);
162162
result |= process_if_exists(

src/xrGame/BoneProtections.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ void SBoneProtections::reload(const shared_str& bone_sect, IKinematics* kinemati
4343
m_default.BonePassBullet = FALSE;
4444

4545
CInifile::Sect& protections = pSettings->r_section(bone_sect);
46-
for (CInifile::SectCIt i = protections.Data.begin(); protections.Data.end() != i; ++i)
46+
for (auto i = protections.Data.cbegin(); protections.Data.cend() != i; ++i)
4747
{
4848
string256 buffer;
4949

5050
BoneProtection BP;
5151

5252
BP.koeff = (float)atof(_GetItem(i->second.c_str(), 0, buffer));
5353
BP.armor = (float)atof(_GetItem(i->second.c_str(), 1, buffer));
54-
BP.BonePassBullet = (BOOL)(atof(_GetItem(i->second.c_str(), 2, buffer)) > 0.5f);
54+
BP.BonePassBullet = (bool)(atof(_GetItem(i->second.c_str(), 2, buffer)) > 0.5f);
5555

5656
if (!xr_strcmp(i->first.c_str(), "default"))
5757
{
@@ -78,7 +78,7 @@ void SBoneProtections::add(const shared_str& bone_sect, IKinematics* kinematics)
7878
m_fHitFracNpc += READ_IF_EXISTS(pSettings, r_float, bone_sect.c_str(), "hit_fraction_npc", 0.0f);
7979

8080
CInifile::Sect& protections = pSettings->r_section(bone_sect);
81-
for (CInifile::SectCIt i = protections.Data.begin(); protections.Data.end() != i; ++i)
81+
for (auto i = protections.Data.cbegin(); protections.Data.cend() != i; ++i)
8282
{
8383
if (!xr_strcmp(i->first.c_str(), "hit_fraction"))
8484
continue;

src/xrGame/Car.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ void CCar::Init()
941941
if (ini->section_exist("damage_items"))
942942
{
943943
CInifile::Sect& data = ini->r_section("damage_items");
944-
for (CInifile::SectCIt I = data.Data.begin(); I != data.Data.end(); I++)
944+
for (auto I = data.Data.cbegin(); I != data.Data.cend(); I++)
945945
{
946946
const CInifile::Item& item = *I;
947947
u16 index = pKinematics->LL_BoneID(*item.first);

src/xrGame/CustomOutfit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ bool CCustomOutfit::install_upgrade_impl(LPCSTR section, bool test)
287287
result |= process_if_exists(
288288
section, "telepatic_protection", &CInifile::r_float, m_HitTypeProtection[ALife::eHitTypeTelepatic], test);
289289
result |= process_if_exists(section, "chemical_burn_protection", &CInifile::r_float,
290-
m_HitTypeProtection[ALife::eHitTypeChemicalBurn], test);
290+
m_HitTypeProtection[ALife::eHitTypeChemicalBurn], test);
291291
result |= process_if_exists(
292292
section, "explosion_protection", &CInifile::r_float, m_HitTypeProtection[ALife::eHitTypeExplosion], test);
293293
result |= process_if_exists(

src/xrGame/Level_load.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ bool CLevel::Load_GameSpecific_After()
106106
{
107107
CInifile::Sect& S = pSettings->r_section("sounds_random");
108108
Sounds_Random.reserve(S.Data.size());
109-
for (CInifile::SectCIt I = S.Data.begin(); S.Data.end() != I; ++I)
109+
for (auto I = S.Data.cbegin(); S.Data.cend() != I; ++I)
110110
{
111111
Sounds_Random.push_back(ref_sound());
112112
Sound->create(Sounds_Random.back(), *I->first, st_Effect, sg_SourceType);

src/xrGame/PHCollisionDamageReceiver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void CPHCollisionDamageReceiver::Init()
2121
if (ini->section_exist("collision_damage"))
2222
{
2323
CInifile::Sect& data = ini->r_section("collision_damage");
24-
for (CInifile::SectCIt I = data.Data.begin(); I != data.Data.end(); I++)
24+
for (auto I = data.Data.cbegin(); I != data.Data.cend(); I++)
2525
{
2626
const CInifile::Item& item = *I;
2727
u16 index = K->LL_BoneID(*item.first);

src/xrGame/PHDestroyable.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ av_transition_factor =1 ; коэффициент передачи угл
4343
CPHDestroyable::CPHDestroyable()
4444
{
4545
m_flags.flags = 0;
46-
m_flags.set(fl_released, TRUE);
46+
m_flags.set(fl_released, true);
4747
m_depended_objects = 0;
4848
}
4949
/////////spawn object representing destroyed
@@ -145,7 +145,7 @@ void CPHDestroyable::Destroy(u16 source_id /*=u16(-1)*/, LPCSTR section /*="ph_s
145145
obj->processing_activate();
146146
if (source_id == obj->ID())
147147
{
148-
m_flags.set(fl_released, FALSE);
148+
m_flags.set(fl_released, false);
149149
}
150150
xr_vector<shared_str>::iterator i = m_destroyed_obj_visual_names.begin(), e = m_destroyed_obj_visual_names.end();
151151

@@ -155,44 +155,43 @@ void CPHDestroyable::Destroy(u16 source_id /*=u16(-1)*/, LPCSTR section /*="ph_s
155155
GenSpawnReplace(source_id, section, *i);
156156
};
157157
///////////////////////////////////////////////////////////////////////////
158-
m_flags.set(fl_destroyed, TRUE);
159-
return;
158+
m_flags.set(fl_destroyed, true);
160159
}
161160

162161
void CPHDestroyable::Load(CInifile* ini, LPCSTR section)
163162
{
164-
m_flags.set(fl_destroyable, FALSE);
163+
m_flags.set(fl_destroyable, false);
165164
if (ini->line_exist(section, "destroyed_vis_name"))
166165
{
167-
m_flags.set(fl_destroyable, TRUE);
166+
m_flags.set(fl_destroyable, true);
168167
m_destroyed_obj_visual_names.push_back(ini->r_string(section, "destroyed_vis_name"));
169168
}
170169
else
171170
{
172171
CInifile::Sect& data = ini->r_section(section);
173172
if (data.Data.size() > 0)
174-
m_flags.set(fl_destroyable, TRUE);
175-
for (CInifile::SectCIt I = data.Data.begin(); I != data.Data.end(); I++)
173+
m_flags.set(fl_destroyable, true);
174+
for (auto I = data.Data.cbegin(); I != data.Data.cend(); I++)
176175
if (I->first.size())
177176
m_destroyed_obj_visual_names.push_back(I->first);
178177
}
179178
}
180179
void CPHDestroyable::Load(LPCSTR section)
181180
{
182-
m_flags.set(fl_destroyable, FALSE);
181+
m_flags.set(fl_destroyable, false);
183182

184183
if (pSettings->line_exist(section, "destroyed_vis_name"))
185184
{
186-
m_flags.set(fl_destroyable, TRUE);
185+
m_flags.set(fl_destroyable, true);
187186
m_destroyed_obj_visual_names.push_back(pSettings->r_string(section, "destroyed_vis_name"));
188187
}
189188
}
190189

191190
void CPHDestroyable::Init() { m_depended_objects = 0; }
192191
void CPHDestroyable::RespawnInit()
193192
{
194-
m_flags.set(fl_destroyed, FALSE);
195-
m_flags.set(fl_released, TRUE);
193+
m_flags.set(fl_destroyed, false);
194+
m_flags.set(fl_released, true);
196195
m_destroyed_obj_visual_names.clear();
197196
m_notificate_objects.clear();
198197
m_depended_objects = 0;
@@ -349,7 +348,7 @@ void CPHDestroyable::NotificateDestroy(CPHDestroyableNotificate* dn)
349348
NotificatePart(*i);
350349
PhysicallyRemoveSelf();
351350
m_notificate_objects.clear();
352-
m_flags.set(fl_released, TRUE);
351+
m_flags.set(fl_released, true);
353352
}
354353
}
355354

src/xrGame/ParticlesPlayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void CParticlesPlayer::LoadParticles(IKinematics* K)
8282
{
8383
bone_mask = 0;
8484
CInifile::Sect& data = ini->r_section("particle_bones");
85-
for (CInifile::SectCIt I = data.Data.begin(); I != data.Data.end(); I++)
85+
for (auto I = data.Data.cbegin(); I != data.Data.cend(); I++)
8686
{
8787
const CInifile::Item& item = *I;
8888
u16 index = K->LL_BoneID(*item.first);

src/xrGame/ShootingObject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class CShootingObject : public IAnticheatDumpable
175175
Fvector vLoadedShellPoint;
176176
float m_fPredBulletTime;
177177
float m_fTimeToAim;
178-
BOOL m_bUseAimBullet;
178+
bool m_bUseAimBullet;
179179

180180
protected:
181181
//имя пратиклов для огня

0 commit comments

Comments
 (0)