Commit Graph

118 Commits

Author SHA1 Message Date
Peter Nelson d2c8b476b5 Codechange: Add functions to test if a station/roadstop class is a waypoint.
This is now checked by class label instead of by index.
2024-05-11 02:12:41 +01:00
Peter Nelson 45886e50b2
Codechange: Unify where rail station tile flags are set. (#12531)
This avoids repeating the logic in three places.
2024-04-18 18:54:10 +01:00
Peter Nelson 9854553e10 Codechange: ZOOM_LVL_SHIFT/BASE are not actually ZOOM_LVLs.
Rename to ZOOM_BASE_SHIFT and ZOOM_BASE respectively, and derive from ZOOM_LVL instead of numeric value.
2024-04-04 22:27:03 +01:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Peter Nelson 8b60fc3d35
Codechange: Use vector for waypoint layout. (#12264)
This replaces manual new/delete of byte array, and matches how it is used for station layouts.
2024-03-10 17:15:34 +00:00
Kuhnovic b38d3c2208
Change: simplified water region evaluation, removed savegame data (#11750) 2024-01-21 20:56:50 +00:00
Kuhnovic f1e999ec59
Feature: Region-based pathfinder for ships (#10543) 2024-01-08 20:29:05 +01:00
Peter Nelson b5dc9328f2
Change: Store station blocked/wires/pylons flags in map. (#11337)
This stores three flags in unused map bits, and avoids having to look up
station graphics and custom station specs to determine blocked/wires/pylons
status.

This potentially affects rail pathfinding performance.

Savegame version is not bumped, as the flags can just be updated every
time.
2023-09-30 12:30:25 +01:00
frosch 5733145c59 Cleanup: Remove unneeded parameters. 2023-09-19 22:49:59 +02:00
PeterN 882f06bf14
Fix: Support more than 256 stations/waypoints/roadstops per class. (#10793)
It was already possible to define more than 256 per class, but not possible
to use them as the index used in GUI and passed through commands was limited
to a byte.
2023-05-08 18:09:33 +00:00
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 2023-04-24 15:56:01 +00:00
Tyler Trahan bc44158f9a
Change: Allow overbuilding station and waypoint tiles (#10618) 2023-04-16 09:05:04 +02:00
Charles Pigott b282664242 Codechange: Replace all usages of alloca/AllocaM with more modern/less discouraged alternatives 2023-04-15 16:57:00 +01:00
Chenshu Yu eabb9db0bb
Fix #9810: 'Rebuilding' a through road stop costs money (#9852) 2023-02-27 08:59:42 +00:00
rubidium42 6ba55e663e Codechange: do not hide variables with other variables 2023-01-29 07:21:34 +01:00
J0anJosep d9a37c915f Cleanup #9725: Replace cmd_helper related functions and remove cmd_helper.h. 2022-02-02 21:30:15 +01:00
Michael Lutz c6d7b98808 Codechange: Un-bitstuff landscape commands. 2021-12-16 22:28:32 +01:00
Michael Lutz 6fe445e6c0 Codechange: Un-bitstuff station/depot/waypoint commands. 2021-12-16 22:28:32 +01:00
Michael Lutz e740c24eb7 Codechange: Template DoCommand to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
2021-12-16 22:28:32 +01:00
Michael Lutz 7048e1522f Codechange: Move flags in CommandProc in front of the command arguments. 2021-12-16 22:28:32 +01:00
Michael Lutz 33ca4f2b99 Codechange: Let the compile generate the master command table out of templated command traits.
This is using a non-intrusive type-traits like templated system, which
allows compile-time validation that the command table and the command
enum match up.
2021-12-16 22:28:32 +01:00
Michael Lutz b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 2021-12-16 22:28:32 +01:00
rubidium42 2e136285e1 Codechange: move from C-string to std::string for DoCommand 2021-05-29 19:02:18 +02:00
rubidium42 661728558e Codechange: let IsUnique.* functions accept std::string 2021-05-29 19:02:18 +02:00
Peter Nelson bd1a20f6ee Codechange: Use std::vector for NewGRF station platform layouts.
This avoids the need to custom memory management and additional members.

This also resolves use-after-free if modifying copied layouts, so presumably nobody has ever done that.
2021-05-02 17:15:27 +01:00
Michael Lutz 63ccb36ef3 Codechange: Use std::string for most of the user-settable custom names. 2020-05-21 20:02:34 +02:00
glx ddabfed1cd Codechange: Replace station related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
Niels Martin Hansen 9900af38f5
Fix #7847: Use ViewportSign coordinates for sign Kdtree coordinates (#7849)
Ensure the same coordinates are used for station/town/player signs regardless of how the landscape changes below it after the coordinates were first determined.

By keeping track of whether each ViewportSign is valid for Kdtree use (and only ever registering the viewport sign when the object is valid) a lot of code can be simplified and become more robust at the same time.
2019-12-01 23:17:33 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
stormcone 2817cd41f1 Fix #7250: Viewport kdtree not being updated for waypoints when sign moved.
Code based on the patch by JGRennison.
JGRennison/OpenTTD-patches@ac84f34062
2019-07-22 21:41:08 +02:00
peter1138 f538179878 Feature: Multi-tile docks and docking points. 2019-06-30 16:46:32 +02:00
PeterN abe8cf4985
Codechange: Replace duplicated code with TileArea::Expand() (#7467) 2019-04-13 14:12:34 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Niels Martin Hansen e8d397e4ee Codechange: Make a merged k-d tree index of all viewport signs 2019-03-09 20:27:11 +01:00
J0an Josep 67f6bcdc9b Fix #6805: Update CmdBuilRailWaypoint bits. 2018-08-04 08:59:22 +02:00
peter1138 3aad5abfe9 (svn r27785) -Fix [FS#6508]: Buoys not always drawn after being placed depending on zoom level (Samu). 2017-03-12 15:32:40 +00:00
rubidium 9daf7e749c (svn r26879) -Codechange: remove most MayHaveBridgeAbove calls since the data is now always accessible 2014-09-21 11:24:51 +00:00
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 2014-04-25 15:40:32 +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
zuu dfb5663313 (svn r25849) -Codechange: Introduce IsTileFlat to not compute full slope information for situations when we only want to know if a tile is flat or not (cirdan, LordAro) 2013-10-12 22:07:58 +00:00
frosch 0f0e7e43cf (svn r24166) -Codechange: Turn NewGRFClass::Get(Tid, uint) and GetCount(Tid) into non-static members GetSpec(uint) and GetSpecCount(). 2012-04-22 16:28:14 +00:00
alberth 4af8c2d5e1 (svn r23704) -Doc: Doxygen comment fixes and additions. 2012-01-01 17:22:32 +00:00
michi_cc f98312eb77 (svn r23414) -Add: Company infrastructure counts for stations/airports. 2011-12-03 23:40:30 +00:00
peter1138 3e1d070413 (svn r23319) -Fix (r23316): Offsets of viewport signs were not scaled up. 2011-11-24 17:37:20 +00:00
rubidium 2ed0f93bfb (svn r23093) -Codechange: add a default NULL for the Z of GetTileSlope and use it 2011-11-04 10:22:27 +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
rubidium 1a515e6344 (svn r22405) -Document: some more "random-ish" tidbits 2011-05-01 19:14:12 +00:00
rubidium faf5d899f7 (svn r22017) -Codechange: move MarkTileDirtyByTile to viewport_func.h 2011-02-07 22:29:47 +00:00
smatz 3057a26fd5 (svn r21953) -Remove [FS#4456]: the non-uniform stations setting. Support for uniform stations has been broken for over a year 2011-02-04 14:11:14 +00:00
terkhen 53c9846f14 (svn r21806) -Codechange: Correct additional appearances of the same typo. 2011-01-15 16:27:04 +00:00