Commit Graph

847 Commits

Author SHA1 Message Date
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
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
Vinicius Sa 41820cd3c2
Close #12392: Refactor PeepActionType to use strong enum 2020-09-30 23:19:10 +02:00
Vinicius Sa ca8fa55fdb
Use EnumValue to get the underlying value of an enum
Applied to objects of the enum class PeepActionSpriteType when they are
used as arrays subscripts.
2020-09-29 11:15:07 -03:00
Vinicius Sa f8dd0a57aa
Refactor PeepActionSpriteType to use strong enum 2020-09-29 11:15:04 -03: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
Duncan 4ec10837a6
Remove Formatter::Common where not required (#12972)
* Remove Formatter::Common where not required

* Remove common from Guest window where possible
2020-09-27 21:09:08 -03: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
Tulio Leao c72f547606
Merge pull request #12916 from richard-fine/pathfinding
Pathfinding cleanup
2020-09-17 17:58:31 -03:00
Matt 38e03ae45d
Use the Formatter for News items 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
Richard Fine b57ed85098 Fixes from review feedback 2020-09-16 21:24:35 -04:00
Matt d0d5cc5179
Remove unused declarations 2020-09-16 20:23:34 +03:00
rpstester f7348b1f06
Close #12389: Refactor PeepSittingSubState (#12908)
* Refactor PeepSittingSubState

* Fix formatting
2020-09-14 20:11:17 +01:00
Richard Fine 4a20ed38a8 Document public API for pathfinder
Add comments explaining the externally-visible points in the pathfinding code.
2020-09-12 14:59:40 -04:00
Richard Fine 542eb873fc Consolidate pathfinding code
Consolidate all the guest pathfinding code from Peep.cpp into GuestPathfinding.cpp, and make a dedicated header for GuestPathfinding to help make it easier to see what the actual public interface is to the pathfinding system.
2020-09-12 14:59:40 -04:00
Gymnasiast d140dd72c6
Remove const void* overload from DrawTextEllipsised() 2020-09-10 18:13:13 +02:00
Richard Fine d2d9750a5b Fix #5753: Entertainers make themselves happy instead of the guests
After identifying guests that are near an entertainer, modify the guest's HappinessTarget and TimeInQueue values instead of the entertainer's own values.
2020-09-08 16:40:29 -04:00
Jacob Schwartz fe71ce437d
Close #12434: Refactor ENTERTAINER_COSTUME to use strong enum (#12865) 2020-09-08 16:29:18 -03:00
Simon Ellmann 5f3fe62f83
Close #12432: Refactor STAFF_MODE to use strong enum (#12752)
* Refactor STAFF_MODE to use strong enum

Closes #12432

* Change type of gStaffModes to StaffMode
2020-09-02 12:48:40 -03:00
ceeac 8f8eb81326
Fix #12740: Compile error when DEBUG_LEVEL is 2 or higher in CMake (#12754)
Commit 6607bad did not fully fix this.
2020-08-24 19:56:16 -03:00
Tulio Leao 6607badad0
Fix #12740: Broken log messages on GuestPathfinding (#12743) 2020-08-20 23:35:04 -03: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
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
Ł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 f49bfa777a
Change maze pathfinding to not prefer a direction (#12546)
* Change maze pathfinding to not prefer a direction

* Increment network version

* Update changelog

* Update replays
2020-08-02 08:20:34 +01:00
Sidney 97d74e142e
Close #12441: Refactor VEHICLE_TRACK_SUBPOSITION to use strong enum (#12550) 2020-08-02 07:50:07 +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
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
Matt fa2bd4cad6 Refactor PeepType to use strong enum 2020-07-25 11:54:37 +02:00
frutiemax f549698e96
Close #12338: Remove goto from Tick128UpdateGuest (#12367) 2020-07-25 07:16:40 +01:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Michael Steenbeek 5c411390bd
Fix #12226: Crash in FindVehicleToEnter (#12310) 2020-07-18 23:54:55 +02:00
Gymnasiast d703768d5d
Use old ride types in RideTypesBeenOn 2020-07-17 00:19:49 +02:00
frutiemax bcc27f4c73
Close #12161: Use CoordsXYE on peep_interact_with_shop (#12236) 2020-07-13 14:39:59 -03:00
frutiemax 6cc52bfb72
Part of #12161: Use CoordsXYE on peep_footpath_move_forward (#12217) 2020-07-13 17:51:57 +02:00
Michael Steenbeek 132b2e5966
Fix #12071: Crash in Guest List when a guest dies (#12126)
Send refresh guest list intent on peep removal

Also added protection to guest list to prevent accessing invalid peeps
2020-07-13 09:31:04 -03:00
frutiemax 75afcb85c5
Part of #12161: Use CoordsXYE on peep_interact_with_entrance 2020-07-11 18:58:56 +02:00
frutiemax 98dbaae461
Part of #12161: Use CoordsXYE on peep_interact_with_path (#12193) 2020-07-10 22:35:29 -03:00
Jim b1600e14ae
Close #12177: Extract patrol offset and index calculation into method 2020-07-09 23:47:21 +02:00
Jimver bda0126539
Part of #12162: Use CoordsXY on staff_is_patrol_area_set 2020-07-09 14:20:37 +02:00
Jimver e4c4c611eb
Part of #12162: Use CoordsXY on staff_set_patrol_area 2020-07-09 14:17:41 +02:00
Jimver eb753261a1
Part of #12162: Use CoordsXY on staff_toggle_patrol_area 2020-07-09 14:12:32 +02:00
Jim 0248621502
Increase handyman randomness in queue (#12145)
* Increase randomness when handyman is on queue path

* Add myself to contributors

* Refactor hex variable probabilities

* Add check if queue is connected to a ride

* Update changelog

* Bump network version

* Update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-07-08 19:48:08 +01:00
Gymnasiast bf5ffdf497
Clean up favourite ride 2020-07-07 21:13:42 +02:00
Gymnasiast e8d6383f57
Clean up voucher arguments 2020-07-07 21:13:40 +02:00
Gymnasiast db764445ed
Clean up photo refs 2020-07-07 21:13:10 +02:00
Gymnasiast 65fa08ef35
Clean up GuestHeadingToRideId 2020-07-07 21:13:10 +02:00
Gymnasiast 0dd5b3bbda
Clean up current_ride 2020-07-07 21:13:09 +02:00
Duncan 8c1aa43ef4
Add TryGetEntity to fetch entity objects easily (#11979)
Implement TryGetEntity and use it
2020-07-07 13:13:22 -03: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
TomasZilinek f08206a5d0
Fix #11963 - Refactor Peep::OutsideOfPark (#12060)
* Fix #11963 - Refactor Peep::OutsideOfPark

Changed the definition of Peep::OutsideOfPark from uint8_t to bool and refactored all its occurences in code accordingly.

* Fix #11963 - Refactor Peep::OutsideOfPark

One forgotten instance of Peep::OutsideOfPark occurrence

* Fix #11963 - Refactor Peep::OutsideOfPark

Fix code according to a review suggestion.
2020-06-28 08:39:30 +01:00
frutiemax 14a07359b3
Part of #11389: Use formatter class for Ride::FormatNameTo (#12041) 2020-06-24 21:02:08 -03:00
Michael Steenbeek f330a22df1
Merge pull request #12030 from tupaschoal/more-coords-stuff
Small CoordsXY* Refactor
2020-06-24 13:07:37 +02:00
frutiemax 6e47385b90
Part of #11389 : in peep class, FormatTo* use Formatter class (#12035) 2020-06-23 14:52:08 +01:00
Tulio Leao abcb50ff96 Make staff_can_ignore_wide_flag use CoordsXYZ 2020-06-23 00:13:01 -03:00
Tulio Leao caeed92cf0 Make staff_is_location_on_patrol_edge use CoordsXY 2020-06-21 16:41:18 -03:00
Tulio Leao f6dae982a6 Make MoneyEffect::CreateAt use CoordsXYZ 2020-06-21 14:32:01 -03:00
Tulio Leao 40a7dfbb24 Make litter_create use CoordsXYZD 2020-06-21 14:32:01 -03:00
Tulio Leao 7622ca513e Make litter_remove_at use CoordsXYZ 2020-06-21 14:06:56 -03:00
Tulio Leao f329644dd5 Make sprite_misc_explosion_flare_create use CoordsXYZ 2020-06-21 14:00:37 -03:00
Tulio Leao 2e31a7d64d Make sprite_misc_explosion_cloud_create use CoordsXYZ 2020-06-21 13:58:13 -03:00
Tulio Leao d5c7063214 Make create_balloon use CoordsXYZ 2020-06-21 13:43:42 -03:00
Hudson Oliveira 28c9ddd706
Part of #9473: Create Vehicle::GetRideEntry (#12003) 2020-06-20 00:25:40 -03:00
Duncan bb34213b93
MapCanConstructAt refactor (#11977)
* Start using MapCanConstructAt

* Fix #11675. Pass the full error message arguments on peep pickup

This was causing a crash as the error message arguments were being cleared which would mean eventually a nullptr dereference would happen.
2020-06-17 22:35:13 +01:00
Michael Steenbeek e2b187c24a
Merge pull request #11921 from duncanspumpkin/CreateSprite6
Entity List Iterator
2020-06-17 21:28:36 +02:00
Gymnasiast 9e702d9e01
Replace 'Bathroom' with 'Toilet' 2020-06-17 18:12:13 +02:00
Michael Steenbeek 97b99122de
Merge pull request #11962 from Gymnasiast/refactor/rtd-rtd-rtd
Move RideNaming, RideHeights and max mass to RTDs
2020-06-17 13:06:26 +02:00
Michael Steenbeek ba5e730c06
Rename UpdateFlag to HasUpdateFlag; refactor to bool (#11966) 2020-06-17 00:05:37 -03: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 c45a0536eb Use new class 2020-06-16 20:27:40 +01:00
duncanspumpkin a30374d200 Use new iterator
Fix mac builds

Fix minor mistake

Fix vehicle loops
2020-06-16 20:25:47 +01:00
duncanspumpkin 133d8c4a0a 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:25:03 +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
hdpoliveira a3fe90c250
Create SpriteBase::Invalidate methods (#11948) 2020-06-14 15:18:07 -03: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
Michael Steenbeek 8f29810e04
Move RideData4 to RideTypeDescriptors (#11939) 2020-06-13 11:29:00 +01:00
hdpoliveira 55bb2eaec9
Change all invalidate_sprite_2(Vehicle*) to Vehicle->Invalidate() (#11935) 2020-06-11 20:42:11 +01:00
Michael Steenbeek 1ea1d24f00
Use constant for 255 tile element height (#11928) 2020-06-10 23:18:26 +02:00
Tulio Leao 5d57012390 Rename Peep::var_37 to Var37 2020-06-08 23:47:45 -03:00
Tulio Leao a993ad8408 Rename Peep::energy to Energy 2020-06-08 23:34:35 -03:00
Tulio Leao 1c59cc2aae Rename Peep::energy_target to EnergyTarget 2020-06-08 23:32:22 -03: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 e387539802 Rename Peep::nausea to Nausea 2020-06-08 23:25:37 -03:00
Tulio Leao 71dc82e79a Rename Peep::nausea_target to NauseaTarget 2020-06-08 23:21:17 -03:00
Tulio Leao 533695cbe6 Rename Peep::hunger to Hunger 2020-06-08 23:18:12 -03:00
Tulio Leao aad80d3390 Rename Peep::thirst to Thirst 2020-06-08 23:12:38 -03:00
Tulio Leao 3dd4adeb81 Rename Peep::toilet to Toilet 2020-06-08 23:10:18 -03:00
Tulio Leao 05cc016132 Rename Peep::mass to Mass 2020-06-08 23:07:31 -03:00