summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2021-12-16Codechange: Un-bitstuff all remaining commands.Michael Lutz
2021-12-16Codechange: Un-bitstuff station/depot/waypoint commands.Michael Lutz
2021-12-16Codechange: Un-bitstuff vehicle/engine commands.Michael Lutz
2021-12-16Change: [Network] Transfer command data as serialized byte stream without ↵Michael Lutz
fixed structure. The data will be transmitted as the length followed by the serialized data. This allows the command data to be different for every command type in the future.
2021-12-16Codechange: Make TileIndex a "strong" typedef to give it a distinct type.Michael Lutz
This is accomplished by changing it to a single member struct with the appropriate operator overloads to make it all work with not too much source modifications.
2021-12-16Codechange: Declare our custom enum operators as constexpr.Michael Lutz
2021-12-16Fix: Template syntax error when using 'span' with a container type.Michael Lutz
2021-12-12Fix: if vehicles only refit to cargo-slots >= 32, the default cargo was ↵frosch
wrong. (#9744)
2021-11-09Cleanup: Fix typo in overflowsafe_type commentTyler Trahan
2021-08-10Fix 68f2213: Don't use GetPoolSize() for end of pool iterator (#9461)Loïc Guilloux
2021-07-20Codechange: Make OverflowSafeInt constexprCharles Pigott
2021-07-20Codechange: Remove (unused) ability to specify min/max of OverflowSafeIntCharles Pigott
2021-07-20Codechange: Use GCC/clang builtins for overflow safety when supportedCharles Pigott
2021-07-20Fix: OverflowSafeInt could underflowCharles Pigott
Notably, a company with an extremely negative amount of money would suddenly become very rich
2021-07-20Fix: OverflowSafeInt negation not handling INT64_MINCharles Pigott
INT64_MIN negated is above INT64_MAX, and would overflow. Instead, when negating INT64_MIN make it INT64_MAX. This does mean that -(-(INT64_MIN)) != INT64_MIN.
2021-07-09Cleanup: Remove now unused FOR_EACH_SET_BIT_EX macroglx22
2021-07-09Codechange: Remove FOR_EACH_SET_BITglx22
2021-07-02Feature: framework to make savegames self-descriptivePatric Stout
We won't be able to make it fully self-descriptive (looking at you MAP-chunks), but anything else can. With this framework, we can add headers for each chunk explaining how each chunk looks like in detail. They also will all be tables, making it a lot easier to read in external tooling, and opening the way to consider a database (like SQLite) to use as savegame format. Lastly, with the headers in the savegame, you can freely add fields without needing a savegame version bump; older versions of OpenTTD will simply ignore the new field. This also means we can remove all the SLE_CONDNULL, as they are irrelevant. The next few commits will start using this framework.
2021-06-13Codechange: convert printf DEBUG statements to fmt Debug statementsrubidium42
2021-06-03Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways ↵Patric Stout
we had While at it, replace OTTD_ASSERT with WITH_ASSERT, as this is always set if assert() is valid. No matter if NDEBUG is set or not.
2021-05-31Codechange: C++-ify lists for SaveLoad (#9323)Patric Stout
Basically, this changes "SaveLoad *" to either: 1) "SaveLoadTable" if a list of SaveLoads was meant 2) "SaveLoad &" if a single entry was meant As added bonus, this removes SL_END / SLE_END / SLEG_END. This also adds core/span.hpp, a "std::span"-lite.
2021-05-27Codechange: pass large parameter by reference instead of value, especially ↵rubidium42
in a recursive function
2021-04-21Cleanup: Replace single-use Pair struct with std::pair.Peter Nelson
This struct is defined in geometry_type but not used by any geometry-related code, only for subsidy code where both parameters are cast from int to NewsReferenceType.
2021-04-01Fix: building on Raspberry Pi failed because of const vs constexpr (#8924)Patric Stout
2021-02-17Fix: [SDL2] simplify what to redraw to prevent tearing (#8685)Patric Stout
When there are a lot of rects to redraw, of which one of the last ones is almost the full screen, visual tearing happens over the vertical axis. This is most visible when scrolling the map. This can be prevented by using less rects. To simplify the situation, and as solutions like OpenGL need this anyway, keep a single rect that shows the biggest size that updates everything correctly. Although this means it needs a bit more time redrawing where it is strictly seen not needed, it also means less commands have to be executed in the backend. In the end, this is a trade-off, and from experiments it seems the approach of this commit gives a better result.
2021-01-08Codechange: Remove min/max functions in favour of STL variants (#8502)Charles Pigott
2020-12-27Codechange: Replace assert_compile macro with static_assertCharles Pigott
2020-12-15Codechange: Make use of the improved C++17 emplace_back function.Michael Lutz
2020-07-03Fix: Globally apply preprocessor directive coding styleTechGeekNZ
Global; except for the 32-bit SSE blitter, which has some #DEFINEs in not-very-nice places.
2020-06-05Add: introduce CMake for project managementPatric Stout
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-05-21Codechange: Replace SmallPair with std::pair.Michael Lutz
std::pair is already the smallest possible pair, and it already handles non-POD types correctly.
2020-02-11Fix: OpenBSD endianness detectionCharlène
2020-01-07Codechange: Remove std::function from Pool iteration wrapperJonathan G Rennison
Add a separate template wrapper for filtered iteration
2019-12-21Fix: unused variable warningsglx
2019-12-21Cleanup: remove FOR_ALL_ITEMSglx
2019-12-21Add: Allow iteration of pools in range-based for loopsglx
2019-11-10Cleanup: Removed SVN headersS. D. Cloudt
2019-10-08Codechange: Performance improvement in k-d tree FindNearest()Gabda
2019-09-29Fix: Some typos found using codespellJMcKiern
2019-08-31Codechange: math functions - use cpp-style castsNikolas Nyby
2019-08-17Add #6887: Option to show zone inside local authority boundary of townsGabda
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-05-04Remove: grow() helper functionglx
2019-04-29Remove: (Simple)TinyEnumTCharles Pigott
2019-04-21Codechange: Use std::underlying_type for DECLARE_POSTFIX_INCREMENT.peter1138
2019-04-21Fix: Replace int with std::underlying_type in DECLARE_ENUM_AS_BIT_SET.peter1138
This fixes 64 bit uses of this macro.
2019-04-18Cleanup: remove core/sort_func.hpp as it's not used anymoreglx
2019-04-18Codechange: use std::vector for _resolutionsglx
2019-04-15Codechange: No need for AutoFreePtr if there's std::unique_ptr.Michael Lutz
2019-04-15Codechange: Replace SmallStackSafeStackAlloc with std::array.Michael Lutz
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-13Fix 801cbea9c: operator< is not always the best ideaglx
Also removes unused and anyway broken SmallMap::SortByKey() function.