- bugfix selection circle and healthbar rendering

This commit is contained in:
SoftCoder 2014-11-28 20:49:04 -08:00
parent 8e7dfbd43a
commit 126ed18589
1 changed files with 14 additions and 12 deletions

View File

@ -5464,19 +5464,21 @@ void Renderer::renderSelectionEffects(int healthbarMode) {
currVec.y+= 0.3f; currVec.y+= 0.3f;
//selection circle //selection circle
int finalHealthbarMode=hbvUndefined; int finalHealthbarMode = hbvUndefined;
if(healthbarMode==hbvUndefined) { if(healthbarMode == hbvUndefined) {
finalHealthbarMode=unit->getFaction()->getType()->getHealthbarVisible(); finalHealthbarMode = unit->getFaction()->getType()->getHealthbarVisible();
} else {
finalHealthbarMode=healthbarMode;
} }
bool healthbarsVisible=((finalHealthbarMode&hbvAlways)||(finalHealthbarMode&hbvSelected)||(finalHealthbarMode&hbvIfNeeded)); else {
float selectionCircleThickness=0.2f; finalHealthbarMode = healthbarMode;
float hpRatio=unit->getHpRatio(); }
bool healthbarsVisible =((finalHealthbarMode & hbvAlways) ||
(finalHealthbarMode & hbvSelected) ||
(finalHealthbarMode & hbvIfNeeded));
float selectionCircleThickness = 0.2f;
float hpRatio = unit->getHpRatio();
if(healthbarsVisible) { if(healthbarsVisible) {
//hpRatio=unit->getHpRatio(); selectionCircleThickness = 0.05f;
selectionCircleThickness=0.05f; hpRatio = 1.0f;
hpRatio=1.0f;
} }
if(world->getThisFactionIndex() == unit->getFactionIndex()) { if(world->getThisFactionIndex() == unit->getFactionIndex()) {
@ -5493,7 +5495,7 @@ void Renderer::renderSelectionEffects(int healthbarMode) {
else if ( world->getThisTeamIndex() == unit->getTeam()) { else if ( world->getThisTeamIndex() == unit->getTeam()) {
glColor4f(hpRatio, hpRatio, 0, 0.3f); glColor4f(hpRatio, hpRatio, 0, 0.3f);
} }
else{ else {
glColor4f(hpRatio, 0, 0, 0.3f); glColor4f(hpRatio, 0, 0, 0.3f);
} }
renderSelectionCircle(currVec, unit->getType()->getSize(), selectionCircleRadius,selectionCircleThickness); renderSelectionCircle(currVec, unit->getType()->getSize(), selectionCircleRadius,selectionCircleThickness);