Commit Graph

55 Commits

Author SHA1 Message Date
Peter Nelson 3b75d8bbf8 Fix: Use modern comparisons instead of memcmp in cache check.
This uses C++20 default operator<=> to provide comparisons of some objects.

This works properly with caches that containers.
2024-04-18 22:13:55 +01:00
Peter Nelson d683ec0183
Codechange: Move dropdown and slider out of widgets directory. (#12403)
Also shuffle headers to place widget includes near end.

This leaves the widgets directory solely for defining Widget IDs.
2024-03-31 19:37:16 +01:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01: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 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.
2023-04-09 19:00:26 +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
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
peter1138 c02ef3e456 Feature: Add NotRoadTypes (NRT) 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
Henry Wilson af7d9020a1 Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual
member declaration overrides a base-class member with the same signature.

Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked
as virtual despite being a template.
2019-03-24 16:10:04 +01:00
rubidium 14a599409e (svn r26888) -Codechange: use ints for some z-levels of vehicles (ic111) 2014-09-21 12:44:38 +00:00
rubidium f3d085e33c (svn r26702) -Fix [FS#6067]: integer overflows in acceleration code causing either too low acceleration or too large acceleration 2014-07-22 19:46:10 +00:00
alberth 5add39d560 (svn r24540) -Codechange: Remove the not-so-useful HALF_TILE_SIZE constant. 2012-09-21 20:31:06 +00:00
frosch 08a8c3a773 (svn r24384) -Fix [FS#5188-ish]: Make IsInDepot() functions behave consistent across vehicle types and add IsChainInDepot instead, if that is what shall be checked. 2012-07-07 15:39:46 +00:00
rubidium e40eb8177a (svn r23735) -Codechange: remove ~50 includes from headers that weren't needed 2012-01-03 20:26:05 +00:00
truebrain 091bc25a90 (svn r23714) -Codechange: don't mix Viewport with non-viewport code 2012-01-02 13:44:37 +00:00
truebrain 1c9bec1999 (svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC) 2011-12-20 17:57:56 +00:00
rubidium df16ebd730 (svn r23595) -Codechange: add comma after last enum to get a more uniform coding style 2011-12-19 17:48:04 +00:00
rubidium 4de1f3be88 (svn r23540) -Codechange: unify and document vehicle widgets 2011-12-16 16:58:55 +00:00
rubidium 2a2c102b0b (svn r23108) -Codechange: more uint -> int / byte -> int conversions for Z related variables 2011-11-04 11:52:19 +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
planetmaker 43c8cd1d5e (svn r22473) -Codechange: Automatic orders are better called implicit orders as no real order influencing path finding is added 2011-05-18 12:19:58 +00:00
frosch 194a941a37 (svn r22328) -Add: a flag to GroundVehicles to disable insertion and removal of automatic orders until the next real order is reached. 2011-04-16 16:45:35 +00:00
rubidium e34c42de32 (svn r22205) -Codechange: replace magic number with constant 2011-03-05 21:52:45 +00:00
frosch 9aa185572b (svn r21989) -Fix (r21954): Vehicle status bar glitches on speed changes. 2011-02-05 21:13:54 +00:00
rubidium 2ad1279725 (svn r21954) -Cleanup: remove setting to not show the vehicle speed in the vehicle view 2011-02-04 14:37:24 +00:00
terkhen 9626e0bf2b (svn r21922) -Codechange: Unify articulated vehicle checking functions. 2011-01-29 17:26:23 +00:00
terkhen 23ffef05ce (svn r21921) -Codechange: Move GroundVehicleSubtypeFlags as they will be needed by some Vehicle functions. 2011-01-29 17:21:39 +00:00
rubidium ab4c419fcf (svn r21916) -Fix [FS#4442]: the minimum speed needed for (realistic) acceleration to work properly can sometimes be more than the (temporary) maximum speed causing Clamp to "fail". Make sure that the minimum speed always overrules the maximum speed 2011-01-26 17:37:12 +00:00
rubidium b4a175ba41 (svn r21914) -Codechange: move the algorithmic part of Train::UpdateSpeed to a function in GroundVehicle 2011-01-26 17:34:07 +00:00
rubidium b11f1bd4ed (svn r21911) -Codechange: move tcache.last_speed to gcache.last_speed and make SetLastSpeed a function of GroundVehicle 2011-01-26 17:31:07 +00:00
smatz 8b9f0d5ade (svn r21883) -Codechange: make UpdateZPosition() faster by not calling GetSlopeZ() when not needed 2011-01-21 17:35:17 +00:00
smatz e860075a16 (svn r21882) -Codechange: make use of the fact that vehicle's Z position can change only if it has GVF_GOINGUP_BIT or GVF_GOINGDOWN_BIT set 2011-01-21 16:51:56 +00:00
smatz e308c348f0 (svn r21879) -Codechange: reset vehicle's GOINGUP/DOWN bits when it crashes 2011-01-21 16:20:55 +00:00
smatz 46dfdfd72b (svn r21878) -Codechange: move parts of UpdateInclination() to separate functions 2011-01-21 16:13:54 +00:00
smatz 4432f7799d (svn r21877) -Codechange: move definition of HALF_TILE_SIZE to tile_type.h 2011-01-21 15:48:52 +00:00
smatz 6dc24cf643 (svn r21876) -Codechange: typedef SpecializedVehicleBase and GroundVehicleBase to reduce typing 2011-01-21 14:43:38 +00:00
terkhen d426906a01 (svn r21862) -Codechange: Unify subtype handling between road vehicles and trains. 2011-01-19 20:04:09 +00:00
terkhen 613743538d (svn r21859) -Codechange: Move train subtype flags to GroundVehicle. 2011-01-19 18:42:54 +00:00
smatz 92b90d877e (svn r21824) -Codechange: don't call GetSlopeZ() when the ground vehicle is on a flat tile 2011-01-16 18:18:45 +00:00
terkhen 48b7916458 (svn r21521) -Codechange: Unify some cached values that were present in both road vehicles and trains. 2010-12-14 21:33:53 +00:00
terkhen a93944e765 (svn r21520) -Document: Complete the comments of GroundVehicleCache. 2010-12-14 21:31:45 +00:00
terkhen 12c86a1391 (svn r21518) -Codechange: Rename AccelerationCache to GroundVehicleCache. 2010-12-14 21:28:45 +00:00
michi_cc 2d801c64a1 (svn r21106) -Change: Tuned realistic acceleration to be a bit more realistic in order to make acceleration "slower", which highlights the differences between vehicle types more. 2010-11-07 13:35:07 +00:00
terkhen 766bf140db (svn r21092) -Codechange: Merge max speed functions. 2010-11-06 12:40:38 +00:00
terkhen 7d0297f967 (svn r20302) -Add: Method for getting the air drag of a ground vehicle. 2010-08-02 14:52:51 +00:00
terkhen 1fd66d7cc4 (svn r20299) -Add: Make trains and road vehicles use a different area value to calculate air drag. 2010-08-02 14:49:23 +00:00
frosch dc79bf4c01 (svn r19356) -Fix: Whitespace. 2010-03-06 16:15:50 +00:00
terkhen a5f9a7c1a5 (svn r19342) -Codechange: Move inclination update functions to GroundVehicle. 2010-03-06 12:52:44 +00:00