Commit Graph

780 Commits

Author SHA1 Message Date
Duncan 87953ace9b
Fix #12535, #12536: RCT1 import can crash when too many misc entities (#12580)
Eventually this can be fixed properly in the new save format
2020-08-03 20:07:13 -03:00
pizza2004 d217dfa9b9
Refactor NewsItem into namespace and Pascal Case (#12511) 2020-08-02 23:14:00 -03:00
Sidney 97d74e142e
Close #12441: Refactor VEHICLE_TRACK_SUBPOSITION to use strong enum (#12550) 2020-08-02 07:50:07 +01: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
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
wdarvin 95b4bca3d0
Close #12448: Refactor RAIN_LEVEL to use strong enum (#12488)
* Close #12448: Refactor RAIN_LEVEL to use strong enum

* Refactor to remove enum suffix
2020-07-28 17:19:45 +01:00
Michael Steenbeek b70716d5f6
Fix #11804: Some RCT1 fences are imported at the wrong height 2020-07-25 16:58:22 +02:00
Matt fa2bd4cad6 Refactor PeepType to use strong enum 2020-07-25 11:54:37 +02:00
Gymnasiast 682add27dd
Change ObjectEntryIndex null value to 0xFFFF 2020-07-23 12:45:42 +02:00
Aaron van Geffen 37a1a1c0a2
Fix #12356: Opening SC4 or SV4 centres viewport on void (#12361) 2020-07-23 11:41:34 +02:00
Duncan 4a235e3bb6
Refactor ResearchItem Type to an enum class (#12346)
* Change type of ResearchItem.type to enum class

This is to prevent any future issues caused by confusion as to what the type is and further improves the codebase.

* Specifiy a size for the type

Also remove the static cast where not required

* Apply review comments
2020-07-22 14:25:05 +01:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Gymnasiast cf664c8340
Close #11971: Replace ride groups with new ride types 2020-07-17 00:19:49 +02:00
Gymnasiast 3c4721d014
Move some constants to RCT12.h 2020-07-13 22:04:50 +02:00
Jimver e4c4c611eb
Part of #12162: Use CoordsXY on staff_set_patrol_area 2020-07-09 14:17:41 +02:00
Gymnasiast e8d6383f57
Clean up voucher arguments 2020-07-07 21:13:40 +02: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
Gymnasiast 5029f754ed
Fix #7324: Research window shows vehicle name instead of ride name 2020-06-19 22:50:53 +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
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
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
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
Tulio Leao 2fdf38a0a9 Rename Peep::time_to_consume to use TitleCase 2020-06-08 23:04:04 -03:00
Tulio Leao 4f9227fd83 Rename Peep::intensity to Intensity 2020-06-08 22:55:07 -03:00
Tulio Leao f1337768f5 Rename Peep::nausea_tolerance to use TitleCase 2020-06-08 22:41:15 -03:00
Tulio Leao f732c2f1cd Rename Peep::window_invalidate_flags to use TitleCase 2020-06-08 22:25:54 -03:00
Tulio Leao 1c566eebcb Rename Peep::paid_on_drink to PaidOnDrink 2020-06-08 20:23:14 -03:00
Tulio Leao 61a598edba Rename Peep::ride_types_been_on to use TitleCase 2020-06-08 20:10:15 -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
Tulio Leao 1ac3b3d2dc Rename Peep::current_train to use TitleCase 2020-06-08 17:36:34 -03:00
Tulio Leao 335cbc900e Rename Peep::current_car to CurrentCar 2020-06-08 17:36:34 -03:00
Tulio Leao 1376dc45c0 Rename Peep::current_seat to CurrentSeat 2020-06-08 17:36:34 -03:00
Tulio Leao 3ad2471a24 Rename Peep::special_sprite to SpecialSprite 2020-06-08 17:36:34 -03:00
Tulio Leao 89a084cbc9 Rename Peep::action_sprite_type to use TitleCase 2020-06-08 17:36:34 -03:00
Tulio Leao 0d84779763 Rename Peep::next_action_sprite_type to TitleCase 2020-06-08 17:36:34 -03:00
Tulio Leao d9e36e5592 Rename Peep::action_sprite_image_offset to TitleCase 2020-06-08 17:36:34 -03:00
Tulio Leao e98cea3615 Rename Peep::action* to Action* 2020-06-08 17:36:33 -03:00
Tulio Leao c953da800a Rename Peep::step_progress to StepProgress 2020-06-07 20:00:07 -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
Tulio Leao 1a3f8490ad Rename Peep::direction to PeepDirection 2020-06-06 11:53:51 -03:00
Tulio Leao 8a50fafdc8 Rename Peep::interaction_ride_index to use TitleCase 2020-06-06 11:53:51 -03:00
Tulio Leao 3748cdb194 Rename Peep::rides_been_on to RidesBeenOn 2020-06-06 11:53:51 -03:00
Tulio Leao 4cdfccb338 Rename Peep::id to Id 2020-06-06 11:53:51 -03:00
Tulio Leao 77af2326ff Rename Peep::cash_in_pocket to CashInPocket 2020-06-06 11:53:50 -03:00
Tulio Leao 0fc7bd1afd Rename Peep::cash_spent to CashSpent 2020-06-06 11:26:04 -03:00
Tulio Leao cf4b052cd4 Rename Peep::time_in_park to TimeInPark 2020-06-06 11:26:04 -03:00
Tulio Leao 3dad0fd500 Rename Peep::previous_ride to PreviousRide 2020-06-06 11:26:00 -03:00
Tulio Leao 7701b1827d Rename Peep::previous_ride_time_out to use TitleCase 2020-06-06 11:25:47 -03:00
Tulio Leao e08c1b44b2 Rename Peep::thoughts to Thoughts 2020-06-06 10:03:58 -03:00
Tulio Leao 57a2dab064
Rename Peep::NoActionFrameNum to WalkingFrameNum 2020-06-04 19:16:25 +02:00
Tulio Leao c9f071a766
Rename Peep::TimeOnRide to GuestTimeOnRide 2020-06-04 19:16:25 +02:00
Tulio Leao ce952961b9
Rename Peep::PeepIsLostCountdown to GuestIsLostCountdown 2020-06-04 19:16:24 +02:00
Tulio Leao fabdb8cdef
Rename Peep::path_check_optimisation to PathCheckOptimisation 2020-06-04 19:16:24 +02:00
Tulio Leao 6dc08afdd0
Rename Peep:staff_id to StaffId 2020-06-04 19:16:24 +02:00
Tulio Leao d05e5f8dc7
Rename Peep::guest_heading_to_ride_id to GuestHeadingToRideId 2020-06-04 19:16:12 +02:00
Tulio Leao 480009c0f6
Rename Peep::peep_is_lost_countdown to PeepIsLostCountdown 2020-06-04 19:16:11 +02:00
Tulio Leao 7357eeca60
Rename Peep::photo1_ride_ref to Photo1RideRef 2020-06-04 19:16:11 +02:00
Tulio Leao a2a0fad886
Rename Peep::peep_flags to PeepFlags 2020-06-04 19:16:11 +02:00
Tulio Leao 53bff03a3f
Rename Peep::pathfind_goal to PathfindGoal 2020-06-04 19:16:11 +02:00
Tulio Leao f2808eecbe
Rename Peep:no_action_frame_num to NoActionFrameNum 2020-06-04 19:16:11 +02:00
Tulio Leao 0933cd4e57
Rename Peep::litter_count to LitterCount 2020-06-04 19:16:11 +02:00
Tulio Leao 7665d1386f
Rename Peep:time_on_ride to TimeOnRide 2020-06-04 19:16:11 +02:00
Tulio Leao e1d0d21b5e
Merge pull request #11849 from hdpoliveira/swing_vars
Rename swing-related variables in Vehicle
2020-06-01 08:27:57 -03:00
hdpoliveira 04664d3a77 Rename swing-related variables in RCT vehicles 2020-05-31 17:46:01 -03:00
hdpoliveira 86550dad20 Rename swing-related variables in Vehicle 2020-05-31 16:37:09 -03:00
Tulio Leao e18abc7e3d Rename NoOf... to AmountOf... on Peep 2020-05-31 09:13:56 -03:00
Tulio Leao 0c502988ef Rename Peep::disgusting_count to DisgustingCount 2020-05-30 20:35:06 -03:00
Tulio Leao a987a9ee5e Rename Peep::paid_to_enter to PaidToEnter 2020-05-30 20:35:06 -03:00
Tulio Leao 3f091d33e2 Rename Peep::paid_on_rides to PaidOnRides 2020-05-30 20:35:05 -03:00
Tulio Leao 414cff9b91 Rename Peep::paid_on_food to PaidOnFood 2020-05-30 20:35:05 -03:00
Tulio Leao c2f7efa328 Rename Peep::paid_on_souvenirs to PaidOnSouvenirs 2020-05-30 20:35:05 -03:00
Tulio Leao a729ac1589 Rename Peep::no_of_food to NoOfFood 2020-05-30 20:35:04 -03:00
Tulio Leao bc7ea40c4b Rename Peep::no_of_drinks to NoOfDrinks 2020-05-30 20:35:04 -03:00
Tulio Leao 625f7859a4 Rename Peep::no_of_souvenirs to NoOfSouvenirs 2020-05-30 20:35:04 -03:00
Tulio Leao fc1ba40dc8 Rename Peep::vandalism_seen to VandalismSeen 2020-05-30 20:35:04 -03:00
Tulio Leao fd71b1b009 Rename Peep::voucher_type to VoucherType 2020-05-30 20:35:04 -03:00
Tulio Leao bf228abf55 Rename Peep::voucher_arguments to VoucherArguments 2020-05-30 20:35:03 -03:00
Ted John f6fbd272ec Add built_date to ScRide and add GetAge() 2020-05-23 15:28:03 +01:00
Tulio Leao e87343f9c6
Rename MoneyEffect member variables to prevent shadowing (#11748) 2020-05-16 17:04:31 -03:00
Tulio Leao c17aa095d5 Rename Peep::surrounding_thought_timeout > SurroundingsThoughtTimeout 2020-05-13 23:28:16 -03:00
Tulio Leao 32c8e5614f Rename Peep::angriness to Angriness 2020-05-13 23:25:09 -03:00
Tulio Leao 589a7a48be Rename Peep::time_lost to TimeLost 2020-05-13 23:22:08 -03:00
Tulio Leao a216cb9930 Rename Peep::days_in_queue to DaysInQueue 2020-05-13 23:19:41 -03:00
Tulio Leao 128c1993c1 Rename Peep::balloon_colour to BalloonColour 2020-05-13 23:16:43 -03:00
Tulio Leao 6c57f33dc9 Rename Peep::umbrella_colour to UmbrellaColour 2020-05-13 23:14:45 -03:00
Tulio Leao 222f8df6cb Rename Peep::hat_colour to HatColour 2020-05-13 23:11:28 -03:00
Tulio Leao 3b632fcf95 Rename Peep::favourite_ride to FavouriteRide 2020-05-13 23:06:40 -03:00
Tulio Leao 7a6de648fe Rename Peep::favourite_ride_rating to FavouriteRideRating 2020-05-13 23:03:58 -03:00
Tulio Leao 14e0cc5e4a Rename Peep::item_standard_flags to ItemStandardFlags 2020-05-13 23:01:03 -03: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
Ted John 7b8ffdb865 Refactor peep.intensity into new strict struct 2020-05-09 12:37:51 +01:00
Gymnasiast cc65564521
Use (RCT12)ObjectEntryIndex in more places 2020-05-01 22:06:13 +02:00
Gymnasiast 6cdee9db93
Fix #7006: Use RTDs for determining ride category 2020-04-30 12:59:18 +02:00
Gymnasiast 73671bbeeb
Make ResearchItem use ObjectEntryIndex 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
Gymnasiast e67ebed697
Remove some Americanisms 2020-04-26 11:07:19 +02:00
Michael Steenbeek 0ecc64f781
Fix #11407: Setting an RCT1 path needs better error messages (#11418) 2020-04-25 15:36:44 +02:00
Michael Steenbeek 144d312ead
Fix RCT1 import importing too many vehicle types (#11419) 2020-04-24 04:00:41 +02:00
Michał Janiszewski 2323cc1596
Use named casts instead of old-style casts
Change prepared with clang-tidy and google-readability-casting check
2020-04-22 17:09:29 +02:00
Tulio Leao 95b43684d0
Change advertise campaign variable type to avoid casts (#11333) 2020-04-18 14:34:07 +02:00
Tulio Leao a4e4040a0c
Use named casts on openrct2/rct* (#11169) 2020-04-18 12:37:34 +02:00
Breno Rodrigues Guimarães 174a480870
Use utf8_remove_format_codes to remove format codes from user strings (#11289)
The previous code used RCT12::RemoveFormatCodes to remove format codes from RCT strings. But that function uses utf8 methods to identify format codes. In this new version, rct2_to_utf8 is called first to obtain an utf8 string, and then utf8_remove_format_codes can be used.
2020-04-15 07:17:43 +02:00
duncanspumpkin 54a058ca6c Fix boat location import/export/update.
After a refactoring to split off the boat location the import/export functions meant incorrect information could be loaded into the s6 file for boats that had not left the station. Boats that had left the station had other fields clobbered for the same reason
2020-04-07 20:19:26 +01:00
Michael Steenbeek 8a12ad8f6b
Fix #9719: Hacked walls in RCT1 saves are imported incorrectly (#11222) 2020-04-05 13:49:36 +02:00
Gymnasiast cfdc8567f7
Fix #11230: Seat Rotation not imported correctly for hacked rides 2020-04-05 12:29:07 +02:00
Michael Steenbeek 87dd126e2a
Fix small red gardens getting imported incorrectly from S4 (#11215) 2020-04-03 19:55:39 +02: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
Duncan 2806104db0
Remove peep sort (#11088)
* Remove peep sort. No longer required.

Peeps are now only sorted in a temporary vector when the staff or guest list is open. This allows for simpler allocation of sprites

* Increment Network Version
2020-03-28 12:37:01 +00:00
Michael Steenbeek b70c5cefd6
Use station index in a few more places (#11066) 2020-03-27 11:13:02 +01:00
Michael Steenbeek c519512cfe
Create ObjectEntryIndex (#10980) 2020-03-20 19:28:39 +01:00
Michael Steenbeek d86dce17e8
Prepare object indices for uint16_t (part 2) (#10966) 2020-03-18 21:27:53 +01:00
Michael Steenbeek 18ebe73dfa
Replace object_entry_get_type() with method (#10937) 2020-03-15 12:07:04 +01:00
Gymnasiast bdf681f440
Clean up many other coordinates 2020-03-13 12:03:43 +01:00
Michael Steenbeek 8113c89f9b
Fix #10904: RCT1/LL-scenarios with red water won't open (#10905)
Co-authored-by: Ted John <ted@brambles.org>
2020-03-11 19:21:02 +01:00
Michael Steenbeek 4f86d0115c
Merge pull request #10866 from Gymnasiast/refactor/more-tile-element-prep
Refactor/more tile element prep
2020-03-06 09:25:32 +01:00
Michael Steenbeek d64b73c29a
Clean up RCT1/2 constants (#10855) 2020-03-05 22:49:16 +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 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
Gymnasiast c9afcaa5b3
Fix errors 2020-03-05 00:09:39 +01:00
Gymnasiast 3ed7694495
Move tile element-specific flags 2020-03-04 22:01:09 +01:00
Gymnasiast 57a40c0657
Extend PathElement 2020-03-04 21:57:42 +01:00
Michael Steenbeek 61175a4fbf
Confine use of LocationXY8 to RCT12 load/save code (#10698) 2020-03-01 21:16:10 +01: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
Tulio Leao 1b3f0e9a44 Create ScreenCoordsXY gSavedView from separate x,y variables 2020-02-22 16:01:21 -03:00
Gymnasiast 1e6efa6eb4
Extend BannerIndex to 16 bits 2020-02-15 10:37:34 +01: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
Michael Steenbeek d16fbb0cd2
Change ride->overall_view to CoordsXY (#10673) 2020-02-08 17:19:59 +01:00
Gymnasiast e6c32230bc
Convert rawValue to uint32 2020-01-26 14:12:57 +01:00
Gymnasiast 63fddee603
Convert gResearchLast/NextItem to std::optional 2020-01-26 10:07:16 +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 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
duncanspumpkin 164acc85cc Rename sprites to newer style naming 2020-01-19 17:10:53 +00:00
duncanspumpkin 4e796ec92d Increase Sprite size to 0x200
This should allow for major refactoring of the sprite classes
2020-01-19 17:08:57 +00:00
modulo7 fdf0c17fd8
Name field var_CD of vehicle struct. Refactor to enum 2020-01-19 17:34:11 +01: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 0f306d6f5c
Fix #10547: RCT1 parks have too many rides available (#10556) 2020-01-13 19:23:05 +01:00
Michael Steenbeek 5e5752d49d
Fix secondary prices being imported incorrectly from SV4 (#10543)
An oversight that has been present since the very first version of the SV4 import code.
2020-01-11 23:27:01 +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 b1dc6ed6ed Use CoordsXY on footpath_connect_edges() 2020-01-05 08:20:16 -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
Michael Steenbeek 64f7cac6d6
Create getters for station height and start (#10453) 2019-12-27 15:57:40 +01:00
Michael Steenbeek 8ca0cf52a7
Replace more direct accesses to base/clearance Z with getter/setter (#10454) 2019-12-27 15:26:40 +01:00
duncanspumpkin 18af061c16 Fix formatting 2019-12-24 12:22:54 +00:00
duncanspumpkin 0f90b2c353 Rename variable as its technically new 2019-12-24 11:46:56 +00:00
duncanspumpkin 370a9b1113 Change type of cur_test_track_location 2019-12-24 11:44:01 +00:00
duncanspumpkin c08958a705 Prepare cur_test_track_location for type change 2019-12-24 11:43:55 +00:00
duncanspumpkin a5ad2f9a87 Change overall view and boat hire return type to TileCoordsXY 2019-12-24 08:51:48 +00:00
duncanspumpkin 58339cff2b Prepare overall_view for type change 2019-12-24 08:39:20 +00:00
duncanspumpkin 0a5d094785 Change type of ChairLiftBullwheel to TileCoordsXYZ 2019-12-24 08:28:10 +00:00
Gymnasiast 62fcbb07ca
Rename methods to GetBaseZ/GetClearanceZ 2019-12-23 20:08:37 +01:00
Gymnasiast 7d11858dbe
Create getter for GetBaseHeight()/GetClearanceHeight() 2019-12-23 20:05:24 +01:00
Tulio Leao a2c7ecc6e5 Make Map::map_get_first_element_at() use CoordsXY (#10413)
* Make Map::map_get_first_element_at() use CoordsXY

* Fix clang-format on ClearAction.hpp

* Prefer TileDIrectionDelta over hardcoded delta on RideConstruction

* Use named Direction constants

* Make Compat::map_get_first_element_at() use CoordsXY
2019-12-23 07:35:41 +00:00
duncanspumpkin 64656cdc0e Fix mistake made by auto complete 2019-12-21 12:43:13 +00:00
duncanspumpkin 21128c5389 Undo clang format mistakes 2019-12-21 11:52:32 +00:00
duncanspumpkin 7297125cae Refactor stations ready for TileCoordsXY 2019-12-21 11:26:37 +00:00
Michael Steenbeek a2b9598341
Modify code using Location8 to use isNull()/setNull() (#10403) 2019-12-21 11:34:46 +01:00
Tulio Leao aea755bd70 Allow TileCoordsXYZD to generate CoordsXYZD equivalent 2019-12-19 00:11:26 -03:00
Tulio Leao c71c4284d0 Make map entrance/exit fetching functions use only CoordsXY objects 2019-12-17 23:55:46 -03:00
Tulio Leao 03e7e29b21 Make map entrance/exit fetching functions use Coords objects 2019-12-14 12:13:09 -03:00
Michael Steenbeek f79667d842
Fix #9995: User strings with umlauts not imported correctly 2019-10-20 19:03:09 +02:00
duncanspumpkin bb042213fd Fix #10069. Actually pass the track element flags to the new element.
Mistake made whilst refactoring #10058. Flags were incorrectly been taken from the destination and not the source.

Refactored names to use the correct t number
2019-10-10 18:48:05 +01:00
Tulio Leao b793d7e79a Avoid dereferencing map_get_first_element_at nullptr on libopenrct2 (#10013)
* Avoid dereferencing map_get_first_element_at nullptr on Map.cpp

* Avoid dereferencing map_get_first_element_at nullptr on MapAnimation.cpp

Returning true or internal control variable, based on what was seen on `map_animation_invalidate_track_onridephoto`

* Avoid dereferencing map_get_first_element_at nullptr on Park.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Scenery.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Sprite.cpp

* Avoid dereferencing map_get_first_element_at nullptr on TileInspector.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Wall.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Fountain.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Footpath.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Entrance.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Banner.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Vehicle.cpp

* Avoid dereferencing map_get_first_element_at nullptr on TrackDesignSave.cpp

* Avoid dereferencing map_get_first_element_at nullptr on TrackDesign.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Track.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Station.cpp

* Avoid dereferencing map_get_first_element_at nullptr on RideRatings.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Ride.cpp

* Avoid dereferencing map_get_first_element_at nullptr on S4Importer.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Staff.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Peep.cpp

* Avoid dereferencing map_get_first_element_at nullptr on GuestPathfinding.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Guest.cpp

* Avoid dereferencing map_get_first_element_at nullptr on VirtualFloor.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Paint.TileElement.cpp

* Fix issues raised on review

* Fix remaining review issues.

* Early exit on loops if tileElement is nullptr

* Fix clang-format issues
2019-10-09 15:02:21 +01:00
Tulio Leao 3f21933d5b Fix clang-format issue. 2019-10-08 18:22:02 -03:00
Tulio Leao 121585578e Remove implicit conversion constructor 2019-10-08 18:22:02 -03:00
Tulio Leao 68ce43308e Remove implicit conversion constructor 2019-10-08 07:48:03 -03:00
Michael Steenbeek a63395eb1c
Fix #10028: Saved park--brakes all set to 0mph 2019-09-29 22:53:41 +02:00
Michael Steenbeek a11762b11a
Remove old C functions that only call their equivalent
* Remove old C functions that only call their equivalent

* fix formatting
2019-09-22 14:12:49 +02:00
Duncan b94b8880aa Fix ride station index related bugs 2019-09-19 22:56:54 +02:00
Gymnasiast bb73dd0dfb
Refactor track element to use 16 bytes 2019-08-31 13:14:19 +02:00
Gymnasiast ec5ba20992
Create dedicated method for SetLastForTile() 2019-08-25 16:13:02 +02:00
Gymnasiast 6e200459d3
Refactor some accessors to tile element type and flags fields 2019-08-24 22:42:47 +02:00
Gymnasiast c3fdb728d1
Rename rct_research_item to ResearchItem 2019-08-23 22:41:43 +02:00
Ted John 132a1916d6
Fix #9832: Access violation in ride_measurement_update (#9842)
We can not store a ride pointer in ride measurement as rides are now stored in a vector which means their addresses can change when rides are constructed / removed.
2019-08-10 15:14:22 +01:00
duncanspumpkin 996cbdec02 Correctly input num_holes, inversions 2019-08-09 20:43:03 +01:00
duncanspumpkin af31404472 Use std::string and cleanup unused functions
Use CoordsXY for save pop scenery functions

Use CoordsXY for push save scenery functions

Further refactoring to use coordsxy and standard functions
2019-08-09 20:43:03 +01:00
duncanspumpkin e9b59064e0 Fix code and clang format. Delete dead code.
Use correct TD4 checksum for vanilla TD4's.

Simplified the code for version detection since checksum numbers do not match up to a version

Fix TD4 imports.

Oh yeah TD4 doesn't have scenery or entrances

Move track related structs to correct files
2019-08-09 20:43:02 +01:00
duncanspumpkin 02d552e048 Create td4 importer 2019-08-09 20:39:54 +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
Ted John a863c7ae50 Remove rest of FOR_ALL_RIDES instances 2019-08-04 16:44:17 +01:00
Ted John a3fe00f0a3 Refactor ride list to a manager with iterator 2019-08-04 16:43:50 +01:00
Ted John c3234b1442 Refactor map animations and dynamically create on park load (#9705) 2019-08-03 22:18:33 +02:00
Ted John af5daaec70 Fix importing and exporting of banner strings containing colour 2019-07-29 21:20:22 +01:00
Ted John f539fdd79c Convert user strings to RCT2 encoding when exporting to S6 2019-07-29 20:01:49 +01:00
Ted John 40d49b93d3 Do not use user strings for peep names 2019-07-29 19:18:16 +01:00
Ted John 61d64ab8c5 Do not use user strings for banners 2019-07-29 19:18:16 +01:00
Ted John 3f8890afde Fix remaining errors and a few bugs 2019-07-29 19:18:16 +01:00
Ted John 6fff2079f9 Refactor ride name to dynamic args and std::string 2019-07-29 19:18:16 +01:00
Ted John 0b4d989a67 Rename get_banner to GetBanner 2019-07-26 17:24:19 +01:00
Ted John 3bff25ab22 Use TileCoordsXY 2019-07-26 17:14:09 +01:00
Ted John 5c07c53faf Refactor get banner 2019-07-25 22:21:19 +01:00
Ted John 85543bd1c8 Separate RCT2 and OpenRCT2 banner struct 2019-07-25 22:21:19 +01:00
Matt 98a17fe8d9
Refactor create_sprite and remove unnecessary move_sprite_to_list 2019-07-24 17:53:51 +02:00
Duncan ab5f5b20cd
Use enum class for RCT2_SOUND (#9618)
* Use enum class for RCT2_SOUND

* Fix formatting. Fix mistaken declaration.

* Change name of enum to SoundId

* Fix clang format
2019-07-22 19:02:45 +01:00
Ted John 5733d666b3 Do not store park name as a user string 2019-07-21 11:33:15 +02:00
Jim Armstrong 9c976daa51 Refactor #9474: Refactor jumping fountain code (#9475)
* Refactor jumping_fountain_update to Update

* Refactor jumping_fountain_get_type to GetType

* Refactor jumping_fountain_continue to Continue

Fix typos and misc refactoring

* Refactor begin and create functions into static member functions

Move jumping_fountain_begin and jumping_fountain_create into the rct_jumping_fountain struct and make them static

* Refactor remaining fountain functionality into member functions

* Rename JumpingFountain struct and move to proper header file

JumpingFountain code was refactored to conform to variable naming conventions and moved into the Fountain.h file.

rct_sprite_generic struct was moved to SpriteBase.h - this was done to get around a circular header dependency between Fountain.h and Sprite.h

* Set access modifier for private functions

* Change JumpingFountain variable names to TitleCase

* Refactor #9474: Clarify where auto is being used with pointers

* Refactor #9474: Change function names for clarity

* Refactor #9474: Fix incorrect function names
2019-07-11 20:38:30 +01:00
Peter dd948f99c4 #9295 Refactor rct_vehcile->status to rct_vehicle::SetState() (#9329)
Fix #9295. Refactor rct_vehicle->status to rct_vehicle::SetState()

Created rct_vehicle::SetState() and refactored all assignments to
rct_vehcile->status. SetState also includes a call to
vehicle_invalidate_window(), so it cannot be forgotten.
2019-06-09 15:45:56 +01:00
Ted John 6f0298deb3 Refactor ride measurement storage 2019-06-09 11:55:41 +02:00
Michael Steenbeek da6794ad9e
Refactor second argument to move_sprite_to_list() 2019-05-08 22:11:51 +02:00
duncanspumpkin 356a0e5e91 Rework flags 2019-04-04 19:23:44 +01:00
duncanspumpkin 29f5018bd1 Implement wall place game action 2019-04-02 18:36:57 +01:00
Michael Steenbeek 8d83f5a549
Merge pull request #8978 from Gymnasiast/refactor/inversions
Close #8965: Refactor ride->inversions
2019-03-28 20:28:35 +01:00
Michael Steenbeek ec3d757854
Fix #5905: Urban Park MGR has entrance/exit swapped 2019-03-27 20:53:48 +01:00
Michael Steenbeek bbf523e829
Fix #8537: Imported RCT1 rides/shops are all numbered 1 2019-03-27 20:07:13 +01:00
Gymnasiast 64e51cd34b Close #8965: Refactor ride->inversions 2019-03-27 11:30:18 +01: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
Duncan f0092b7aae
Merge pull request #8781 from duncanspumpkin/flag_refactor
Flag refactor
2019-02-27 19:18:02 +00:00
duncanspumpkin 7840f6a7f7 Use SetIsBroken 2019-02-27 10:49:48 +00:00
Ted John bac3168a23 Refactor IsChild to IsHead 2019-02-25 17:58:22 +00:00
Ted John 520b1b4819 Try out changed sprite structs for main game 2019-02-25 12:29:31 +00:00
Ted John c0e4eff9f1 Start copying sprite structures for RCT1 and RCT2 2019-02-20 23:31:14 +00:00
Ted John 4013479094 Refactor marketing to be a single vector 2019-02-20 16:49:02 +00:00
Michał Janiszewski 604da7ce01
Merge pull request #8661 from tomlankhorst/refactor-random
Refactor random engine
2019-02-03 23:29:10 +01:00
Tom Lankhorst 6a42a95495
Refactor random engine
Introduce RotateEngine and Rct2Engine, FixedSeedSequence and Rct2Seed.
Adhere respectively to requirements `RandomNumberEngine` and `SeedSequence`.
Can be used with C++11 adaptors and distributions in <random>.
2019-02-01 14:32:04 +01:00
ζeh Matt 6668a1fa86 Refactor remaining number values to RideStation::NO_TRAIN (#8655) 2019-01-30 13:49:46 +00:00
Michael Steenbeek 4e9d2ce764
Split footpath object into two internally 2019-01-20 21:38:38 +01:00
Ted John 92412d4bab Store ride index inside ride struct 2019-01-18 11:46:18 +01:00
Gymnasiast 87f894079b Replace hardcoded occurrences of RIDE_ENTRY_INDEX_NULL 2019-01-12 12:48:35 +01:00
Ted John 8701286772
Use new ride_id_t typedef (#8561) 2019-01-12 10:11:55 +00:00
ζeh Matt 20496b0390
Merge pull request #8545 from richard-fine/use-enum-types
Use of enum types in Peep code
2019-01-04 10:57:56 +01:00
Michael Steenbeek 31298bd772
Merge pull request #8543 from IntelOrca/refactor-ride
Refactor ride structure
2019-01-02 22:38:20 +01:00
Michael Steenbeek b5317ee9e9
Split drawing of path and railing 2019-01-02 19:52:53 +01:00
Richard Fine 60396c6658 Rename enums to modern style
Change various PEEP_ENUM_TYPE names to PeepEnumType names, to match the more modern coding standard.
2019-01-02 14:10:05 +00:00
Richard Fine f3292194f5 Use PEEP_SPRITE_TYPE enum
Use the PEEP_SPRITE_TYPE enum for rct_peep::sprite_type so we get type safety on it.
2019-01-01 22:40:59 +00:00