Commit Graph

272 Commits

Author SHA1 Message Date
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 2020-12-27 10:55:42 +00:00
Michael Lutz 79240eab1e Codechange: Make use of the improved C++17 emplace_back function. 2020-12-15 00:29:30 +01:00
TechGeekNZ 716c883737 Fix: Globally apply preprocessor directive coding style
Global; except for the 32-bit SSE blitter, which has some #DEFINEs
in not-very-nice places.
2020-07-03 09:08:46 +02:00
Patric Stout 56d54cf60e Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.

Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.

This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.

Addtiionally, this heavily improves our detection of libraries, etc.
2020-06-05 19:36:05 +02:00
Michael Lutz f2b40f40aa Codechange: Replace SmallPair with std::pair.
std::pair is already the smallest possible pair, and it already handles non-POD types correctly.
2020-05-21 20:02:34 +02:00
Charlène 2196cd3cf8 Fix: OpenBSD endianness detection 2020-02-11 13:01:45 +00:00
Jonathan G Rennison 150dfba95b Codechange: Remove std::function from Pool iteration wrapper
Add a separate template wrapper for filtered iteration
2020-01-07 09:00:45 +00:00
glx e3c75a30ba Fix: unused variable warnings 2019-12-21 20:13:03 +01:00
glx ae532008ff Cleanup: remove FOR_ALL_ITEMS 2019-12-21 20:13:03 +01:00
glx 68f22134cb Add: Allow iteration of pools in range-based for loops 2019-12-21 20:13:03 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Gabda 652fb40652 Codechange: Performance improvement in k-d tree FindNearest() 2019-10-08 08:53:19 +02:00
JMcKiern 04f659e768 Fix: Some typos found using codespell 2019-09-29 21:27:32 +01:00
Nikolas Nyby 28e11623bd Codechange: math functions - use cpp-style casts 2019-08-31 20:27:56 +01:00
Gabda b870596f15 Add #6887: Option to show zone inside local authority boundary of towns
Can be found at town information > local authority window
Layout for button is same as Graph Keys
Turn on/off for every town individually
2019-08-17 21:45:20 +01:00
glx 26aa3b8623 Remove: grow() helper function 2019-05-04 19:50:53 +01:00
Charles Pigott 9e19a5f93e Remove: (Simple)TinyEnumT 2019-04-29 17:40:22 +01:00
peter1138 66cd32a252 Codechange: Use std::underlying_type for DECLARE_POSTFIX_INCREMENT. 2019-04-21 22:31:12 +01:00
peter1138 ac1e1a272f Fix: Replace int with std::underlying_type in DECLARE_ENUM_AS_BIT_SET.
This fixes 64 bit uses of this macro.
2019-04-21 22:31:12 +01:00
glx ebd4f32d15 Cleanup: remove core/sort_func.hpp as it's not used anymore 2019-04-18 21:49:34 +02:00
glx 9195f2337a Codechange: use std::vector for _resolutions 2019-04-18 21:49:34 +02:00
Michael Lutz 38729297f9 Codechange: No need for AutoFreePtr if there's std::unique_ptr. 2019-04-15 22:52:50 +01:00
Michael Lutz 4e85ccf3c0 Codechange: Replace SmallStackSafeStackAlloc with std::array.
The only port that ever used it to make heap allocations instead of stack ones was the NDS port, which got thrown out some time ago.
2019-04-15 22:52:50 +01:00
glx 410b81537c Fix 801cbea9c: operator< is not always the best idea
Also removes unused and anyway broken SmallMap::SortByKey() function.
2019-04-13 21:05:25 +02:00
glx 801cbea9cc Codechange: use std::sort() for all std::vector types 2019-04-13 12:49:18 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Michael Lutz 8b1880187a Remove: AutoFreeSmallVector.
The last use was for storing a list of memory blocks. As the way these lists are accessed is very
specific, it is easier to just write an explicit destructor instead of trying to exactly match the behaviour.
2019-04-09 22:45:15 +02:00
Michael Lutz e804173595 Codechange: If something is a vector of strings, use a vector of strings instead of an AutoFreeSmallVector. 2019-04-09 22:45:15 +02:00
Michael Lutz c7b9987d08 Codechange: Switch DropDownList to directly use std::vector, thus making AutoDeleteSmallVector obsolete.
DropDownListItem are strongly managed using std::unique_ptr to ensure leak-free handling. Appropriate use
of move-semantics make intent a lot clearer than parameter comments and allows the compiler to generate
copy-free code for most situations.
2019-04-09 22:45:15 +02:00
Michael Lutz 05f4e73608 Codechange: Replace custom mutex code with C++11 mutex'es.
A conforming compiler with a valid <mutex>-header is expected.
Most parts of the code assume that locking a mutex will never fail unexpectedly,
which is generally true on all common platforms that don't just pretend to
be C++11. The use of condition variables in driver code is checked.
2019-04-06 11:27:39 +02:00
Michael Lutz 21d9e87b46 Fix #7165: Const overload SmallMap::Contains(key) compared wrong types.
Const and non-const Find() have different return types.
2019-03-28 00:04:28 +00:00
stormcone ee260e4704 Fix #7165: SmallMap::Erase(key) does not work correctly 2019-03-28 00:04:28 +00:00
glx22 66dd7c3879
Fix: MSVC warnings (#7423) 2019-03-28 00:09:33 +01:00
Charles Pigott ed9005690a Fix #7421: Don't (directly) dereference std::vector::end() in SmallMap 2019-03-27 06:31:49 +00:00
Henry Wilson 03ca3190c9 Codechange: Use range-based for-loop in Auto[Free|Delete]SmallVector 2019-03-26 20:15:57 +00:00
Henry Wilson cc62f4163f Cleanup: Remove unused size template parameters from SmallMap and Auto[Free|Delete]SmallVector 2019-03-26 20:15:57 +00:00
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 2019-03-26 20:15:57 +00:00
Henry Wilson 6570f7989f Codechange: Declare SmallVector as an alias for std::vector 2019-03-26 20:15:57 +00:00
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 2019-03-26 20:15:57 +00:00
Henry Wilson 297fd3dda3 Codechange: Replaced SmallVector::Include() with include() 2019-03-26 20:15:57 +00:00
Henry Wilson 2bc2de9034 Codechange: Replaced SmallVector::Find() with std::find() 2019-03-26 20:15:57 +00:00
Henry Wilson e0c58bf5ee Codechange: Removed SmallVector::Insert() 2019-03-26 20:15:57 +00:00
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 2019-03-26 20:15:57 +00:00
Henry Wilson ca2f33c6d0 Codechange: Replaced SmallVector::Erase() with std::vector::erase() 2019-03-26 20:15:57 +00:00
Henry Wilson 097328c3d7 Codechange: Replaced SmallVector::Get() const with std alternatives 2019-03-26 20:15:57 +00:00
Henry Wilson aa7ca7fe64 Codechange: Replaced SmallVector::Get(n) non-const with std::vector::data() + n 2019-03-26 20:15:57 +00:00
Henry Wilson bc7dcaffca Codechange: Removed SmallVector::Assign() 2019-03-26 20:15:57 +00:00
Henry Wilson 5795f66d2e Codechange: Replaced SmallVector::Contains() with std::find() pattern 2019-03-26 20:15:57 +00:00
Henry Wilson b1f5119d3a Codechange: Replaced SmallVector::ErasePreservingOrder(pos, count) with std::vector::erase() 2019-03-26 20:15:57 +00:00
Henry Wilson 9b5cc73f3e Codechange: Replaced SmallVector::ErasePreservingOrder(it, count) with std::vector::erase() 2019-03-26 20:15:57 +00:00