Commit graph

13566 commits

Author SHA1 Message Date
Duncan
c04cb0b94b
Merge pull request #10254 from tupaschoal/coords-for-ride-construction
Coords for ride construction
2019-11-19 11:12:51 +00:00
Tulio Leao
2acdc577f7 Use Coords for windows/RideConstruction 2019-11-18 19:17:54 -03:00
Tulio Leao
9fa355cb8c Make window_event_list use Coords for moved and cursor (#10258) 2019-11-18 23:13:32 +01:00
Duncan
5bfe31ceb9
Merge pull request #10062 from tupaschoal/nullptr-deref-avoid-surface
Avoid dereferencing map_get_surface_element_at nullptr on libopenrct2
2019-11-18 12:39:41 +00:00
Tulio Leao
72b4d93ad2 Avoid dereferencing map_get_surface_element_at nullptr on libopenrct2 2019-11-18 08:01:04 -03:00
Ted John
f7a8f5a0c7 Fix #10228: Can't import RCT1 Deluxe from Steam (#10260)
Use size of buffer rather than the size of a pointer which would always return 4 or 8 for the buffer size.
2019-11-18 10:05:16 +01:00
ζeh Matt
7744fc71e4 Fix #10256: Desync because of client advancing ahead of server ticks during map change (#10257) 2019-11-17 23:26:32 +01:00
ζeh Matt
5606b4895b Fix desync because of ride status (#10227) 2019-11-16 16:12:33 +01:00
Tulio Leao
93083780df Use ScreenCoordsXY for windows/Map (#10233)
* Use ScreenCoordsXY for windows/Footpath

- Refactor `place_park_entrance_get_map_position()` to receive `ScreenCoordsXY` and return `CoordsXYZD`
- Refactor `sub_68A15E()` to receive `ScreenCoordsXY` and return `CoordsXY`. Some of its usage are narrowing the result on purpose, as same variable is used for contexts where `int16_t` is still a hard requirement.

* Properly increment for big Z and use LOCATION_NULL
2019-11-14 23:09:27 +01:00
duncanspumpkin
e4ee91f5ff Refactor get_map_coordiantes to enforce Coords struct 2019-11-14 20:28:54 +00:00
Duncan
8eb42867dd
Merge pull request #10223 from duncanspumpkin/viewport_refactor
Remove global variables from get_map_coordinates_from_pos_window
2019-11-14 20:27:39 +00:00
Duncan
d6bb101f8d
Merge pull request #10237 from tupaschoal/screencoords-for-mouse-functions
Use ScreenCoordsXY for scroll_mouse* functions
2019-11-14 20:24:06 +00:00
Tulio Leao
cc12dbf238
Fix tile_element_height to use mapCoords instead of screenCoords 2019-11-14 10:50:10 -03:00
Duncan
a80566027a
Merge pull request #10236 from tupaschoal/coords-for-tile-inspector
Use more ScreenCoordsXY on windows/TileInspector.cpp
2019-11-14 12:52:00 +00:00
Duncan
38db42ac22
Merge pull request #10235 from tupaschoal/coords-for-landrights
Use ScreenCoordsXY on windows/LandRights.cpp
2019-11-14 12:43:17 +00:00
Duncan
3f7a4a9f42
Merge pull request #10229 from tupaschoal/refactor_ride_get_entrance_or_exit
Refactor ride_get_entrance_or_exit_position_from_screen_position()
2019-11-14 12:42:38 +00:00
Tulio Leao
fe3d6f6faf Use ScreenCoordsXY for scroll_mouse* functions 2019-11-14 08:40:40 -03:00
Tulio Leao
a5492acdec Use more ScreenCoordsXY on windows/TileInspector.cpp 2019-11-14 08:05:07 -03:00
Tulio Leao
5ca54758ae Use ScreenCoordsXY on windows/LandRights.cpp 2019-11-14 07:58:54 -03:00
Tulio Leao
0bc28406e0 Fix mistake on Coords Z assignment 2019-11-14 07:27:28 -03:00
Tulio Leao
7e65aeaea3 Fix issues in code review
Implement operator== and operator!= for CoordsXYZD
Set location to null before returning from ride_get_entrance_or_exit_position_from_screen_position
2019-11-13 18:46:02 -03:00
Tulio Leao
ce9432964c Improve coords management on window_rotate_camera 2019-11-13 18:28:03 -03:00
Tulio Leao
c36606c051 Distinguish Screen and Map Coords on window_rotate_camera 2019-11-13 18:28:03 -03:00
Tulio Leao
47387690f5 Improve coords assignments 2019-11-13 18:28:03 -03:00
Tulio Leao
30815f0886 Fix clang-format 2019-11-13 18:28:03 -03:00
Tulio Leao
054bc8e4ca Receive ScreenCoordsXY and return CoordsXY in Viewport 2019-11-13 18:27:59 -03:00
duncanspumpkin
0af10781f1 Remove unused globals 2019-11-13 19:04:01 +00:00
duncanspumpkin
57baeeaa3c Refactor to remove std::optional 2019-11-13 18:58:17 +00:00
Duncan
dde6ee93e0
Merge pull request #10220 from tupaschoal/coords-for-footpath
Use ScreenCoordsXY for windows/Footpath
2019-11-13 18:41:37 +00:00
Tulio Leao
27f47e1407
Apply suggestions from code review 2019-11-13 05:18:06 -08:00
Tulio Leao
677bd119cf
Update src/openrct2/ride/Ride.cpp 2019-11-13 05:17:02 -08:00
Tulio Leao
c568510bdc Fix warning displayed on CI 2019-11-13 09:54:05 -03:00
Tulio Leao
5dfe373061 Refactor ride_get_entrance_or_exit_position_from_screen_position() 2019-11-13 09:41:58 -03:00
Tulio Leao
0fc6da2443 Use ScreenCoordsXY for MazeConstruction (#10222) 2019-11-13 11:54:55 +01:00
Tulio Leao
5e888747de Use mapCoords instead of ScreenCoords 2019-11-12 20:13:14 -03:00
duncanspumpkin
278dd9b1d2 Remove global variables from get_map_coordinates_from_pos_window 2019-11-12 20:11:48 +00:00
Tulio Leao
3fa4b7b964 Fix clang-format 2019-11-12 00:27:59 -03:00
Tulio Leao
892c084cd8 Use ScreenCoordsXY for windows/Footpath 2019-11-11 23:10:51 -03:00
ζeh Matt
7e279d37cd Fix out of bounds access opening the in-game console at startup (#10197) 2019-11-09 21:26:14 +01:00
Conrad Kostecki
fef1906d0d CMakeLists.txt: make discord-rpc and google benchmark optional (#10208)
For a package maintainer, it should be possible to disable the support
for discord-rpc and google benchmark, as it currently always includes them,
when the library if found.
2019-11-09 21:20:16 +01:00
ζeh Matt
9b499ea239 Fix #10087: crash loading a save with corrupt peeps (#10122) 2019-11-09 17:00:09 +01:00
ζeh Matt
f6a23fd5f5 Add compile time selection for copying data with specialised paths (#9331) 2019-11-09 15:54:43 +01:00
ζeh Matt
f4a1b75a53
Merge pull request #10191 from ZehMatt/refactor/benchgfx
Refactor benchgfx
2019-11-09 00:22:58 +01:00
Michał Janiszewski
afc92ee15a
ifdef-out WinNT 6.0+ APIs (#10198)
Occasionally I need to build a binary compatible with WinNT 5.1, e.g.
when testing out Wine or ReactOS. There are just a few minor changes
required to have a working build, but as they are not part of the
repository, I always end up doing them from scratch. I would like to
upstream them instead so I don't have to recreate them each time, even
if this is not the most common use case.
2019-11-08 23:16:15 +01:00
Matt
d3103b6397
Refactor benchgfx 2019-11-08 08:52:45 +01:00
Tom Lankhorst
027c09553b Reformat code with clang-format 8.0. 2019-11-04 15:11:06 +01:00
Tom Lankhorst
efea8856ed Clean up OpenGL engine.
Code de-duplication and improved namespacing.
2019-11-04 15:10:42 +01:00
Aaron van Geffen
91f91d4388
Merge pull request #10147 from AaronVanGeffen/implement/1164
Use available translations for shortcut keys
2019-11-04 13:07:34 +01:00
Aaron van Geffen
d3b5214f95 Clarify user strings section in comment; add stylistic braces. 2019-11-04 12:09:36 +01:00
Duncan
8dc5865e6f
Merge pull request #10170 from tupaschoal/int32t_for_vehicle_train_index
Use int32_t instead of int for train_index
2019-11-03 05:17:30 +00:00
duncanspumpkin
ac87b3f667 Use std::optional to remove requirement for invalid result. 2019-11-02 14:43:51 +00:00
Tulio Leao
9776a0843d Make Viewport::screen_to_map_pos() return coords (#10171)
* Make Viewport::screen_to_map_pos() return coords

* Fix clang-format

* Update src/openrct2-ui/windows/TileInspector.cpp

* Update src/openrct2-ui/windows/TileInspector.cpp

* Apply suggestions from code review
2019-11-02 08:04:46 +00:00
Duncan
57f202d721
Merge pull request #10175 from ZehMatt/ga-queue-investigation
Add game action type to the assert in GameActions::ProcessQueue
2019-11-01 20:58:45 +00:00
Alan Berndt
a4181d10f4 Refactor get_map_coordinates_from_pos_window (#10109)
* Refactor get_map_coordinates_from_pos_window

This changes get_map_coordinates_from_pos_window to use the
ScreenCoordsXY and CoordsXY structs instead of bare ints as suggested
in #10065

* Use default constructor.

The default constructor initializes the coordinates to (0, 0) anyway so
doing that explicitly is redundant.

* Fix parentheses

* Fix formatting issues

* Manually fix clang formatting

Apparently my version of clang-format doesn't behave properly so I am
manually making the changes that CI suggests.
2019-11-01 20:57:44 +00:00
Duncan
834e8da379
Merge pull request #10168 from duncanspumpkin/refactor_vp_to_map
Refactor viewport_coord_to_map_coord to return a CoordXY
2019-11-01 20:56:56 +00:00
Duncan
6cbc052c4e
Merge pull request #10144 from cskrisz/refactor
Refactor vehicle_visual_virginia_reel
2019-11-01 20:55:17 +00:00
Aaron van Geffen
71699543dd Remove obsolete key label strings; update changelog. 2019-11-01 21:14:01 +01:00
Aaron van Geffen
e3b0c52086 Use available translations for shortcut keys. 2019-11-01 21:14:01 +01:00
duncanspumpkin
5ca553dd08 Refactor viewport_coord_to_map_coord to return a CoordXY 2019-11-01 20:04:07 +00:00
Duncan
9bf2cffbb7
Merge pull request #10169 from SijmenSchoon/feature/refactor-coordinates
Change a sizable portion of LocationXY(Z) to (Tile)CoordsXY(Z)
2019-11-01 20:02:26 +00:00
Sijmen Schoon
f7fd98fcf2
Add constexpr keywords 2019-11-01 02:07:14 +01:00
Matt
fbe0506ca8
Add game action type to the assert in GameActions::ProcessQueue 2019-10-31 17:27:55 +01:00
Sijmen Schoon
6b351870c3
Format MiniatureRailway.cpp 2019-10-31 16:20:22 +01:00
Sijmen Schoon
a815a3c626
Remove unnecessary static_casts 2019-10-31 16:18:44 +01:00
Sijmen Schoon
3f3baa2b13
Revert changing constructor lists to constructors 2019-10-31 16:10:26 +01:00
Tulio Leao
e86ee10e5f Use int32_t instead of int for train_index 2019-10-31 01:39:37 -03:00
Sijmen Schoon
ab2dbea32a
Change a sizable portion of LocationXY(Z) to (Tile)CoordsXY(Z) 2019-10-31 00:19:14 +01:00
Duncan
bb48a471e6
Merge pull request #10135 from tupaschoal/constexpr-for-openrct2-defines
Use constexpr on openrct2/*
2019-10-30 19:45:25 +00:00
Duncan
219046af14
Merge pull request #10136 from tupaschoal/constexpr-for-openrct2ui-define
Use constexpr on openrct2-ui/*
2019-10-30 06:44:11 +00:00
Duncan
3362cbc366
Merge pull request #10131 from tupaschoal/screencoords-for-tool-functions
Use ScreenCoordsXY for tool_* functions
2019-10-30 06:29:07 +00:00
Tulio Leao
afc14183e7 Use ScreenCoordsXY for tool_* functions 2019-10-29 19:02:58 -03:00
Tulio Leao
d1cec43065 Use constexpr on openrct2-ui/* 2019-10-29 18:48:04 -03:00
Tulio Leao
9123b597a9 Use constexpr on openrct2/* 2019-10-29 18:44:14 -03:00
babywashbear
86844d2a57 Context: replace 2nd std::make_unique<Context> with CreateContext call (#10139) 2019-10-29 17:41:49 +01:00
Tulio Leao
d9efd64fea Use ScreenCoordsXY for interface\Widget.h (#10123) 2019-10-29 17:41:19 +01:00
Krisztián Csordás
f2eb1fada6 Refactor SteamParticleOffsets (#10134)
* Refactor SteamParticleOffsets

Turn flat array of 48 offsets into arrays of 16 offsets for 3 different
types.
2019-10-29 17:38:57 +01:00
Michael Steenbeek
5c6e2c7fe9
Merge pull request #10119 from duncanspumpkin/maze_place_ga
Maze Place Track Game Action
2019-10-29 17:37:35 +01:00
Tulio Leao
96e54519ca Remove comparison of ScreenCoords with MONEY32_UNDEFINED (#10124) 2019-10-29 17:36:57 +01:00
Hielke Morsink
78c550351d Properly fix usage of station index string (#10141)
This basically reverts the change in en-GB.txt from #10077 and fixes the usage of this string where it was broken.
2019-10-29 17:35:36 +01:00
Michał Janiszewski
d645338752 Release 0.2.4
- Feature: [#9285] Remember current group in scenario list window.
- Feature: [#9918] Increase image list capacity by about 100k units.
- Change: [#1349] Increase the number of ride music played simultaneously from 2 to 32.
- Fix: [#4927] Giant screenshot cut off at bottom and top.
- Fix: [#7572] Queue paths connect to regular paths through fences.
- Fix: [#7690] Problem with guests freezing on certain tiles of path.
- Fix: [#7883] Headless server log is stored incorrectly if server name contains CJK in Ubuntu
- Fix: [#8136] Excessive lateral G penalty is too excessive.
- Fix: [#8584] Duck spawning function does not check tiles with x or y coordinate of 0..64 (Original bug)
- Fix: [#9179] Crash when modifying a ride occasionally.
- Fix: [#9533] Door sounds not playing.
- Fix: [#9574] Text overflow in scenario objective window when using CJK languages.
- Fix: [#9603] Don't render audio when master volume is turned off.
- Fix: [#9625] Show correct cost in scenery selection.
- Fix: [#9669] The tile inspector shortcut key does not work with debugging tools disabled.
- Fix: [#9675] Guest entry point limit can be bypassed in scenario editor.
- Fix: [#9683] Cannot raise water level if part of the tool's area of effect is off of the map.
- Fix: [#9684] Entering custom size for water/land tool allows confirmation with main enter key, but not numpad enter key.
- Fix: [#9690] The keyboard shortcut for rotating the game view can be set to Enter or KP Enter, but not both.
- Fix: [#9717] Scroll bars do not render correctly when using OpenGL renderer.
- Fix: [#9729] Peeps do not take into account height difference when deciding to pathfind to a ride entrance (original bug).
- Fix: [#9902] Doors/Portcullis do not check to make sure doors are open causing double opens.
- Fix: [#9926] Africa - Oasis park has wrong peep spawn (original bug).
- Fix: [#9953] Crash when hacked rides attempt to find the closest mechanic.
- Fix: [#9955] Resizing map in while pause mode does not work and may result in freezes.
- Fix: [#9957] When using 'no money' cheat, guests complain of running out of cash.
- Fix: [#9970] Wait for quarter load fails.
- Fix: [#9994] Game action tick collision during server connect and map load.
- Fix: [#10017] Ghost elements influencing ride excitement.
- Fix: [#10036] Do not allocate large chunks of memory for save file classification.
- Fix: [#10106] Ride circuits should not be used for modes that do not support it.
- Fix: [#10149] Desync in headless mode with rides that create smoke particles.
- Improved: [#9466] Add the rain weather effect to the OpenGL renderer.
- Improved: [#9987] Minimum load rounding.
- Improved: [#10125] Better support for high DPI screens.
2019-10-28 21:18:47 +01:00
Krisztián Csordás
8f7c95e425 Fix SDL_Texture double free (#10156)
Double freeing of SDL_Texture caused assertion failure when calling
HardwareDisplayDrawingEngine::SetVSync. According to SDL documentation,
SDL_DestroyRenderer frees the associated textures.
2019-10-28 20:43:22 +01:00
ζeh Matt
040a0e58aa Fix desync in headless mode with rides that create smoke particles 2019-10-27 16:55:34 +01:00
Krisztián Csordás
7bbb5110b7 Refactor vehicle_visual_virginia_reel 2019-10-26 16:41:06 +02:00
Tom Lankhorst
6eea943083 Pass SDL_WINDOW_ALLOW_HIGHDPI to SDL_CreateWindow (#10125) 2019-10-21 22:36:05 +02:00
Duncan
28e7d90efb
Merge pull request #10127 from tupaschoal/fix-10126
Fix #10126: window movement inversed
2019-10-21 07:46:02 +01:00
Tulio Leao
6c35a0234e Fix CoordsXY sum and subtract operators (#10128) 2019-10-21 07:23:01 +02:00
Tulio Leao
08db611dd5 Fix #10126: window movement inversed 2019-10-20 23:44:26 -03:00
Tulio Leao
5f916b79ae Use ScreenCoordsXY for MouseInput (#10120) 2019-10-20 19:10:30 +02:00
Michael Steenbeek
f79667d842
Fix #9995: User strings with umlauts not imported correctly 2019-10-20 19:03:09 +02:00
duncanspumpkin
a91098de05 minor correction 2019-10-20 16:07:34 +01:00
duncanspumpkin
ee64892f4b Clang format 2019-10-20 15:47:45 +01:00
duncanspumpkin
5842b851c2 Remove old game command for MazePlaceTrack 2019-10-20 15:23:36 +01:00
duncanspumpkin
783ae13538 Add MazePlaceTrackAction
This game action had been accidently assumed to be hard to do. Woops.
2019-10-20 15:21:49 +01:00
Matt
666158df1c
Bump up network version 2019-10-20 00:22:11 +02:00
Matt
07f401baa2
Use unsigned type for scenario_rand results 2019-10-20 00:21:19 +02:00
Matt
6dbbc86ee1
Allow rendering of ducks with zoom level 1 2019-10-20 00:21:19 +02:00
Matt
365c7c6f51
Use better variable name 2019-10-20 00:21:19 +02:00
Matt
70d37fe8f9
Fix ducks asserting due to invalid position 2019-10-20 00:21:18 +02:00
Matt
ac30e35dfa
Fix crash when ducks try to navigate out of bounds 2019-10-20 00:21:18 +02:00
Matt
01ea0ae366
Fix duck removal not invalidating screen 2019-10-20 00:21:18 +02:00
Matt
477347b6d4
Implement 'Remove Ducks' cheat 2019-10-20 00:21:18 +02:00
Matt
7fa41bb82d
Implement 'Create Ducks' cheat 2019-10-20 00:21:18 +02:00
Hielke Morsink
2e090493f2 Use white colour for labels in Tile Inspector (#10076)
The DARK_GREEN colour comes from the days of hardcoded numbers, where it was most likely copied from somewhere else.
2019-10-19 18:12:00 +02:00
Duncan
0f659794d0 Fix #10108. Import/Export smoke particles correctly to stop desync (#10113)
Mistake made whilst refactoring import/export caused steam particiles to have the wrong information for each of its fields. This manifestied on multiplayer games causing an immediate desync.
2019-10-19 18:11:20 +02:00
Duncan
7546c846df Name functions and remove dead code
The dead code removed has been removed already from the draw sprite. Should have removed it from interaction at the same time.
2019-10-19 17:21:08 +02:00
Tulio Leao
dbb66dd028 Remove duplicate functions (#10067)
* Reduce code duplication in src\openrct2\interface\Window.cpp

`window_resize_gui_scenario_editor` was a subset of `window_resize_gui`

* Reduce code duplication in src\openrct2\network\Twitch.cpp

Both `GetFollowers()` and `GetMessage()` were very similar

* Reduce code duplication in src/openrct2/world/SmallScenery.cpp

`map_place_non_scenery_clear_func` and `map_place_scenery_clear_func` did basically the same thing, with a single branch difference

* Reduce code duplication in src/openrct2-ui/windows/TopToolbar.cpp

Make `top_toolbar_tool_update_scenery_clear` call `top_toolbar_tool_update_land_paint` and then do the additional differing calculation it did.
2019-10-19 15:38:26 +02:00
Duncan
9ad15e398b
Merge pull request #10091 from tupaschoal/nullprt-deref-avoid-get_first_at
Avoid dereferencing invalid map_get_first_element_at return
2019-10-19 13:55:54 +02:00
Tulio Leao
ce1f38da25 Use ScreenCoordsXY for window functions (#10086)
* Use ScreenCoordsXY for window_create function

* Use ScreenCoordsXY for window_find_from_point function

* Use ScreenCoordsXY for window_find_widget_from_point

* Use ScreenCoordsXY for ride_contruction_tool*

* Use ScreenCoordsXY for window_event_tool*

* Use ScreenCoordsXY for window_event_scroll_mouse*

* Use ScreenCoordsXY for remaining window_event*

* Use ScreenCoordsXY for window_(set|move)_position
2019-10-19 13:07:03 +02:00
Tulio Leao
35577f5b19 Avoid dereferencing invalid map_get_first_element_at return 2019-10-19 07:54:31 -03:00
Duncan
c3e14328f1
Little Refactor (#10075)
* Correct the label for track elem 255.

* Catch last little change
2019-10-19 10:00:42 +02:00
Duncan
a491543e17
Merge pull request #10107 from tupaschoal/fix-powered-not-passing-station
Fix #10106: Reset number of circuits if unsupported
2019-10-19 09:54:27 +02:00
Tulio Leao
88dfff5f5e Use ScreenCoordsXY for Keyboard shortcuts 2019-10-18 18:36:18 -03:00
Tulio Leao
9d468167e4 Fix #10106: Reset number of circuits if unsupported
Closes #10106
2019-10-18 18:06:51 -03:00
Tulio Leao
e1a9e6005d Use ScreenCoordsXY for Chat functions (#10084) 2019-10-18 17:57:31 +02:00
Tulio Leao
2159fd282b Use ScreenCoordsXY for Window functions (#10083) 2019-10-18 17:44:26 +02:00
Denis Khabenkov
6632b979d7 Fix #9684 and #9690: Enter and keypad enter are treated as different keys
* Remapped keypad Enter to return scancode

Fix #9684: Entering custom size for water/land tool allows confirmation
with main enter key, but not numpad enter key

Fix #9690: The keyboard shortcut for rotating the game view can be set
to Enter or KP Enter, but not both

* Add changelog entry
2019-10-18 10:40:07 +02:00
Hielke Morsink
8c1ccfdaa9
Fix possible cause for desyncs on ride crashes (#10104)
`scenario_rand` was used twice between two sequence points. The order of evaluation is unspecified in C++, meaning that these calls could be done in both forward and reverse order. Storing them in variables guarantees their order, making this cross-platform.
2019-10-16 21:51:59 +02:00
Matt
59b71183a2
Only temporarily set the cheat state 2019-10-16 13:21:21 +02:00
Michał Janiszewski
bf18bb8161
Fixup MSVC CMake targets (#10100) 2019-10-15 23:14:00 +02:00
Michał Janiszewski
6c4f63ba58
Add define for ARM64 (#10096) 2019-10-15 06:47:49 +02:00
Denis Khabenkov
4e111c66a3
Fix #10074: Refactor TrackDesignEntranceElement 2019-10-11 00:25:13 +03:00
duncanspumpkin
bb042213fd Fix #10069. Actually pass the track element flags to the new element.
Mistake made whilst refactoring #10058. Flags were incorrectly been taken from the destination and not the source.

Refactored names to use the correct t number
2019-10-10 18:48:05 +01:00
Denis Khabenkov
57a208d560 Fix #10064: Refactor TrackDesignEntranceElement (#10066)
* Fix #10064: Refactor TrackDesignEntranceElement
2019-10-10 18:23:29 +01: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
Tulio Leao
3f21933d5b Fix clang-format issue. 2019-10-08 18:22:02 -03:00
Tulio Leao
121585578e Remove implicit conversion constructor 2019-10-08 18:22:02 -03:00
Tulio Leao
7193ba1bb7 Create TrackDesignMazElement struct
Closes #10053
2019-10-08 18:21:58 -03:00
Tulio Leao
6be7c42a3d Close #10051: Create TrackDesignSceneryElement 2019-10-08 17:13:34 +02:00
ζeh Matt
dd6d028c5b
Merge pull request #10061 from tupaschoal/nullptr-deref-consistency
Make check for map_get_nth_element_at consistent
2019-10-08 17:08:52 +02:00
Tulio Leao
4a817b88d9 Make check for map_get_nth_element_at consistent
Most places compare to `nullptr` explicitly, thus changed the ones that didn't.

Also moved one call that might have been superfluous if `offset == 0`
2019-10-08 08:06:46 -03:00
Tulio Leao
68ce43308e Remove implicit conversion constructor 2019-10-08 07:48:03 -03:00
Tulio Leao
ff57f43996 Create TrackDesignTrackElement struct
Closes #10054
2019-10-08 07:47:56 -03:00
Duncan
ee0025987a
Merge pull request #10056 from duncanspumpkin/refactor
Refactor
2019-10-08 09:26:43 +01:00
Denis Khabenkov
163221520b
Delete assert and size information 2019-10-07 22:26:16 +03:00
Denis Khabenkov
de53ac84b8
Fix #10052: Create a TrackDesignEntranceElement struct to replace rct_td6_entrance_element 2019-10-07 21:59:07 +03:00
duncanspumpkin
2c5ff4a0d1 Rename variables 2019-10-07 18:56:31 +01:00
duncanspumpkin
213ba15ba5 Remove unused code and variables from function 2019-10-07 18:36:27 +01:00
duncanspumpkin
f10e4dc6b9 Remove unused variables from function call 2019-10-07 18:33:51 +01:00
Matt
884611c20b
Bump up network version 2019-10-05 13:13:44 +02:00
Matt
0c11bbd4e7
Fix #9994: Game action tick collision during server connect and map load 2019-10-05 13:09:21 +02:00
ζeh Matt
e4a2b1f9c5 Fix #9953: Crash when hacked rides attempt to find the closest mechanic 2019-10-03 23:08:40 +02:00
Gymnasiast
db5c018e22
Add requested check 2019-10-03 22:26:08 +02:00
crorvig
7f54ba0be7
Set BuildInPauseMode to true during map_remove_out_of_range_elements()
Set BuildInPauseMode to true during map_remove_out_of_range_elements()
2019-10-03 22:26:08 +02:00
crorvig
ed1dfa39c2
Fix #9955 Allow resizing of map in pause mode
Prevents infinite loop by forcing BuildInPauseMode on for the duration
of the map_remove_out_of_range_elements() call.
2019-10-03 22:26:08 +02:00
ζeh Matt
a39bd39268 Fix #10036: Do not allocate large chunks of memory for save file classification (#10040) 2019-10-03 17:36:58 +02:00
ζeh Matt
0b95dcd0d0 Fix #8584: Duck spawn search now uses entire map (#9743) 2019-10-02 22:14:56 +02:00
Ted John
15767c3be3 Fix output result of remove_unused_objects (#10029) 2019-10-01 22:30:11 +02:00
Michael Steenbeek
a63395eb1c
Fix #10028: Saved park--brakes all set to 0mph 2019-09-29 22:53:41 +02:00
aw20368
ff1698bcb9 Improve #9987: Minimum load rounding (#9987)
Refactor code for vehicles waiting for a specific load level.
Original code rounded the target load down, changed to round up.
2019-09-28 20:51:13 +02:00
ζeh Matt
b82d1bbc64 Fix #10015: Crash when certain images are drawn (#10016) 2019-09-23 22:37:28 +02:00
ζeh Matt
b2a42de579 Fix ghost elements influencing ride excitement 2019-09-23 22:36:51 +02:00
Jan Beich
a5555649ec network: unbreak build with Clang 9 (#10014)
ld: error: libopenrct2.a(Network.cpp.o): unable to find library from dependent library specifier: Ws2_32.lib
2019-09-23 17:14:57 +02:00
Gymnasiast
856075a781
Bump network version and amend changelog 2019-09-22 23:07:57 +02:00
aw20368
3f10811426
Fix #9970: Wait for quarter load fails
Vehicle was always incorrectly flagged as ready to depart when quarter load is selected. Removed erroneous flag.
2019-09-22 23:06:54 +02:00
Michael Steenbeek
5e1d14f061
Merge pull request #9939 from IntelOrca/refactor/image-id
Create new ImageId struct
2019-09-22 17:07:49 +02:00
Michael Steenbeek
a5700a3d07
Merge pull request #9959 from richard-fine/directions
Convert more code to use proper Direction symbols
2019-09-22 16:59:41 +02:00
gill984
565ad3798d Fix #9957: Guests complain about running out of money in no money parks 2019-09-22 16:52:53 +02:00
Joseph Atkins-Turkish
2e5f46fcf1 Fix raise/lowering water at edge of map (#9979) 2019-09-22 14:13:52 +02:00
Michael Steenbeek
a11762b11a
Remove old C functions that only call their equivalent
* Remove old C functions that only call their equivalent

* fix formatting
2019-09-22 14:12:49 +02:00
Duncan
b94b8880aa Fix ride station index related bugs 2019-09-19 22:56:54 +02:00
Joseph Atkins-Turkish
747e00512d Fix #7572: Queue paths connect to regular paths through fences 2019-09-18 23:31:29 +02:00
Peter
650142de9b Fix #9902: Doors and portcullises can be double opened 2019-09-18 23:26:33 +02:00
Joseph Atkins-Turkish
6b21aac4ea Fix #9675: Inconsistent number of guest entry points (#9990) 2019-09-15 18:57:21 +02:00
Gymnasiast
0aca04256b
Fix #9978: Mazes are imported incorrectly 2019-09-12 23:12:54 +02:00
Michael Steenbeek
4424964686
Fix #9975 and #9976: Crash when removing LargeScenery with null element (#9977) 2019-09-10 21:03:22 +02:00
ζeh Matt
afda556e86
Merge pull request #9915 from ZehMatt/audio-music-limit
#1349: Increase the number of ride music played simultaneously to 32
2019-09-10 13:02:29 +02:00
Gymnasiast
673b12029e
Bump network version 2019-09-09 23:07:46 +02:00
Michael Steenbeek
d314782a40
Merge pull request #9952 from Gymnasiast/refactor/use-that-space
Refactor/use that space
2019-09-09 19:05:50 +02:00
Ted John
fc679c9105 Fix #9956: invalid-read in window_ride_main_open 2019-09-08 13:55:02 +01:00
Ted John
7b7d3ec5e3 Fix #9971: invalid-read in place_virtual_track 2019-09-08 13:45:56 +01:00
Richard Fine
92f50efedc Formatting fixes 2019-09-01 19:10:27 +01:00
Richard Fine
31ce0f20f7 Use range-based for loops for checking all directions 2019-09-01 18:40:28 +01:00
Richard Fine
3131bfdc74 Use INVALID_DIRECTION in a bunch of places 2019-09-01 18:40:24 +01:00
Richard Fine
bf3461e014 Restrict FootpathPlaceAction more correctly
direction_valid() restricts the direction to 0-3, not 0-15. As discussed on Gitter, this is more correct.
2019-09-01 18:40:21 +01:00
Richard Fine
caa6ad71c7 Add direction_next and direction_prev helpers 2019-09-01 18:40:17 +01:00
Richard Fine
9123fa74d3 Add ALL_DIRECTIONS array 2019-09-01 18:40:14 +01:00
Richard Fine
0e04dbeea1 Allow SwapBE to swap non-uint types
If we want to have more semantically meaningful types (like Direction), it's useful to be able to support those in the DataSerializer too. Swapping bytes for entire structures is probably never going to make sense, but for types that are pure wrappers around integer types, we want to be able to swap them as if they were the integer they wrap.
2019-09-01 18:40:11 +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
Richard Fine
6449393d50 Use Direction type in a bunch of the pathfinding code 2019-09-01 18:38:03 +01:00
Richard Fine
06b2f66ba1 Use Direction type for peep::direction 2019-09-01 16:08:01 +01:00
Richard Fine
52b4717d85 Use Direction type for PathElement SlopeDirection 2019-09-01 16:08:01 +01:00
Richard Fine
6a673cc7be Introduce INVALID_DIRECTION constant 2019-09-01 16:08:01 +01:00
Gymnasiast
f12eb3010f
Fix display of G2 characters; remove some unused sprite IDs 2019-09-01 11:12:09 +02:00
Gymnasiast
bb73dd0dfb
Refactor track element to use 16 bytes 2019-08-31 13:14:19 +02:00
Gymnasiast
1fead03179
Modify Surface tile element to use 16 bytes 2019-08-30 22:22:08 +02:00
Gymnasiast
f4eceaf35e
Modify Large Scenery tile element to use 16 bytes 2019-08-30 22:07:43 +02:00
Gymnasiast
7e8ab6b693
Also clear pad_08 in tile_element_insert() 2019-08-30 21:48:18 +02:00
Michał Janiszewski
8637eb6c57
Rename some bits to allow unity builds of libopenrct2 (#9944)
* Rename some bits to allow unity builds of libopenrct2

Some names are clashing when doing a unity build, renaming them solves
the problem.
2019-08-29 23:03:56 +02:00
ζeh Matt
1db18d4778 Bump up network version (#9949) 2019-08-28 19:58:30 +01:00
Michael Steenbeek
931a607fd6
Merge pull request #9938 from Gymnasiast/refactor/less-access-to-type-flags
Refactor some accessors to tile element type and flags fields
2019-08-28 09:37:39 +02:00
Gymnasiast
d6b6edcc06
Remove unnecessary parentheses [ci skip] 2019-08-27 23:07:46 +02:00
Gymnasiast
0152d9f880
Fix comment [ci skip] 2019-08-27 23:05:12 +02:00
Gymnasiast
f365bc3cb7
Create getters and setters for occupied quadrant 2019-08-27 21:12:48 +02:00
Ted John
c211292fdd Fix #9941: Giant screenshot's made from command line aren't positioned right 2019-08-26 14:50:47 +01:00
Ted John
48bc28b618 Fix #9937: Incorrect tooltips when hovering ride entrances and ride exits
- Localised strings have an extra POP16, not sure why it was there in vanilla.
- Exit string never appended station number.
2019-08-26 14:31:20 +01:00
Ted John
9be0130f2d
Show image limit in show_limits console command (#9935) 2019-08-26 12:28:37 +01:00
Matt
db5c4ab1b4
Cleanup code in ride_music_update_final 2019-08-25 18:14:28 +02:00
Matt
1e1dd2fc2f
Increase the number of ride music played simultaneously to 32 2019-08-25 18:14:25 +02:00
Gymnasiast
5ef72a4e11
Rename quartertile param in map_can_construct_with_clear_at() 2019-08-25 17:49:44 +02:00
Gymnasiast
ec5ba20992
Create dedicated method for SetLastForTile() 2019-08-25 16:13:02 +02:00
Ted John
fa792d04e1 Add constexpr modifiers 2019-08-25 12:56:42 +01:00
Ted John
c653f13552 Add tertiary colour to ImageId 2019-08-24 22:40:19 +01:00
Gymnasiast
6e200459d3
Refactor some accessors to tile element type and flags fields 2019-08-24 22:42:47 +02:00
Ted John
3925a6162d Start using ImageId 2019-08-24 18:35:40 +01:00
Ted John
583855d639 Add new ImageId struct 2019-08-24 17:30:39 +01:00
Ted John
f23e3368b1
Merge pull request #9933 from ZehMatt/fix-desync-regression
Fix desync regression
2019-08-24 16:33:20 +01:00
Ted John
8d543a056d
Prevent cropping top of giant screenshot (#9934)
Search through every single tile on the map for the highest element in 2D space. Use that as reference for top of screenshot.
2019-08-24 16:33:03 +01:00
Michael Steenbeek
e11f2d965a
Merge pull request #9437 from Gymnasiast/nog-eens-research
Move research to vectors
2019-08-24 10:45:58 +02:00
Michael Steenbeek
7270a86eb7
Fix #9924: Traffic light in Ride List shows incorrect status (#9931) 2019-08-24 10:45:39 +02:00
Matt
9f773f27f8
Bump up network version 2019-08-23 23:06:45 +02:00
Matt
d6d480a31b
Fix desyncs because of GameActions ignoring the tick on client 2019-08-23 23:06:27 +02:00
Gymnasiast
ad96aa5785
Fix bug introduced after empty vector check 2019-08-23 22:52:13 +02:00
Ted John
ae8c93ca2b
Fix research list UI / dragging 2019-08-23 22:41:50 +02:00
Gymnasiast
abe721b308
Fix rebase errors and formatting 2019-08-23 22:41:50 +02:00
Gymnasiast
984fd5e58a
Make EditorInventionsList a bit less buggy 2019-08-23 22:41:50 +02:00
Gymnasiast
9de2819cef
Process feedback from code review 2019-08-23 22:41:50 +02:00
Gymnasiast
1265913bdb
Fix dragging crash and some bugs 2019-08-23 22:41:43 +02:00
Gymnasiast
5ce3d4b947
Use new iterator syntax in more places 2019-08-23 22:41:43 +02:00
Gymnasiast
b1fb75e496
Move everything to research vectors 2019-08-23 22:41:43 +02:00
Gymnasiast
c3fdb728d1
Rename rct_research_item to ResearchItem 2019-08-23 22:41:43 +02:00
Gymnasiast
daa00147d5
Split off RCT12ResearchItem 2019-08-23 22:41:43 +02:00
Michael Steenbeek
91d02093f9
Merge pull request #9918 from IntelOrca/increase-image-list
Increase image list and fix assert when exiting scenario editor
2019-08-23 22:32:48 +02:00
Hielke Morsink
371f1fd016 Fix #9926: Africa - Oasis park has wrong peep spawn (#9927) 2019-08-23 21:54:54 +02:00
Hielke Morsink
1ee5c0fa56
Merge pull request #9929 from Broxzier/bugfix/remove-park-fences-screen-artifacts
Fix: Fences still visible after using remove_park_fences
2019-08-23 21:47:30 +02:00
Ted John
adb5c3aa7f Fix assert when exiting game in scenario editor
The object selection window loads objects when it is closed which is triggered from window_close_all. We need to unload all the objects after this step on shutdown.
2019-08-23 20:15:53 +01:00
Ted John
6d80e65783 Increase the capacity of dynamic / object images 2019-08-23 20:14:05 +01:00
Ted John
d5a1b4fc8f Fix #9920: Ghost pieces break maps on multiplayer for the client (#9928) 2019-08-23 21:05:00 +02:00
Hielke Morsink
bd42977243 Fix: Fences still visible after using remove_park_fences 2019-08-23 21:01:08 +02:00
Michael Steenbeek
4cf1d1eb69
Fix #9905: Ride type dropdown shows wrong text (#9923) 2019-08-22 23:46:15 +02:00
Michael Steenbeek
4093480f83
Fix #9909: 'Build 10 roller coasters' objectives do not complete (#9922) 2019-08-22 23:08:11 +02:00
Michael Steenbeek
af2ad8045c
Merge pull request #9914 from ZehMatt/refactor/gameaction-queue
Refactor network queue out and one desync fix
2019-08-22 12:07:19 +02:00
r0
9f6a944174 Fix #9603: Don't render audio when master volume is turned off (#9907) 2019-08-21 23:36:07 +02:00
Ted John
2dda23d82e Refactor benchgfx 2019-08-21 20:12:26 +01:00
Ted John
f4079434dc Fix #4927: Giant screenshot cut off at bottom and top 2019-08-21 20:11:06 +01:00
Matt
e0afefc6de
Add missing Invalidate calls 2019-08-21 12:31:05 +02:00
Matt
66793e664a
Refactor some unnecessary Invalidate calls and call member function if available 2019-08-21 12:08:19 +02:00
Matt
c36591c81f
Bump up network version 2019-08-21 00:29:05 +02:00
Matt
3bdc3935dc
Use correct update order 2019-08-21 00:28:08 +02:00
Matt
8c9008825d
Remove remaining game command/game action code from network 2019-08-21 00:26:43 +02:00
Matt
4f7dab6f67
Fix desync because of incorrect tick data 2019-08-21 00:19:52 +02:00
Matt
769ed255f3
Refactor game action queue out of network into GameActions 2019-08-21 00:15:39 +02:00
Duncan
2f8dccbba2
Merge pull request #9867 from duncanspumpkin/refactor_map
Refactor map
2019-08-20 18:22:24 +01:00
ζeh Matt
9897572f55
Merge pull request #9912 from s0r00t/refactor/jobpool-avoid-redefine
Avoid redefining JobPool::AddTask
2019-08-20 10:54:20 +02:00
duncanspumpkin
4f157240aa Fix coordinate direction 2019-08-19 20:04:59 +01:00
duncanspumpkin
f39905bd2e Clang format 2019-08-19 20:04:59 +01:00
duncanspumpkin
92f3e2de8b Pass by const reference where possible 2019-08-19 20:04:59 +01:00
duncanspumpkin
6c4031c323 Further clean up 2019-08-19 20:04:59 +01:00
duncanspumpkin
11aa41c4c4 Reduce the number of temporary variables 2019-08-19 20:04:59 +01:00
duncanspumpkin
b77f15c4b7 Refactor map_get_highest_z to use CoordsXY 2019-08-19 20:04:59 +01:00
duncanspumpkin
a3ad551d10 Refactor clear_elements_at to use CoordsXY 2019-08-19 20:04:58 +01:00