Commit Graph

378 Commits (17c3ce8632776b546d338e825c085487a6ad6f93)

Author SHA1 Message Date
PeterN acd7d3c913
Codechange: Rename *Railtype* to *RailType* for consistency. (#11287) 10 months 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
12 months ago
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 1 year ago
Rubidium 9d2a0f3d0b Change: make GetPartialZ consistent, meaning Z of adjacent slopes continue
Previously, on a straight line of a one corner up slope with the adjacent
steep sloop the Z would increase one step every two sub pixels, except for one
case where one sub pixel is skipped. Similarly, a steep slope with two
adjacent one corner up slopes, would have a bump in the height line along the
diagonal whenever it enters/leaves the steep slope tile.
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
rubidium42 6ba55e663e Codechange: do not hide variables with other variables 1 year ago
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 1 year ago
Francis Herne 01be423237 Fix #10362: NewGRF bridges without speed limits.
For bridges, a max speed of 0xFFFF (i.e. no effective limit)
 is no longer displayed as a limit in the UI.

A max speed of 0 is also considered unlimited, for similarity to the
 roadtype and railtype interface.
1 year ago
Loïc Guilloux c50fabb574
Fix #10208: allow to use specific underlay for road/tram tunnels (#10233) 2 years ago
SamuXarick c7505539af Fix #9869: remove docking tile when doing a clear square
Terraforming through objects placed on water didn't properly remove docking tiles as expected.

By moving some logic regarding removal of docking tiles into DoClearSquare, the issue is solved, while also simplifying code, avoiding repetition elsewhere.
2 years ago
J0anJosep d9a37c915f Cleanup #9725: Replace cmd_helper related functions and remove cmd_helper.h. 2 years ago
Michael Lutz c521b965bd Codechange: Don't use a global for the terrforming error tile. 3 years ago
Michael Lutz c6d7b98808 Codechange: Un-bitstuff landscape commands. 3 years ago
Michael Lutz 46bd2f1ced Codechange: Un-bitstuff remaining transport infrastructure commands. 3 years ago
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.
3 years ago
Michael Lutz 7048e1522f Codechange: Move flags in CommandProc in front of the command arguments. 3 years ago
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.
3 years ago
Michael Lutz b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 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
rubidium42 2e136285e1 Codechange: move from C-string to std::string for DoCommand 3 years ago
glx22 2feb801e56 Codechange: Replace FOR_ALL_ROADTRAMTYPES with range-based for loops 3 years ago
Patric Stout fece1c57ca
Codechange: Suppress warnings when asserts are disabled (#8917) 3 years ago
Patric Stout aac8c28d73 Fix #7656: destroying a tunnel/bridge now first removes the tracks for cost calculation
This means that for rail tunnel/bridges, the rail is first sold,
and the tunnel/bridge is destroyed after. This means destroying
tunnels/ bridges now often makes you money, instead of costing.

Similar, with road/tram tracks. Destroying a road+tram
tunnel/bridge now costs the same amount of money as first
removing the tram tracks and than destroying the road
tunnel/bridge. Especially as tram tracks generate money when
removing, this is a noticeable difference.
4 years ago
Patric Stout ebd9f26c15 Fix: replacing a bridge didn't charge for clearing last tile
It only considered the end-tile (or start-tile) for the bridge,
instead of both. This is obvious in the rest of the code which
constantly does "+ 2"; this being the only place that does a "+ 1".
4 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 4 years ago
J0anJosep edbb5f4f73 Doc: Remove some SmallVector references from documentation. 4 years ago
Michael Lutz 79240eab1e Codechange: Make use of the improved C++17 emplace_back function. 4 years ago
ilayaraja97 cf8ccf4b08 Fix #8131: small bridges also have pillars drawn 4 years ago
Niels Martin Hansen 45838d0105 Fix #7958: Use NewGRF provided catenary sprites when either front or back is overridden 4 years ago
Niels Martin Hansen 9e4eee1b9e Codechange: Refactor road bridge catenary drawing 4 years ago
Charles Pigott ab9042145e Fix #6667: Also recalculate bridge costs for 'spectated' AI companies 5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
JMcKiern 04f659e768 Fix: Some typos found using codespell 5 years ago
peter1138 f538179878 Feature: Multi-tile docks and docking points. 5 years ago
peter1138 c02ef3e456 Feature: Add NotRoadTypes (NRT) 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 5 years ago
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 5 years ago
Niels Martin Hansen b8b6954fb5 Fix 6a3d411: Silence truncation warning 6 years ago
Charles Pigott 1778b2d66e Codechange: Merge some duplicated functions 6 years ago
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 6 years ago
Peter Nelson bf8d7df736 Change: Extend rail types to 64 (6 bit storage) 6 years ago
Jonathan G Rennison 6a3d411fa1 Fix: Use after free in CmdBuildTunnel (#6856)
Use after free could occur when when excavating far end
removed multiple NewGRF objects
6 years ago
frosch 10293c5fb1 (svn r27686) -Change: List railtype of rail tiles explicitly in the tile info window. 8 years ago
frosch d9bfe88261 (svn r27676) -Codechange: Rename catenary functions, so that they refer unambiguously to either RoadCatenary or RailCatenary. 8 years ago
frosch 55e53780cb (svn r27313) -Fix [FS#6317]: Adding tram to town-owned bridges assigned an incorrect owner to the tram and did not count infrastructure counts properly. (marcole) 9 years ago
frosch beb213f9ee (svn r27209) -Add: Draw path reservation on the whole bridge, not only on the bridge heads. 9 years ago
frosch 8f03a02efc (svn r27208) -Fix: Draw correct overlay sprites for path reservations on bridges and tunnels. 9 years ago
frosch e8e49e5dda (svn r27157) -Fix: Mark bridge middle tiles dirty when building/removing/changing bridges. 9 years ago
rubidium ce04c49e3d (svn r26882) -Feature: allow limiting the height of bridges (ic111) 10 years ago