Commit Graph

205 Commits

Author SHA1 Message Date
Richard Fine 74b581c572 Remove unused 'direction' parameter
The get_track_paint_function functions have all been taking an extra 'direction' parameter, but nothing is actually using it. To simplify things, remove the parameter.
2020-09-07 21:20:34 -04:00
Cory Sanin df5dd4f253
Fix #12737: Space Rings draw the same vehicle 4 times (#12738)
paint_space_rings_structure always used vehicle 0 for it's vehicle reference
2020-08-20 19:04:15 +02:00
Łukasz Pękalski 399e0abe2e
Close #12497: Remove extra SPRITE_INDEX_NULL checks (#12601) 2020-08-08 09:12:52 -03:00
Duncan 6d11825e1a
Reduce the use of rct_sprite (#12530)
* Reduce the use of rct_sprite

* Pass the correct types in S4 importer

* Add additional nullptr checks

* Simplify the viewport interaction

* Apply review comments

* Small cleanup of GetEntity

* Fix test paint
2020-08-01 11:29:54 +01:00
Duncan c6e26267a4
Reduce the use of GET_VEHICLE (#12494)
* Start removing GET_VEHICLE macro use

* Further work

* Remove further GET_VEHICLE's

* Further removal of GET_VEHICLE

* Remove the last of GET_VEHICLE

* Fix testpaint

* Fix nullptr deref

* Make review changes

Also swapped in helper functions and used a standard patern for iterating the train cars

* Further simplify loops for train cars
2020-07-31 07:48:27 +01:00
Michael Steenbeek e03753c139
Fix #12498: Circus construction ghost does not rotate (#12519) 2020-07-30 20:29:26 +02:00
Duncan 8a378ad236
Remove uses of GET_PEEP macro and replace with GetEntity (#12467)
* Use TryGetEntity and GetEntity instead of macro

* Use GetEntity for ui guest window

* Remove final GET_PEEP macro uses

* Fix remaining issues
2020-07-26 17:42:02 +01:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Gymnasiast bc3ad044f8
Consistently use 'Circus' 2020-07-21 13:55:48 +02:00
Gymnasiast cf664c8340
Close #11971: Replace ride groups with new ride types 2020-07-17 00:19:49 +02:00
frutiemax d969e93ea1
Fix #12112: Move TrackColourPreviews to RideTypeDescriptors (#12114) 2020-07-03 22:15:11 +02:00
Hudson Oliveira ef5f117373
Part of #9473: Create Vehicle::GetRide (#12002)
* Part of #9473: Create Vehicle::GetRide

* Redefine Vehicle::GetRide in Compat.cpp
2020-06-21 08:38:53 +01:00
frutiemax 57b50e46df
Part of #11964: Move RideTypeEnumNames to RideTypeDescriptors 2020-06-19 23:03:24 +02:00
frutiemax 51f32130b3
Part of #11964: Merge RideColourKey in RideTypeDescriptor (#11996) 2020-06-19 20:21:16 +02:00
frutiemax 57b121d448
Part of 11964: move RideColourPresets to RideTypeDescriptors 2020-06-19 18:04:43 +02:00
Michael Steenbeek ab9b8cd57e
Merge pull request #11983 from frutiemax/11964_RatingsCalculate 2020-06-18 18:22:11 +02:00
frutiemax 642f4f83a8 Merge RideRatingsCalculateFuncTable in RideTypeDescriptor 2020-06-18 09:29:27 -04:00
Michael Steenbeek 8a4724a691
Move covered track piece availability to RTD 2020-06-17 23:15:05 +02:00
frutiemax f6eb9f1cc5
Merge RideRatings in RideTypeDescriptor structure (#11975) 2020-06-17 22:22:52 +02:00
Michael Steenbeek e2b187c24a
Merge pull request #11921 from duncanspumpkin/CreateSprite6
Entity List Iterator
2020-06-17 21:28:36 +02:00
frutiemax de1c172c74
Move RideProperties and rideBonusValue to RideTypeDescriptors
Part of #11964.
2020-06-17 18:59:04 +02:00
Gymnasiast 96678a14eb
Move ride naming to RTD
This also means that all unused ride types will now have the same name. I have made an exception for the 'arbitrary ride type change' dropdown only.
2020-06-16 22:52:48 +02:00
duncanspumpkin 6ed17b4ff9 Remove FOR_ALL_PEEPS/GUESTS/STAFF macros
Replaced with an EntityList iterator

Fix formatting

Fix nullptr issues
2020-06-16 20:27:44 +01:00
duncanspumpkin 904e6c6987 Implement GetSprite and use it in a number of places
This will eventually replace all of the get_sprite and try_get_sprite calls

Further use of GetSprite

Use GetSprite in all remaining easy to use functions

Correct formatting

Rename GetSprite to GetEntity

Make suggested changes

Remove const to allow for building

Fix crashes due to next sprite
2020-06-16 20:21:56 +01:00
Gymnasiast 9cf12e763d
Move RideHeights and max mass to RTDs 2020-06-16 20:57:55 +02:00
Tulio Leao e54a3d89f2
Rename some Peep member variables to use TitleCase (#11931)
* Rename Peep::destination_tolerance to use TitleCase

* Rename Peep::destination_y to use TitleCase

* Rename Peep::destination_x to use TitleCase

* Rename Peep::trousers_colour to use Title Case

* Rename Peep::tshirt_colour to use TitleCase

* Rename Peep::no_of_rides to use Title Case

* Rename Peep::staff_type to use TitleCase

* Rename Peep::type to use TitleCase

* Rename Peep::sprite_type to use TitleCase

* Rename Peep::sub_state to use TitleCase

* Rename Peep::state to use TitleCase

* Rename Peep::outside_of_park to use TitleCase

* Rename Peep::next_flags to use TitleCase

* Rename Peep::name to use TitleCase

* Rename Peep::NoOfRides to GuestNoOfRides

* Rename Peep::Type to AssignedPeepType

* Rename Peep::GuestNoOfRides to GuestNumRides
2020-06-14 06:31:08 +01:00
Gymnasiast f66d103d9a
Move build costs to RTD 2020-06-13 18:48:53 +02:00
Michael Steenbeek 8f29810e04
Move RideData4 to RideTypeDescriptors (#11939) 2020-06-13 11:29:00 +01:00
Michael Steenbeek 783494df68
Use rotated calls in GhostTrain.cpp (#11691) 2020-05-10 12:49:02 +02:00
Michael Steenbeek fa91b4091f
Name tunnel constants (#11694) 2020-05-09 23:54:47 +02:00
Gymnasiast e67ebed697
Remove some Americanisms 2020-04-26 11:07:19 +02:00
Gymnasiast 100236c2d2
Move available ride modes to RTD; ride mode cleanup 2020-04-26 11:07:19 +02:00
Michael Steenbeek 44f62a97c2
Move PhotoItem to RTD (#11415) 2020-04-24 04:47:40 +02:00
Michael Steenbeek e1e58423fc
Replace RideTypeHasRideGroups with flag (#11375) 2020-04-20 21:50:35 +02:00
Gymnasiast d2b71392cf
Move upkeep costs to RTD 2020-04-19 21:27:22 +02:00
Gymnasiast 7d50a2d186
Move alternate ride type to RTD 2020-04-19 18:44:38 +02:00
Gymnasiast 99d270388b
Move ride start piece to RTD 2020-04-19 18:05:57 +02:00
Michael Steenbeek deb56c2a72
Move LiftData to RTDs (#11347) 2020-04-19 14:41:26 +02:00
Michael Steenbeek 3bf316ee8c
Merge pull request #11336 from Gymnasiast/refactor/available-breakdowns-to-rtd
Move available breakdowns, category and independent listing flag to RTD
2020-04-18 18:31:39 +02:00
Michael Steenbeek 20a0cea903
Fix #11325: Space rings change colours and show incorrect sprites (#11338) 2020-04-18 18:19:01 +02:00
Gymnasiast 5d3bf2be20
Move category to RTD; move RideTypeIsIndependent to a flag 2020-04-18 15:22:41 +02:00
Gymnasiast c41fb64535
Move available breakdowns to RTD 2020-04-18 15:22:41 +02:00
Michael Steenbeek b4a763c751
Move naming convention to RTD (#11319) 2020-04-18 12:12:07 +02:00
Tulio Leao fd69886350
Use named casts on openrct2/ride/* (#11168) 2020-04-17 19:39:18 +02:00
Gymnasiast 20fd115d8d
Group some common flag combination into constexprs 2020-04-17 17:03:34 +02:00
Gymnasiast edd31d9f16
Move flags to RideTypeDescriptors 2020-04-17 17:03:33 +02:00
Ted John d34dec9c27 Create ZoomLevel struct to add two new zoom levels 2020-03-23 15:54:03 +00:00
Michael Steenbeek 270417f788
Merge pull request #10819 from Gymnasiast/refactor/even-more-rtd
Move track paint function lookup to RTDs
2020-02-24 10:56:43 +01:00
Gymnasiast 93926d5e5d
Move all the ride type-specific track categories to regular ones 2020-02-22 23:20:12 +01:00
Gymnasiast 08ad1816d3
Move track paint function to RTDs 2020-02-22 20:15:00 +01:00
Michael Steenbeek 86a79e742f
Use RideTypeDescriptor for available track pieces 2020-02-22 20:13:44 +01:00
Matt c381d9ff3f
Remove obsolete construction of CoordsXY object 2020-02-13 12:11:20 +01:00
duncanspumpkin a5ef8d6240 Rename rct_vehicle 2020-01-19 17:14:56 +00:00
Gymnasiast 62fcbb07ca
Rename methods to GetBaseZ/GetClearanceZ 2019-12-23 20:08:37 +01:00
Gymnasiast 85ecb52e7c
Manually replace more Z occurrences 2019-12-23 20:05:26 +01:00
Sijmen Schoon ab2dbea32a
Change a sizable portion of LocationXY(Z) to (Tile)CoordsXY(Z) 2019-10-31 00:19:14 +01:00
Ted John 9954f0b725
Add nullptr checks for more instances of get_ride (#9819) 2019-08-09 14:20:59 +01:00
Ted John ab7b17fc4e
Add nullptr checks for get_ride in libopenrct2 (#9788) 2019-08-08 22:58:56 +01:00
Gymnasiast b65e243486 Fix #9398: Observation tower vehicle is coloured incorrectly 2019-06-10 22:51:23 +02:00
Ted John 5c8aa743f6 Implement ghost drawing for special vehicles 2019-05-28 16:50:08 +01:00
Matt 37c3809744 Implement partial multicore rendering 2019-03-31 15:50:55 +02:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Ted John cdec457abd Refactor peep struct 2019-02-28 20:28:58 +01:00
Xkeeper 2828cbb2fc
Fix crash in FerrisWheel paint
[OpenRCT2/OpenRCT2#8662]
2019-02-05 11:14:17 -08:00
Xkeeper 2bb8813c41
Fix crash in paint_haunted_house_structure
[OpenRCT2/OpenRCT2#8662]
2019-02-05 11:01:23 -08:00
Ted John 8701286772
Use new ride_id_t typedef (#8561) 2019-01-12 10:11:55 +00:00
Hielke Morsink 53ae48ffca
Merge pull request #8550 from janisozaur/fallthroughs
Fix implicit fallthroughs
2019-01-04 23:27:02 +01:00
Hielke Morsink 5ef5e4153d Fix some more implicit and conditional fallthroughs 2019-01-04 22:26:56 +01:00
Ted John 38f632074b Merge ride track colour arrays into one 2019-01-01 21:25:34 +00:00
Ted John 8e6497fc1d Merge vehicle_colours and vehicle_colours_extended 2018-12-31 19:25:07 +00:00
Ted John 06f203a7e7 Implement surfaces, edges and stations as objects 2018-12-09 23:30:40 +00:00
Matt 468d94a6ca Remove gCurrentViewportFlags 2018-12-05 23:09:17 +01:00
Hielke Morsink 354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
Michael Steenbeek f8add7f62e
Rename rct_tile_element to TileElement 2018-11-01 13:53:50 +01:00
Michael Steenbeek 3f17782692 Move direct access to maze entry to struct methods 2018-09-25 21:57:21 +02:00
Michael Steenbeek a3e9c63fc3 Move GetRideIndex to struct methods 2018-09-25 21:57:21 +02:00
Michael Steenbeek 74ccf010e6 Port surface elements to new structure 2018-09-16 21:34:51 +02: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 ca6fda5724 clang-format generated ride files 2018-07-23 16:00:08 +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
Michał Janiszewski 1d28826b79 Fix -Wdocumentation and add it to default warnings 2018-06-11 09:52:54 +02:00
Hielke Morsink de3cab59bb Fix warnings reported by travis 2018-06-05 16:07:54 +02:00
Ted John 92f6ac7333 Rename header files to match renamed source files 2018-06-01 09:38:30 +02:00
Michael Steenbeek b573bd49b3 Replace all occurrences of tile_element_is_last_for_tile() 2018-05-24 11:44:53 +02:00
ζeh Matt ee56021067 Minor code cleanup. (#7538) 2018-05-18 22:50:57 +02:00
oli414 3bff12c081 Seperate surface tile element 2018-05-01 16:33:16 +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
Michał Janiszewski cd065d4f41 Reduce includes in common header 2018-03-20 00:27:58 +01:00
Michał Janiszewski 32619f460b Remove remaining calls to get_current_rotation in paint code 2018-02-17 13:11:07 +01:00
Michał Janiszewski acccd0a2c8 Remove rotation argument from sub_98199C 2018-02-17 13:11:07 +01:00
Michał Janiszewski 3f92471ffb Remove rotation argument from sub_98197C 2018-02-17 13:11:07 +01:00
Michał Janiszewski c420fb56f5 Remove rotation argument from sub_98196C 2018-02-17 13:11:07 +01:00
Michael Steenbeek bde913ee16 Rename SmallCoords and BigCoords 2018-02-15 22:26:50 +01:00
Michael Steenbeek a2af371de9 Replace LocationXYZ8 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
Michał Janiszewski 3f76bd214f Const all the painted tile elements
Extracted from https://github.com/OpenRCT2/OpenRCT2/pull/7036
2018-02-12 16:03:20 +01:00
duncanspumpkin 5401e69b50 Name vehicle animation offsets 2018-01-30 12:53:50 +00:00
Michał Janiszewski 3ba0cc3dae Add missed constexprs 2018-01-14 16:13:37 +01:00