Commit Graph

303 Commits

Author SHA1 Message Date
Michael Steenbeek 83b4bcb068
Prepare tunnel door support 2018-05-10 09:39:33 +02:00
Michael Steenbeek 5f9d40be7a
Replace tile_element_get_type() with struct method 2018-05-02 19:27:04 +02:00
Michael Steenbeek b725916808 Use TitleCase 2018-05-02 13:27:53 +02:00
Michael Steenbeek ef433df26a Clean up tile element usage, introduce struct methods 2018-05-02 11:58:12 +02:00
oli414 c5fd9e67eb Seperate tile element from map 2018-05-01 17:47:00 +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
Duncan 0ab3d0955c
Merge pull request #7310 from OpenRCT2/json-objects
Add support for new JSON object format
2018-04-08 10:45:55 +01:00
Hielke Morsink 9f7d4f1bc4 Fix clipheight assuming tile order
Instead of breaking the loop when running into an element that's above the clip height, only skip it - the next element may still be below the clip height.
The check for the first tile could be removed entirely. The screen gets cleared every frame when the clip height flag is set already.
2018-03-27 22:17:58 +02:00
Ted John 7c05e22cd0 Refactor large scenery tile flags field 2018-03-26 21:37:23 +02:00
Michał Janiszewski cd065d4f41 Reduce includes in common header 2018-03-20 00:27:58 +01:00
Michał Janiszewski 28391eaf5d Move cstring out of common.h 2018-03-18 23:29:13 +01:00
Michał Janiszewski 4b323f401f Initialise dl in Surface.cpp 2018-03-14 22:11:30 +01:00
Michał Janiszewski 9b0fe5f09e Don't use registers struct where not strictly required
The only advantage of `struct registers` is the union hierarchy. If this
is not being actively exploited, it is detrimental to use this struct.
2018-03-14 22:11:30 +01:00
Gymnasiast 8e37ee26c9 Avoid warning spam during park entrance drawing 2018-03-13 20:48:16 +01:00
Michał Janiszewski afb0c48ebd Sink some arrays 2018-03-13 13:37:41 +01:00
Michał Janiszewski 764520076f
Reduce header inclusion
* Update includes in PlatformEnvironment.cpp

* Update includes in ParkImporter.h

* Update includes of OpenRCT2.h

* Update includes in Intro.h

* Remove unused include from Input.cpp

* Update includes of Imaging.h

* Update includes in Game.h

* Update includes in Editor.h

* Update includes of Context.cpp

* Update includes in Cheats.cpp, CmdlineSprite.cpp

* Update includes of some source files

* Update includes in some cpp files

* Update includes in some cpp files

* Update includes in TextureCache.h

* Fix tests

* Update includes in Font.cpp

* Update includes in LightFX files

* Update some includes

* Fix GCC builds

* Update some includes

* Update some includes

* Update includes in FontsFamilies.*

* Update includes of Console.h

* Improve includes in Window.h

* Improve headers in Viewport.h/Window.h

* Fix MSVC build

* Fix network-less builds

