Skip to content

Commit

Permalink
Merge pull request #961 from Wedge009/bug_14503_fix
Browse files Browse the repository at this point in the history
Prevent alpha underflow and reduce Shadow translucency (bug #14503)
  • Loading branch information
CelticMinstrel committed Apr 8, 2017
2 parents 753df47 + 9078ec5 commit 2df28aa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/units/frame.cpp
Expand Up @@ -886,9 +886,10 @@ const frame_parameters unit_frame::merge_parameters(int current_time, const fram
}

/** The engine provides a highlight ratio for selected units and visible "invisible" units */
result.highlight_ratio = current_val.highlight_ratio != 1.0 ? current_val.highlight_ratio : animation_val.highlight_ratio;
if(primary && engine_val.highlight_ratio != 1.0) {
result.highlight_ratio = result.highlight_ratio + engine_val.highlight_ratio - 1.0; // selected unit
result.highlight_ratio = (current_val.highlight_ratio < 0.999 || current_val.highlight_ratio > 1.001) ?
current_val.highlight_ratio : animation_val.highlight_ratio;
if(primary && (engine_val.highlight_ratio < 0.999 || engine_val.highlight_ratio > 1.001)) {
result.highlight_ratio = result.highlight_ratio * engine_val.highlight_ratio; // selected unit
}

assert(engine_val.offset == 0);
Expand Down

0 comments on commit 2df28aa

Please sign in to comment.