Skip to content

Commit f517280

Browse files
author
Pavel Kovalenko
committed
Rename SGameTypeMaps::SMapItm -> MPLevelDesc, SGameWeathers -> MPWeatherDesc.
1 parent e86bd60 commit f517280

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

src/xrGame/UIGameCustom.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ void CMapListHelper::LoadMapInfo(const char* cfgName, const xr_string& levelName
336336
lastItem.m_game_type_id = ParseStringToGameType(gameType.c_str());
337337
suitableLevels = &m_storage.back();
338338
}
339-
SGameTypeMaps::SMapItm levelDesc;
339+
MPLevelDesc levelDesc;
340340
levelDesc.map_name = shLevelName;
341341
levelDesc.map_ver = shLevelVer;
342342
auto& levelNames = suitableLevels->m_map_names;
@@ -365,7 +365,7 @@ void CMapListHelper::Load()
365365
m_weathers.reserve(weatherCfg.Data.size());
366366
for (CInifile::Item& weatherDesc : weatherCfg.Data)
367367
{
368-
SGameWeathers gw;
368+
MPWeatherDesc gw;
369369
gw.Name = weatherDesc.first;
370370
gw.StartTime = weatherDesc.second;
371371
m_weathers.push_back(gw);
@@ -435,7 +435,7 @@ const SGameTypeMaps& CMapListHelper::GetMapListFor(const EGameIDs gameId)
435435
return m_storage[0];
436436
}
437437

438-
const xr_vector<SGameWeathers>& CMapListHelper::GetGameWeathers()
438+
const xr_vector<MPWeatherDesc>& CMapListHelper::GetGameWeathers()
439439
{
440440
if (m_weathers.size() == 0)
441441
Load();

src/xrGame/UIGameCustom.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ struct StaticDrawableWrapper : public IPureDestroyableObject
3636
void SetText(const char* text);
3737
};
3838

39-
struct SGameTypeMaps
39+
struct MPLevelDesc
4040
{
41-
struct SMapItm
42-
{
43-
shared_str map_name;
44-
shared_str map_ver;
45-
bool operator == (const SMapItm& rhs) { return map_name == rhs.map_name && map_ver == rhs.map_ver; }
46-
};
41+
shared_str map_name;
42+
shared_str map_ver;
43+
bool operator == (const MPLevelDesc& rhs) { return map_name == rhs.map_name && map_ver == rhs.map_ver; }
44+
};
4745

46+
struct SGameTypeMaps
47+
{
4848
shared_str m_game_type_name;
4949
EGameIDs m_game_type_id;
50-
xr_vector<SMapItm> m_map_names;
50+
xr_vector<MPLevelDesc> m_map_names;
5151
};
5252

