[Commits] [wesnoth/wesnoth] f8fa22: Prevent alpha underflow (bug #14503)

GitHub noreply at github.com
Sat Apr 8 23:04:48 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: f8fa22ccc085d7dad238bb0510a1c94b4ae7b14c
      https://github.com/wesnoth/wesnoth/commit/f8fa22ccc085d7dad238bb0510a1c94b4ae7b14c
  Author: Wedge009 <wedge009 at wedge009.net>
  Date:   2017-04-09 (Sun, 09 Apr 2017)

  Changed paths:
    M src/units/frame.cpp

  Log Message:
  -----------
  Prevent alpha underflow (bug #14503)

Shadows - like most ghost units - have varying alpha levels as part of their animation, however, the Shadow also has the Nightstalker ability which reduces alpha by 0.5 (invisible unit).
As a result, there is an alpha underflow when the animation frames vary from -0.1 to 0.3.
By using a multiplication instead of an addition-1, as suggested by CelticMinstrel, the alpha variation becomes 0.2 to 0.4, avoiding the underflow and making the Shadow slightly less translucent at night.


  Commit: 9078ec5c55c95a0ccd94fe53265501887d78b6d3
      https://github.com/wesnoth/wesnoth/commit/9078ec5c55c95a0ccd94fe53265501887d78b6d3
  Author: Wedge009 <wedge009 at wedge009.net>
  Date:   2017-04-09 (Sun, 09 Apr 2017)

  Changed paths:
    M src/units/frame.cpp

  Log Message:
  -----------
  Avoid floating-point equality comparisons.

The assumption is that the highlight ratio is only ever 0.5, 1.0, or 1.5. This might be true now... but probably best to avoid equality comparisons if possible.


  Commit: 2df28aa3cb52943d02dc60e1c00ec605b1af2c50
      https://github.com/wesnoth/wesnoth/commit/2df28aa3cb52943d02dc60e1c00ec605b1af2c50
  Author: Celtic Minstrel <CelticMinstrel at users.noreply.github.com>
  Date:   2017-04-08 (Sat, 08 Apr 2017)

  Changed paths:
    M src/units/frame.cpp

  Log Message:
  -----------
  Merge pull request #961 from Wedge009/bug_14503_fix

Prevent alpha underflow and reduce Shadow translucency (bug #14503)


Compare: https://github.com/wesnoth/wesnoth/compare/753df47137aa...2df28aa3cb52


More information about the Commits mailing list