1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 23:34:37 +01:00
Commit Graph

101 Commits

Author SHA1 Message Date
duncanspumpkin
98f9f24909 Remove sprite.h includes where possible 2021-05-29 08:54:33 +01:00
Duncan
39fcc5d078 Split up Sprite header (#14764)
* Remove fields from rct_sprite union

* more header fun

* Fix guest include
2021-05-29 06:01:32 +01:00
ZxBiohazardZx
36b2742c19 Change Vehicle Rotation namings in accordance with OpenRCT2 Codestyle (#14616)
* Code Refactor: Rename vehicle_sprite_type to Pitch 

In some of the issues the vehicle_sprite_type is used to check for properties in regards to the pitch of the vehicle.Similarly bank_rotation is used to provide information on the Roll property. This is not in alignment with the https://github.com/OpenRCT2/OpenRCT2/wiki/Coding-Style and makes it harder to refactor other elements of the codebase and makes for undesired nested logics.

This PR also includes the change from rename bank_rotation to Roll in alignment with the OpenRCT2 Coding Style


Related to PullRequest #11956

* Apply formatting

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-05-12 12:38:46 +01:00
Duncan
a9e1f2e89c Remove SpriteBase::flags (#14460)
* Remove SpriteBase::flags

* Increment network version

* update replays
2021-04-11 18:02:19 +01:00
Michael Steenbeek
7344b7fbfd Use 16-bit ride_id_t thoughout and raise RIDE_ID_NULL (#14411)
* Replace RIDE_ENTRY_INDEX_NULL with OBJECT_ENTRY_INDEX_NULL

Ride entries are objects like any other, so there is little point having separate constants.

* Use ride_id_t in many more places

* Change RIDE_ID_NULL to 0xFFFF

* Increment network version

* Update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-04-01 16:02:57 +01:00
Duncan
6ec379cd0e Split Entity Lists by Entity type (#14326)
* Make initial changes to add entity type

* Make further corrections

* Revert header changes

* Fix mistakes
2021-03-16 11:18:06 +00:00
Duncan
5474194905 Implement train view and remove linked_list_index (#13956)
* Make train manager view

* Remove linked list index field

* Remove merge mistake

* Fix further rebase errors

* Rename and add comments

* Update replays

* Fix Xcode project

* Increment network version

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2021-03-15 08:13:00 +00:00
Michael Steenbeek
28c680f97f Merge pull request #14163 from Gymnasiast/refactor/get-rtd
Use GetRideTypeDescriptor() in more places
2021-02-26 10:46:38 +01:00
Gymnasiast
44d0e77afb Make all access to RTD table use the bounds checking function 2021-02-26 10:01:00 +01:00
Michał Janiszewski
67b61478cf Reduce inclusion of EntityList.h 2021-02-25 10:56:27 +01:00
Gymnasiast
d63e3b1d9f Replace RideTypeDescriptors[ride->type] with GetRideTypeDescriptor() 2021-02-24 14:10:30 +01:00
Michael Steenbeek
e3a1af3d05 Use getters/setters for track type and direction 2021-01-30 15:16:17 +01:00
Michael Steenbeek
20f959c833 Use track_type_t in more places 2021-01-22 11:33:55 +01:00
Duncan
d5ada2dca1 Remove type from SpriteBase (#13735)
* Move type field into sub structures

* Use type for misc_type

* Use type for l_type

* Rename to SubType

* Rename SpriteGeneric to MiscEntity

* Rename generic to misc

* Add extra nullptr checks for compilers that cant understand

* Make review changes

* Increment network version

* Update replays
2021-01-10 15:14:34 +00:00
Matt
19b63a1825 Refactor logic of MoveTo to always imply invalidation 2021-01-02 16:22:28 +02:00
Michael Steenbeek
92a5f1aa24 Merge pull request #13310 from ju-pinheiro/sprite-identifier-strong-enum
Close #12450: Refactor SPRITE_IDENTIFIER to use strong enum
2020-11-06 16:55:01 +01:00
Manuel Vögele
6517757df7 Rename VEHICLE_UPDATE_FLAG_1 2020-11-03 20:08:10 +01:00
ju-pinheiro
bb16ca075b Close #12450: Refactor SPRITE_IDENTIFIER to use strong enum 2020-10-27 13:26:27 -03:00
Matt
091145037e Move the audio code into OpenRCT2 namespace 2020-10-07 00:34:42 +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
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
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
Aaron van Geffen
7b5087f057 Update copyright year to 2020 2020-07-21 15:04:34 +02:00
duncanspumpkin
64ab101b4e Fix formatting and comment 2020-07-04 07:38:11 +01:00
duncanspumpkin
e51bbeed23 Convert SPRITE_LIST to an enum class 2020-07-04 07:38:11 +01:00
Tulio Leao
3ba505e5bd Merge pull request #11956 from hdpoliveira/loc_6DB38B
Simplify code related to V-angle and bank
2020-07-03 15:16:08 -03: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
hdpoliveira
c35556d754 Use CamelCase on track functions 2020-06-19 17:35:21 -03:00
hdpoliveira
0bdbcbcd88 Part of #9473: Create Vehicle::GetTrackProgress 2020-06-19 15:02:35 -03:00
hdpoliveira
f33f3c07bd Part of #9473: Create Vehicle::GetMoveInfo 2020-06-19 15:02:35 -03:00
hdpoliveira
93b2872747 Rename v-angle to pitch and bank to roll 2020-06-19 12:23:16 -03:00
hdpoliveira
23cf4b580e Remove global _vehicleVAngleAndBank 2020-06-19 11:17:46 -03:00
hdpoliveira
affa0dd30b Create struct VAngleAndBank and simplify code 2020-06-19 11:16:52 -03: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
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
55bb2eaec9 Change all invalidate_sprite_2(Vehicle*) to Vehicle->Invalidate() (#11935) 2020-06-11 20:42:11 +01:00
hdpoliveira
5b1469b8b7 Create Vehicle::GetTrackType() (#11895) 2020-06-07 21:43:32 +01:00
hdpoliveira
a1be45d0b7 #9473: Create Vehicle::UpdateFlag (#11850) 2020-06-01 08:35:30 -03:00
hdpoliveira
86550dad20 Rename swing-related variables in Vehicle 2020-05-31 16:37:09 -03:00
hdpoliveira
60b54bdd04 #9473: Create CableLiftUpdateTrackMotion functions 2020-05-30 20:23:02 -03:00
hdpoliveira
c5e0489a48 #9473: Create Vehicle::CableLiftUpdateTrackMotion 2020-05-30 20:23:02 -03:00
Gymnasiast
11472f909d Convert sprite_move to method 2020-05-13 10:47:32 +02:00
Tulio Leao
28b3ac1693 Make track_block_get_previous() use CoordsXYE 2020-05-02 11:07:18 -03:00
hdpoliveira
d69cc1c877 Part of #9473: Create Vehicle::TrainHead and Vehicle::TrainTail
Converted from vehicle_get_head and vehicle_get_tail
2020-04-30 20:53:17 -03: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
Mustapha Elghoul
38630eeb59 Update dist_x and dist_y to camelCase. (1 >> 1) to VEHICLE_UPDATE_MOTION_TRACK_FLAG_1, and (1 >> 0) to VEHICLE_UPDATE_MOTION_TRACK_FLAG_VEHICLE_AT_STATION 2020-04-21 16:51:00 -04:00