* Change _ctype.h and __locale to cctype and clocale
* Change _wctype.h to cwctype in game.cpp
* Change __functional_base to functional
* Remove libcxx internal headers
* Remove UNIX system headers
* Fix clang-tidy error with -nostdinc++
To make rectangle and cuboid work more smoothly with the new point
types, make their point type a template argument, and update uses
accordingly.
The new flexibility for these types is used in overmap and overmap_ui.
Turns out box is the name of an ncurses function, so we can't have a
class template with the same name. Before I can change cox to a class
template, need to either rename it or put it in a namespace.
Chose to go with renaming it to cuboid.
Previously we had separate functions closest_points_first and
closest_tripoints_first. We'd like to extend this functionality to
coord_point, but it's easier to do if both the raw underlying functions
have the same name (so the generic wrapper can be the same).
To that end, rename closest_tripoints_first to closest_points_first
(they are chosen between based on overload resolution), and add a
wrapper to allow coord_point to be used similarly.
Previously rectangle and box were just a min and max. Determining
whether the upper bound should be considered to be inclusive was done by
which function was called on it.
I now regret that design choice, and am changing it. Now the inclusive
vs half-open is part of the rectangle or box type, and the functions are
generic.
This leads to less repetition in the code.
Also, the next step is to make it possible to iterate over rectangles
(to simplify a bunch of our nested for loops), and this design fits much
better for that.
* Helper script to run IWYU
* Run IWYU
* Update deprecated headers
* Run IWYU again
* Re-suppress cxxabi.h
This pragma got accidentally removed because it was deemed to be a
comment attached to a #include.
* Remove extra SDL header includes
* Fix ime.cpp headers
Some tweaks to help IWYU not break this file by messing with
platform-specific stuff not relevant on Linux.
* Update game.h
* Move new point.h includes inside #ifdef
* Re-add platform_win.h to mapsharing.cpp
* Apply suggestions from code review
Co-authored-by: ZhilkinSerg <ZhilkinSerg@users.noreply.github.com>
* Add simple unit tests for `closest_points` functions
* Minor simplification and optimization of `closest_points` functions
* Allow specifying minimal distance in `closest_points` functions
* Use `closest_points` functions for overmap buffer search
* Initial version of UseNamedPointConstantsCheck
This is intended to convert hand-rolled point constants like
point( 0, 0 ) into point_zero.
* Apply refactoring pass
* Manual fixup of refactored code
Add various manual tweaks to the automatically refactored code where I
think it makes sense.
* Remove some unnecessary initializations
Rather than having a free function for generic_inbounds, have two member
functions on each of rectangle and box to test bounds.
Rather than having an optional 'clearance' parameter, have two names for
the two common bounds types (inclusive and half-open ranges).
Refactor all uses to this new API.
The main goal here is to make it easier to use these bounds tests in
fewer lines of code for common cases. I also think the member function
form reads more smoothly in code.