1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 05:53:02 +01:00
Commit Graph

262 Commits

Author SHA1 Message Date
frutiemax
5f438535ad Part of #13874: Gymnasiast review 2021-08-27 17:57:10 -04:00
frutiemax
046c060e74 Part of #13874: Replace Track Sequence properties 2021-08-22 18:01:03 -04:00
Michael Steenbeek
8f5ec43486 Pass derived tile element classes to functions (#15206) 2021-08-11 23:26:46 +02:00
ζeh Matt
13aee659f0 Fix #15096: Crash placing entrance near corner in scenario editor 2021-07-27 12:02:34 +02:00
Duncan
6f81248084 Rework and refactor PathBitEntry (#14809) 2021-06-03 21:23:00 +01:00
Gymnasiast
5e28586a1c Create ProvisionalFootpath struct 2021-04-14 14:56:28 +02:00
Gymnasiast
85157d8604 Move some globals to Footpath window 2021-04-14 14:31:10 +02:00
Duncan
b65f12f1cf Use correct null value (#14421)
* Use correct null value

* Increment network version
2021-04-02 13:13:33 +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
Michał Janiszewski
67b61478cf Reduce inclusion of EntityList.h 2021-02-25 10:56:27 +01:00
Matt
62baee3adb Allow passing of destination tolerance via SetDestination 2021-02-21 09:52:33 +02:00
Matt
965041b437 Remove direct access to DirectionX and DirectionY 2021-02-21 09:52:33 +02:00
Ted John
762b6ee816 Refactor viewport interaction flags and add plugin API 2021-02-18 18:10:29 +00:00
Gymnasiast
1b964c0f2e Refactor flat ride track pieces 2021-02-18 17:50:19 +01:00
Duncan
eb52391b9a Remove next_in_quadrant (#13754)
* Use std::vector of quadrants

* Prevent ptr invalidation issues

* Remove next_in_quadrant

* Make review changes

* Rebuild next_in_quadrant for S6Export

* Fix formatting

* Constexpr where possible

* Increment network version and update replays
2021-01-23 07:36:46 +00:00
Mathias Gibbens
b1e5a11bf3 Several more spelling fixes (#13752)
Signed-off-by: Mathias Gibbens <mathias@calenhad.com>

Co-authored-by: Mathias Gibbens <mathias@calenhad.com>
2021-01-10 18:23:35 +00:00
Tulio Leao
a2de9cfc70 Merge pull request #12573 from NathanIkola/Fix12334
Refactor footpath_is_connected_to_map_edge
2021-01-10 09:22:08 -03:00
ζeh Matt
acf71315b5 Cleanup variables usage and initialize them 2021-01-06 22:29:40 +01:00
Matt
efa1db826e Refactor invalidation logic to be generic to the callee 2021-01-02 16:22:28 +02:00
Dennis Devriendt
3073cca6aa Close #13624: Refactor ViewportInteractionItem to use strong enum (#13657)
* Closes #13624: Refactor ViewportInteractionItem to use strong enum
2020-12-29 15:09:15 -03:00
Michael Steenbeek
abd7babc86 Get RTD from ride via a struct method, part 1 2020-12-12 22:53:50 +01:00
Adam
f09b14ef2b Split actions hpp files into separate h and cpp files (#13548)
* Split up SmallSceneryPlace/Remove

Added undo function for Remove Scenery

* Refactor: Balloon and Banner actions hpp=>h/cpp

* Refactor: rename all action *.hpp files to *.cpp

This is preparation for separation in later commits. Note that without
the complete set of commits in this branch, the code will not build.

* Refactor Clear, Climate, Custom, and Footpath actions hpp=>h/cpp

* VSCode: add src subdirectories to includePath

* Refactor Guest actions hpp=>h/cpp

* Refactor Land actions hpp=>h/cpp

* Refactor LargeScenery actions hpp=>h/cpp

* Refactor Load, Maze, Network actions hpp=>h/cpp

* Refactor Park actions hpp=>h/cpp

* Refactor/style: move private function declarations in actions *.h

Previous action .h files included private function declarations with
private member variables, before public function declarations. This
commit re-orders the header files to the following order:
- public member variables
- private member variables
- public functions
- private functions

* Refactor Pause action hpp=>h/cpp

* Refactor Peep, Place, Player actions hpp=>h/cpp

* Refactor Ride actions hpp=>h/cpp

* Refactor Scenario, Set*, Sign* actions hpp=>h/cpp

* Refactor SmallScenerySetColourAction hpp=>h/cpp

* Refactor Staff actions hpp=>h/cpp

* Refactor Surface, Tile, Track* actions hpp=>h/cpp

* Refactor Wall and Water actions hpp=>h/cpp

* Fix various includes and other compile errors

Update includes for tests.
Move static function declarations to .h files
Add explicit includes to various files that were previously implicit
(the required header was a nested include in an action hpp file, and the
action .h file does not include that header)
Move RideSetStatus string enum to the cpp file to avoid unused imports

* Xcode: modify project file for actions refactor

* Cleanup whitespace and end-of-file newlines

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-12-10 06:39:10 +00:00
Łukasz Pękalski
6e5105ab3b refactor: ObjectType to use strong enum
enum renaming complete
2020-11-11 16:07:01 +01:00
Manuel Vögele
69b07904c1 Make TileElement conversion preserve the const qualifier
Additionally this commit fixes some constness issues revealed by this change
2020-11-04 19:15:44 +01:00
ζeh Matt
645289f4ec Rename GameActionResult and use GameActions namespace instead (#13184) 2020-10-14 22:04:39 -03:00
Duncan
250586cb45 Port some OpenLoco helper functions (#13113)
* Port some OpenLoco helper functions

Added a few helper functions from OpenLoco to make viewport code a bit simpler
2020-10-12 22:25:11 -03:00
Nathan Ikola
7389e10e95 Apply change requested by duncanspumpkin
Remove or improve comments that do not provide information

Use range based for loops when indexes are not necessary

Use more informative variable names

Load tiles starting from the most recently added tile to better mimic
the recursive logic of the original code

Operate on TileState objects rather than overwriting local variables to
simplify the logic in CaptureCurrentTileState and LoadNextTileElement

Use the existing map_is_edge function versus manually checking for
the map edge in the code

Fix edge culling logic to correctly cull all banner edges

Replace incorrect continue with break

Remove level, distanceFromJunction, and junctionTolerance from function
arguments as they are no longer required
2020-10-09 20:22:20 -07:00
Nathan Ikola
6a0d089c84 Add vanilla RCT2 behavior for unowning paths
Implements vanilla RCT2 behavior when unowning paths
by bypassing the early returns when the UNOWN flag is set
and letting the method continue to unown all connected path tiles
2020-10-09 15:29:27 -07:00
Nathan Ikola
30d65aa433 Fix #12557: no editor hang when looking for edges
Fixed a bug that caused the scenario editor to hang
when searching for the map edge
2020-10-09 15:29:27 -07:00
Nathan Ikola
24a8b4be70 Remove recursion in footpath_is_connected_to...
Refactor footpath_is_connected_to_map_edge to be
iterative rather than recursive
2020-10-09 15:29:27 -07:00
Nathan Ikola
94731c5f5f Fix #12334: remove goto in footpath_is...map_edge 2020-10-09 15:29:26 -07: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
Ł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
Gymnasiast
247de81e3b Apply requested fixes 2020-09-12 13:45:50 +02:00
Ron4u
5fe542dd25 fixed issue 12335 2020-09-12 13:18:00 +02:00
Richard Fine
4d3ba7a6f0 Rename PathElement::Edges for clarity
PathElement::Edges actualy stores both 'edges' (in the lower 4 bits) and 'corners' in the upper four. Rename the variable to make this dual usage easier to see.
2020-09-07 21:20:34 -04:00
Simon J
b51e98215a Fix #12728: Paths made in scenario editor don't connect to the map edge (#12730)
Co-authored-by: Simon Jarrett <simonjjarrett@gmail.com>
2020-08-19 19:51:13 -03:00
frutiemax
9ab1f3b5fe Close #12336: Remove goto from loc_6A6D7E (#12366) 2020-08-17 23:28:26 -03:00
Duncan
aa11773da3 Fix #12566, #12565, #12562, #12560, #12558: Nullptr deref (#12567)
Mistake made in refactor meant that a nullptr deref took place when the screen coords were outside of the normal play area
2020-08-02 20:13:09 +01: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
Matt
4b17b2ea76 Fix GetAdditionEntry trying obtain the object when no additions exist 2020-07-24 15:58:17 +02:00
Aaron van Geffen
7b5087f057 Update copyright year to 2020 2020-07-21 15:04:34 +02:00
frutiemax
27734e2971 Part of #12160: Use Coords for viewport_coord_to_map_coord (#12216) 2020-07-12 18:42:54 -03:00
duncanspumpkin
a30374d200 Use new iterator
Fix mac builds

Fix minor mistake

Fix vehicle loops
2020-06-16 20:25:47 +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
duncanspumpkin
517ed57593 Remove IsPeep 2020-06-06 11:36:48 +01:00
Gymnasiast
cc65564521 Use (RCT12)ObjectEntryIndex in more places 2020-05-01 22:06:13 +02:00