Skip to content

Commit 7e21ff0

Browse files
.
1 parent 8a3f4f7 commit 7e21ff0

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Client/core/CSettings.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,8 +1019,8 @@ void CSettings::CreateGUI()
10191019
m_pRadarMapImageCombo = reinterpret_cast<CGUIComboBox*>(pManager->CreateComboBox(pTabAdvanced, ""));
10201020
m_pRadarMapImageCombo->SetPosition(CVector2D(vecTemp.fX + fIndentX, vecTemp.fY - 1.0f));
10211021
m_pRadarMapImageCombo->SetSize(CVector2D(fComboWidth, 95.0f));
1022-
m_pRadarMapImageCombo->AddItem(_("1024 x 1024 (Default)"))->SetData((void*)0);
1023-
m_pRadarMapImageCombo->AddItem(_("2048 x 2048"))->SetData((void*)1);
1022+
m_pRadarMapImageCombo->AddItem(_("1024 x 1024 (Default)"));
1023+
m_pRadarMapImageCombo->AddItem(_("2048 x 2048"));
10241024
m_pRadarMapImageCombo->SetReadOnly(true);
10251025
vecTemp.fY += fLineHeight;
10261026

@@ -3565,7 +3565,7 @@ void CSettings::SaveData()
35653565
{
35663566
int iSelected = (int)pSelected->GetData();
35673567
CVARS_SET("radar_map_image", iSelected);
3568-
// TODO Update the map image if radar map exists
3568+
// TODO: Update the map image if radar map exists
35693569
}
35703570

35713571
// Fast clothes loading

Client/mods/deathmatch/logic/CRadarMap.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ CRadarMap::CRadarMap(CClientManager* pManager)
5858

5959
// Create the radar map image
6060
m_pRadarImage = nullptr;
61-
SetMapImage(g_pCore->GetCVars()->GetValue<int>("radar_map_image", 0));
61+
SetMapImage(g_pCore->GetCVars()->GetValue<std::uint32_t>("radar_map_image", 0));
6262

6363
// Create the marker textures
6464
CreateMarkerTextures();
@@ -116,16 +116,15 @@ CRadarMap::~CRadarMap()
116116
}
117117

118118
// If invalid presetIndex is passed, it will use the first preset
119-
void CRadarMap::SetMapImage(const int presetIndex)
119+
void CRadarMap::SetMapImage(const std::uint32_t presetIndex)
120120
{
121121
if (m_pRadarImage != nullptr)
122122
SAFE_RELEASE(m_pRadarImage);
123123

124124
auto [fileName, width, height] = GetRadarImagePreset(presetIndex);
125125
m_pRadarImage = g_pCore->GetGraphics()->GetRenderItemManager()->CreateTexture(CalcMTASAPath("MTA\\cgui\\images\\" + fileName), nullptr, false, width, height,
126126
RFORMAT_DXT1);
127-
g_pCore->GetConsole()->Printf("Radar map image preset id %d loaded (%d x %d)", presetIndex, width, height);
128-
127+
g_pCore->GetConsole()->Printf("Radar map image preset id loaded: [%d] %d x %d", presetIndex, width, height);
129128
SetupMapVariables();
130129
}
131130

Client/mods/deathmatch/logic/CRadarMap.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,15 @@ class CRadarMap
6262
void ZoomIn();
6363
void ZoomOut();
6464

65-
void SetMapImage(const int presetIndex);
65+
void SetMapImage(const std::uint32_t presetIndex);
6666

6767
SString GetBoundKeyName(const SString& strCommand);
6868

69-
std::tuple<std::string, int, int> GetRadarImagePreset(int index) const noexcept
69+
std::tuple<std::string, std::uint32_t, std::uint32_t> GetRadarImagePreset(std::uint32_t index) const
7070
{
7171
if (index < 0 || index >= m_radarImagePresets.size())
7272
index = 0;
73+
assert(index < m_radarImagePresets.size()); // Vector should never be empty
7374
return m_radarImagePresets[index];
7475
}
7576

@@ -92,7 +93,7 @@ class CRadarMap
9293
CTextureItem* m_pLocalPlayerBlip;
9394
std::vector<CTextureItem*> m_MarkerTextureList;
9495

95-
std::vector<std::tuple<std::string, int, int>> const m_radarImagePresets = {
96+
const std::vector<std::tuple<std::string, std::uint32_t, std::uint32_t>> m_radarImagePresets = {
9697
{"radar_1024.png", 1024, 1024},
9798
{"radar_2048.png", 2048, 2048},
9899
};

0 commit comments

Comments
 (0)