Commit Graph

84 Commits

Author SHA1 Message Date
Rubidium 6b21368bc2 Codechange: replace FIND_FIRST_BIT/FindFirstBit2x64 with FindFirstBit 2024-01-19 21:10:39 +01:00
Tyler Trahan 1f41e773d6 Codechange: Use consistent name for bay road stops
As of #10494, this is how we describe original dead-end road stops.
2023-11-28 14:24:33 -05:00
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Patric Stout 9624017fc2
Codechange: be more type-specific about types in NPFs queue (#11192) 2023-08-12 18:18:22 +00:00
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
2023-07-19 19:30:14 +02:00
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.
2023-04-09 19:00:26 +02:00
Rubidium 580d0a6343 Codechange: make use of Tile in for all direct map accesses 2023-02-28 07:11:48 +01:00
Rubidium 71b46db8d0 Cleanup: remove commented out code 2023-01-26 23:47:55 +01:00
Loïc Guilloux 6ff0858b38
Fix #9669, cbe00ec: Only try valid reverse directions (#9672) 2021-11-06 17:32:37 +01:00
glx22 cbe00ec651 Fix: Try all possible reverse directions when a ship reaches a dead end 2021-10-11 21:11:13 +02:00
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.
2021-08-31 09:57:44 +02:00
glx22 49b66ea504 Codechange: Remove FOR_EACH_SET_TRACK 2021-07-09 21:36:09 +02:00
Rubidium 281a65b3e1 Cleanup: simplify some boolean expressions 2021-06-17 16:18:30 +02:00
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
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.
2021-06-03 17:30:00 +02:00
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.
2021-04-30 12:48:41 +02:00
Charles Pigott 591ea9862d
Codechange: Suppress warnings when asserts are disabled (#8916) 2021-04-01 10:03:12 +02:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
JMcKiern 04f659e768 Fix: Some typos found using codespell 2019-09-29 21:27:32 +01:00
peter1138 31db4f8d5e Add: Penalty for occupied docking points. 2019-06-30 16:46:32 +02:00
peter1138 f538179878 Feature: Multi-tile docks and docking points. 2019-06-30 16:46:32 +02:00
peter1138 c02ef3e456 Feature: Add NotRoadTypes (NRT) 2019-05-01 21:36:27 +02:00
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.
2019-05-01 21:36:27 +02:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Michael Lutz cc5f175615 Feature: Railtype flags to allow/disallow 90 degree curves. (#7352) 2019-03-10 08:12:47 +00:00
Peter Nelson 3f327116db Change: Don't apply forbid 90 deg turn settings to ships. 2019-03-03 20:59:44 +01:00
J0an Josep 029c48cf4a Cleanup: [NPF] Remove unused parameter. 2019-01-31 22:15:56 +00:00
J0an Josep d814dd3434 Cleanup: [NPF] Assert that a track has been chosen. 2019-01-31 22:15:56 +00:00
J0an Josep aa63517c92 Fix #7060: [NPF] Do not check whether ignored first tiles are end nodes. 2019-01-31 22:15:56 +00:00
J0an Josep 19be1f4ace Codechange: [NPF] Add some consts. 2019-01-31 22:15:56 +00:00
J0an Josep 96c5e5e73a Cleanup: [NPF] Remove unused parameters. 2019-01-31 22:15:56 +00:00
J0an Josep c304aa50e9 Fix: [NPF] Don't look two-way for road vehicles when looking for a depot. Road vehicles shouldn't reverse all of a sudden. 2019-01-06 16:47:45 +01:00
Juanjo! edb7adf183 Codechange: [NPF] Stop looking for an automatic servicing (rail/road) depot when the cost of a path exceeds max. penalty. 2019-01-06 16:47:45 +01:00
J0an Josep 16a91130a7 Codechange: Use INVALID_TRACKDIR instead of 0xFF. 2019-01-04 23:55:07 +01:00
J0anJosep 31ac11bddb Codechange: Increase readability of track functions and pathfinders. 2018-06-27 23:14:30 +02:00
Patric Stout 17bd580630
Remove: NO_DEBUG_MESSAGES was only read and setting it broke compilation (#6703)
Given any speed issue cannot be attributed to checking for _debug_NNN_level, removing this is a safe action

This fixes #6652.
2018-04-11 22:07:21 +02:00
michi_cc 016a68815d (svn r27912) -Fix (r13948): [NPF] Reserved track bits were not accounted for when trying to find any safe position. 2017-09-03 13:06:29 +00:00
adf88 1dd6930507 (svn r27906) -Cleanup: Remove some NPF code with no effect and mark possible bug about never used NPF_FLAG_IGNORE_RESERVED flag 2017-08-31 06:51:01 +00:00
frosch 062c736437 (svn r27896) -Fix: some warnings 2017-08-20 21:04:21 +00:00
frosch a23f707f92 (svn r27733) -Codechange: Pass NPF user data as void* instead of as array of integers. 2017-01-15 13:59:46 +00:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
frosch d17ec934f5 (svn r24481) -Feature [FS#5127]: Make the pathfinder decide whether ships shall leave depots towards north or south. 2012-08-18 11:37:47 +00:00
frosch 9215192d34 (svn r24479) -Fix: Trains were unable to reverse in stations when using NPF. 2012-08-18 11:37:03 +00:00
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 2012-01-03 21:32:51 +00:00
rubidium 7757a2ed40 (svn r23091) -Codechange: rename some Get*Z functions to Get*PixelZ functions if they return the Z in pixels (like TilePixelHeight) 2011-11-04 10:18:13 +00:00
alberth 31386c42a7 (svn r22145) -Codechange: Do explicit test for non-bool values. 2011-02-25 22:04:38 +00:00
rubidium faf5d899f7 (svn r22017) -Codechange: move MarkTileDirtyByTile to viewport_func.h 2011-02-07 22:29:47 +00:00
michi_cc e744b97ec8 (svn r21524) -Fix [FS#4302]: Do not apply the last signal red pathfinder penalty when the signal is a path signal. 2010-12-15 14:33:24 +00:00