From d5249333d4274c46bf5ab4d8802820a4c5f29afe Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Fri, 4 Aug 2017 20:27:33 +1100 Subject: [PATCH] Unit/Frame: fixed alpha mods being applied to all units of the same type --- src/units/frame.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/units/frame.cpp b/src/units/frame.cpp index 86a4f14a810b..43e0279c5117 100644 --- a/src/units/frame.cpp +++ b/src/units/frame.cpp @@ -560,11 +560,11 @@ void unit_frame::redraw(const int frame_time, bool on_start_time, bool in_scope_ fixed_t alpha = ftofxp(current_data.highlight_ratio); - // FIXME: this has a problem where multiple units of the same type (so, same texture) - // all get this applied to them. Not sure how to fix... - if(alpha < ftofxp(1.0)) { - set_texture_alpha(image, alpha); - } + // Explicitly set sprite to opaque if not applying an alpha effect. This ensures that + // multiple copies of the same sprite - ie, diffent units of the same type - don't all + // get drawn with the alpha effect. This happened because they all use the same texture + // and setting the alpha mod on one affects them all. + set_texture_alpha(image, alpha < ftofxp(1.0) ? alpha : ALPHA_OPAQUE); #if 0 surface surf(image);