* Reduce inclusion of Map.h
2018-03-13 13:14:02 +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
Michael Steenbeek 2de6529cf5 Use big coordinates for PeepSpawn's Z coordinate 2018-02-21 09:50:07 +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 ab94ea74f4 More MSVC fixes 2018-02-15 22:26:50 +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 683ffcdadc
Merge pull request #7167 from IntelOrca/refactor/easy-new-object-types
Refactor things related to object types
2018-02-12 19:43:49 +00: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
Ted John 4d8fe051e8 Remove most usages of object_entry_groups 2018-02-12 12:48:41 +00:00
Gymnasiast 778ba466c5 Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Aaron van Geffen e3db8be68c Highlight full litter bins, too. 2018-02-05 00:20:12 +00:00
Aaron van Geffen f5db6dbde9 Replace constants with palette codes. 2018-02-05 00:20:12 +00:00
Aaron van Geffen ead49fa84e Name Unk141E9DC as WaterHeight. 2018-02-05 00:20:12 +00:00
Aaron van Geffen 0acf423031 Don't hide water when highlighting vandalism and vomit. 2018-02-05 00:20:12 +00:00
Richard Jenkins 95dfcea6bd Implement #4984: Add option to highlight vomit, litter and handymen 2018-02-05 00:20:12 +00:00
Michael Steenbeek 037b236d8f Add the RCT1 edge styles 2018-01-13 15:39:22 +01:00
ZehMatt 84f2917f59 Use const and constexpr whenever possible. 2018-01-11 22:29:08 +01:00
Michael Steenbeek cd5a1ba888 Compile files in world folder as C++ 2018-01-11 13:25:09 +01:00
Aaron van Geffen 1d7bec8a11 Make the virtual floor optional, on by default. 2018-01-11 10:37:40 +01:00
Michael Steenbeek a410872fec Move VirtualFloor.cpp to the paint folder and fix Xcode project 2018-01-11 10:37:40 +01:00
Aaron van Geffen c835832e79 Compile the virtual floor code as C++.
Add a proper header file for the virtual floor in the process.
2018-01-11 10:37:40 +01:00
Michał Janiszewski c031f6c5fa Don't reference virtual floor from testpaint 2018-01-11 10:37:40 +01:00
Jeroen D Stout 4354aae958 Correct the handling of edges 2018-01-11 10:37:40 +01:00
Jeroen D Stout e4b53dc68a Add more generic virtual floor tile check 2018-01-11 10:37:40 +01:00
Jeroen D Stout c8e63de802 Refactor tile property checks and code conventions 2018-01-11 10:37:40 +01:00
Jeroen D Stout 8e8dc89068 Improve floor visuals with glassy transparent surface 2018-01-11 10:37:40 +01:00
Jeroen D Stout b9faed7437 Mark being inside a piece of sloped terrain as being occupied 2018-01-11 10:37:40 +01:00
Jeroen D Stout cee9129601 Improve visual quality of virtual floor 2018-01-11 10:37:40 +01:00
Jeroen D Stout 58321ec2cd Fix underground check for sloped surfaces / clipping improvement 2018-01-11 10:37:40 +01:00
Jeroen D Stout 79fa16138a Move virtual_floor_paint to own file / add edge highlighting 2018-01-11 10:37:40 +01:00
Jeroen D Stout 128cff60db Add virtual floor painting functions. 2018-01-11 10:37:40 +01:00
Michał Janiszewski 469e142c7b Change casing of header files 2018-01-11 09:30:09 +01:00
Michał Janiszewski 5a8cfb16c8 Clang-format guards for static data
This guards most of the hardcoded data from clang-format.

