1
0
forked from mirrors/0ad

Restores minimap entities size and adds options.

Restores minimap entities size to size they have in A25.
Adds minimap options.

Fixes #6782.
This commit is contained in:
Vladislav Belov
2025-10-05 12:04:21 +02:00
parent 3dfd4b0d3e
commit e1d5e92c2a
2 changed files with 8 additions and 1 deletions
+7 -1
View File
@@ -517,11 +517,17 @@ void CMiniMapTexture::RenderFinalTexture(
m_LastFinalTextureUpdate = currentTime;
m_FinalTextureDirty = false;
CmpPtr<ICmpRangeManager> cmpRangeManager(m_Simulation, SYSTEM_ENTITY);
ENSURE(cmpRangeManager);
// We might scale entities properly in the vertex shader but it requires
// additional space in the vertex buffer. So we assume that we don't need
// to change an entity size so often.
// Also compensate circular maps for being rendered closer than square maps.
const float mapGeometryScale{cmpRangeManager->GetLosCircular() ? std::sqrt(2.0f) : 1.0f};
const float entityRadiusScale{g_ConfigDB.Get("gui.session.minimap.entityradiusscale", 1.0f) / mapGeometryScale };
// Radius with instancing is lower because an entity has a more round shape.
const float entityRadius = static_cast<float>(m_MapSize) / 128.0f * (m_UseInstancing ? 5.0 : 6.0f);
const float entityRadius = static_cast<float>(m_MapSize) / 128.0f * (m_UseInstancing ? 5.0 : 6.0f) * entityRadiusScale;
UpdateAndUploadEntities(deviceCommandContext, entityRadius, currentTime);