53-
struct SGameWeathers
53+
struct MPWeatherDesc
5454
{
5555
shared_str Name;
5656
shared_str StartTime;
@@ -60,12 +60,12 @@ class CMapListHelper
6060
{
6161
private:
6262
xr_vector<SGameTypeMaps> m_storage;
63-
xr_vector<SGameWeathers> m_weathers;
63+
xr_vector<MPWeatherDesc> m_weathers;
6464

6565
public:
6666
const SGameTypeMaps& GetMapListFor(const shared_str& gameType);
6767
const SGameTypeMaps& GetMapListFor(const EGameIDs gameId);
68-
const xr_vector<SGameWeathers>& GetGameWeathers();
68+
const xr_vector<MPWeatherDesc>& GetGameWeathers();
6969

7070
private:
7171
void Load();

src/xrGame/console_commands_mp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ class CCC_ChangeLevelGameType : public IConsole_Command {
13421342
bool bMapFound = false;
13431343
for(u32 i=0; i<cnt; ++i)
13441344
{
1345-
const SGameTypeMaps::SMapItm& itm = M.m_map_names[i];
1345+
const MPLevelDesc& itm = M.m_map_names[i];
13461346
if (!xr_strcmp(itm.map_name.c_str(), LevelName) &&
13471347
!xr_strcmp(itm.map_ver.c_str(), LevelVersion))
13481348
{

src/xrGame/ui/UIMapList.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void CUIMapList::OnListItemClicked()
130130

131131
CUIListBoxItem* itm = m_pList1->GetSelectedItem();
132132
u32 _idx = (u32)(__int64)(itm->GetData());
133-
const SGameTypeMaps::SMapItm& M = GetMapNameInt(GetCurGameType(), _idx);
133+
const MPLevelDesc& M = GetMapNameInt(GetCurGameType(), _idx);
134134

135135
map_name += M.map_name.c_str();
136136
xr_string full_name = map_name + ".dds";
@@ -203,7 +203,7 @@ const char* CUIMapList::GetCommandLine(LPCSTR player_name){
203203
return NULL;
204204

205205
u32 _idx = (u32)(__int64)(itm->GetData());
206-
const SGameTypeMaps::SMapItm& M = GetMapNameInt (GetCurGameType(), _idx);
206+
const MPLevelDesc& M = GetMapNameInt(GetCurGameType(), _idx);
207207

208208
m_command.clear();
209209
m_command = "start server(";
@@ -248,7 +248,7 @@ void CUIMapList::LoadMapList()
248248
{
249249
const auto& weathers = gMapListHelper.GetGameWeathers();
250250
u32 cnt = 0;
251-
for (const SGameWeathers& weather : weathers)
251+
for (const MPWeatherDesc& weather : weathers)
252252
AddWeather(weather.Name, weather.StartTime, cnt++);
253253
if (weathers.size() > 0)
254254
m_pWeatherSelector->SetItemIDX(0);
@@ -275,7 +275,7 @@ void CUIMapList::SaveMapList()
275275
{
276276
CUIListBoxItem* itm = m_pList2->GetItemByIDX(idx);
277277
u32 _idx = (u32)(__int64)(itm->GetData());
278-
const SGameTypeMaps::SMapItm& M = GetMapNameInt(GetCurGameType(), _idx);
278+
const MPLevelDesc& M = GetMapNameInt(GetCurGameType(), _idx);
279279

280280
xr_sprintf (map_name, "sv_addmap %s/ver=%s", M.map_name.c_str(), M.map_ver.c_str() );
281281
pW->w_string (map_name);
@@ -426,7 +426,7 @@ bool CUIMapList::IsEmpty()
426426
return 0 == m_pList2->GetSize();
427427
}
428428

429-
const SGameTypeMaps::SMapItm& CUIMapList::GetMapNameInt(EGameIDs _type, u32 idx)
429+
const MPLevelDesc& CUIMapList::GetMapNameInt(EGameIDs _type, u32 idx)
430430
{
431431
const SGameTypeMaps& M = gMapListHelper.GetMapListFor(_type);
432432
R_ASSERT (M.m_map_names.size()>idx);

src/xrGame/ui/UIMapList.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CUIMapList : public CUIWindow {
3939
void StartDedicatedServer();
4040
void ClearList();
4141
bool IsEmpty();
42-
const SGameTypeMaps::SMapItm& GetMapNameInt(EGameIDs _type, u32 idx);
42+
const MPLevelDesc& GetMapNameInt(EGameIDs _type, u32 idx);
4343

4444
private:
4545
CUIListBoxItem* GetMapItem_fromList1(shared_str const& map_name);
@@ -69,7 +69,7 @@ class CUIMapList : public CUIWindow {
6969
// CUISpinText* m_pModeSelector;
7070
CUIStatic* m_pMapPic;
7171
CUIMapInfo* m_pMapInfo;
72-
72+
// XXX nitrocaster: use MPWeatherDesc
7373
struct Sw{
7474
shared_str weather_name;
7575
shared_str weather_time;

0 commit comments

Comments
 (0)