Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando-A-Rocha committed Oct 26, 2024
1 parent ed4d3cd commit c48fa4e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Client/mods/deathmatch/logic/CRadarMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,15 @@ CRadarMap::CRadarMap(CClientManager* pManager)
m_iVerticalMovement = 0;
SetupMapVariables();

// Create the radar and local player blip images
m_pRadarImage =
g_pCore->GetGraphics()->GetRenderItemManager()->CreateTexture(CalcMTASAPath("MTA\\cgui\\images\\radar.jpg"), NULL, false, 2048, 2048, RFORMAT_DXT1);
// Create the local player blip image
m_pLocalPlayerBlip = g_pCore->GetGraphics()->GetRenderItemManager()->CreateTexture(CalcMTASAPath("MTA\\cgui\\images\\radarset\\02.png"));

// Create the radar map image
int radarImagePreset = 0; // TEMP
auto [radarImgFileName, radarImgWidth, radarImgHeight] = GetRadarImagePreset(radarImagePreset);
m_pRadarImage = g_pCore->GetGraphics()->GetRenderItemManager()->CreateTexture(CalcMTASAPath("MTA\\cgui\\images\\" + radarImgFileName), NULL, false,
radarImgWidth, radarImgHeight, RFORMAT_DXT1);

// Create the marker textures
CreateMarkerTextures();

Expand Down
12 changes: 12 additions & 0 deletions Client/mods/deathmatch/logic/CRadarMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ class CRadarMap

SString GetBoundKeyName(const SString& strCommand);

std::tuple<std::string, int, int> GetRadarImagePreset(int index) const
{
if (index < 0 || index >= m_radarImagePresets.size())
index = 0;
return m_radarImagePresets[index];
}

private:
bool CalculateEntityOnScreenPosition(class CClientEntity* pEntity, CVector2D& vecLocalPos);
bool CalculateEntityOnScreenPosition(CVector vecPosition, CVector2D& vecLocalPos);
Expand All @@ -83,6 +90,11 @@ class CRadarMap
CTextureItem* m_pLocalPlayerBlip;
std::vector<CTextureItem*> m_MarkerTextureList;

std::vector<std::tuple<std::string, int, int>> m_radarImagePresets = {
{"radar_1024.png", 1024, 1024},
{"radar_2048.png", 2048, 2048},
};

unsigned int m_uiHeight;
unsigned int m_uiWidth;

Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c48fa4e

Please sign in to comment.