Commit Graph

205 Commits

Author SHA1 Message Date
Michael Steenbeek 86a79e742f
Use RideTypeDescriptor for available track pieces 2020-02-22 20:13:44 +01:00
Matt c381d9ff3f
Remove obsolete construction of CoordsXY object 2020-02-13 12:11:20 +01:00
duncanspumpkin a5ef8d6240 Rename rct_vehicle 2020-01-19 17:14:56 +00:00
Gymnasiast 62fcbb07ca
Rename methods to GetBaseZ/GetClearanceZ 2019-12-23 20:08:37 +01:00
Gymnasiast 85ecb52e7c
Manually replace more Z occurrences 2019-12-23 20:05:26 +01:00
Sijmen Schoon ab2dbea32a
Change a sizable portion of LocationXY(Z) to (Tile)CoordsXY(Z) 2019-10-31 00:19:14 +01:00
Ted John 9954f0b725
Add nullptr checks for more instances of get_ride (#9819) 2019-08-09 14:20:59 +01:00
Ted John ab7b17fc4e
Add nullptr checks for get_ride in libopenrct2 (#9788) 2019-08-08 22:58:56 +01:00
Gymnasiast b65e243486 Fix #9398: Observation tower vehicle is coloured incorrectly 2019-06-10 22:51:23 +02:00
Ted John 5c8aa743f6 Implement ghost drawing for special vehicles 2019-05-28 16:50:08 +01:00
Matt 37c3809744 Implement partial multicore rendering 2019-03-31 15:50:55 +02:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Ted John cdec457abd Refactor peep struct 2019-02-28 20:28:58 +01:00
Xkeeper 2828cbb2fc
Fix crash in FerrisWheel paint
[OpenRCT2/OpenRCT2#8662]
2019-02-05 11:14:17 -08:00
Xkeeper 2bb8813c41
Fix crash in paint_haunted_house_structure
[OpenRCT2/OpenRCT2#8662]
2019-02-05 11:01:23 -08:00
Ted John 8701286772
Use new ride_id_t typedef (#8561) 2019-01-12 10:11:55 +00:00
Hielke Morsink 53ae48ffca
Merge pull request #8550 from janisozaur/fallthroughs
Fix implicit fallthroughs
2019-01-04 23:27:02 +01:00
Hielke Morsink 5ef5e4153d Fix some more implicit and conditional fallthroughs 2019-01-04 22:26:56 +01:00
Ted John 38f632074b Merge ride track colour arrays into one 2019-01-01 21:25:34 +00:00
Ted John 8e6497fc1d Merge vehicle_colours and vehicle_colours_extended 2018-12-31 19:25:07 +00:00
Ted John 06f203a7e7 Implement surfaces, edges and stations as objects 2018-12-09 23:30:40 +00:00
Matt 468d94a6ca Remove gCurrentViewportFlags 2018-12-05 23:09:17 +01:00
Hielke Morsink 354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
Michael Steenbeek f8add7f62e
Rename rct_tile_element to TileElement 2018-11-01 13:53:50 +01:00
Michael Steenbeek 3f17782692 Move direct access to maze entry to struct methods 2018-09-25 21:57:21 +02:00
Michael Steenbeek a3e9c63fc3 Move GetRideIndex to struct methods 2018-09-25 21:57:21 +02:00
Michael Steenbeek 74ccf010e6 Port surface elements to new structure 2018-09-16 21:34:51 +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 ca6fda5724 clang-format generated ride files 2018-07-23 16:00:08 +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
Michał Janiszewski 1d28826b79 Fix -Wdocumentation and add it to default warnings 2018-06-11 09:52:54 +02:00
Hielke Morsink de3cab59bb Fix warnings reported by travis 2018-06-05 16:07:54 +02:00
Ted John 92f6ac7333 Rename header files to match renamed source files 2018-06-01 09:38:30 +02:00
Michael Steenbeek b573bd49b3 Replace all occurrences of tile_element_is_last_for_tile() 2018-05-24 11:44:53 +02:00
ζeh Matt ee56021067 Minor code cleanup. (#7538) 2018-05-18 22:50:57 +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
Michał Janiszewski cd065d4f41 Reduce includes in common header 2018-03-20 00:27:58 +01:00
Michał Janiszewski 32619f460b Remove remaining calls to get_current_rotation in paint code 2018-02-17 13:11:07 +01:00
Michał Janiszewski acccd0a2c8 Remove rotation argument from sub_98199C 2018-02-17 13:11:07 +01:00
Michał Janiszewski 3f92471ffb Remove rotation argument from sub_98197C 2018-02-17 13:11:07 +01:00
Michał Janiszewski c420fb56f5 Remove rotation argument from sub_98196C 2018-02-17 13:11:07 +01:00
Michael Steenbeek bde913ee16 Rename SmallCoords and BigCoords 2018-02-15 22:26:50 +01:00
Michael Steenbeek a2af371de9 Replace LocationXYZ8 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
Michał Janiszewski 3f76bd214f Const all the painted tile elements
Extracted from https://github.com/OpenRCT2/OpenRCT2/pull/7036
2018-02-12 16:03:20 +01:00
duncanspumpkin 5401e69b50 Name vehicle animation offsets 2018-01-30 12:53:50 +00:00
Michał Janiszewski 3ba0cc3dae Add missed constexprs 2018-01-14 16:13:37 +01:00
ZehMatt 84f2917f59 Use const and constexpr whenever possible. 2018-01-11 22:29:08 +01:00
Michał Janiszewski 469e142c7b Change casing of header files 2018-01-11 09:30:09 +01:00
Ted John f18595a1c1 Refactor viewport.c to C++ 2018-01-07 12:39:58 +01:00
Michał Janiszewski b2bc974fe7
Use nullptr where possible 2018-01-04 06:58:44 +01:00
Michael Steenbeek 91589f57c6 Compile map.c as C++ 2018-01-03 20:40:51 +01:00
Hielke Morsink eb4a8924d1 Refactor and clean up footpath-related code
This commit corrects some misused defines, and gave them clearer names.
For example, the slope mask was only useful for surface elements, so now
"SURFACE" is in its name. I also replaced any hard coded values that I
could find and knew their purpose off.
2018-01-03 10:57:37 +01:00
Michael Steenbeek c4f44e5e7a Compile files in paint folder as C++ 2017-12-17 17:24:36 +01:00
platipo 789b47b7bb Refactor slope flags and path type flag 2017-11-18 12:58:27 +01:00
Enrico Paganin 8ffe7d5b43 Refactor maze flags 2017-11-17 17:03:57 +01:00
Michael Steenbeek ab3f42f1f9 Add getters and setters for ride index and maze entry 2017-11-17 12:54:47 +01:00
Christian F. Coors 06afeeda9a Apply some refactoring 2017-11-02 12:22:28 +01:00
Michael Steenbeek af845beb61 Replace mapElement with tileElement 2017-10-31 19:59:06 +01:00
Michael Steenbeek ce8d9cc71b Rename map_element to tile_element 2017-10-31 19:59:06 +01:00
Michał Janiszewski 75685fa75d Fix #3781: Glitchy map causing crash 2017-10-30 12:03:34 +01:00
Michał Janiszewski 90a14205c8 Compile track_data.c as C++ 2017-10-25 23:53:47 +02:00
Michael Steenbeek bb01699b7d Compile track.c as C++ 2017-10-17 13:51:47 +02:00
Michael Steenbeek 7f9c25a7a9 Use constant for LOCATION_NULL, split off location stuff to Location.h 2017-10-13 22:23:07 +02:00
Michael Steenbeek 3a9dc3f491 Ensure that get_ride_entry returns NULL on invalid ride entries 2017-10-12 21:07:35 +02:00
Michał Janiszewski c4538496c5 Make sure variables are either static or declared externally 2017-10-09 22:59:40 +02:00
Michael Steenbeek e25d6b807d Fix refactor error in MiniGolf.cpp 2017-10-09 15:33:34 +02:00
Michael Steenbeek 2fd4d39456 Fix compilation in Visual Studio 2017-10-09 15:24:51 +02:00
Michał Janiszewski 7bdcc3345f Rename files to C++ convention 2017-10-09 15:24:22 +02:00
Michał Janiszewski a9dafef0f4 Apply C++ formatting 2017-10-09 15:24:21 +02:00
Michał Janiszewski a8c8f726ee Compile ride drawing code as C++ 2017-10-09 15:24:20 +02:00
Ted John 3a9cafd2f0 Remove gTrackColours macro (#6266) 2017-09-12 19:48:18 +01:00
Gymnasiast a28509e24c Split Ride and rct2_ride 2017-09-12 11:16:57 +02:00
Ted John 43c6f7fda0 Pass paint session to ps functions 2017-09-03 02:27:07 +01:00
Ted John f2b8cf181e Pass paint session to remaining support functions 2017-09-03 01:56:56 +01:00
Ted John 1cc82d1cb5 Pass paint session to tunnel functions 2017-09-03 01:51:59 +01:00
Ted John 972a3bf111 Pass paint session to track_paint helpers 2017-09-03 01:42:08 +01:00
Ted John dce007feaa Pass paint session to support functions 2017-09-03 01:04:23 +01:00
Ted John 0f9784a423 Pass paint session to many specific track helpers 2017-09-03 00:34:33 +01:00
Ted John 90f4478f48 Pass paint session to all track functions 2017-09-03 00:19:17 +01:00
Ted John 2980be0667 Pass paint session to more ps functions 2017-09-02 23:22:19 +01:00
Ted John 6a9cd63874 Pass paint session to some vehicle paint functions 2017-09-02 23:05:58 +01:00
Ted John a0f5f1243f Remove more map element paint globals 2017-09-02 17:11:59 +01:00
Ted John eb7b1e7b7e Remove global, gPaintMapPosition 2017-09-02 17:11:59 +01:00
Ted John 5730a36555 Simplify gPaintMapPosition to rct_xy16 2017-09-02 17:11:59 +01:00
Ted John 1d04f334e3 Change more paint globals to use gPaintSession 2017-09-02 17:11:58 +01:00
Philip Goto 6547116401 Fix #6193: All rings in Space Rings use the same secondary colour (#6194)
The Space Rings attraction used the secondary colour of the first ring no matter if the colours are set to all the same or different per ring. Now it uses the right colour for each ring.
2017-08-17 20:06:08 +02:00
Michael Steenbeek 367efa2020 Use remap flags, SPRITE_ID_PALETTE_COLOUR_1 and _2 in many more places 2017-07-20 20:56:29 +02:00
Michael Steenbeek bb09019d9b Name and fix vehicle entry and tertiary colour flags 2017-07-20 12:57:37 +02:00
Michael Steenbeek 7a4e7e17a1 Fix incorrect terminology 2017-07-18 18:07:43 +02:00
Michael Steenbeek 44af1653a6 Replace 'center' with 'centre' (#5745) 2017-06-30 23:11:28 +01:00
Gymnasiast 0db5bc6bd2 Define max vehicles per ride entry, use SPRITE_INDEX_NULL more 2017-06-20 13:38:23 +02:00
Michał Janiszewski 61d38511bc Expand tabs to spaces
This commit expands tabs to spaces (ts=4) in all the files under src/
and test/.

Until now we had two wildly different code styles with C using tabs and
new C++ using spaces. It is painful to maintain as none of the commonly
used tools support this kind of setup and in reality is needless, as we
can simply convert all the sources to spaces and have opened PRs do the
same, where needed.

Additionally, trailing whitespace has been removed.
2017-06-06 23:46:14 +02:00
rwjuk 325bb3e2da Name sub_88ABA4() 2017-06-06 01:16:44 +01:00
Michał Janiszewski 79d76759bb Fix #5516: Update copyrights for 2017
Not all files were necessarily _changed_, but all were touched, see
https://github.com/OpenRCT2/OpenRCT2/pull/4932
2017-06-01 21:55:10 +02:00
CraigCraig 26287f5a3e More readability, grammar, spelling fixes 2017-05-15 09:28:43 +02:00
Ted John fb2c835d52 Include new config header 2017-02-18 15:45:10 +00:00
Michael Steenbeek cad39c788a Remove more magic values from metal_a_supports_paint_setup 2017-02-02 21:54:19 +01:00
Broxzier 60603ae10a Use types from common.h 2017-01-14 12:37:31 +01:00
Ted John b79af110c7 Fix more warnings 2017-01-12 18:02:28 +00:00
Michael Steenbeek 92feea1612 Clean up metal supports 2017-01-11 20:23:47 +01:00
Ted John 25bc798ff8 Move contents of src into project sub directory 2017-01-04 17:44:12 +00:00