Commit Graph

240 Commits (0316940fe83023b7603ce4db7001bf855f0ff8c2)

Author SHA1 Message Date
Patric Stout 07730584d7
Codechange: make explicit when a TileIndex is cast to its basetype (#11190)
This prevents people accidentially assigning a TileIndex to a Date
or any other type they shouldn't.
1 year ago
Patric Stout 9624017fc2
Codechange: be more type-specific about types in NPFs queue (#11192) 1 year ago
Patric Stout 299570b2c1
Codechange: make TimerGameCalendar Date and Year types strongly typed (#10761) 1 year ago
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
1 year ago
Rubidium c518293135 Codechange: replace printf with fmt::print 1 year ago
Rubidium 68ff3fd062 Change: include fmt.h C++ headers in stdafx.h
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
1 year ago
Tyler Trahan 6501f84b4a
Codechange: Move calendar date functions inside TimerGameCalendar (#10753) 1 year ago
Rubidium e8af8daa68 Codechange: pass "ground vehicle" to GetTileSlopeZ since for tunnel/bridges there are two states
Previously it checked the position in non-driving direction to "guess" whether
a ground vehicle was using the function, so on tunnels/bridges it could either
return the Z of the (virtual) ground compared to the Z of the path the vehicle
would take.
1 year ago
Rubidium 580d0a6343 Codechange: make use of Tile in for all direct map accesses 2 years ago
Rubidium b7a5d8e296 Codechange: add annotation to selectively force inlining in debug build 2 years ago
Rubidium 71b46db8d0 Cleanup: remove commented out code 2 years ago
Rubidium ae422be979 Cleanup: remove/replace trailing ; with . in comments 2 years ago
Nicolas Chappe 7e7d943526 Codechange: [YAPF] Allow to retrieve the final tile of the calculated path 2 years ago
Nicolas Chappe 227626b0b7 Change: [YAPF] All compatible depots are targets for 'any depot' orders 2 years ago
Loïc Guilloux 6ff0858b38
Fix #9669, cbe00ec: Only try valid reverse directions (#9672) 3 years ago
glx22 cbe00ec651 Fix: Try all possible reverse directions when a ship reaches a dead end 3 years ago
Loïc Guilloux 11dece205c
Revert 7ca1793: Using Trackdir keyed node is not required, Exitdir keyed node still have the correct trackdir (#9576) 3 years ago
Patric Stout f87fe395a7
Fix: pathfinders always tried to avoid docking tiles (even if nothing was on them) (#9522)
When coming across any docking tile (for example, all tiles around
an oilrig are docking tiles), it always at least added a penalty
of 3 times a normal tile, even when there are no ships on them.

In result, the pathfinder got suggested to always go around docking
tiles. This was most likely not the intention of the change made in
31db4f8d5e.
3 years ago
glx22 49b66ea504 Codechange: Remove FOR_EACH_SET_TRACK 3 years ago
Rubidium 281a65b3e1 Cleanup: simplify some boolean expressions 3 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
Patric Stout 28e90769f7 Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways 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.
3 years ago
Vít Šefl 0125ba82e8 Fix: Do not send vehicles towards incomplete PF nodes
YAPF could end up in a situation where it sets the best intermediate node
to a node whose construction is never finalized (i.e. it is never added to
the open list). The content of the node would be overwritten in the next
round, potentially sending the vehicle to an unwanted location.
3 years ago
rubidium42 9197de39e4 Cleanup: remove unused copy-constructor without copy-assignment 3 years ago
Vít Šefl 33d99d27f4 Fix: Encountering two-way red signals could prune unrelated branches.
The intermediate node branch is now only pruned if the node is on the
path leading to the two-way red signal.
3 years ago
rubidium42 44ca7d9377 Change: Use gender-neutral pronouns 3 years ago
Patric Stout 665a3928e2 Remove: performance measurements in YAPF
YAPF was constantly measuring its performance, but only at
certain debug-levels this information was shown.

Now after years, I sincerely wonder if anyone still knows about this
feature and who still use it. Especially with the new framerate window,
this detailed performance is not as meaningful anymore as it once
was.
3 years ago
Patric Stout e162aff7a3 Cleanup: remove weird left-over comment in yapf.hpp 3 years ago
Charles Pigott e8a94dc8bb Cleanup: Delete remaining Blob code 4 years ago
Charles Pigott e8022a589d Codechange: Replace CBlobT usage with std::vector 4 years ago
Charles Pigott f481c9fc2c Codechange: Replace CStrA with std::string 4 years ago
Charles Pigott 591ea9862d
Codechange: Suppress warnings when asserts are disabled (#8916) 4 years ago
Patric Stout d4583fa64c
Fix #8123: trams on half-tiles couldn't find depots (#8738)
Basically, follow_track.hpp contains a fix for half-tiles, but
this wasn't duplicated for when trying to find a depot and in
a few other places. This makes sure all places act the same.
4 years ago
Charles Pigott 80fb1c74f0 Change: Make pathfinder account for maximum order speed, if set 4 years ago
Charles Pigott 1d6a0c7b52 Fix: [YAPF] Road pathfinder did not account for length of tunnel/bridge in path cost
Copy calculations from the rail pathfinder
4 years ago
Charles Pigott c461999b2b Fix #8594: [NRT] Road pathfinder did not account for roadtype speed limits 4 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 4 years ago
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.
4 years ago
Quipyowert2 acb3d10832 Codechange: Format unsigned integers with %u instead of %i or %d. 5 years ago
Jonathan G Rennison 1a88fb5c91 Fix #7592: Do not cache road vehicle path within 8 tiles of destination with multiple entrances
Ported from jgrpp commit 79d5be7e26
5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Charles Pigott 71a3e83468 Fix: GCC9's warnings about deprecated implicit assignment operators 5 years ago
JMcKiern 04f659e768 Fix: Some typos found using codespell 5 years ago
peter1138 0db31ae27f Change: Avoid caching end of ship path, to allow penalties to apply. 5 years ago
peter1138 31db4f8d5e Add: Penalty for occupied docking points. 5 years ago
peter1138 f538179878 Feature: Multi-tile docks and docking points. 5 years ago
peter1138 c02ef3e456 Feature: Add NotRoadTypes (NRT) 5 years ago
peter1138 bcdb28249c Codechange: Use RAILTYPES_NONE instead of INVALID_RAILTYPES when not using rail.
INVALID_RAILTYPES, if it was accidentally tested, would match any railtype.
5 years ago
Charles Pigott 9f3928658b Codechange: Remove Track{dir,}{Bits,}Byte types 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 6 years ago