Commit Graph

145 Commits

Author SHA1 Message Date
Gymnasiast 89f04c4fb3
Fix names of two track type functions 2020-08-10 23:48:18 +02:00
Gymnasiast 6802011f7d
Use a 16-bit integer for track type in more places 2020-08-10 21:34:10 +02:00
Gymnasiast 9d24655056
Convert track_element_is_block_start() to member function 2020-08-10 21:15:48 +02:00
Arran Ireland 89e4714198
Close #12331: Use CoordsXY in track_remove_station_element (#12609)
* Update track_remove_station_element signature

Part of #12331: This commit will update the
signature of track_remove_station_element and
its callers, to use CoordsXYZD.

* Fix track_remove_station_element local vars

Part of #12331: This commit will ensure that
references to the previous arguments in
track_remove_station_element will now use the new
CoordsXYZD argument.

* Refactor remove in track_remove_station_element

Part of #12331: This commit refactors the removeX/Y
to use CoordsXY.

* Refactor station0 in track_remove_station_element

Part of #12331: This commit will refactor stationX/Y0
to use CoordsXY.

* Close #12331 track_remove_station_element refactor

This commit refactors stationX/Y1 to use CoordsXY,
and fixes the smallZ vs bigZ problem in callers of
track_remove_station_element. These are the final
changes for this issue.

* Added operator for CoordsXYZD minus CoordsXY.

This commit adds a missing operator for subtracting
a CoordsXY from a CoordsXYZD. This was needed for
refactoring Track.cpp

* Refactor track_remove_station_element Coord use

This commit utilises the overloaded operators for
Coords and ensures that they are used so that the
function implementation is more readable.

* Close #12331 track_remove_station_element refactor

This commit also fixes a bug in which a small Z
value (the Height of a RideStation) was being
updated with a big Z value without scaling. It
adds a few extra refactors in calls of the
track_remove_station_element function, and
changes the contributors to add ion232.
2020-08-09 07:25:44 +01:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
0ro8lu 6e077c42ea
Close #12270: Remove goto track_remove_station_element (#12323)
Refactored the goto statement
2020-07-20 20:55:50 +01:00
Gymnasiast cf664c8340
Close #11971: Replace ride groups with new ride types 2020-07-17 00:19:49 +02:00
hdpoliveira c35556d754 Use CamelCase on track functions 2020-06-19 17:35:21 -03:00
hdpoliveira 93b2872747 Rename v-angle to pitch and bank to roll 2020-06-19 12:23:16 -03:00
hdpoliveira 4ce425b436 Fix type issues 2020-06-19 11:18:59 -03:00
hdpoliveira 23cf4b580e Remove global _vehicleVAngleAndBank 2020-06-19 11:17:46 -03:00
hdpoliveira d3d853b7d6 Make loc_6DB38B receive only the update flag 2020-06-19 11:14:02 -03:00
Michael Steenbeek ba5e730c06
Rename UpdateFlag to HasUpdateFlag; refactor to bool (#11966) 2020-06-17 00:05:37 -03:00
Michael Steenbeek f21ddb0723
Refactor checks for station pieces (#11876) 2020-06-05 17:55:15 -03:00
hdpoliveira a1be45d0b7
#9473: Create Vehicle::UpdateFlag (#11850) 2020-06-01 08:35:30 -03:00
Tulio Leao 28b3ac1693 Make track_block_get_previous() use CoordsXYE 2020-05-02 11:07:18 -03:00
Gymnasiast edd31d9f16
Move flags to RideTypeDescriptors 2020-04-17 17:03:33 +02:00
Michael Steenbeek 9dfe5af851
Add remark about track designs with 5 stations (#11051) 2020-03-26 05:53:49 +00:00
Michael Steenbeek 3f473ec3f0
Fix #6123: Cannot build some track designs with 4 stations (#11031) 2020-03-25 14:20:29 +01:00
Gymnasiast 0f8fec1413
Fix #10631: Assertion fails when modifying copied station pieces 2020-03-21 18:43:34 +01:00
Gymnasiast 2f7a26e8da
Refactor station index a bit 2020-03-21 17:05:16 +01:00
Michael Steenbeek fd91c41a76
Name remaining ride type flags (#10947) 2020-03-16 22:52:06 +01:00
Michael Steenbeek ba49850195
Fix errors and apply requests 2020-03-08 11:23:20 +01:00
Gymnasiast 27af60f062
More CoordsXYZ(D) conversion 2020-03-07 22:14:29 +01:00
Gymnasiast ad91654a3d
Use big Z in more places 2020-03-07 21:54:47 +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
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 93926d5e5d
Move all the ride type-specific track categories to regular ones 2020-02-22 23:20:12 +01:00
Michael Steenbeek 1690361b36
Increase size of ride_id_t to 16 bits 2020-02-16 22:21:17 +01:00
duncanspumpkin a5ef8d6240 Rename rct_vehicle 2020-01-19 17:14:56 +00:00
Tulio Leao 98110c0544 Make Map::map_invalidate*() use CoordsXY (#10437)
* Make Map::map_invalidate_element() use CoordsXY

* Make Map::map_invalidate_tile_full() use CoordsXY

* Make Map::map_invalidate_tile_zoom0() use CoordsXY

* Make Map::map_invalidate_tile_zoom1() use CoordsXY

* Make Map::map_invalidate_tile() use CoordsXY

* Use CoordsXYRangedZ for map invalidation

* Fix vehicle tile invalidation use Z instead of Y coord

* Fix BannerRemoveAction sending Z TileCoords to invalidate tile

* Fix wrong tile invalidation on peep_update_walking_break_scenery

* Prefer ToTileStart over bitwise and
2019-12-28 08:44:33 +00:00
Michael Steenbeek 64f7cac6d6
Create getters for station height and start (#10453) 2019-12-27 15:57:40 +01:00
Tulio Leao 81647b3dd8 Make Map::map_get_track_element_at_with_direction_from_ride() use CoordsXYZD 2019-12-24 11:19:06 -03: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
Michael Steenbeek a2b9598341
Modify code using Location8 to use isNull()/setNull() (#10403) 2019-12-21 11:34:46 +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
Gymnasiast bb73dd0dfb
Refactor track element to use 16 bytes 2019-08-31 13:14:19 +02:00
Gymnasiast 169d2980ca
Properly export tile elements to S6 2019-08-18 18:20:56 +02:00
Ted John 93789b9034
Add nullptr checks for get_ride in libopenrct2ui (#9795) 2019-08-09 08:06:25 +01:00
Ted John ab7b17fc4e
Add nullptr checks for get_ride in libopenrct2 (#9788) 2019-08-08 22:58:56 +01:00
Gymnasiast 2ea1fcc69d Remove unused declarations and functions 2019-05-13 22:16:14 +02:00
Nazey 9cbc308c40 Remove gTrackGroundFlags by returning it within GameActionResult (#8930)
Fix #8726
2019-03-24 19:48:37 +00:00
Michael Steenbeek 1c570c8eec
Move some ride functions to struct methods 2019-03-20 20:05:25 +01:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
duncanspumpkin 539c12b41a Remove old game command 2019-03-11 19:11:54 +00:00
duncanspumpkin 92cdbfb0a8 Use Is/Set Indestructible 2019-02-27 10:49:48 +00:00
duncanspumpkin 354cce71eb Introduce new functions to stop direct access 2019-02-27 10:49:48 +00:00
duncanspumpkin 737c308e4e Use IsGhost() to access ghost state
Added set and clear ghost to further prevent direct access to flags
2019-02-25 15:12:35 +00:00