mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-02-09 13:24:01 +00:00
fix far off minimap symbols. broke in ce7239056
This commit is contained in:
parent
486541b1d7
commit
83ce096119
1 changed files with 12 additions and 13 deletions
|
@ -769,20 +769,19 @@ void MiniMapRender::renderIcon(MinimapIcon *ico, const Vector& pos)
|
|||
return;
|
||||
Vector d = pos - dsq->game->avatar->position;
|
||||
const float len = d.getLength2D();
|
||||
float iconScale;
|
||||
if (len < iconMaxOffset || !ico->scaleWithDistance)
|
||||
float iconScale = 1;
|
||||
if (len >= iconMaxOffset)
|
||||
{
|
||||
iconScale = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
d *= iconMaxOffset / len;
|
||||
float k;
|
||||
if (len < iconMaxDistance)
|
||||
k = ((iconMaxDistance - len) / (iconMaxDistance - iconMaxOffset));
|
||||
else
|
||||
k = 0;
|
||||
iconScale = iconMinScale + k*(1-iconMinScale);
|
||||
d *= iconMaxOffset / len; // clamp to outer circle distance
|
||||
if(ico->scaleWithDistance)
|
||||
{
|
||||
float k;
|
||||
if (len < iconMaxDistance)
|
||||
k = ((iconMaxDistance - len) / (iconMaxDistance - iconMaxOffset));
|
||||
else
|
||||
k = 0;
|
||||
iconScale = iconMinScale + k*(1-iconMinScale);
|
||||
}
|
||||
}
|
||||
|
||||
ico->tex->apply();
|
||||
|
|
Loading…
Add table
Reference in a new issue