Skip to content

Commit

Permalink
reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando-A-Rocha committed Nov 6, 2024
1 parent 68ac2e8 commit 7378967
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
3 changes: 1 addition & 2 deletions Client/core/CSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1653,8 +1653,7 @@ void CSettings::UpdateVideoTab()

// Player map image
CVARS_GET("mapimage", iVar);
if (iVar == 0 || iVar == 1)
m_pPlayerMapImageCombo->SetSelectedItemByIndex(iVar);
m_pPlayerMapImageCombo->SetSelectedItemByIndex(iVar);
}

//
Expand Down
13 changes: 3 additions & 10 deletions Client/mods/deathmatch/logic/CPlayerMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,11 @@ CPlayerMap::~CPlayerMap()

void CPlayerMap::SetMapImage(std::size_t imageIndex)
{
std::uint32_t width, height;
if (imageIndex < MAP_IMAGE_SIZES.size())
width = height = MAP_IMAGE_SIZES[imageIndex];
else // Fail safe, ideally client settings system should not allow this case
width = height = MAP_IMAGE_SIZES[0];

SString fileName("MTA\\cgui\\images\\map_%d.png", width);
std::uint32_t mapSize = MAP_IMAGE_SIZES[imageIndex];
SString fileName("MTA\\cgui\\images\\map_%d.png", mapSize);

SAFE_RELEASE(m_mapImageTexture);
m_mapImageTexture = g_pCore->GetGraphics()->GetRenderItemManager()->CreateTexture(CalcMTASAPath(fileName), nullptr, false, width, height, RFORMAT_DXT1);

g_pCore->GetConsole()->Printf("Player map image loaded: %s", fileName);
m_mapImageTexture = g_pCore->GetGraphics()->GetRenderItemManager()->CreateTexture(CalcMTASAPath(fileName), nullptr, false, mapSize, mapSize, RFORMAT_DXT1);
}

void CPlayerMap::DoPulse()
Expand Down

0 comments on commit 7378967

Please sign in to comment.