Commit Graph

294 Commits

Author SHA1 Message Date
Matt 727ba2d7d0 Fix #8333: Replace assert with in-game error. 2018-12-23 22:28:59 +01:00
Michael Steenbeek 2530cd1ac3
Fix #8426: Queue banner left behind after ride demolition 2018-12-22 15:34:17 +01:00
Ted John 06f203a7e7 Implement surfaces, edges and stations as objects 2018-12-09 23:30:40 +00:00
ζeh Matt 06c5508bab Fix #8212: Crash when opening rides with changed mode and no tracks. (#8216) 2018-11-12 20:13:42 +01:00
Felix Pelletier 0cd7f1e07c Fix #8142: Reliability of unbreakable rides can go below 100% 2018-11-02 09:04:27 +01:00
Michael Steenbeek f8add7f62e
Rename rct_tile_element to TileElement 2018-11-01 13:53:50 +01:00
clang-format b02dfdbc93 Binpack function arguments together
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead.

Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:22 +02:00
clang-format 95ce592579 Enforce not breaking before assignments and function names
Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:19 +02:00
clang-format e8310d079d clang-format ride 2018-07-23 16:00:09 +02:00
Gymnasiast 5128737666 Rename some flags, move FLAG_16 to ride groups 2018-06-23 17:39:38 +02:00
spacek531 0861481cb6 First iteration 2018-06-23 16:24:01 +02:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Hielke Morsink 0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
Ted John b4d3806614 Unblock tiles when vehicles are removed from ride 2018-06-10 22:59:58 +01:00
Hielke Morsink 2fed57d792
Check for ghost flag when removing track blocks (#7596) 2018-05-31 22:36:45 +02:00
jensj12 56fcd2ec94 Use ride_get_start_of_track in TrackDesignSave 2018-05-23 16:33:37 +02:00
jensj12 50e3f8b4f6 Cleanup of ride_demolish 2018-05-23 16:33:37 +02:00
jensj12 23dc6bb9d3 Add button to refurbish ride
Add a button to refurbish the selected ride. The cost for this is 35% of the
build price and may only be done if the ride is closed and empty.
2018-05-23 16:33:37 +02:00
Michael Steenbeek fcf507e051
Spin off shop item stuff to separate files 2018-05-14 19:21:43 +02:00
Ted John d7e93cec27 Prevent use of Context during ~Context 2018-05-13 00:43:56 +01:00
Michael Steenbeek 2d92ecf10b Fix #7436: Only the first 32 vehicles of a train can be painted 2018-04-26 10:33:54 +02:00
Hielke Morsink bf4f68fe33 Use enum type that guarantee to support its values
By default enumerators use type `int` which can store values up to `1 << 31 - 1`. The clang compiler generates this error for enums values that use the sign bit: `enumerator value is not representable in the underlying type 'int'.`

To get rid of those warnings (and technically improve the code) the erroneous enums are now of type of `uint32`.

Note: I've skipped peep.h to prevent conflicts with the peep refactor branch.
2018-04-24 16:51:42 +02:00
Hielke Morsink 30063984e6
Delete unused function arguments or mark them so (#7426)
This aims to make future refactoring easier. The arguments are removed where possible, but kept and marked with C++17's [[maybe_unused]] where they could not be removed (e.g. when they are used as a callback, rather than called directly).

I've skipped the rides/<category>/* and peep/* source files, because the rides source files are mostly generated and have a ton of unused variables, and the peep source files are being refactored.
I've also skipped most of window/* source files, because most of the functions are used as callbacks and will be bulk-renamed at some point.
2018-04-20 13:56:37 +02:00
Michael Steenbeek cfb5a6b39d Correct spelling of 'sujonkwa' 2018-03-29 13:00:01 +02:00
Ted John f700c661d8 Allow cars property to be a single object 2018-03-26 21:37:23 +02:00
Michael Steenbeek 695d3762e5 Remove last usages of SEPARATE_RIDE flag 2018-03-26 20:36:16 +02:00
Michael Steenbeek 1fa2fa8f80
Refactor ride->entrances and ride->exits 2018-03-07 19:10:50 +01:00
Michael Steenbeek f4ac2b4d5b Replace LocationXYZD16 2018-02-16 16:16:49 +01:00
Michael Steenbeek bde913ee16 Rename SmallCoords and BigCoords 2018-02-15 22:26:50 +01:00
Michael Steenbeek a2260929dd Replace rct_xy_element with BigCoordsXYE 2018-02-15 22:26:50 +01:00
Hielke Morsink 55979a3fff Remove and replace C typedefs
`typedef struct/union/enum name { ... } name_again;` is not needed whe compiling C++, moving the name at the back to be in front of the object and removing `typedef` makes it usable the very same way.
This also replaces typedefs with the using keyword. They have better readability, especially for function pointer types, and would allow more flexibility when used with templates.
2018-02-14 09:42:26 +01:00
jensj12 02474353e3 Reduce duplicate code
Fix two cases of duplicated code
2018-02-13 00:11:29 +01:00
Michael Steenbeek acc6136847 Do not pack Ride struct 2018-02-08 15:33:43 +01:00
Michael Steenbeek e2dd629aaf Remove padding and offsets in Ride struct 2018-02-08 15:33:43 +01:00
Michael Steenbeek 34c8409251 Clean up ride struct and num_riders import, update changelog 2018-02-08 15:33:43 +01:00
Gymnasiast 02196a1919 Fix #3330: Current number of passengers overflows 2018-02-08 15:33:43 +01:00
Gymnasiast 34a6b5ef92 Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
Gymnasiast 778ba466c5 Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Ted John aa0d7645da Refactor ride_ratings.c to C++ 2018-01-18 22:33:06 +00:00
Michał Janiszewski 19d35e6898 MSVC fixes pt 5 2018-01-11 09:30:09 +01:00
Michael Steenbeek 6a88d6e04d Move and rename RCT{1,2,12}.h 2018-01-09 13:36:41 +01:00
Michael Steenbeek 91589f57c6 Compile map.c as C++ 2018-01-03 20:40:51 +01:00
Gymnasiast 6e281e2061 Move music tune id list out of Ride.cpp for now 2017-12-31 20:43:17 +01:00
Gymnasiast 23d70a4ac9 Compile ride.c as C++ 2017-12-31 20:43:17 +01:00
Renamed from src/openrct2/ride/ride.h (Browse further)