Commit Graph

576 Commits

Author SHA1 Message Date
Tulio Leao 2ddde8a344 Simplify attach calculation on Paint.cpp 2019-12-09 17:19:45 -03:00
Tulio Leao 5b43f19708 Use CoordsXY for Paint rotations 2019-12-04 23:08:26 -03:00
ζeh Matt ab5be44ccb Fix #10325: Crash when banners have no text (#10327)
* Fix #10325: Crash when banners have no text

* Update changelog.txt
2019-12-04 11:22:07 +01:00
Tulio Leao 2acdc577f7 Use Coords for windows/RideConstruction 2019-11-18 19:17:54 -03:00
Sijmen Schoon f7fd98fcf2
Add constexpr keywords 2019-11-01 02:07:14 +01:00
Sijmen Schoon 3f3baa2b13
Revert changing constructor lists to constructors 2019-10-31 16:10: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
Matt 6dbbc86ee1
Allow rendering of ducks with zoom level 1 2019-10-20 00:21:19 +02:00
Tulio Leao b793d7e79a Avoid dereferencing map_get_first_element_at nullptr on libopenrct2 (#10013)
* Avoid dereferencing map_get_first_element_at nullptr on Map.cpp

* Avoid dereferencing map_get_first_element_at nullptr on MapAnimation.cpp

Returning true or internal control variable, based on what was seen on `map_animation_invalidate_track_onridephoto`

* Avoid dereferencing map_get_first_element_at nullptr on Park.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Scenery.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Sprite.cpp

* Avoid dereferencing map_get_first_element_at nullptr on TileInspector.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Wall.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Fountain.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Footpath.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Entrance.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Banner.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Vehicle.cpp

* Avoid dereferencing map_get_first_element_at nullptr on TrackDesignSave.cpp

* Avoid dereferencing map_get_first_element_at nullptr on TrackDesign.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Track.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Station.cpp

* Avoid dereferencing map_get_first_element_at nullptr on RideRatings.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Ride.cpp

* Avoid dereferencing map_get_first_element_at nullptr on S4Importer.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Staff.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Peep.cpp

* Avoid dereferencing map_get_first_element_at nullptr on GuestPathfinding.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Guest.cpp

* Avoid dereferencing map_get_first_element_at nullptr on VirtualFloor.cpp

* Avoid dereferencing map_get_first_element_at nullptr on Paint.TileElement.cpp

* Fix issues raised on review

* Fix remaining review issues.

* Early exit on loops if tileElement is nullptr

* Fix clang-format issues
2019-10-09 15:02:21 +01:00
Richard Fine 5ff78e48c7 Reduce usage of GetDirectionWithOffset()
GetDirectionWithOffset(2) is the same thing as 'direction_reverse(GetDirection())', and the latter is more readable.
2019-09-01 18:40:08 +01:00
Gymnasiast f12eb3010f
Fix display of G2 characters; remove some unused sprite IDs 2019-09-01 11:12:09 +02:00
duncanspumpkin f39905bd2e Clang format 2019-08-19 20:04:59 +01:00
duncanspumpkin 37de01a10d Replace coordiante_3d_to_2d with CoordsXYZ equivelent 2019-08-19 20:04:58 +01:00
duncanspumpkin bc12618d46 Clang format 2019-08-19 20:04:57 +01:00
duncanspumpkin c6452095ca Refactor tile_element_height to use CoordsXY 2019-08-19 20:04:57 +01:00
duncanspumpkin 5333dc4295 Return a SurfaceElement from get_surface_element 2019-08-19 20:04:56 +01:00
duncanspumpkin 9619fd384d Refactor map_is_location_owned to use CoordsXYZ 2019-08-19 20:04:56 +01:00
Ted John 53f228fc33 Fix #9769: NRE in sub_6A4101 2019-08-08 12:45:17 +01:00
Ted John 2cfad1fc66 Fix #9764: NRE in ride_entrance_exit_paint 2019-08-08 12:37:53 +01:00
Ted John b7121553b4 Fix #9715: large scenery banners have incorrect colour and scrolling (#9716) 2019-08-02 21:18:42 +02:00
Ted John 1f9f48e054 Fix flickering banners 2019-07-29 21:41:21 +01:00
Ted John 7ce2f38c92 Fix formatting 2019-07-29 20:01:49 +01:00
Ted John 61d64ab8c5 Do not use user strings for banners 2019-07-29 19:18:16 +01:00
Ted John 6fff2079f9 Refactor ride name to dynamic args and std::string 2019-07-29 19:18:16 +01:00
Ted John 0b4d989a67 Rename get_banner to GetBanner 2019-07-26 17:24:19 +01:00
Ted John 5c07c53faf Refactor get banner 2019-07-25 22:21:19 +01:00
Ted John 85543bd1c8 Separate RCT2 and OpenRCT2 banner struct 2019-07-25 22:21:19 +01:00
Ted John 5733d666b3 Do not store park name as a user string 2019-07-21 11:33:15 +02:00
Jim Armstrong 9c976daa51 Refactor #9474: Refactor jumping fountain code (#9475)
* Refactor jumping_fountain_update to Update

* Refactor jumping_fountain_get_type to GetType

* Refactor jumping_fountain_continue to Continue

Fix typos and misc refactoring

* Refactor begin and create functions into static member functions

Move jumping_fountain_begin and jumping_fountain_create into the rct_jumping_fountain struct and make them static

* Refactor remaining fountain functionality into member functions

* Rename JumpingFountain struct and move to proper header file

JumpingFountain code was refactored to conform to variable naming conventions and moved into the Fountain.h file.

rct_sprite_generic struct was moved to SpriteBase.h - this was done to get around a circular header dependency between Fountain.h and Sprite.h

* Set access modifier for private functions

* Change JumpingFountain variable names to TitleCase

* Refactor #9474: Clarify where auto is being used with pointers

* Refactor #9474: Change function names for clarity

* Refactor #9474: Fix incorrect function names
2019-07-11 20:38:30 +01:00
Hielke Morsink 6b7fee86bb Don't clear the screen to black for giant screenshots
When certain viewport flags were set (underground view, hide base land,
hide vetical faces, clip view), the viewport would always be cleared,
including for giant screenshots.
2019-06-16 16:42:21 +02:00
aw20368 9effe21dd0 Fix #8602: Wall piece collision detection deviates from vanilla (#9414)
Wall piece collision used the base height of the wall. Changed to use the clearance height.
2019-06-13 20:03:53 +02:00
Duncan e5972f8a67
Fix #9401, Fix #9387. Check for tile element before deref. (#9409)
This fixes two crashes that can occur when surface elements are deleted. For normal play you should never delete a surface element as the game expects there to be a surface element on all usable terrain.
2019-06-12 21:16:40 +01:00
Hielke Morsink bffc012d16 Implement #1260: --transparent switch for screenshot command 2019-06-09 11:03:00 +02:00
Duncan 993709c087
Merge pull request #9321 from aw20368/fix/8723-use-rotate_map_coordinates
Fix #8723 Use rotate_map_coordinates to rotate coordinate
2019-06-08 07:52:52 +01:00
aw20368 e0cf476398 Fix #8723 Use rotate_map_coordinates to rotate coordinate
Added Rotate to CoordsXY, TileCoordsXY and used them to replace redundant rotation code.
2019-06-06 08:21:40 -04:00
aw20368 3823befa10 Fix #7323 Tunnel entrances not rendering in 'highlight path issues' (#9339)
Hiding path scenery caused function that draws tunnel to prematurely return. Changed to only skip drawing scenery.
2019-06-04 20:34:39 +02:00
Ted John c4e18e570e Add and implement simulation mode for rides 2019-05-28 16:50:08 +01:00
aw20368 8c20b635bd Fix #9270: Refactor money effect
Changed static functions to rct_money_effect member functions. GetStringId now returns std::pair.
2019-05-21 21:22:47 +02:00
Gymnasiast 170307cd0f Remove redundant semicolons after for loops 2019-05-13 22:16:30 +02:00
Ted John 15cb3e1889 Remove unnecessary new line characters from log calls (#9237) 2019-05-12 13:48:56 +02:00
Filip Gawin 6833da77e3 Simplify boolean expresions 2019-05-10 22:00:38 +02:00
Xkeeper 51593c540a Fix ride entrance hut banner issue
This fixes the problem where the ride entrance hut
banner would show a nonsense number after auto-named
rides based on the amount the text had scrolled.
2019-05-01 23:59:09 +02:00
Xkeeper 100ee139f5 Update code style with clang-format 2019-05-01 23:59:09 +02:00
Xkeeper c6a4316bd4 Update banner formatting code/strings
Changes some things to use STR_BANNER_TEXT_FORMAT and removes
instances of " - - " attached to other strings in the
localization files.

This can be used in the future to show the messages on
a sign or banner via a tooltip without having to
duplicate those messages without " - - ".
2019-05-01 23:57:07 +02:00
Nicole d38fb6a7a2 Fix #8800: ensure tile_element_height is used correctly (#9087)
* Changed calls to tile_element_height to tile_element_water_height

* Changes to calls to tile_element_height

* Removed tile element_height, map_get_highest_land_height, and map_get lowest_land_height

3 functions removed due to relocation.

* Added function tile_element_height back to map.cpp

Added tile_element height back to map.cpp. Was unnecessarily deleted.

* Update Map.h

* water_height changes

* Update Scenario.cpp

* Update Scenario.cpp

* Fix 8800: applied clang format

* Removed unnecessary ANDs
2019-04-23 18:26:48 +01:00
Michael Steenbeek 42a1a8704d
Use empty() for vectors; clean up bool comparisons (#9118) 2019-04-20 20:39:47 +02:00
duncanspumpkin 30a5194085 Use a vector for map selection tiles 2019-04-04 19:23:44 +01:00
Matt c520b0061e Refactor large_scenery_sign_fit_text to not return static local. 2019-04-02 20:14:50 +02:00
Matt 4b1e7c3dd2 Remove _unk9E32BC from global scope and make it local 2019-03-31 17:15:15 +02:00
Matt 383ded68e9 Cleanup 2019-03-31 15:50:55 +02:00
Matt 65ef018e4e Move paint_session_alloc and paint_session_free into Painter. 2019-03-31 15:50:55 +02:00
Matt db96df010f Expose Painter in Context 2019-03-31 15:50:55 +02: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
Michael Steenbeek 6884eac24c
Turn railing support type into enum class 2019-03-16 14:21:44 +01:00
Michael Steenbeek 602821a389
Split path surface objects into paths and queues 2019-03-16 12:37:32 +01:00
Ted John cdec457abd Refactor peep struct 2019-02-28 20:28:58 +01:00
duncanspumpkin 9d78bb0d4e Fix compile and formating 2019-02-27 10:54:08 +00:00
duncanspumpkin fae15fceca Use IsBroken 2019-02-27 10:49:48 +00:00
duncanspumpkin 6495ffdb34 Use IsBlockedByVehicle 2019-02-27 10:49:48 +00:00
duncanspumpkin 112b40910b Pass a bool to the set function. Make review changes 2019-02-25 20:44:12 +00:00
duncanspumpkin 737c308e4e Use IsGhost() to access ghost state
Added set and clear ghost to further prevent direct access to flags
2019-02-25 15:12:35 +00:00
Michael Steenbeek 2a4215a30f
Create constant for SCROLLING_MODE_NONE 2019-02-14 22:41:48 +01:00
Michael Steenbeek 4e9d2ce764
Split footpath object into two internally 2019-01-20 21:38:38 +01:00
Gymnasiast cd8227c756 Clean up magic numbers in footpath corner drawing 2019-01-20 17:54:30 +01:00
Gymnasiast d000457fb5 Rename more occurrences to railingEntry 2019-01-20 17:23:27 +01:00
Gymnasiast ad2698df0d Move 'should draw path over supports' to tile element 2019-01-20 17:23:27 +01:00
Gymnasiast 1f6d4caf7c Rename some variables 2019-01-20 17:23:27 +01:00
Gymnasiast 2f0b6a9652 Rename FOOTPATH_ENTRY_FLAG_HAS_PATH_BASE_SPRITE 2019-01-20 17:23:27 +01:00
Gymnasiast 73e25399d3 Rename footpathEntry to railingEntry where appropriate 2019-01-20 17:23:27 +01:00
Gymnasiast 9da5b5d513 Rename path_paint_{box,pole}_support parameter 2019-01-20 17:23:27 +01:00
Michael Steenbeek 6ef01b3cd3
Name some path drawing variables 2019-01-18 20:35:43 +01:00
Richard Fine e90e9dd73f Introduce many uses of direction_reverse
Change many of the places doing the ^2 trick to use direction_reverse instead, for improved readability.
2019-01-05 15:41:46 +00:00
ζeh Matt 20496b0390
Merge pull request #8545 from richard-fine/use-enum-types
Use of enum types in Peep code
2019-01-04 10:57:56 +01:00
Michael Steenbeek 31298bd772
Merge pull request #8543 from IntelOrca/refactor-ride
Refactor ride structure
2019-01-02 22:38:20 +01:00
Michael Steenbeek b5317ee9e9
Split drawing of path and railing 2019-01-02 19:52:53 +01:00
Richard Fine 60396c6658 Rename enums to modern style
Change various PEEP_ENUM_TYPE names to PeepEnumType names, to match the more modern coding standard.
2019-01-02 14:10:05 +00:00
Richard Fine a5e896f0c3 Use PEEP_ACTION_SPRITE_TYPE in the peep drawing code 2019-01-01 23:07:13 +00:00
Ted John 38f632074b Merge ride track colour arrays into one 2019-01-01 21:25:34 +00:00
Matt c7ab757a86 Cleanup. 2018-12-29 23:06:15 +01:00
Matt b6c2dca849 Adjust replay notification position. 2018-12-29 19:23:27 +01:00
Matt 624427259b Draw text notice if replay system is active. 2018-12-29 19:23:27 +01:00
ζeh Matt 7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01: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
Matt adb4aa69a6 Rename UnkF1AD28 to LastRootPS 2018-12-05 23:08:43 +01:00
Matt aa8b8d8415 Remove unused member in paint_session. 2018-12-05 23:08:43 +01:00
ζeh Matt 940fff4bbf Fix dereferencing nullptr when game objects are missing. (#8360) 2018-12-05 22:59:15 +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 5f4cca3c7e Remove rest of access to footpath edges 2018-10-31 15:08:06 +01:00
Michael Steenbeek d89c3d9e67 Replace calls to get path edges
This replaces most calls/direct access to the footpath edges (i.e. the orthogonal directions, not the corners). This includes places where the whole byte was retrieved, but only compared against orthogonal directions.
2018-10-31 15:08:06 +01:00
Michael Steenbeek af2c1e69d1 Remove residual access to path addition_status field 2018-10-31 13:10:07 +01:00
Michael Steenbeek 853e4c4a6a Remove residual access to path ride_index field 2018-10-31 13:09:53 +01:00
Michael Steenbeek 66cde65f87 Replace C style function for getting slope direction 2018-10-31 13:09:19 +01:00
ζeh Matt 3e457436b1 Refactor some painting code. (#8144) 2018-10-26 10:49:27 -07:00
Gymnasiast a6885ea464 Replace C-style functions for getting direction 2018-10-04 14:54:12 +02:00
Gymnasiast 015ece94c6 Replace C-style functions for getting path entries 2018-10-04 12:13:17 +02:00
Gymnasiast ecd6247462 Replace C-style functions for checking getting path additions 2018-10-04 12:13:17 +02:00
Gymnasiast ee05438953 Replace C-style functions for checking path addition ghost status 2018-10-04 12:13:17 +02:00
Gymnasiast e159ac65a6 Replace C-style functions for IsWide() and SetWide() 2018-10-04 12:13:17 +02:00
Gymnasiast f9f233dbb1 Replace C-style function for HasQueueBanner() 2018-10-04 12:13:17 +02:00
Gymnasiast 37f59e17dc Replace C-style isSloped() function 2018-10-04 12:13:17 +02:00
Michael Steenbeek 882a65e4c0 Port queue functions 2018-10-03 12:18:21 +02:00
Michael Steenbeek 3b7fc4cf8c Port rest of banner functions 2018-09-27 22:15:04 +02:00
Michael Steenbeek d01b21a1ac Port banner index 2018-09-27 22:15:04 +02:00
Michael Steenbeek 995c6debf1 Port entrance path type lookup 2018-09-27 22:15:04 +02:00
Michael Steenbeek 3c93aca727 Port entrance station index and sequence lookup 2018-09-27 22:15:04 +02:00
Michael Steenbeek c7eaa1ba80 Port entrance ride index lookup 2018-09-27 22:15:04 +02:00
Michael Steenbeek cc7f8e612d Port entrance type lookup 2018-09-27 22:15:04 +02:00
Michael Steenbeek 75b5c45a97 Remove residual direct access to most track fields 2018-09-25 21:57:21 +02:00
Michael Steenbeek 6062960390 Port remaining wall stuff to struct methods 2018-09-17 15:42:34 +02:00
Michael Steenbeek 508276b081 Remove lots of direct access to ->type fields 2018-09-17 15:18:07 +02:00
Michael Steenbeek 345e03d41b Move animation frame and rct1 wall functions to methods 2018-09-17 14:48:27 +02:00
Michael Steenbeek dcabdeb805 Move wall colour functions over to the struct methods 2018-09-17 14:22:17 +02:00
Michael Steenbeek 66f9e9d646 Properly reset surface objects 2018-09-17 13:17:47 +02:00
Gymnasiast 0f08128657 Fix formatting 2018-09-16 21:34:51 +02:00
Michael Steenbeek 74ccf010e6 Port surface elements to new structure 2018-09-16 21:34:51 +02:00
Michael Steenbeek 35b4724626 Port large scenery to new structure 2018-09-16 21:34:50 +02:00
Michael Steenbeek 1d3baef9b7 Remove some C-style tile element functions 2018-09-16 21:34:04 +02:00
Michael Steenbeek 0e998c2d78
Merge pull request #7988 from Gymnasiast/tile-element-makeover
Change tile elements to use the OpenLoco structure
2018-09-14 10:56:19 +02:00
Gymnasiast 865a497115 Fix formatting 2018-09-13 20:14:44 +02:00
Michael Steenbeek a31176b7e7 Remove remnants of old small scenery code 2018-09-13 18:12:20 +02:00
Michael Steenbeek b5bb4c7fb9 Do not access old small scenery age field 2018-09-13 17:26:36 +02:00
Michael Steenbeek e9993f78de Replace read access of small scenery entry index 2018-09-13 17:02:38 +02:00
Michael Steenbeek a02d360df6 Change TileElement to use OpenLoco's structure 2018-09-13 15:36:32 +02:00
Matt a89b352fb2 Rename rct_sprite::unknown to rct_sprite::generic 2018-08-20 18:27:40 +02:00
Gymnasiast 6fc86d5766 Fix #7872: CJK tooltips are often cut off 2018-08-13 21:41:10 +02:00
Linus Unnebäck fd07be587a
Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01:00
ζeh Matt e87e9f1b2e Update virtual floor to better indicate blocked areas (#7837) 2018-08-07 15:39:52 +02:00
clang-format d787872cbe Indent preprocessor directives 2018-07-23 16:00:23 +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
Hielke Morsink fdc6e52da1 Correct formatting in files from network to paint 2018-07-23 16:00:15 +02:00
clang-format 191973b202 clang-format paint 2018-07-23 16:00:06 +02:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Michael Steenbeek ec3a1e575e
Replace Math::Min and Max with std variants 2018-06-20 17:11:35 +02:00
Hielke Morsink 14d6625c15
Merge pull request #7695 from Broxzier/wide-path-debug
Add debug option to visualize wide path flags.
2018-06-15 17:07:50 +02:00
Hielke Morsink 0fda25d365 Add debug option to visualize wide path flags.
This implements #7694
2018-06-15 16:08:25 +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
Hielke Morsink 7355b497a1 Use new banner index type
BannerIndex is defined in common.h (like some other types such as money32 and rct_string_id), so that banner.h wouldn't have to be includede everywhere. Later on, it may be nicer to have a custom types file instead of putting them all in common.h.
2018-06-11 13:29:41 +02:00
Hielke Morsink ead97a4638 Split colour into union with ride index
The colour field in the banner object is also used to store the ride index when a banner is linked to a ride. This commit turns this field into a union with both named fields, to make the code clearer.

It also changes the return types of related functions to uint8 instead of sint32, and makes use of the RIDE_ID_NULL define where applicable.
2018-06-11 13:21:48 +02:00
Michał Janiszewski bcd4e9c50b
Merge pull request #6284 from janisozaur/compiler-warnings
Compiler warnings
2018-06-11 11:06:34 +02:00
Ted John b043428cf0
Merge pull request #6998 from JeroenDStout/railway-crossings-wait
Railway crossing behaviour for peeps and vehicles
2018-06-11 09:09:07 +01:00
Michał Janiszewski 1d28826b79 Fix -Wdocumentation and add it to default warnings 2018-06-11 09:52:54 +02:00
Ted John e38f4df575 [wip] Move themes to libopenrct2ui 2018-06-10 23:34:12 +01:00
Ted John d1d9f0a86a Add debug drawing option for blocked tiles
Replace old unused original drawing code toggle options with new option to show which tiles are blocked by vehicles.
2018-06-10 22:59:58 +01:00
Jeroen D Stout 1f7dbe1178 Debug-show tiles which are blocked by vehicles as coloured 2018-06-10 22:59:58 +01:00
Hielke Morsink 204dd4439b Mark unused arguments in the libopenrct2 project
For dummy classes and functions with empty bodies I've only commented out the arguments, for all others I used C++17's [[maybe_unused]].
2018-06-06 21:03:11 +02:00
Hielke Morsink de3cab59bb Fix warnings reported by travis 2018-06-05 16:07:54 +02:00
Hielke Morsink 5d0022a5cb Remove argument list from zero-initializers with zero/false/nullptr value 2018-06-04 19:50:46 +02:00
Michał Janiszewski 58bde442dd
Fix headers to ensure they carry all their dependencies (#7610) 2018-06-02 09:46:14 +02:00
Ted John 92f6ac7333 Rename header files to match renamed source files 2018-06-01 09:38:30 +02:00
Ted John b3c17b215f Use single output folder for msbuild obj files
This requires unique named source files within a project.
2018-06-01 09:37:49 +02:00
Aaron van Geffen bf44007197 Allow fine-tuning the virtual floor style (#7577)
The virtual floor by @JeroenDStout, introduced in the v0.1.2 release, has generally been well-received. However, some players find it too intrusive in its current appearance (cf. #7221). This PR gives them the option of a toned-down version, rather than having to turn it off completely.

![screenshot_20180528_221350](https://user-images.githubusercontent.com/604665/40628292-6e71358e-62c4-11e8-9293-e166e75d0da6.png)

The clear/transparent style, introduced by this PR, looks like the virtual floor as originally introduced in #6338:
![](https://user-images.githubusercontent.com/14242454/31050274-e3f0e62e-a645-11e7-9b10-ec26b733d631.gif)

The glassy/translucent style is the virtual floor as we've come to know it since the v0.1.2 release, and remains the default setting.
2018-05-30 13:09:50 +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
Ted John 34531f7afb
Fix signed/unsigned mismatch warnings (#7529)
Unignore MSVC warning: C4245:
'conversion_type': conversion from 'type1' to 'type2', signed/unsigned mismatch
2018-05-16 21:22:17 +01:00
Hielke Morsink 9cec47c6e6 Remove duplicated code (#7527)
The same check is performed later on right before `edgeStyle` gets used.
2018-05-16 15:03:58 +02:00
Aaron van Geffen 829ac11bec
Merge pull request #7519 from IntelOrca/refactor/new-object-types-prep
Refactor code around object types
2018-05-15 15:10:16 +02:00
Aaron van Geffen 19442eb6c2
Merge pull request #7510 from Broxzier/feature/horizontal-clipping
Horizontal Clipping
2018-05-15 14:55:05 +02:00
Hielke Morsink 1721a397fc Fix drawing edges for surfaces with water 2018-05-15 01:41:54 +02:00
Ted John f8271e93b0 Refactor code base to allow easy addition of new object types 2018-05-15 00:32:36 +01:00
Hielke Morsink efded3e0d2 Always paint edges for tiles next to tiles that don't get drawn
This also makes it so that when a surface is cut off by the clip height, the neighbour tiles will draw the edges too, making the surface appear as a pit instead of a blank tile.

I've renamed some of the variables and added a few comments to make the code easier to understand. I've also left a todo comment for a future improvement - the current call isn't expensive so it won't become a bottleneck in the meantime.
2018-05-15 00:21:03 +02:00
Hielke Morsink 4e5f5de1a3 Update the year in copyright notice for changed files 2018-05-12 14:24:51 +02:00
Hielke Morsink 9034a0bce9 Restore old selection when the tool gets interupted
And re-type the selection variables to use LocationXY8 instead of storing them separately.
2018-05-12 14:24:47 +02:00
Hielke Morsink f1bbf077d6 Add clip selection
This allows the user to select an area of tiles. Anything outside of this area won't be drawn.
2018-05-12 14:24:01 +02:00
Ted John 302fe00805 Always pass shared_ptr by reference 2018-05-11 20:39:00 +01:00
Ted John 7b28078da2 Remove use of gUseTrueTypeFont 2018-05-11 20:37:48 +01:00
Ted John 466c465d44 Use unique_ptr and shared_ptr for IDrawingEngine 2018-05-11 20:37:48 +01:00
Ted John 7b610fd3c0 Use shared_ptr more for UiContext in relation to DrawingEngine 2018-05-11 20:37:48 +01:00
Michael Steenbeek 83b4bcb068
Prepare tunnel door support 2018-05-10 09:39:33 +02:00
Hielke Morsink 8d10bfb5a1 Add namespace closing comments 2018-05-04 22:54:43 +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 a51462b0fd Include necessary files for compiling headers
This commits works towards #7289. It includes files that it depends on, or forward declares types when possible. It may seem like this only increases compilation time, but before this commit they depended on the other includes of the source files that use them.
2018-03-31 23:07:14 +02:00
Hielke Morsink a2fe309be0
Merge pull request #7355 from Broxzier/fix/virtual-floor-zero-height
Fix #7303 Visual glitch with virtual floor near map edges
2018-03-28 12:48:39 +02:00
Hielke Morsink 8adfd9a87c Fix #7303 Visual glitch with virtual floor near map edges 2018-03-27 23:09:41 +02: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
Hielke Morsink d7c198388e Fix #7327: Draw transparent images see-through too
This removes the check for transparent images before applying the hardcoded colours. It sets the transparency flag anyway.
2018-03-26 10:28:10 +02:00
Ted John dd0573b235 Move in game console to UI library 2018-03-22 20:16:58 +00: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 9e1dfffee8 Remove unnecessary checks for __cplusplus 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 8069a04d67 Fix logic error in setting virtual floor height. 2018-03-05 00:24:38 +01:00
ZehMatt c8328610ee Optimise the algorithm for virtual floor invalidation. 2018-03-04 19:28:56 +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