Commit Graph
372 Commits
Author SHA1 Message Date
Stephan Spengler 76b918e7ed Change openrct2/ride methods to UpperCamelCase, part 1 2023-01-17 01:32:54 +01:00
Gymnasiast 5309c80e29 Remove snake_case in interface folder 2023-01-16 22:20:41 +01:00
Hielke Morsink 6dafbbfb65 Rename global window functions to TitleCase (#19167) 2023-01-16 20:13:42 +00:00
James103 73738bbdc8 Replace 2022 with 2023 in copyright headers
Replace all instances of the year 2022 with 2023 in all copyright headers
2023-01-01 11:58:01 +01:00
Duncan 482971710d Apply code style to context functions 2022-11-06 21:49:07 +01:00
Duncan 406b73d904 Remove final snakes from map and world (#18304) 2022-10-12 09:14:45 -03:00
Duncan 7dd8989e70 Next chunk of World/Map.h snakes (#18296)
* Next chunk of World/Map.h snakes

* Apply clang-format
2022-10-12 06:35:20 +01:00
Duncan 67bbc8560d Code style: Remove snakes from everything world apart from Map.h (#18273)
* Remove remaining snakes from world (outside of map)

* Initial few desnaking of Map.h
2022-10-11 19:39:24 +01:00
Duncan 5dba30778d Code style: Remove more snakes from the park, maphelper, scenery. (#18222) 2022-10-08 06:56:17 -03:00
duncanspumpkin 16581e9288 Address snakes in mapgen and map animation 2022-10-05 20:22:51 +01:00
duncanspumpkin 2a593b6029 Remove snake cases from Location and LargeScenery 2022-10-05 20:21:56 +01:00
duncanspumpkin 3e8dc1b2ac Remove snakes from the foopaths 2022-10-04 20:08:14 +01:00
duncanspumpkin 2c29190ff8 Remove snakes from entrance 2022-10-04 20:07:35 +01:00
73 b9e677945d Replace 20XX with 2022 (#18158)
* Replace 2020 with 2022

Replace all 2020 headers with 2022

* replace other years with 2022

add missing years
2022-10-01 08:42:14 +01:00
Rik Smeets efa7a23773 Fix #18140 & #18143: Invalid read in Staff
The tile element should be determined the same way as is done when checking if the footpath is blocked by a vehicle.

Also added some extra safety checks and made the code a bit more efficient / reusable. For example: when the staff member is not a mechanic, the tile element doesn't have to determined.
2022-09-30 18:00:59 +00:00
Rik SmeetsandGymnasiast 67856292a4 Fix #17889: Peeps don't stop at level railway crossings if approached from downhill
If peeps approached a railway crossing from downhill, they would not stop for a passing train. This was because the exact destination z is determined too late. To always get the correct path, get the first footpath at the previous z index, or one step above.

Co-authored-by: Gymnasiast <m.o.steenbeek@gmail.com>
2022-09-28 16:44:05 +00:00
Gymnasiast f5f4a8a2f6 Use gMapSize instead of MAXIMUM_MAP_SIZE_TECHNICAL in appropriate places
Backported from my map size refactors.

These functions previously scanned the whole map,
so this might also provide a slight performance boost (not tested).
2022-09-22 16:19:46 +02:00
lalip a891d85dd9 Fix #17897: Guest can get stuck on construction rights outside the park
Caused by a refactor mistake in https://github.com/OpenRCT2/OpenRCT2/commit/f0777e54186a79a5ae44a097ed1fb3b165f1af35.
2022-08-31 23:51:05 +02:00
Hielke Morsink 7f29e4e39c Make rct_windowclass strong type WindowClass
This already revealed some places where implicit conversions were done, including some where its use was nonsense (MouseInput.cpp).
The changes to the Intent class were necessary to keep things working, and this splits things up more neatly.
2022-08-21 18:38:25 +02:00
Gymnasiast f0777e5418 Introduce constant for construction rights clearance 2022-07-28 21:25:42 +02:00
Sadretandduncanspumpkin ed18ef1146 Fix #16392: Scenery on sloped surface is placed at wrong height. (#17343)
* Fix #16392: Scenery on sloped surface is placed at wrong height.

* fix SceneryQuadrantOffset

* fix valley land height

* Bump network version

* update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2022-07-20 20:33:33 +01:00
underdoom 46b3687a2d Simplify tile element initialisation 2022-07-04 21:59:09 +02:00
Ted John 45040cd34a More code review changes 2022-02-14 23:15:59 +00:00
Ted John 454bfb0a8f Refactor map size to allow for rectangle maps 2022-02-14 23:15:59 +00:00
ζeh Matt 06e430157f Use RideId::GetNull and RideId::IsNull over constant 2022-02-12 18:11:18 +02:00
ζeh Matt a2470c0573 Rename ride_id_t to RideId 2022-02-12 18:11:18 +02:00
ζeh MattandTed John 993b168bfd Implement profiler (#16194)
* Implement profiling API

* Add console commands for the profiler

* Remove accidental line

* Correct csv output

* Add copyright notice

* Add missing override

* Add default virtual destructor

* Explicitly pass template argument

* Use static

* Add plugin API for profiler

* Add more profile calls

* Workaround for GCC hopefully

* Add missing static keyword

* Use uint64 for call count

* Reduce name length see if CI passes

* Improve handling of function names

* Work around (broken) static inline variables

* Fix missing include

* Disable profiler for clang 5 and older

* Update copyright date

* Profile UpdateAllMiscEntities

* Apply review suggestions

Co-authored-by: Ted John <ted@brambles.org>
2022-01-18 20:21:20 +02:00
ζeh Matt 2329d3d681 Refactor tile access to be continuous when iterating 2021-12-30 23:03:32 +01:00
Hielke Morsink 5fbb77ebc1 Remove unused includes from Map.cpp 2021-12-30 13:58:20 +01:00
Gymnasiast ef6f2cceee Create RideConstruction.h 2021-12-18 20:27:13 +01:00
Gymnasiast aa34f0f760 Drop the N postfix 2021-12-11 00:39:39 +01:00
Gymnasiast 23c5988fb1 Change last usage of GetType() and remove the method 2021-12-11 00:38:42 +01:00
Gymnasiast fc3ce3294c Move over switches to normalised tile element types 2021-12-11 00:30:59 +01:00
Gymnasiast 50c0080da8 Update calls to ClearAs() 2021-12-10 22:58:27 +01:00
Michael Steenbeek 2d1af0ec42 Replace many GetType() calls with GetTypeN() 2021-12-10 22:43:17 +01:00
Gymnasiast 91635a5047 Replace SetType and old strong enum with normalised 2021-12-05 13:54:01 +01:00
Hielke Morsink 53d9bfa8b4 Update implicit zoom conversions 2021-12-01 00:08:35 +01:00
ζeh Matt 83b911b193 #15634: Refactor passing GameActions::Result by copy (#15951)
* Refactor to result GameActions::Result as copy instead of unique_ptr

* Remove alias GameActions::Result::Ptr

* Remove MakeResult wrapper

* Remove type forwarder in TileInspector
2021-11-24 07:35:08 +00:00
Ted John 0e57643a68 Refactor TilePointerIndex 2021-11-21 22:43:23 +01:00
Duncan f84c5616e5 Port over NSF map changes (#15912) 2021-11-14 20:58:33 +00:00
ζeh Matt 14b6894e77 Remove overwriting error message in map_is_location_in_park 2021-10-28 21:21:59 +03:00
ζeh Matt 3016701a98 Prevent map_is_location_owned from overwriting the global error message 2021-10-28 21:15:24 +03:00
Sijmen cec8447c6f Refactor Viewport.cpp to use ScreenRect (#15790) 2021-10-27 00:13:38 -03:00
ζeh Matt 7a30169c28 Refactor out construction clearance into a new compilation unit 2021-10-20 22:21:54 +03:00
Hielke Morsink 9dd20ec619 Improve array formatting
For most of these cases, adding a trailing comma to the array block makes clang-format put each item on a new line, and clang-format exception blocks could be reduced where clang-format does not handle them properly.
2021-10-17 18:21:45 +02:00
Hielke Morsink c2d3ca5f85 Automatically deduce std::array types
This also improves formatting of some arrays with weird or no indention.
2021-10-14 23:27:28 +02:00
Hielke Morsink 1d62a902e7 Make scenery_small_entry_has_flag a member function (#15509) 2021-10-01 16:50:05 -03:00
frutiemaxandζeh Matt 2906cb8c89 Fix #14474: Map size can be synced in multiplayer (#15312)
* Fix #14474: Map size can be synced in multiplayer

* Bump up network version

Co-authored-by: ζeh Matt <5415177+ZehMatt@users.noreply.github.com>
2021-09-29 16:46:03 +01:00
Hielke Morsink 53c22c9b4b Check for nullptr explicitly (#15458) 2021-09-24 20:05:50 +02:00
ζeh Matt 719a5a9d8e Merge pull request #15369 from ZehMatt/refactor/tile-coords
Refactor overload map_get_first_element_at
2021-09-21 14:36:03 -07:00