Commit Graph

23 Commits

Author SHA1 Message Date
Binrui Dong 9fdb7ef59c Run IWYU
* 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++
2021-02-06 00:18:41 -05:00
Aivean dcc7997329 extract read-only part of visitable interface
make visitable a real interface
2020-12-24 16:09:29 -08:00
haveric c380afc798 Fix spelling issues (#45878)
* JSON description spelling fixes
* Markdown + txt spelling fixes
* Fix FLAMMABLE_ASH flag for butchering rack
* Fix result spelling of southwest
* Fix cephalopod achievement id spelling
* unsually is probably unusually
* Fix spelling in dynamic line
* Simple comment/text spelling fixes
* Fix variable/enum spellings
* Fix function spelling issues
2020-12-08 16:46:14 -08:00
John Bytheway 2c04d796ef Add units::angle and port various code to use it (#44805)
* Add units::angle and port various code to use it

Add a typesafe angle type.  Partly for general type safety but also to
avoid confusion between different measures of angle (radians, degrees,
and arcmin are all used in this codebase.

Convert tileray to use the new type, and deal with the fallout from
other things that depend on tileray.

Most of the changes relate to changing vehicle facing to the new type.

Note that this changes vehicle facing from an integer to a floating
point type, which could cause some behavioural change.

* Include math_defines.h for Window build
2020-10-18 21:24:56 +00:00
Angela Graves 292d63c295 Merge pull request #42825 from Hirmuolio/no-temp
Fix items with undefined temperature
2020-08-11 00:19:57 -05:00
Hirmuolio 8e80ac4e26 wider prototype 2020-08-09 22:20:58 +03:00
Kevin Granade c5ccf0c2c7 IWYU for tests (#42806) 2020-08-09 09:46:57 +03:00
anothersimulacrum 8eaa61fd8f Remove inventory.h from character.h
Convert it to a pimpl<T> to help speed up build times.
2020-08-03 23:25:28 +00:00
Kevin Granade 6d1841ac67 Precompiled Catch2 header (#42453)
* Hoist catch.hpp include to the top of files

* Precompile the catch header in tests
2020-07-29 01:28:26 +03:00
John Bytheway 4f597dc72a Make closest_points_first work for all point types
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.
2020-07-08 21:30:13 -04:00
Kevin Granade 501f14189b Map reference migration part nine (#41717)
* Map reference migration part nine

* Downgrade avatar references to Character

Reducing inclusions of avatar.h and player.h
2020-07-01 14:14:36 +03:00
John Bytheway b83fc88b9e Convert itype_id to string_id<itype>
itype_id is (presumably) one of the oldest type ids in the game.  In
particular, it predates string_id, and was simply a typedef of
std::string.

This is bad for type safety.

Make it be a string_id specialization instead, and update the rest of
the code accordingly.
2020-05-19 21:07:40 -04:00
KorGgenT a22941a95f adjust item::fill_with to take itype instead of item parameter 2020-05-02 16:05:28 -04:00
KorGgenT 73e5fa574b Update visitable_remove_test.cpp 2020-05-02 16:05:13 -04:00
Eric Pierce 52e6ad8a64 Remove unused lambda capture liquid_id 2020-05-02 16:05:12 -04:00
KorGgenT 09ee4e1b90 nested containers code 2020-05-02 16:02:49 -04:00
John Bytheway 3525bed4ef Fix some sign-comparison warnings in tests
The new Catch2 version is structured so as to surface these warnings
that previously did not occur.  So they need to be resolved.
2020-04-21 17:41:03 -04:00
John Bytheway e189957ff2 Run IWYU 20200408 (#39364)
* 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>
2020-04-10 12:16:19 +03:00
KorGgenT e03227a039 encapsulate item::contents into a new class 2020-04-07 07:31:19 +00:00
Kevin Granade 5fa9146f83 Revert string centralization (#38321)
* Revert "Moved more string consts into single file (#38237)"

This reverts commit 49877426ce.

* Revert "Moved more string consts into single file (#38220)"

This reverts commit d9c6079762.

* Revert "Move string consts into single file (#38195)"

This reverts commit b1b48badff.

* Revert "More string consts into single file (#38189)"

This reverts commit 4fffd96143.

* Revert "More string consts into single file (#38183)"

This reverts commit 05940bfe3a.

* Revert "Move string consts into single file (#38184)"

This reverts commit 19c569826b.

* Revert "Move string consts into single file (#38181)"

This reverts commit 55cabb794c.

* Revert "Move more string consts into single file (#38175)"

This reverts commit 571efb2f8e.

* Revert "Merge pull request #38176 from Ramza13/string_consts_and_more"

This reverts commit 9c9835ff08, reversing
changes made to 07995cdda5.

* Revert "Move more string consts into single file (#38169)"

This reverts commit 07995cdda5.

* Revert "Merge pull request #38168 from Ramza13/even_more_string_consts"

This reverts commit 2bf1c1ea18, reversing
changes made to 24a32c0d1a.

* Revert "Merge pull request #38141 from ZhilkinSerg/sa-2020-02-18"

This reverts commit 142295b1dc, reversing
changes made to f98c67d3c3.

* Revert "Move string consts into single file (#38158)"

This reverts commit 50059c8a24.

* Revert "Merge pull request #38157 from Ramza13/string_consts_more_flags"

This reverts commit 8ec8e78959, reversing
changes made to 72ef0222a0.

* Revert "Move string_consts"

This reverts commit 0a6bf67436.

* Revert "Merge pull request #38146 from Ramza13/battery"

This reverts commit 9286722b74, reversing
changes made to e9f1cd7787.

* Revert "Merge pull request #38134 from AMurkin/rename-blob"

This reverts commit 06f72d2b7d, reversing
changes made to bcfe0741e1.

* Revert "Yet more string consts moved out (#38130)"

This reverts commit b5f18f3574.

* Revert "Merge pull request #38115 from Ramza13/string_consts_game"

This reverts commit 98076577b0, reversing
changes made to 036465f517.

* Fixup to the picked_up

* RE-inline item_location initialization

* Update character.h

* Update item.cpp

* Update item.h

* Update item_action.cpp

* Update item_factory.cpp

* Update point.h

* Update safemode_ui.cpp
2020-02-25 23:00:09 +03:00
Eric 49877426ce Moved more string consts into single file (#38237) 2020-02-23 19:50:56 +03:00
ZhilkinSerg fbaae72067 Refactor closest_(tri)points_first functions (#37108)
* Refactored `closest_(tri)points_first` functions
- moved into `point` file;
- rearranged function parameters;
- removed duplicate code;
- get rid of some `auto` and one time use variables;
2020-01-17 07:57:04 +00:00
John Bytheway ba319e75d8 Rename test files for consistency
Have all files containing tests be named *_test.cpp.
2020-01-11 11:05:54 -05:00