Make player entities more visible on minimap
This patch is increasing contrast of player colours used on minimap in minimap component instead of changing player colours themselves to not mess with other cases, when they are used. Differential revision: D3242 Comments by: @vladislavbelov, @ValihrAnt, @Freagarach This was SVN commit r25312.
This commit is contained in:
parent
45805043a1
commit
895182cbcb
@ -33,6 +33,7 @@
|
|||||||
#include "lib/external_libraries/libsdl.h"
|
#include "lib/external_libraries/libsdl.h"
|
||||||
#include "lib/ogl.h"
|
#include "lib/ogl.h"
|
||||||
#include "lib/timer.h"
|
#include "lib/timer.h"
|
||||||
|
#include "maths/MathUtil.h"
|
||||||
#include "ps/ConfigDB.h"
|
#include "ps/ConfigDB.h"
|
||||||
#include "ps/Filesystem.h"
|
#include "ps/Filesystem.h"
|
||||||
#include "ps/Game.h"
|
#include "ps/Game.h"
|
||||||
@ -621,6 +622,15 @@ void CMiniMap::Draw()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (cmpMinimap->UsesPlayerColor())
|
||||||
|
{
|
||||||
|
// Based on article: https://alaingalvan.tumblr.com/post/79864187609/glsl-color-correction-shaders
|
||||||
|
const int contrast = 10;
|
||||||
|
v.r = Clamp(((v.r - 128) * contrast) + 128, 0, 255);
|
||||||
|
v.g = Clamp(((v.g - 128) * contrast) + 128, 0, 255);
|
||||||
|
v.b = Clamp(((v.b - 128) * contrast) + 128, 0, 255);
|
||||||
|
|
||||||
|
}
|
||||||
addVertex(v, attrColor, attrPos);
|
addVertex(v, attrColor, attrPos);
|
||||||
++m_EntitiesDrawn;
|
++m_EntitiesDrawn;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2019 Wildfire Games.
|
/* Copyright (C) 2021 Wildfire Games.
|
||||||
* This file is part of 0 A.D.
|
* This file is part of 0 A.D.
|
||||||
*
|
*
|
||||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||||
@ -195,6 +195,11 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool UsesPlayerColor() const
|
||||||
|
{
|
||||||
|
return m_UsePlayerColor;
|
||||||
|
}
|
||||||
|
|
||||||
virtual bool CheckPing(double currentTime, double pingDuration)
|
virtual bool CheckPing(double currentTime, double pingDuration)
|
||||||
{
|
{
|
||||||
if (!m_Active || !m_IsPinging)
|
if (!m_Active || !m_IsPinging)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2018 Wildfire Games.
|
/* Copyright (C) 2021 Wildfire Games.
|
||||||
* This file is part of 0 A.D.
|
* This file is part of 0 A.D.
|
||||||
*
|
*
|
||||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||||
@ -45,6 +45,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void UpdateColor() = 0;
|
virtual void UpdateColor() = 0;
|
||||||
|
|
||||||
|
virtual bool UsesPlayerColor() const = 0;
|
||||||
|
|
||||||
DECLARE_INTERFACE_TYPE(Minimap)
|
DECLARE_INTERFACE_TYPE(Minimap)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user