1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 06:44:38 +01:00
Commit Graph

49 Commits

Author SHA1 Message Date
Linus Unnebäck
fd07be587a Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01:00
ζeh Matt
b2005c3b9f Implement FootpathRemoveAction as a GameAction (#7867) 2018-08-12 10:31:00 +02:00
Hielke Morsink
0b03464186 Replace 0 and NULL with nullptr (#7827) 2018-07-25 22:49:20 +02:00
clang-format
b02dfdbc93 Binpack function arguments together
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead.

Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:22 +02:00
clang-format
95ce592579 Enforce not breaking before assignments and function names
Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:19 +02:00
clang-format
5c55fd6132 clang-format world 2018-07-23 16:00:12 +02:00
Michael Steenbeek
1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Hielke Morsink
0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
Ted John
c300f873f5 Refactor peep check for vehicle 2018-06-10 22:59:58 +01:00
Hielke Morsink
5d0022a5cb Remove argument list from zero-initializers with zero/false/nullptr value 2018-06-04 19:50:46 +02:00
Michael Steenbeek
a14d59028f Modify some commands to use CoordsXY 2018-06-04 19:18:52 +02:00
Hielke Morsink
20fb4501d0 Fix #7505: Crash when building path off map edge (#7587)
Validate map location before looping over the tile elements.
2018-06-01 11:30:41 +02:00
Michael Steenbeek
b573bd49b3 Replace all occurrences of tile_element_is_last_for_tile() 2018-05-24 11:44:53 +02:00
duncanspumpkin
fcb66b7449 Start refactoring pathfinding to use tileCoords 2018-05-05 11:42:34 +01:00
Hielke Morsink
2203d662c9 Add bench and bin usage to the peep class 2018-05-05 11:42:20 +01:00
duncanspumpkin
40a88dc178 Move staff functions to staff.cpp 2018-05-05 11:08:20 +01:00
duncanspumpkin
8d37502c7a Further use of SetState 2018-05-05 11:08:17 +01:00
duncanspumpkin
986b5a3f4d Fix rebase issues 2018-05-05 11:06:24 +01:00
duncanspumpkin
80006cd4a0 Continue 2018-05-05 11:04:50 +01:00
Michael Steenbeek
5f9d40be7a Replace tile_element_get_type() with struct method 2018-05-02 19:27:04 +02:00
oli414
3bff12c081 Seperate surface tile element 2018-05-01 16:33:16 +02:00
Hielke Morsink
30063984e6 Delete unused function arguments or mark them so (#7426)
This aims to make future refactoring easier. The arguments are removed where possible, but kept and marked with C++17's [[maybe_unused]] where they could not be removed (e.g. when they are used as a callback, rather than called directly).

I've skipped the rides/<category>/* and peep/* source files, because the rides source files are mostly generated and have a ton of unused variables, and the peep source files are being refactored.
I've also skipped most of window/* source files, because most of the functions are used as callbacks and will be bulk-renamed at some point.
2018-04-20 13:56:37 +02:00
Hielke Morsink
f661d48d90 Add tests for tile_element_wants_path_connection_towards 2018-04-17 20:43:49 +02:00
Hielke Morsink
99d8c83807 Fix #7402 Properly check for entrance location before disconnecting paths 2018-04-17 20:43:49 +02:00
Albert Morgese
a3b04a67b2 Implement #1675: Auto-rotate shops to face footpaths 2018-04-16 20:02:46 +02:00
Hielke Morsink
dc673a64d8 Give context the ownership of repositories and the object manager (#7340)
This makes them no longer a singleton, which fixes annoying behaviour when launching multiple contexts in one game session.
2018-04-10 13:19:23 +01:00
Michał Janiszewski
67f74119cf Fix missing headers 2018-03-20 00:27:58 +01:00
Michał Janiszewski
cd065d4f41 Reduce includes in common header 2018-03-20 00:27:58 +01:00
Michał Janiszewski
bb98618847 Fix compilation errors in Footpath.cpp 2018-03-18 10:19:17 +01:00
Michał Janiszewski
62000236a8 Add missing Guard.hpp header in Footpath.cpp 2018-03-18 10:19:17 +01:00
Hielke Morsink
f9307c8c9e Proplerly check for element to be removed
The element that gets removed is only a ghost while using the path tool, other tools just remove the path immediately.
2018-03-18 10:19:17 +01:00
Hielke Morsink
d0471bcbfd un-fill corners that were filled by the ghost
Old behaviour: connected edge and corners get removed.
New behaviour: connected edge may stay connected, but corners will be removed.
2018-03-18 10:19:17 +01:00
Hielke Morsink
16c575c115 Keep paths connected when wanted
A tile can have multiple connections to a path when building with clearance checks disables, but the function that removes the edges doesn't assume this. This PR makes it so that it first checks if there are no other tile elements that want to stay connected to a path before removing an edge.
2018-03-18 10:19:17 +01:00
Michael Steenbeek
5411c77358 Clean up more direct access to tile elements 2018-03-09 19:40:16 +01:00
Michael Steenbeek
1fa2fa8f80 Refactor ride->entrances and ride->exits 2018-03-07 19:10:50 +01:00
Aaron van Geffen
ba1d269227 Move all Virtual Floor code from Map to its own file. 2018-03-04 19:28:56 +01:00
ZehMatt
fdf7adecd9 Fix #7002: Always invalidate virtual floor regardless of selection. 2018-03-04 19:28:56 +01:00
Michael Steenbeek
2de6529cf5 Use big coordinates for PeepSpawn's Z coordinate 2018-02-21 09:50:07 +01:00
Michael Steenbeek
ea0566a3f5 Split PeepSpawn and rct12_peep_spawn 2018-02-21 09:50:07 +01:00
Michael Steenbeek
45e892e5b5 Allow passing BigCoordsXY into map_get_surface_element_at() 2018-02-15 22:26:50 +01:00
Hielke Morsink
55979a3fff Remove and replace C typedefs
`typedef struct/union/enum name { ... } name_again;` is not needed whe compiling C++, moving the name at the back to be in front of the object and removing `typedef` makes it usable the very same way.
This also replaces typedefs with the using keyword. They have better readability, especially for function pointer types, and would allow more flexibility when used with templates.
2018-02-14 09:42:26 +01:00
Ted John
7e01dcdaaf Remove legacy object list 2018-02-12 12:48:41 +00:00
Hielke Morsink
7fe50a481f Allow building queues from raised/lowered entrances
The original code assumes the entrance is at the exact same height as the
station, which is not always the case with hacked rides.
2018-02-06 19:09:51 +01:00
Michael Steenbeek
b78a744b8e Create footpath_get_edges() 2018-02-06 10:41:31 +01:00
Gymnasiast
5cc21fd21b Replace NULL with nullptr in C++ files 2018-01-29 21:33:21 +00:00
Michał Janiszewski
3ba0cc3dae Add missed constexprs 2018-01-14 16:13:37 +01:00
Michael Steenbeek
1787af8084 Fix #7003: Building sloped paths trough flat ones causes glitches 2018-01-11 16:30:11 +01:00
Michael Steenbeek
47a23603ae Remove unused functions 2018-01-11 13:25:09 +01:00
Michael Steenbeek
cd5a1ba888 Compile files in world folder as C++ 2018-01-11 13:25:09 +01:00