[ci skip]
2018-01-11 09:19:56 +01:00
Ted John f18595a1c1 Refactor viewport.c to C++ 2018-01-07 12:39:58 +01:00
Ted John 630a5065db Refactor colour.c to C++ 2018-01-07 12:39:58 +01:00
Richard Jenkins c966faf9c2 Fix #6242: Scenery invalidated when there is no visual change 2018-01-06 19:20:39 +00:00
Michael Steenbeek 755add6c9a
Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
Ted John 3dcbebcf68 Refactor drawing.c to C++ 2018-01-05 22:57:57 +01:00
Ted John 0c3c998177 Refactor lightfx.c to C++ 2018-01-05 22:57:55 +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 347ff702d0 Refactor objects 2018-01-03 10:16:51 +01:00
Hielke Morsink 4459eb09b9 Fix invalid entries in surface boundries table 2017-12-30 13:55:39 +01:00
Hielke Morsink bcfd66cbc6 Use nullptr instead of 0 2017-12-21 23:47:30 +01:00
Hielke Morsink 628039dd8a Use range-based for loops in libopenrct2 2017-12-21 23:47:30 +01:00
Michael Steenbeek c4f44e5e7a Compile files in paint folder as C++ 2017-12-17 17:24:36 +01:00
Michael Steenbeek 1a9975d683 Compile util and cheats as C++ 2017-12-14 10:03:21 +01:00
ζeh Matt c84fd8edd2 Fix #6821: Edge sprites drawing is corrupted 2017-12-14 09:46:22 +01:00
ζeh Matt 8772d746ce Use index instead of memmove 2017-12-13 17:57:39 +01:00
Michael Steenbeek 9ea5302a2a Refactor access to some footpath stuff 2017-12-13 13:51:38 +01:00
ZehMatt 02128131e2 Refactor access to tile descriptor via reference. 2017-12-13 12:00:45 +01:00
ZehMatt 1d0750b2dd Refactor more variables to const type. 2017-12-13 12:00:45 +01:00
ZehMatt 07bd4f13be Unify some surface drawing functions. 2017-12-13 12:00:45 +01:00
ZehMatt 05137355fd Format Surface.cpp 2017-12-13 12:00:45 +01:00
ZehMatt 594c32b537 Refactor park boundary fences to use data tables. 2017-12-13 12:00:45 +01:00
ZehMatt 8814b15a85 Add sprite definitions for park boundary fences. 2017-12-13 12:00:45 +01:00
ZehMatt 6787e6ca04 Rename surface.c to Surface.cpp. 2017-12-13 12:00:45 +01:00
Michael Steenbeek 6dc49d643a Compile files in base dir as C++ 2017-12-13 08:03:48 +01:00
Michael Steenbeek 8951d1b332 Fix box and pole support naming 2017-12-10 13:59:02 +01:00
Michael Steenbeek 60d8865efb Compile game.c and game.h as C++ 2017-12-05 09:10:27 +01:00
Ted John 3de8e0d37e
Merge pull request #6772 from IntelOrca/remove-rct2-interop-2
Remove RCT2 interop
2017-12-04 20:10:35 +00:00
Michael Steenbeek 407f1ad148
Create scenery_small_entry_has_flag() 2017-12-04 20:09:38 +01:00
Ted John 99d7aaa2d6 Remove RCT2 interop 2017-12-04 19:04:06 +00:00
Michael Steenbeek 273edee634 Turn construction marker into a define 2017-12-04 11:26:53 +01:00
Aaron van Geffen c000263bbb Remove construction marker colour option. 2017-12-04 11:26:53 +01:00
Ted John f52544d607 Fix #6739: Park name isn't displayed
Fix wrong type, down cast introduced by mistake in 585fc1afce
2017-12-01 20:25:41 +00:00
Michał Janiszewski 585fc1afce
Ensure variables in switch are properly scoped 2017-11-26 23:14:40 +01:00
Michael Steenbeek c9ca5d55cd Rename incorrectly named flag 2017-11-24 11:44:57 +01:00
Ted John aff7609b86 Name remaining wall entry flags 2017-11-22 22:53:13 +00:00
Michael Steenbeek dd8464f907 Refactor small, large and wall scenery 2017-11-20 14:40:56 +01:00
Michael Steenbeek bf69b2e682 Make terminology use more consistent 2017-11-20 11:20:04 +01:00
platipo 789b47b7bb Refactor slope flags and path type flag 2017-11-18 12:58:27 +01:00
Michael Steenbeek bb483b0c5f Replace direct access to large scenery colour with helper functions 2017-11-17 22:54:54 +01:00
Enrico Paganin 27b420374e Refactor path flags 2017-11-17 17:03:57 +01:00
Michael Steenbeek 470c9993fa Fix calling wrong function 2017-11-17 13:10:58 +01:00
Michael Steenbeek 3bd68947b9 Create functions for getting large scenery type and sequence 2017-11-17 12:56:08 +01:00
Ted John f7c7a5bace Fix build 2017-11-16 19:11:10 +00:00
Jeroen D Stout afab2bd51f Change path bounding box when intersecting with track 2017-11-16 19:03:14 +00:00
Jeroen D Stout 3410330bb2 Add paint session memory for tracks and paths 2017-11-16 19:02:28 +00: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