[Commits] [wesnoth/wesnoth] ecbb15: Minor cleanups to math utils

GitHub noreply at github.com
Sun Jan 21 07:12:30 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: ecbb15e1c6d1106ff2f8e540c584523481426c04
      https://github.com/wesnoth/wesnoth/commit/ecbb15e1c6d1106ff2f8e540c584523481426c04
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-01-21 (Sun, 21 Jan 2018)

  Changed paths:
    M src/gui/widgets/slider.cpp
    M src/terrain/terrain.hpp
    M src/tod_manager.cpp
    M src/utils/math.hpp

  Log Message:
  -----------
  Minor cleanups to math utils

* Dropped bounded_add for clamp. There's a slight behavior change with this, namely that
  base is no longer returned if it falls outside the bounds. However, for both usecases of
  bounded_add, that behavior doesn't make sense. The wiki clearly states min/max_light=
  define the bounds for light=.

* Replaced gcd with Boost's gcd function. We already use the latter in the Preferences
  dialog, so this is more consistent.

* Simplified the implementation of in_ranges.





More information about the Commits mailing list