Commit Graph

659 Commits

Author SHA1 Message Date
Simon Jarrett 65a8c58af7 Fix missing direction arrow for stations 2020-10-15 19:44:36 +01:00
Simon Jarrett 25ce8b3f6e Fix #7443: Construction arrows pulse at irregular intervals. 2020-10-15 19:44:10 +01:00
ζeh Matt 645289f4ec
Rename GameActionResult and use GameActions namespace instead (#13184) 2020-10-14 22:04:39 -03:00
Duncan 84c9ff833a
Move formatter to separate file. Rework GetMeasurement (#13131)
* Move formatter to seperate file. Rework GetMeasurement

* Add Formatter source files to Xcode project

Co-authored-by: Aaron van Geffen <aaron@aaronweb.net>
2020-10-09 08:02:07 -03:00
Duncan 4fb4feb83c
Fix missing error message on ride graph (#13129)
* Fix missing error message on ride graph

Mistake made during implementation meant that the ride graph would not show the error message when the ride had not left the station. Another mistake meant that the tertiary colour of the ride window was not set to green. The tertiary colour was only used by this error message though so was not noticed.
2020-10-08 15:22:23 -03:00
Tulio Leao db728d61a7
Fix signed/unsigned mismatch 2020-10-06 21:32:59 -03:00
Matt 7045fd9e9f
Minor cleanup 2020-10-07 01:10:53 +03:00
Matt 091145037e
Move the audio code into OpenRCT2 namespace 2020-10-07 00:34:42 +03:00
Simon J 7f963c4901
Fix entrance and exit ghosts not being removed for mazes (#13074)
* Fix entrance and exit ghosts not being removed for mazes

Co-authored-by: Simon Jarrett <simonjjarrett@gmail.com>
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-10-03 09:33:28 -03:00
Tulio Leao 29955f28e0
Merge pull request #12976 from mwnciau/Refactor-TRACK_ELEM-enum
Refactor TRACK_ELEM_* enum
2020-10-01 22:05:44 -03:00
Simon Jarrett 52209af94d Rename TRACK_ELEM_* enums to TrackElemType::*
- Replace enum in Track.h with namespace and constexpr
- Find and replace all instances of TRACK_ELEM_* enums
2020-10-01 19:57:52 +01:00
Sam J Gunner 55b4c4c6f1
Fix #13046: Simplify block sectioned comparisons (#13049) 2020-10-01 09:06:28 -03:00
rpstester 3508bdc37d
Close #12390: Refactor PeepRideSubState to enum class
Also made a RideSubState as a union with SubState and SittingSubState
Updated all values across all files, and the corresponding assert.
2020-09-30 23:33:58 +02:00
Duncan 3c8adb1fc1
Remove gMapTooltip format args global (#12971)
Fix mistake
2020-09-28 21:45:28 -03:00
Łukasz Pękalski d1cd2e08b5
Close #12388, refactor PeepState to use strong enum (#12927)
* Close #12388, refactor:PeepState to use strong enum

* refactor: refactored file PlayTests.cpp

* refactor: change PEEP_STATE_ to PeepState:: and camel case after merging

chore: code reformatting
2020-09-28 15:51:49 -03:00
Łukasz Pękalski 065da23b3b
Close #12437, refactor: RIDE_MODE_* to strong enums (#12833)
* partial refactor: RIDE_MODE_* to strong enums

* Close #12437, refactor: RIDE_MODE_* to strong enums

* chore: code formatting

* refactor: RideMode, change enum names to CamelCase

and resolve casting order.

* chore: refactor due to code formatting

* Close #12437, refactor: RIDE_MODE_* to strong enums

Resolved comments

* chore: Formatting correction.

* Use EnumsToFlags constexpr

* refactor: resolved comments

added newline at the end of file

* refactor: Change case stack to default in Switch

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-09-28 14:09:59 +01:00
Richard Fine a1222fa4ca
Staff code cleanup (#12907)
* Make UpdateFixing*() methods use const where possible

To make it clearer which steps actually modify the ride being fixed and which do not, pass const Ride* instead of Ride* where possible.

* Extract maximum litter search distance to a constant

* Make peep_update_*() methods return bool

* Use Direction type and helpers where applicable

* Const correctness and other cleanup

Make many functions take a const Peep* / const Staff* to clarify that they do not modify the peep being passed in. Also use the Direction type for some return values, and simplify staff_is_location_on_patrol_edge.

* Use clearer expression of constant value

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>

* Convert staff functions to members

* Remove AsStaff const overload

* Use As<Staff>() instead of static_cast

* Simplify direction selection code

* Clean up use of magic constants

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-09-27 21:07:09 -03:00
Matt b3b9a348c5
Apply review suggestions 2020-09-17 22:16:05 +03:00
Matt 38e03ae45d
Use the Formatter for News items 2020-09-17 22:14:36 +03:00
Matt ccde06ab0f
Explicitly pass formatter arguments to ShowError and family 2020-09-17 22:14:36 +03:00
Matt 2639349925
Move storage into Formatter class and refactor usage 2020-09-17 22:14:36 +03:00
Michael Steenbeek 8b19d943a4
Merge pull request #12676 from mwnciau/Ride-Helix-Save
Fix #7037: saving rides starting with sloped turn
2020-08-26 12:13:59 +02:00
Tulio Leao efdb7e1a2d Change gDateMonthsElapsed type to int32_t 2020-08-25 19:06:38 -03:00
Tulio Leao 10aca0fe6e Fix #12764: Rides don't start aged anymore 2020-08-25 08:21:34 -03:00
Simon Jarrett 31a1d5259c Fix #7037: Unable to save tracks starting with a sloped turn or helix 2020-08-19 00:08:14 +01:00
ryan-bello cc2bb33892 changed enum STAFF_TYPE to strong enum StaffType, moved it to Peep.h 2020-08-17 22:59:02 -04:00
ryan-bello 54a33cbde8 renamed StaffType to AssignedStaffType 2020-08-17 20:16:09 -04:00
Gymnasiast 89f04c4fb3
Fix names of two track type functions 2020-08-10 23:48:18 +02:00
Arran Ireland 4de58e1fd4
Close #12440: Refactor VEHICLE_STATUS to use strong enum (#12606)
* Close #12440: Refactor VEHICLE_STATUS to use strong enum

* Fix code formatting for VEHICLE_STATUS refactoring

* Refactor VehicleStatus enum to be inside Vehicle

This commit moves VehicleStatus inside Vehicle,
renamed as Status.
2020-08-09 06:24:25 +01:00
Arran Ireland 1702c90c8e
Merge pull request #12605 from ion232/refactor-vehicle-type
closes #12439: Refactor VEHICLE_TYPE to use strong enum
2020-08-08 18:41:04 +01:00
Łukasz Pękalski 399e0abe2e
Close #12497: Remove extra SPRITE_INDEX_NULL checks (#12601) 2020-08-08 09:12:52 -03:00
pizza2004 156be224f9
Close #12399: Refactor MIXER_GROUP to strong enum (#12531) 2020-08-03 20:51:12 -03:00
pizza2004 d217dfa9b9
Refactor NewsItem into namespace and Pascal Case (#12511) 2020-08-02 23:14:00 -03:00
Duncan 733bc5a981
Close #12518: Viewport Refactor (#12541)
* Remove viewport pointer from get_map_coordinates_from_pos

* Removed viewport from get_window

* Return a InteractionInfo from get_map_coord...

* Remove viewport_interaction_info struct

* Add Entity union to simplify code

* Name the enum used for viewport interaction

* Simplify functions further by returning the info struct

* Add default switches
2020-08-02 08:32:59 +01:00
Łukasz Pękalski 0f78d452a4
Part of #12497: Remove extra SPRITE_INDEX_NULL check (#12538)
* refactor: deleted double check of SPRITE_INDEX_NULL in Staff* ride_get_mechanic(Ride* ride)

* refactor: deleted double check of SPRITE_INDEX_NULL in Ride.cpp file

* refactor: deleted double check of SPRITE_INDEX_NULL in windows/Ride.cpp in function static rct_string_id window_ride_get_status_vehicle

* refactor: deleted double check of SPRITE_INDEX_NULL in ride/Ride.cpp

* refactor: deleted double check in FormatStatusTo
2020-08-02 08:28:11 +01:00
Sidney 97d74e142e
Close #12441: Refactor VEHICLE_TRACK_SUBPOSITION to use strong enum (#12550) 2020-08-02 07:50:07 +01:00
Cory Sanin 394e8fb733
Resolve GCC warnings for Ride.cpp (#12553)
Eliminate warnings from ride_create_vehicles and ride_create_vehicles_find_first_block that would prevent build from succeeding when using GCC.
2020-08-02 00:28:47 +02: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
Tulio Leao 63f683853e
Merge pull request #12479 from pizza2004/news-enum
Refactor NewsItem to use strong enums
2020-07-28 18:21:45 -03:00
pizza2004 cee7f8d34c Close #12397: Refactor NEWS_ITEM_* to use strong enum 2020-07-28 12:54:18 -06: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
Michael Steenbeek ba10b84789
Fix #12478: Crash in track_block_get_next() 2020-07-26 17:16:27 +02:00
chaitanyathengdi 33a88fbdbd
Fix #10946: On-ride photo profit assumes every guest buys one (#12285)
* Use stored values of customers to adjust income from on-ride photos

Use stored values of photos sold and total customers to calculate ratio
and use that to predict income per hour for rides that include
on-ride-photo sections.

* Get rid of float

* Fix formatting

* Fix formatting - again

* Review changes

* Fix formatting

* Use new method of checking on-ride photo

* Use constants

* Add a changelog and contributors entry
2020-07-25 07:19:51 +01:00
Gymnasiast cf664c8340
Close #11971: Replace ride groups with new ride types 2020-07-17 00:19:49 +02:00
frutiemax 0fa0ca451e
Part of #12245: Use coords for window_scroll_to_location (#12282) 2020-07-15 23:26:27 -03:00
Tulio Leao 0758d0fe5c Prefer reference on ride_create_vehicles parameter 2020-07-11 12:21:46 -03:00
Tulio Leao de8bb169de Use CoordsXYZ on vehicle_create_trains 2020-07-11 12:21:44 -03:00
Tulio Leao 47db30f1d7 Use CoordsXYZ on vehicle_create_train 2020-07-11 12:21:09 -03:00
Tulio Leao 7921740938 Use CoordsXYZ on vehicle_create_car 2020-07-11 12:21:07 -03:00
frutiemax 123d0cceb6
Close #12173: Remove Formatter additions with void* (#12196) 2020-07-11 03:06:23 +02:00
Helio Santos 925d21eeda Part of #12159: update check_for_adjacent_station to use CoordsXYZ&
Update check_for_adjacent_station to use CoordsXYZ&. Updated caller(s) accordingly.
2020-07-10 11:00:00 -07:00
Helio Santos b0a4f2a97e Part of #12159: updated get_station_platform to use CoordsXYRangedZ
Updated get_station_platform function to use CoordsXYRangedZ. Updated caller(s) accordingly. Implemented constructor for CoordsXYRangedZ that takes a CoordsXYZ as argument.
2020-07-10 10:59:52 -07:00
Helio Santos fb9fab69a9 Part of #12159: Uses CoordXY on find_closest_mechanic
Updated find_closest_mechanic prototype to use CoordXY. Updated caller(s) accordingly.
2020-07-10 09:41:51 -07:00
Tulio Leao e5e70688c5
Use big Z coords on some Ride station functions (#12192) 2020-07-10 08:40:42 -03:00
Tulio Leao f29abf6953
Part of #11389: Use Formatter on Ride::FormatStatusTo (#12172) 2020-07-09 18:54:30 +02:00
duncanspumpkin 57d2877e67 Provide accesor function for get entity list count 2020-07-05 07:28:38 +01:00
duncanspumpkin e51bbeed23 Convert SPRITE_LIST to an enum class 2020-07-04 07:38:11 +01:00
frutiemax 14a07359b3
Part of #11389: Use formatter class for Ride::FormatNameTo (#12041) 2020-06-24 21:02:08 -03:00
frutiemax f86931d8a0
Close #12019: Use ScreenCoordsXY on gfx_draw_sprite_software 2020-06-22 23:52:54 +02:00
frutiemax 57b50e46df
Part of #11964: Move RideTypeEnumNames to RideTypeDescriptors 2020-06-19 23:03:24 +02:00
frutiemax 57b121d448
Part of 11964: move RideColourPresets to RideTypeDescriptors 2020-06-19 18:04:43 +02:00
Michael Steenbeek 2013e1a36f
Merge pull request #11974 from Gymnasiast/refactor/ride-type-misc
Refactor/ride type misc
2020-06-17 23:15:30 +02:00
Michael Steenbeek e2b187c24a
Merge pull request #11921 from duncanspumpkin/CreateSprite6
Entity List Iterator
2020-06-17 21:28:36 +02:00
Gymnasiast 2a9c2be7d0
Remove unused function 2020-06-17 19:11:02 +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
Gymnasiast 140f2d6922
Rename rct_ride_data_5 and its fields to RideHeights 2020-06-16 20:17:07 +02:00
Gymnasiast 2eccef5979
Split max_mass from rct_ride_data_5 2020-06-16 20:00:25 +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
hdpoliveira 55bb2eaec9
Change all invalidate_sprite_2(Vehicle*) to Vehicle->Invalidate() (#11935) 2020-06-11 20:42:11 +01:00
Tulio Leao 92fbb9fc04 Rename Peep::happiness to Happiness 2020-06-08 23:30:27 -03:00
Tulio Leao 1b7223462f Rename Peep::happiness_target to use TitleCase 2020-06-08 23:27:47 -03:00
Tulio Leao f732c2f1cd Rename Peep::window_invalidate_flags to use TitleCase 2020-06-08 22:25:54 -03:00
Tulio Leao ccd76f8fc4 Rename Peep::current_ride to CurrentRide 2020-06-08 17:36:35 -03:00
Tulio Leao c302b16386 Rename Peep::current_ride_station to use TitleCase 2020-06-08 17:36:34 -03:00
Michael Steenbeek a0c6752ff3
Merge pull request #11882 from tupaschoal/prevent-shadow-peep-4
Rename some Peep member variables to use TitleCase
2020-06-07 23:35:23 +02:00
Michael Steenbeek 7646f1b7e4
Merge pull request #11896 from hdpoliveira/update_flags
Update flags
2020-06-07 23:03:48 +02:00
hdpoliveira 5b1469b8b7
Create Vehicle::GetTrackType() (#11895) 2020-06-07 21:43:32 +01:00
hdpoliveira 7bef44b020 Create Vehicle::SetUpdateFlag 2020-06-07 17:16:13 -03:00
hdpoliveira 480d1a6d6b Create Vehicle::ClearUpdateFlag 2020-06-07 17:16:12 -03:00
Tulio Leao 95624c748e Prefix Peep::NextInQueue with Guest 2020-06-07 10:46:18 -03:00
Tulio Leao d195c9fb1d Rename Peep::next_in_queue to NextInQueue 2020-06-06 11:53:51 -03:00
duncanspumpkin 5c48e5f0bb Remove AsPeep 2020-06-06 11:36:48 +01:00
duncanspumpkin 517ed57593 Remove IsPeep 2020-06-06 11:36:48 +01:00
Michael Steenbeek f21ddb0723
Refactor checks for station pieces (#11876) 2020-06-05 17:55:15 -03:00
Tulio Leao 9fbaf61e07
Rename Peep::staff_orders to StaffOrders 2020-06-04 19:16:12 +02:00
hdpoliveira 86550dad20 Rename swing-related variables in Vehicle 2020-05-31 16:37:09 -03:00
hdpoliveira c5e0489a48 #9473: Create Vehicle::CableLiftUpdateTrackMotion 2020-05-30 20:23:02 -03:00
Ted John bfa96d6205 Fix price in ScRide 2020-05-23 15:28:03 +01:00
Ted John f6fbd272ec Add built_date to ScRide and add GetAge() 2020-05-23 15:28:03 +01:00
Tulio Leao 3b632fcf95 Rename Peep::favourite_ride to FavouriteRide 2020-05-13 23:06:40 -03:00
Michael Steenbeek 620fb5e5c4
Migrate many set_format_arg calls to Formatter (#11744) 2020-05-13 21:29:39 -03:00
Michael Steenbeek 32609791de
Merge pull request #11719 from Gymnasiast/random-cleanup
Convert sprite_move to method
2020-05-13 11:52:18 +02:00
Michael Steenbeek 511a300251
Some cleanup in Vehicle.cpp (#11742) 2020-05-13 11:51:38 +02:00
Gymnasiast b5b563c2a8
Apply review requests 2020-05-13 10:53:30 +02:00
Gymnasiast 11472f909d
Convert sprite_move to method 2020-05-13 10:47:32 +02:00
Gymnasiast 15b5d97795
Refactor shop items 2020-05-11 19:16:23 +02:00
Michael Steenbeek d10f9ebf2a
Use named flags in calls to sub_6C683D() (#11650) 2020-05-05 23:11:38 -03:00
Fred-1044276 b03fbc086d
Fix #11450: Can't open rides, even with "Enable all track pieces" 2020-05-05 11:16:24 +02:00
Gymnasiast f88e1c03a0
Fix #11624: Crash when testing ride with a ghost end-of-station 2020-05-04 17:46:12 +02:00
Gymnasiast 50c750e176
Clean up GetOriginElement() 2020-05-04 17:10:57 +02:00
Tulio Leao a808ded45a Favour usage of CoordsXY objects instead of individual variables 2020-05-02 11:07:18 -03:00
Tulio Leao 1872152df9 Make window_ride_construction_update_state() use CoordsXYZ* 2020-05-02 11:07:18 -03:00
Tulio Leao 02a5c10a58 Make place_provisional_track_piece() use CoordsXYZ 2020-05-02 11:07:18 -03:00
Tulio Leao 28b3ac1693 Make track_block_get_previous() use CoordsXYE 2020-05-02 11:07:18 -03:00
Tulio Leao d58f3ec0b6 Make track_block_get_previous_from_zero() use CoordsXYZ 2020-05-02 11:07:17 -03:00
Tulio Leao 6203a5a20d Make track_block_get_next_from_zero() use CoordsXYZ 2020-05-02 11:07:15 -03:00
hdpoliveira 4649b573f4 Part of #9473: Create Vehicle::GetGForces
Converted from vehicle_get_g_forces
2020-05-01 19:49:03 -03:00
Tulio Leao 4589560a15 Make sub_6C683D() use CoordsXYZ on parameter and return 2020-05-01 18:06:26 -03:00
Michael Steenbeek fc860e8b6e
Merge pull request #11521 from Gymnasiast/refactor/oein3
Make ResearchItem use ObjectEntryIndex
2020-05-01 13:28:21 +02:00
hdpoliveira 4389670939 Improve names in UpdateDodgemsCollision 2020-04-30 20:53:18 -03:00
hdpoliveira 90cd90e738 Part of #9473: Create Vehicle::Entry
Converted from vehicle_get_vehicle_entry
2020-04-30 20:53:15 -03:00
hdpoliveira c88695a29c Part of #9473: Create Vehicle::UpdateDodgemsCollision
Converted from vehicle_update_dodgems_collision
2020-04-30 20:53:15 -03:00
Gymnasiast 6cdee9db93
Fix #7006: Use RTDs for determining ride category 2020-04-30 12:59:18 +02:00
duncanspumpkin 63549dee57 Ensure move_sprite_to_list only used in sprite.cpp
After an entity is created it should never need to call this function. This will be important in later changes when the lists are changed to vectors
2020-04-28 07:27:05 +01:00
duncanspumpkin 5b07a76f05 Use sprite_identifier when identifying entitys
The linked list index is only meant to be used for accessing the linked lists. Using the wrong variable is unlikely to cause issues for this exact case but it makes things cleaner.
2020-04-27 18:47:51 +01:00
Michael Steenbeek bcabc1d807
Merge pull request #11457 from Gymnasiast/refactor/rtd-forever
More RTD + cleanup
2020-04-27 15:11:54 +02:00
Fred-1044276 a3e7f0958c
Allow Air Powered Vertical Coaster without complete circuit
This changes the Air Powered Vertical Coaster so that it can be tested and opened without the need for a complete circuit (mirroring RCT1 and RCT3 behaviour). There appears to be no technical reason for RCT2's requirement for having a complete circuit.
2020-04-26 11:25:08 +02:00
Gymnasiast 100236c2d2
Move available ride modes to RTD; ride mode cleanup 2020-04-26 11:07:19 +02:00
Gymnasiast 2e3a4d41ce
Clean up some ride construction variables 2020-04-26 11:07:19 +02:00
Michael Steenbeek b89130e0f3
Use ObjectEntryIndex in more places (#11440) 2020-04-25 00:10:47 +02:00
Michael Steenbeek 44f62a97c2
Move PhotoItem to RTD (#11415) 2020-04-24 04:47:40 +02:00
Breno Rodrigues Guimarães ef8fd20c99
Let Ride::FormatStatusTo return the number of written bytes (#11411) 2020-04-22 21:24:51 -03:00
Breno Rodrigues Guimarães 374b744477
Use Formatter to handle argument formatting for tooltips (#11379) 2020-04-21 12:38:59 +02:00
Breno Rodrigues Guimarães 2479256bc1
Adjust Formatter function names according to coding style (#11378) 2020-04-20 18:55:15 -03:00
Michael Steenbeek e1e58423fc
Replace RideTypeHasRideGroups with flag (#11375) 2020-04-20 21:50:35 +02:00
ifimfree fb6dd4bfad
Create constants for a few flags 2020-04-20 10:39:26 +02:00
Breno Rodrigues Guimarães d4a2a98e20
Replacing set_format_arg_on macro in favor of a more C++zy solution (#11350) 2020-04-20 07:10:33 +02:00
Gymnasiast 99d270388b
Move ride start piece to RTD 2020-04-19 18:05:57 +02:00
Michael Steenbeek 957294568f
Use constants in ride_entry_get_supported_track_pieces() (#11337) 2020-04-19 13:33:01 +02:00
hdpoliveira fd111403f1 Part of #9473: vehicle_update_track_motion to Vehicle::UpdateTrackMotion 2020-04-18 14:41:47 -03: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
Eyal Minsky-Fenick 2ef77414d5
Ensure ride->inspection_station is set in ride_prepare_breakdown (#10245) 2020-04-18 15:30:25 +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
Gymnasiast a295f3c003 Fix #11315: Never opened ride shown as favourite ride of 74 guests 2020-04-18 07:39:24 +01:00
Tulio Leao b449e445f7
Use named casts on openrct2/ride (#11163)
Excluding subfolders
2020-04-17 19:53:33 +02:00
Michael Steenbeek 777201c7fd
Return false for non-existing ride types
Co-Authored-By: Tulio Leao <tupaschoal@gmail.com>
2020-04-17 17:05:16 +02:00
Gymnasiast edd31d9f16
Move flags to RideTypeDescriptors 2020-04-17 17:03:33 +02:00
duncanspumpkin b857792f23 Fix vehicles changing state on export/import 2020-04-07 20:07:37 +01:00
Michał Janiszewski 94f6d70ac7 Fix #11084: null broken vehicle (#11090) 2020-04-06 22:32:27 +02:00
Michał Janiszewski 63c11ab8fd Fix #11128: null tile element in track_block_get_previous (#11144) 2020-04-06 22:32:27 +02:00
Michał Janiszewski 27da48336a Revert "Fix #11084: null broken vehicle (#11090)"
This is being reverted now that we have replay records uploaded as part
of the backtrace.io information to try figuring out the root cause.

This reverts commit 24edada2d8.
2020-04-03 09:53:36 +02:00
Michał Janiszewski 620be75285 Revert "Fix #11128: null tile element in track_block_get_previous (#11144)"
This is being reverted now that we have replay records uploaded as part
of the backtrace.io information to try figuring out the root cause.

This reverts commit d1faa228c5.
2020-04-03 09:49:58 +02:00
Michał Janiszewski d1faa228c5
Fix #11128: null tile element in track_block_get_previous (#11144) 2020-03-29 22:01:13 +01:00
Duncan f64ea65d03
Rename SPRITE_LIST_TRAIN_HEAD to reduce car head confusion (#11105)
A single car on a coaster can comprise of multiple vehicles. One of those vehicles will be the car head vehicle. The train can comprise of multiple cars. Therefore not all vehicle->IsHead 's will be in SPRITE_LIST_TRAIN_HEAD. This rename makes that slightly more clear
2020-03-29 09:23:24 +01:00
Tulio Leao fc645180be
Ammend #11090 for consistency on nullptr check (#11104) 2020-03-28 11:39:59 +00:00
Michał Janiszewski 24edada2d8
Fix #11084: null broken vehicle (#11090) 2020-03-28 10:21:24 +00:00
Michael Steenbeek b70c5cefd6
Use station index in a few more places (#11066) 2020-03-27 11:13:02 +01:00
Michael Steenbeek cfb405f0ed
Use StationIndex in many more places (#10992) 2020-03-26 21:38:26 +01:00
Aaron van Geffen 302fe1cb2b
Merge pull request #10926 from IntelOrca/zoom-refactor
Zoom refactor
2020-03-24 23:28:32 +01:00
Michael Steenbeek e66a6754f5
Remove some hardcoded numbers (#11004) 2020-03-23 19:12:57 +01:00
Ted John d34dec9c27 Create ZoomLevel struct to add two new zoom levels 2020-03-23 15:54:03 +00:00
Gymnasiast 2f7a26e8da
Refactor station index a bit 2020-03-21 17:05:16 +01:00
Ted John c89cecb2b5
Refactor the ride type to entry map (#10967)
Use C++ vectors and allow larger ride entry indices (> 256)
2020-03-20 18:07:31 +01:00
Michael Steenbeek b73098ba21
Fix #10902: Resetting ride let guest out in the air (#10968) 2020-03-18 22:22:25 +01:00
Michael Steenbeek fd91c41a76
Name remaining ride type flags (#10947) 2020-03-16 22:52:06 +01:00
X123M3-256 7219c880e2
Allow opening rides with unsuitable track when "Enable all drawable track pieces" cheat is on. (#10923)
Co-authored-by: Edward Calver <hx010973@reading.ac.uk>
2020-03-15 14:11:04 +01:00
Gymnasiast bdf681f440
Clean up many other coordinates 2020-03-13 12:03:43 +01:00
Gymnasiast 9fd2b883a8
Apply review request 2020-03-12 15:27:58 +01:00
Gymnasiast 02c135e4fa
Clean up many staff functions 2020-03-07 23:07:47 +01:00
Gymnasiast ad91654a3d
Use big Z in more places 2020-03-07 21:54:47 +01:00
Michael Steenbeek be13c1fc87
Refactor more TileCoords 2020-03-07 21:07:18 +01:00
Michael Steenbeek 904cad77b5
Merge pull request #10864 from Gymnasiast/refactor/station-starts
Change station starts to CoordsXY
2020-03-05 22:48:53 +01:00
Gymnasiast 9c7c57f722
Apply review request 2020-03-05 21:25:58 +01:00
Gymnasiast dcf4301559
Use constant for invalid direction 2020-03-05 18:27:36 +01:00
Gymnasiast 2eb967b30d
Change station start to CoordsXY 2020-03-05 12:29:02 +01:00
Tulio Leao 09fad0ef7f Change rct_viewport to use ScreenCoordsXY 2020-03-02 20:50:58 -03:00
Michael Steenbeek d5c4d78d49
Move vehicle track location to CoordsXYZ (#10856)
* Move vehicle track location to CoordsXYZ

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-03-01 15:45:51 -03:00
Michael Steenbeek e3f5eb7275
Merge pull request #10847 from tupaschoal/const-ref-coords
Prefer const ref to send (Tile)CoordsXY(ZD) over
2020-03-01 14:38:39 +01:00
Tulio Leao 9bcd20e0e6 Prefer const ref to send ScreenCoordsXY over 2020-02-29 08:25:48 -03:00
Tulio Leao 181eaf768d Receive CoordsXYZ by const ref instead of copy 2020-02-29 01:14:05 -03:00
Tulio Leao 473bb4683b Receive (Tile)CoordsXYZD by const ref instead of copy 2020-02-29 01:09:24 -03:00
Duncan b8b539c16e
Modify next_x/y/z to become a CoordsXYZ (#10680)
* Modify next_x/y/z to become a CoordsXYZ

Should be further scope for refactoring from this.

* Make suggested changes

* Fix default construct issues
2020-02-11 22:01:14 +00:00
Gymnasiast ca2f37ae7f
Remove opt::optional polyfill
std::optional is supported by Xcode 10. The non-polyfill variant was already used in our code, so this is not likely to break anything that wasn't broken before.
2020-02-01 22:25:03 +01:00
Duncan 171e255981 Fix #10598. Mistake made when fixing #7784. (#10606) 2020-01-23 22:43:29 +01:00
duncanspumpkin 5e9e9df7ce Refactor invalidate_sprite 2020-01-19 17:16:42 +00:00
duncanspumpkin bdcfd615ed Refactor sprite_move 2020-01-19 17:16:41 +00:00
duncanspumpkin a262f325ed Refactor sprite_remove 2020-01-19 17:15:52 +00:00
duncanspumpkin 65c6564165 Use SpriteBase instead of rct_sprite for move_sprite_to_list 2020-01-19 17:15:52 +00:00
duncanspumpkin a5ef8d6240 Rename rct_vehicle 2020-01-19 17:14:56 +00:00
Michael Steenbeek b1e8caa575
Merge pull request #10570 from tupaschoal/use-more-coords-6
Prefer CoordsXY* on more places
2020-01-19 18:06:20 +01:00
Gymnasiast af12421f2d
Apply fixes 2020-01-19 17:34:11 +01:00
modulo7 fdf0c17fd8
Name field var_CD of vehicle struct. Refactor to enum 2020-01-19 17:34:11 +01:00
Tulio Leao c8097eab3a Use CoordsXYE on maze_entrance_hedge_removal() 2020-01-19 13:30:28 -03:00
Tulio Leao a3ecefcf89 Use CoordsXYE on maze_entrance_hedge_replacement() 2020-01-19 13:30:28 -03:00
Michael Steenbeek 8a9f0eeca5
Prepare track piece handling code for more than 256 pieces (#10575) 2020-01-17 12:27:14 +01:00
Michael Steenbeek f05aeb1fcd
Fix #7784: Vehicle tab takes 1st car colour instead of tab_vehicle's colour (#10544) 2020-01-12 10:32:11 +01:00
Michael Steenbeek 44dc2068e7
Merge pull request #10515 from tupaschoal/use-more-coords-4
Use CoordsXY* on world/Footpath.cpp
2020-01-11 20:52:39 +01:00
Tulio Leao c5ec4982a3 Use CoordsXY on footpath_chain_ride_queue() 2020-01-11 11:13:05 -03:00
Tulio Leao 7cf03d3e41 Use CoordsXY on footpath_remove_edges_at() 2020-01-11 11:13:04 -03:00
Michael Steenbeek 0c9b1cec96
Correct max vehicles per ride value (#10504)
* Correct max vehicles per ride value

* Fix formatting

* Fix constant usage in TrackDesign.cpp
2020-01-04 18:10:33 +01:00
Gymnasiast 0d09a645fc
Refactor map_get_footpath_element() and fix #10486 2019-12-31 10:08:36 +01:00
Duncan c170926200 Refactor to prefer baseZ instead of height for big Z (#10478) 2019-12-31 09:33:27 +01:00
Duncan d486ac4d3b Reduce direct usage of LOCATION_NULL (#10480)
* Reduce direct usage of Location_Null

Ideally we want to refactor these out to use std::optional as much as possible but for now move to using the standard interfaces.

* Remove incorrect AND with LOCATION_NULL

In the original this was a simple comparison to check for negative. Unsure how it ended up as an AND with the negative bit.
2019-12-31 09:01:17 +01:00
Tulio Leao a7b33a7d36 Use more Coords on some files. (#10463)
* Use more Coords on MazePlaceTrackAction

* Use more Coords on MazeSetTrackAction

* Use more Coords on PlacePeepSpawnAction

* Use more Coords on SetCheatAction

* Use more Coords on SurfaceSetStyleAction

* Use more Coords on Station
2019-12-30 16:50:48 +00:00