Commit graph

13566 commits

Author SHA1 Message Date
Ted John
e72d2aba85
Merge pull request #10309 from tupaschoal/floor-ceil-constexpr
Make floor2 and ceil2 constexpr functions
2019-12-09 22:48:20 +00:00
Tulio Leao
68e0519c5e Remove Map::map_offset_with_rotation() 2019-12-09 17:55:57 -03:00
Tulio Leao
2ddde8a344 Simplify attach calculation on Paint.cpp 2019-12-09 17:19:45 -03:00
Tulio Leao
01c62437b2 Remove Ride::ride_get_rotated_coords() 2019-12-09 16:52:47 -03:00
Tulio Leao
aca4d39107 Allow TileCoordsXYZ conversion to CoordsXYZ 2019-12-05 21:43:20 -03:00
Tulio Leao
e21e0105af Use CoordsXY for Map rotations (#10335) 2019-12-05 20:38:14 +01:00
Tulio Leao
081c9fb187 Use CoordsXY for TrackDesign* rotations 2019-12-04 23:30:36 -03:00
Tulio Leao
5b43f19708 Use CoordsXY for Paint rotations 2019-12-04 23:08:26 -03:00
Tulio Leao
accb4ea691 Use CoordsXY on TopToolbar and TrackDesignPlace rotations 2019-12-04 22:07:11 -03:00
Tulio Leao
d9348cf562 Use CoordsXY::ToTileCentre() on Ride.cpp 2019-12-04 22:02:11 -03:00
Michael Steenbeek
d012c8141b
Merge pull request #10316 from duncanspumpkin/light_fx
Make lights work for all rotations.
2019-12-04 14:11:26 +01:00
Tulio Leao
6f0ebfea27 Use CoordsXY and ScreenCoordsXY for rotate in Ride*.* 2019-12-04 08:02:09 -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
aa02a8c7ce Throw exception if floor2 and ceil2 are misused 2019-12-03 23:13:12 -03:00
Tulio Leao
c4089acd63 Removed parentheses for improved readability 2019-12-01 22:45:16 -03:00
duncanspumpkin
44998481f6 Use tile Offset 2019-12-01 15:15:44 +00:00
duncanspumpkin
ef10cb243b minor code cleanup 2019-12-01 14:53:52 +00:00
duncanspumpkin
813ed4fdac Remove commented out dead code 2019-12-01 14:52:17 +00:00
duncanspumpkin
f964d38e7d Renable light occlusion 2019-12-01 14:51:14 +00:00
duncanspumpkin
ace59e6a73 Make lights work for all rotations.
Mistake made with the coordinates confusing viewport and screen coordinates. In addition occlusion code that is depretiated was culling all lights in two rotations due to dead code.
2019-12-01 14:07:48 +00:00
duncanspumpkin
0c6e062d5a Refactor return value of screen_coord_to_viewport_cord 2019-12-01 09:15:07 +00:00
Tulio Leao
1532ee2b23 Create CoordsXY::ToTileStart() and CoordsXY::ToTileCentre() 2019-11-30 16:47:23 +01:00
Tulio Leao
1e67c3bff8 Make floor2 and ceil2 constexpr functions 2019-11-30 08:41:45 -03:00
Tulio Leao
721a4961a7 Fix #10304: Mouse zoom not following cursor position 2019-11-29 18:08:59 -03:00
Tulio Leao
4537c061d9 Prefer std::optional over LOCATION_NULL on Viewport (#10297) 2019-11-29 17:17:01 +01:00
Duncan
7e96ddf1d6
Merge pull request #10289 from tupaschoal/viewport-inter-2
Use CoordsXY on ViewportInteraction.cpp
2019-11-29 09:21:08 +00:00
Duncan
b316f447a4
Merge pull request #10285 from tupaschoal/useCoords-get-map-coords
Remove raw coordinates overload of get_map_coordinates_from_pos
2019-11-29 09:20:12 +00:00
Ted John
569161902f Fix #9919: invalid read in vehicle_update_measurements (#10300) 2019-11-27 21:45:32 +01:00
Tulio Leao
fb95154000 Use operator -= and += of CoordsXY 2019-11-25 23:08:31 -03:00
Tulio Leao
47935288d0 Remove raw coordinates overload of get_map_coordinates_from_pos 2019-11-25 17:45:02 -03:00
Tulio Leao
2af1f1feba Use CoordsXY on ViewportInteraction.cpp 2019-11-24 19:45:56 -03:00
duncanspumpkin
0c4fffb2ec Refactor viewport_adjust_for_map_height to use CoordsXYZ. 2019-11-24 21:37:35 +00:00
Duncan
966ba6b018
Merge pull request #10269 from duncanspumpkin/centre_2d
Refactor centre_2d_coordinates to use screenCoords.
2019-11-24 14:28:18 +00:00
Duncan
81566a5e90
Merge pull request #10276 from tupaschoal/viewport-inter
Use ScreenCoordsXY on viewport interactions
2019-11-24 14:27:58 +00:00
tjwrona1992
5f41e9df38 Add missing include for std::max to fix VS16.4.0P2 compilation (#10282)
* Fix errors where "std::max" was not recognized while compiling with the latest Visual Studio (2019 16.4.0 Preview 2.0) due to a missing "#include" statement.

* Ran clang-format.
2019-11-24 08:12:50 +01:00
Tulio Leao
831050745c Fix #10275: Track element preview incorrect 2019-11-22 12:10:47 +01:00
Tulio Leao
c91bdadb47 Use ScreenCoordsXY on viewport interactions 2019-11-21 17:53:28 -03:00
Duncan
dfe8335e91
Merge pull request #10273 from tupaschoal/with_z_coords
Use CoordsXY/ScreenCoordsXY for viewport*_with_z
2019-11-21 17:06:49 +00:00
Paweł Bylica
7e7e088d8e
Use fs::path for some implementations in Path 2019-11-21 13:40:21 +01:00
Paweł Bylica
45002d723a
Add core/FileSystem.hpp for accessing std::filesystem
This file enables access to std::filesystem as `fs` namespace
or injects third-party drop-in replacement on build configs
where std::filesystem is not available.
2019-11-21 13:40:20 +01:00
Paweł Bylica
5a8a7fe7ba
Add ghc::filesystem for thirdparty/
This adds the filesystem.hpp from https://github.com/gulrak/filesystem the the src/openrct2/thirdparty directory. The header is going to be used in build configurations where std::filesystem is not available.
2019-11-21 13:40:20 +01:00
Tulio Leao
7f74e01669
Add braces to fix return on null Coords 2019-11-21 09:22:09 -03:00
Tulio Leao
a9c2e1229a Propagate error upward with LOCATION_NULL 2019-11-21 08:00:06 -03:00
duncanspumpkin
d4c15cd774 Refactor centre_2d_coordinates to use screenCoords. 2019-11-20 18:44:03 +00:00
Tulio Leao
f94970b059 Use CoordsXY/ScreenCoordsXY for viewport*_with_z
Closes #10268
2019-11-19 18:33:40 -03:00
Duncan
463ef9d218
Merge pull request #10238 from duncanspumpkin/viewport_get_xy_z
Refactor screen_get_map_xy_with_z to use CoordsXY structs
2019-11-19 15:02:50 +00:00
Tulio Leao
7718d83b21 Simplify assignment in RideConstruction.cpp (#10266) 2019-11-19 16:01:22 +01:00
duncanspumpkin
3b8bf56b71 Use helper function 2019-11-19 11:20:59 +00:00
duncanspumpkin
421107436f Refactor helper function to take screen coords 2019-11-19 11:20:59 +00:00
duncanspumpkin
1d6a923298 Refactor screen_get_map_xy_with_z to use CoordsXY structs 2019-11-19 11:20:58 +00:00
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