Commit Graph

15667 Commits

Author SHA1 Message Date
Duncan e24c897cad
Fix #12857: Incorrect thought arguments for RCT1 import 2020-09-05 13:24:26 +02:00
Ted John c7b8a63fa9 Fix network enum 2020-09-03 22:38:42 +01:00
Ted John 858bb4045f Explicitly close sockets when plugin is stopped 2020-09-03 22:38:42 +01:00
Ted John 33ba51b763 Fix crashes and improve socket lifecycle 2020-09-03 22:38:42 +01:00
Ted John 0bddf5a5db Rename SocketServer to Listener 2020-09-03 22:38:42 +01:00
Ted John 173a42f656 Apply code review suggestions 2020-09-03 22:38:42 +01:00
Ted John 1c91404707 Add more network guards 2020-09-03 22:38:42 +01:00
Ted John fd6fddb61a Improve WSA handling 2020-09-03 22:38:42 +01:00
Ted John 7dfb748500 Add listening property 2020-09-03 22:38:42 +01:00
Ted John 5da5804f84 Add localhost limitation 2020-09-03 22:38:42 +01:00
Ted John 703dc1efa7 Add ability to connect 2020-09-03 22:38:42 +01:00
Ted John 182bcaf21a Implement setNoDelay 2020-09-03 22:38:42 +01:00
Ted John 7a5cb8a5b6 Refactor events into EventList class 2020-09-03 22:38:42 +01:00
Ted John dce547af99 Start implementing TCP API 2020-09-03 22:38:35 +01:00
Nils Caspar 359bbee9f5
Fix #12845: Cancel marketing campaigns for demolished rides (#12848) 2020-09-03 18:20:42 -03:00
Duncan c0255efeaa
Create an enum class serializer (#12810)
* Create an enum class serializer

* Make visitor work again

* Make suggested changes
2020-09-03 21:55:46 +01:00
Nils Caspar bc33ef3d43
Add Park.entranceFee to the plugin API (#12840) 2020-09-03 17:07:19 -03:00
Nils Caspar 22f29bf192
Close #12414: Refactor GUEST_LIST_FILTER_TYPE to use strong enum (#12830) 2020-09-02 12:50:16 -03:00
Simon Ellmann 5f3fe62f83
Close #12432: Refactor STAFF_MODE to use strong enum (#12752)
* Refactor STAFF_MODE to use strong enum

Closes #12432

* Change type of gStaffModes to StaffMode
2020-09-02 12:48:40 -03:00
Nils Caspar ae81ed63cc
Remove unused constant TAB_HEIGHT in Cheats.cpp (#12838) 2020-09-01 22:58:06 +02:00
Michael Steenbeek 55722a7ad4
Remove commented-out code (#12834) 2020-09-01 15:33:52 -03:00
Simon J f7acb84e42
Fix #400: unable to place some saved tracks flush to the the ground (#12721) 2020-09-01 18:26:44 +02:00
Tulio Leao 4e58eae43d
Merge pull request #12808 from gguedesaz/fix-stringbuilder
Part of #11159: Refactor on StringBuilder.hpp
2020-09-01 00:48:55 -03:00
Gabriel Guedes 95ae589750 Part of #11159: Prefer std::basic_string<utf8> over raw pointer
Usage of std::basic_string to improve readability and maintainability.
2020-08-31 21:06:02 -03:00
Julia Pinheiro dafde532af
Close #12426: Refactor NETWORK_READPACKET to use strong enum (#12807)
Replacing enum NETWORK_READPACKET with enum class NetworkReadPacket.
2020-08-31 09:13:15 -03:00
Aaron van Geffen e9803fc4b5
Fix #12820: Title menu buttons not invalidating properly (#12821)
This introduces constants for the title menu buttons to ensure this does not happen again.
2020-08-30 23:30:02 +02:00
Aaron van Geffen 5825dedd81
Rename TitleScenarioSelect to ScenarioSelect (#12822)
The scenario select window is not only available through the title screen.
2020-08-30 20:22:20 +02:00
Gabriel Guedes 332e9e76d5 Part of #11159: Removing unused functions from StringBuilder.hpp 2020-08-29 14:34:30 -03:00
ju-pinheiro e9c3f31422
Close #12423: Refactor NETWORK_SERVER_STATE to use strong enum (#12802)
#12423
2020-08-29 08:05:51 -03:00
Łukasz Pękalski bfdc1f6d2a
Close #12430: Refactor OBJ_STRING_ID to use strong enum (#12796) 2020-08-28 23:36:58 -03:00
Tulio Leao 731a93dc39
Create WindowColour enum for widget definition calls (#12722)
* Make MakeWidget* functions take enum colour

* Make windows A-D use WindowColour enum

* Make windows E-G use WindowColour enum

* Make windows I-M use WindowColour enum

* Make windows N-P use WindowColour enum

* Make windows R-S use WindowColour enum

* Make windows T use WindowColour enum

* Make windows V-W use WindowColour enum
2020-08-28 23:31:31 -03:00
Cory Sanin 8d366ebaea
Add Ride.totalProfit to the plugin API (#12795)
Add Ride.totalProfit to the plugin API
2020-08-28 22:52:54 +01:00
awiebe b53c4b3625
Downgrade Mac build requirements of OpenRCT2 to macOS 10.13 (#12749)
Keep targeting macOS 10.14 for libopenrct2 target. Replace deployment target with macOS 10.13 for other targets, including the OpenRCT2 bundle.

Explicitly type std::arrays, since Xcode refuses to use C++17 array deduction.

Co-authored-by: Aaron van Geffen <aaron@aaronweb.net>
2020-08-28 22:27:25 +02:00
Ted John 3a0bff4b93 Add comment about remX, remY 2020-08-28 01:30:17 +01:00
Ted John 65e3d20156 Refactor drawing 2020-08-28 01:30:15 +01:00
Ted John a1cd02c61c Disable closer zoom levels for software rendering 2020-08-28 01:29:59 +01:00
Ted John 609cde2304 Fix drawing of money text when zoomed in 2020-08-28 01:29:59 +01:00
Ted John 7f0510e444 Fix sub pixel clip issues with OpenGL 2020-08-28 01:29:59 +01:00
Ted John f51ad862c9 Refactor window drawing 2020-08-28 01:29:59 +01:00
Ted John 2b51eaeaa1 Fix weather gloom when zoomed in 2020-08-28 01:29:59 +01:00
Ted John 25581fa4ef Share blit methods between BMP and RLE 2020-08-28 01:29:59 +01:00
Ted John f16a46b872 Refactor RLE minify 2020-08-28 01:29:59 +01:00
Ted John 1645c64e87 Implement RLE magnify 2020-08-28 01:29:59 +01:00
Ted John 247c950c60 Implement magnify for bitmap 2020-08-28 01:29:59 +01:00
Ted John cd7324262d Create ZoomLevel struct to add two new zoom levels 2020-08-28 01:29:59 +01:00
Łukasz Pękalski 411f242cfd
Close #12431 Refactor VirtualFloorStyles to use strong enum (#12790) 2020-08-27 21:06:39 -03:00
Michał Janiszewski c6b10bb051
Make GetCurrentExecutableDirectory public (#12791) 2020-08-27 21:03:41 +02:00
Michael Steenbeek db8efe20d0
Merge pull request #12785 from Gymnasiast/refactor/text-drawing
Start removal of gfx_draw_string_*()
2020-08-26 22:51:39 +02:00
Michael Steenbeek 60a35f7abb
Merge pull request #12783 from Gymnasiast/refactor/ride-status-formatter
Use Formatter in windows/Ride.cpp
2020-08-26 22:51:09 +02:00
Gymnasiast 549a771120
Use Formatter& 2020-08-26 17:13:19 +02:00
Aaron van Geffen ec6f1b5fcd
Fix #12784: Scenery tab images missing 2020-08-26 17:06:19 +02:00
Gymnasiast 17bac8c57b
Use colour_t 2020-08-26 15:38:27 +02:00
Gymnasiast 972e6e80ab
Allow passing Formatter to DrawTextBasic() and DrawTextEllipsised() 2020-08-26 15:08:42 +02:00
Gymnasiast 39bc73c394
Deprecate text draw functions with 1:1 replacements 2020-08-26 14:53:59 +02:00
Gymnasiast 9a31a94128
Use const args in DrawTextEllipsised() 2020-08-26 14:49:28 +02:00
Gymnasiast ceace1a3ad
Remove draw_string_left_underline() 2020-08-26 14:47:47 +02:00
Gymnasiast f1caddc9fe
Remove draw_string_right_underline() 2020-08-26 14:46:37 +02:00
Gymnasiast 5f468da9cf
Remove draw_string_centred_underline() 2020-08-26 14:44:57 +02:00
Gymnasiast e1b778832b
Expose DrawTextBasic() and DrawTextEllipsised() 2020-08-26 14:44:30 +02:00
Gymnasiast 10ac7954b0
Remove set_format_arg_body() 2020-08-26 14:04:44 +02:00
Gymnasiast 879ce64a86
Use Formatter in windows/Ride.cpp 2020-08-26 13:59:18 +02:00
Michael Steenbeek 8b19d943a4
Merge pull request #12676 from mwnciau/Ride-Helix-Save
Fix #7037: saving rides starting with sloped turn
2020-08-26 12:13:59 +02:00
Michael Steenbeek 56c623e549
Merge pull request #12671 from AaronVanGeffen/refactor/tabs
MakeTab wrapper for standard tab widgets
2020-08-26 12:13:36 +02:00
Gymnasiast c85960abee
Fix Junior RC booster G2 offsets 2020-08-26 11:58:15 +02:00
Tulio Leao 02d1c5afca
Merge pull request #12771 from tupaschoal/fix-12764
Fix #12764: Rides don't start aged anymore
2020-08-25 21:51:57 -03:00
Tulio Leao efdb7e1a2d Change gDateMonthsElapsed type to int32_t 2020-08-25 19:06:38 -03:00
Michał Janiszewski 30e452d76c
Fix null dereference in place_provisional_track_piece (#12777) 2020-08-25 23:20:40 +02:00
Michał Janiszewski 3d12dfec3e
Part of #11437: Refactor Win32 RemoveFileAssociations to Platform2 (#12773)
Additionally fixes missing changes from previous refactor in #12036 that
borked WinNT 5.1 support
2020-08-25 23:20:24 +02:00
Tulio Leao 10aca0fe6e Fix #12764: Rides don't start aged anymore 2020-08-25 08:21:34 -03:00
ceeac 8f8eb81326
Fix #12740: Compile error when DEBUG_LEVEL is 2 or higher in CMake (#12754)
Commit 6607bad did not fully fix this.
2020-08-24 19:56:16 -03:00
frutiemax 4165d64e60
Part of #11159: save_for_network returns unique_ptr (#12163) 2020-08-22 18:56:34 -03:00
Duncan 2660df85ed
Reset sprite spatial index on all inits (#12746) 2020-08-22 05:09:42 +01:00
Tulio Leao 4caf571c22
Followup on #12475 post-mortem comments (#12745)
* Remove using namespace OpenRCT2 from header

* Fix using wronf undefined enum for shortcut key map
2020-08-21 16:07:38 +01:00
Sidney 5330f7fb86
closes #12445 Refactor CLIMATE to use strong enum (#12551) 2020-08-21 09:43:57 +01:00
frutiemax 4cc550a364
Close #12460: Refactor KeyboardShortcut to use strong enum (#12475)
* Close #12460: Refactor KeyboardShortcut to use strong enum

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-08-20 23:54:43 -03:00
Tulio Leao 6607badad0
Fix #12740: Broken log messages on GuestPathfinding (#12743) 2020-08-20 23:35:04 -03:00
Tom Parsons 9cdae2d1e2
Fix #12401: Refactor SCALE_QUALITY to use strong enum (#12673) 2020-08-20 23:32:56 -03:00
frutiemax d61a749b70
Use CoordsXYZ for sub_98199C in MiniatureRailway.cpp (#12723) 2020-08-20 23:14:56 -03:00
Cory Sanin df5dd4f253
Fix #12737: Space Rings draw the same vehicle 4 times (#12738)
paint_space_rings_structure always used vehicle 0 for it's vehicle reference
2020-08-20 19:04:15 +02:00
Simon J b51e98215a
Fix #12728: Paths made in scenario editor don't connect to the map edge (#12730)
Co-authored-by: Simon Jarrett <simonjjarrett@gmail.com>
2020-08-19 19:51:13 -03:00
Simon Jarrett 31a1d5259c Fix #7037: Unable to save tracks starting with a sloped turn or helix 2020-08-19 00:08:14 +01:00
Simon Jarrett 9fb51c18d4 Fix: Incomplete loop collision box allowed overlap (original bug) 2020-08-18 17:03:35 +01:00
frutiemax 33f3f5cc3b
Use CoordsXYZ for sub_98199C in RiverRapids.cpp (#12289) 2020-08-18 09:27:23 -03:00
Simon J 4c2ce0f892
Remove duplicate TRACK_ELEMENT_LOCATION_IS_UNDERGROUND flag (#12714)
Renamed all instances to ELEMENT_IS_UNDERGROUND

Co-authored-by: Simon Jarrett <simonjjarrett@gmail.com>
2020-08-18 09:26:03 -03:00
Aaron van Geffen 40cfadcdc5 Apply formatting suggestions from code review
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-08-18 10:13:48 +02:00
Aaron van Geffen 0f6611b6d6 Remove unused disabled tab sprite 2020-08-18 10:13:48 +02:00
Tulio Leao f2af98b3e8
Merge pull request #12690 from ryan-bello/develop
Fix #12433 Refactor STAFF_TYPE to use strong enum
2020-08-18 00:46:49 -03:00
ryan-bello cc2bb33892 changed enum STAFF_TYPE to strong enum StaffType, moved it to Peep.h 2020-08-17 22:59:02 -04:00
frutiemax 9ab1f3b5fe
Close #12336: Remove goto from loc_6A6D7E (#12366) 2020-08-17 23:28:26 -03:00
ryan-bello 54a33cbde8 renamed StaffType to AssignedStaffType 2020-08-17 20:16:09 -04:00
Aaron van Geffen 3b97cd9b14 Refactor Staff*, Themes, and TitleEditor to use MakeTab 2020-08-17 20:59:42 +02:00
Aaron van Geffen 6b9211c8b8 Refactor Park, Player, Research, Ride* to use MakeTab 2020-08-17 20:59:42 +02:00
Aaron van Geffen 3631d75b98 Use MakeTab in Mapgen, Multiplayer, Network, NewRide, NewsOptions 2020-08-17 20:59:23 +02:00
Aaron van Geffen be626d0b7c Refactor Editor*, Finances, Guest* to use MakeTab 2020-08-17 20:59:17 +02:00
Aaron van Geffen 6602b51b8b Use MakeTab in EditorInventionsList, EditorObjectSelection, Scenery 2020-08-17 20:59:17 +02:00
Aaron van Geffen 4a55acd71e Introduce MakeTab wrapper function
The MakeTab function is only applied in two places, for the moment:
the Cheats and Options windows.
2020-08-17 20:59:13 +02:00
Aaron van Geffen 72be84caf8
Remove unused fourth tab from Staff window (#12713) 2020-08-17 20:21:46 +02:00
Duncan 55ba164dee
Fix crash when switching ride types with construct window open (#12694) 2020-08-16 18:48:21 +01:00
pizza2004 647730fcfa
Fix #12691: Tooltip at ride's graph tab is not using a proper string 2020-08-15 23:17:38 +02:00
Aaron van Geffen 135cc10b47 Release v0.3.0 2020-08-15 21:13:50 +02:00
Aaron van Geffen f95da1c99a Fix alignment for widget definitions 2020-08-14 10:18:17 +02:00
Michał Janiszewski 6dd67296a4 Merge "new version" window back to changelog 2020-08-14 10:18:17 +02:00
Michał Janiszewski ddee3c0e46 Postpone update check until the context gets fully initialised 2020-08-14 10:18:17 +02:00
Michał Janiszewski 6ae5645686 Show update information on main screen & in floppy menu 2020-08-14 10:18:17 +02:00
Michał Janiszewski 55835456a0 Pester users to update to latest release 2020-08-14 10:18:17 +02:00
Aaron van Geffen eda8e31055
Refactor widget defs in EditorObjectiveOptions window (#12672) 2020-08-13 23:07:19 -03:00
Michał Janiszewski c8fbffa0e2
Update backtrace token for upcoming release 2020-08-13 23:28:31 +02:00
Matt Thomson a8f8f06e2d
Fix #12402: Refactor MEASUREMENT_FORMAT to use strong enum (#12642)
* Fix #12402: Refactor MEASUREMENT_FORMAT to use strong enum

* Remove redundant default branches

Co-authored-by: Matt Thomson <matt-thomson@users.noreply.github.com>
2020-08-13 21:51:28 +01:00
Michael Steenbeek 5e09ecc904
Fix #12308: Cannot use cheats in editor modes (#12661)
This allows opening the cheats window while in editor mode. Some tabs and options are disabled because they are not relevant to these modes.
2020-08-13 13:03:56 +02:00
Michael Steenbeek 33d9fc2b75
Fix #10549: 'Build the best ride you can' objective missing ride name
This is implemented in a way that is compatible with RCT2 (as long as the ride type was not split).
2020-08-13 00:23:08 +02:00
Michael Steenbeek 68ce06e833
Refactor objective handling in Scenario Editor
This moves some knowledge out of the window and into the main code and also cleans up the window a bit.

This also allows setting the "x guests by the end of year y" goal for no money scenarios, which was not the case previously.
2020-08-12 22:10:47 +02:00
ζeh Matt c1076658fc
Merge pull request #12658 from ZehMatt/fix-network-hang
Fix freezes on incomplete packet transmission
2020-08-12 19:00:27 +02:00
Matt 08af1e9be6 Increase network buffer to maximum packet size of 64 KiB 2020-08-12 18:36:12 +02:00
Michael Steenbeek d1b193c06d
Fix #11968: Maze height is higher than it should be 2020-08-12 18:33:15 +02:00
Matt ebc2be4cd0 Fix freezes on incomplete packet transmission 2020-08-12 18:11:09 +02:00
ζeh Matt e464c9e522
Invert the condition (#12645) 2020-08-11 19:29:18 +01:00
Michael Steenbeek 2d56c8d2de
Merge pull request #12636 from Gymnasiast/refactor/to-member-function
Use a 16-bit integer for track type in more places
2020-08-11 17:53:20 +02:00
ζeh Matt ae25af291b
Merge pull request #12631 from ZehMatt/12474-part1
Add more guards in network code
2020-08-11 17:25:22 +02:00
Matt 2a9796f2cc Add more guards in network code 2020-08-11 15:56:09 +02:00
Tulio Leao 2e4edf6f5d
Merge pull request #12638 from quale/fix-debug-window
Fix Z coordinate and spillover in guest debug tab
2020-08-11 07:53:19 -03:00
Jonathan van Tuijl 4117965a4a Fix Z coordinate in guest debug tab 2020-08-11 03:37:34 +02:00
Jonathan van Tuijl dcdc782361 Increase minimum window size so pathfind history doesn’t spill out 2020-08-11 03:35:24 +02:00
Gymnasiast 89f04c4fb3
Fix names of two track type functions 2020-08-10 23:48:18 +02:00
Gymnasiast 6802011f7d
Use a 16-bit integer for track type in more places 2020-08-10 21:34:10 +02:00
Gymnasiast 9d24655056
Convert track_element_is_block_start() to member function 2020-08-10 21:15:48 +02:00
Michael Steenbeek be0123decb
Fix #12611: Bad check for pay-per-ride ability 2020-08-10 18:56:06 +02:00
ζeh Matt cb38d28b62
Fix #12621: Missing argument for localisation 2020-08-10 14:58:39 +02:00
Michał Janiszewski 6f8ae294ae
Fix launchpad builds (#12575)
```
/<<PKGBUILDDIR>>/src/openrct2-ui/interface/ViewportInteraction.cpp: In function ‘InteractionInfo viewport_interaction_get_item_left(const ScreenCoordsXY&)’:
/<<PKGBUILDDIR>>/src/openrct2-ui/interface/ViewportInteraction.cpp:85:29: error: potential null pointer dereference [-Werror=null-dereference]
   85 |             switch (sprite->sprite_identifier)
      |                     ~~~~~~~~^~~~~~~~~~~~~~~~~
```
2020-08-09 07:27:26 +01:00
Michael Lu 7cd6e72edd
Refactor TEMPERATURE_FORMAT to use strong enum (#12610)
* Refactor TEMPERATURE_FORMAT to use strong enum

* Rename TEMPERATURE_FORMAT to TemperatureFormat

* Rename TemperatureFormat to TempueratureUnit
2020-08-09 07:26:46 +01:00
Arran Ireland 89e4714198
Close #12331: Use CoordsXY in track_remove_station_element (#12609)
* Update track_remove_station_element signature

Part of #12331: This commit will update the
signature of track_remove_station_element and
its callers, to use CoordsXYZD.

* Fix track_remove_station_element local vars

Part of #12331: This commit will ensure that
references to the previous arguments in
track_remove_station_element will now use the new
CoordsXYZD argument.

* Refactor remove in track_remove_station_element

Part of #12331: This commit refactors the removeX/Y
to use CoordsXY.

* Refactor station0 in track_remove_station_element

Part of #12331: This commit will refactor stationX/Y0
to use CoordsXY.

* Close #12331 track_remove_station_element refactor

This commit refactors stationX/Y1 to use CoordsXY,
and fixes the smallZ vs bigZ problem in callers of
track_remove_station_element. These are the final
changes for this issue.

* Added operator for CoordsXYZD minus CoordsXY.

This commit adds a missing operator for subtracting
a CoordsXY from a CoordsXYZD. This was needed for
refactoring Track.cpp

* Refactor track_remove_station_element Coord use

This commit utilises the overloaded operators for
Coords and ensures that they are used so that the
function implementation is more readable.

* Close #12331 track_remove_station_element refactor

This commit also fixes a bug in which a small Z
value (the Height of a RideStation) was being
updated with a big Z value without scaling. It
adds a few extra refactors in calls of the
track_remove_station_element function, and
changes the contributors to add ion232.
2020-08-09 07:25:44 +01:00
Arran Ireland 4de58e1fd4
Close #12440: Refactor VEHICLE_STATUS to use strong enum (#12606)
* Close #12440: Refactor VEHICLE_STATUS to use strong enum

* Fix code formatting for VEHICLE_STATUS refactoring

* Refactor VehicleStatus enum to be inside Vehicle

This commit moves VehicleStatus inside Vehicle,
renamed as Status.
2020-08-09 06:24:25 +01:00
Tom Parsons c4ae579a84
Feature #11817: Show authors field in object selection (#12591)
* Feature #11817: Show authors field in object selection

- authors field in JSON shows as last line in bottom right on object selection
- authors field added to Object class
- ObjectFileIndex version bump as authors is serialised

* fix sign comparison warning

* Start object selection corner text higher to avoid overlap

* Use references to reduce unneccessary copies

* make GetAuthors const

* Clip drawing of authors string so it doesn't cross widgets

At max length the leftmost aligns exactly with description left

* Add a changelog message

* make SetAuthors use an rvalue reference

* remove unnecessary nullptr check
2020-08-09 06:23:28 +01:00
Matt c16bdb5c69 Fix #11085: Handle player list before game actions during map load 2020-08-08 20:47:34 +02:00
Arran Ireland 1702c90c8e
Merge pull request #12605 from ion232/refactor-vehicle-type
closes #12439: Refactor VEHICLE_TYPE to use strong enum
2020-08-08 18:41:04 +01:00
Sidney 933570fd62
Close #12442: Refactor SCENARIO_SOURCE to use strong enum (#12608) 2020-08-08 09:38:43 -03:00
Łukasz Pękalski 399e0abe2e
Close #12497: Remove extra SPRITE_INDEX_NULL checks (#12601) 2020-08-08 09:12:52 -03:00
Sidney 93ef28927f
Close #12447: Refactor WEATHER_EFFECT to use strong enum (#12548) 2020-08-07 17:10:59 +01:00
ceeac db010cd971
Fix compile error when compiling with clang-10 (#12599)
<cstddef> is required for size_t (used in CircularBuffer.h)
2020-08-06 16:24:50 +01:00
Tulio Leao be9dca6945
Close #12416: Refactor CURRENCY_AFFIX to use strong enum (#12589)
* Close #12416: Refactor CURRENCY_AFFIX to use strong enum

* Add static assert to check config enum type

Co-authored-by: Matt Thomson <matt-thomson@users.noreply.github.com>
2020-08-05 20:26:18 -03:00
Matt Thomson 788bc1581c Add static assert to check config enum type 2020-08-05 20:48:02 +01:00
ζeh Matt 1f0a5587a0
Merge pull request #12593 from quale/fix10751
Fix #10751: Save mazes in their entirety
2020-08-05 19:18:17 +02:00
quale 9ef3eec47d Fix #10751: Save mazes in their entirety 2020-08-05 18:08:34 +02:00
ζeh Matt 765eada18e
Merge pull request #12526 from ZehMatt/win32-cleanup
Win32 and namespace cleanup
2020-08-05 17:18:50 +02:00
Duncan 3533d1734f
Merge pull request #12571 from ZehMatt/network/update-2
Refactor more network code
2020-08-05 15:55:24 +01:00
Matt 97d14feaa6 Rebase fixes 2020-08-05 16:35:40 +02:00
Matt 0dc43d66e4 Remove the use of INTERFACE macro and macro its self 2020-08-05 16:30:44 +02:00
Matt 83355e35cc Move IStream, MemoryStream, FileStream into OpenRCT2 namespace 2020-08-05 16:29:36 +02:00
Matt 30376085cf Include missing headers 2020-08-05 16:29:29 +02:00
Matt e91e68e3ec Re-phrase the network compatibility comment 2020-08-05 16:19:57 +02:00
Matt 05a9b27136 Fix ByteSwapBE type safety 2020-08-05 16:17:18 +02:00
Tom Parsons 58240cf1ad
Close #12459: Remove unused enum PARK_LOAD_ERROR (#12590)
* Remove unused enum PARK_LOAD_ERROR

A refactoring a couple of years ago removed all uses so it
can safely be removed.

Closes #12459

* Also fix header order for clang-format
2020-08-04 23:26:59 -03:00
Matt Thomson 150100d89f Fix #12416: Refactor CURRENCY_AFFIX to use strong enum 2020-08-04 21:35:59 +01:00
Tom Parsons d9129bca0f
Fix #12405: Make LIGHTFX_LIGHT_TYPE a strong enum (LightType) (#12569)
* Fix #12405: Make LIGHTFX_LIGHT_TYPE a strong enum

* Fix #12405: Make LIGHTFX_LIGHT_TYPE a strong enum

- New strong enum LightType

- Remove unused enum members

- GetLightTypeSize and SetLightTypeSize modify size of light (0-3)

* actually save the change to lightType
2020-08-04 15:55:14 +01:00
Tulio Leao 78053e34d5
Fix #12561: Synchronized coasters not synced (#12572) 2020-08-04 15:51:35 +01:00
pizza2004 156be224f9
Close #12399: Refactor MIXER_GROUP to strong enum (#12531) 2020-08-03 20:51:12 -03:00
Tulio Leao bf0c4c4f0e
Fix #12533: Track designs list does not use natural sorting (#12537) 2020-08-03 20:42:54 -03:00
Duncan 0809069e74
Fix #12577: Mistake made in refactor #12538 (#12579)
Loop called the peep window open only when nullptr. Added extra checks for nullptr on window open
2020-08-03 20:09:24 -03:00
Duncan 87953ace9b
Fix #12535, #12536: RCT1 import can crash when too many misc entities (#12580)
Eventually this can be fixed properly in the new save format
2020-08-03 20:07:13 -03:00
Duncan 4fcdcc3729
Fix #12581: Divide by zero on dodgems on customised vehicles (#12582)
Likely caused by use of the console or a new plugin
2020-08-03 20:05:22 -03:00
Sidney 31fc1bd225
closes #12454: Remove unused enum EDIT_SCENARIOOPTIONS_* (#12547) 2020-08-03 21:05:43 +01:00
pizza2004 d217dfa9b9
Refactor NewsItem into namespace and Pascal Case (#12511) 2020-08-02 23:14:00 -03:00
Matt 07b343813a Fix passing missing parameter 2020-08-03 00:46:44 +02:00
Matt 28dcaeae2f Refactor reading/writing packets 2020-08-03 00:36:02 +02:00
Matt 21f63c1010 Pass NetworkCommand type as constructor to simplify code 2020-08-02 22:31:00 +02:00
Matt 313b8a7518 Remove std::unique_ptr and use move semantics instead 2020-08-02 22:08:56 +02:00
Matt 224efdbbdf Simplify usage of NetworkPacket::Data 2020-08-02 22:07:47 +02:00
Duncan aa11773da3
Fix #12566, #12565, #12562, #12560, #12558: Nullptr deref (#12567)
Mistake made in refactor meant that a nullptr deref took place when the screen coords were outside of the normal play area
2020-08-02 20:13:09 +01:00
Duncan 733bc5a981
Close #12518: Viewport Refactor (#12541)
* Remove viewport pointer from get_map_coordinates_from_pos

* Removed viewport from get_window

* Return a InteractionInfo from get_map_coord...

* Remove viewport_interaction_info struct

* Add Entity union to simplify code

* Name the enum used for viewport interaction

* Simplify functions further by returning the info struct

* Add default switches
2020-08-02 08:32:59 +01:00
Łukasz Pękalski 0f78d452a4
Part of #12497: Remove extra SPRITE_INDEX_NULL check (#12538)
* refactor: deleted double check of SPRITE_INDEX_NULL in Staff* ride_get_mechanic(Ride* ride)

* refactor: deleted double check of SPRITE_INDEX_NULL in Ride.cpp file

* refactor: deleted double check of SPRITE_INDEX_NULL in windows/Ride.cpp in function static rct_string_id window_ride_get_status_vehicle

* refactor: deleted double check of SPRITE_INDEX_NULL in ride/Ride.cpp

* refactor: deleted double check in FormatStatusTo
2020-08-02 08:28:11 +01:00
Duncan f49bfa777a
Change maze pathfinding to not prefer a direction (#12546)
* Change maze pathfinding to not prefer a direction

* Increment network version

* Update changelog

* Update replays
2020-08-02 08:20:34 +01:00
Sidney 7c0b03463c
Close #12452: Refactor DIAGNOSTIC_LEVEL to use strong enum (#12549) 2020-08-02 07:51:02 +01:00
Sidney 97d74e142e
Close #12441: Refactor VEHICLE_TRACK_SUBPOSITION to use strong enum (#12550) 2020-08-02 07:50:07 +01:00
Aaron van Geffen e039a51826
Fix #12552: Grey rectangles appear under windows and menus (#12554)
* Fix #12552: Grey rectangles appear under windows and menus

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-08-02 00:47:28 -03:00
Cory Sanin 394e8fb733
Resolve GCC warnings for Ride.cpp (#12553)
Eliminate warnings from ride_create_vehicles and ride_create_vehicles_find_first_block that would prevent build from succeeding when using GCC.
2020-08-02 00:28:47 +02:00
annoyingdroid ddd21fa87a
Part of #12098: Use ScreenRect on gfx_filter_rect (#12134) 2020-08-01 14:40:01 -03:00
TELK bf08943929
Fix #12352: Wrong date format for file names (#12543)
Issue likely caused by 5ae592ec79

Also see: https://en.cppreference.com/w/cpp/chrono/c/tm
2020-08-01 18:43:19 +02:00
Michał Janiszewski 88bad7729c
Merge pull request #12491 from janisozaur/openurl
Add OpenURL method, with implementation for Linux and Windows
2020-08-01 15:42:31 +02:00
Michael Steenbeek 4e9c32ff3a
Merge pull request #12521 from AaronVanGeffen/refactor/widgets-8
Refactor the last sets of widget definitions
2020-08-01 15:11:28 +02:00
Gymnasiast 3d071cec53
Implement OpenURL for macOS 2020-08-01 14:25:32 +02:00
Duncan 6d11825e1a
Reduce the use of rct_sprite (#12530)
* Reduce the use of rct_sprite

* Pass the correct types in S4 importer

* Add additional nullptr checks

* Simplify the viewport interaction

* Apply review comments

* Small cleanup of GetEntity

* Fix test paint
2020-08-01 11:29:54 +01:00
frutiemax 2c350fa416
Part of #12097: Use ScreenRect in gfx_fill_rect_inset (#12284) 2020-08-01 00:51:29 -03:00
Taylor Stieff f7f5124c07
Make tile element direction accessible for scripts (#12057)
* Make tile element direction accessible for scripts

Add the direction field from the tile element
class to the ScTileElement class passed to
the script engine.

Co-authored-by: Taylor Stieff <taylor.stieff@heavenhr.de>
2020-08-01 00:46:59 -03:00
Aaron van Geffen 3430076088 Very quickly process remaining review comments 2020-07-31 13:25:08 +02:00
Duncan cd1d573c39
Pass the formatter directly to scrolling_text_setup 2020-07-31 12:31:26 +02:00
Aaron van Geffen 16a484545a
Use WW in MapGen common widgets 2020-07-31 11:26:49 +02:00
Aaron van Geffen e6e850e399
Apply suggestions from code review
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-07-31 11:25:50 +02:00
Michael Steenbeek 402570adb6
Refactor usage of TextPaint
Eliminating a global variable in the process.
2020-07-31 11:13:28 +02:00
Duncan c6e26267a4
Reduce the use of GET_VEHICLE (#12494)
* Start removing GET_VEHICLE macro use

* Further work

* Remove further GET_VEHICLE's

* Further removal of GET_VEHICLE

* Remove the last of GET_VEHICLE

* Fix testpaint

* Fix nullptr deref

* Make review changes

Also swapped in helper functions and used a standard patern for iterating the train cars

* Further simplify loops for train cars
2020-07-31 07:48:27 +01:00
Aaron van Geffen d32809eaef
Fix formatting for StaffFirePrompt (#12525) 2020-07-30 23:06:01 +02:00
Aaron van Geffen 16ad1d18fb
Refactor another set of widget definitions (#12503)
* Refactor TopToolbar

* Refactor TrackDesignManage

* Refactor TrackDesignPlace

* Refactor TrackList

* Refactor ViewClipping

* Refactor Viewport

* Refactor TitleEditor

* Refactor TitleCommandEditor

* Refactor Themes

* Refactor TextInput
2020-07-30 22:58:49 +02:00
Aaron van Geffen b738c4fa87 Refactor StaffFirePrompt 2020-07-30 22:51:32 +02:00
Aaron van Geffen fe9d577c2e Refactor Staff 2020-07-30 22:45:40 +02:00
Aaron van Geffen e8e61bd987 Refactor Sign 2020-07-30 22:39:09 +02:00
Aaron van Geffen 9b6f6b6216 Refactor Ride 2020-07-30 22:36:42 +02:00
Aaron van Geffen c1cff7fab0 Refactor Park 2020-07-30 22:25:18 +02:00
Michael Steenbeek e0f2aa9b99
Fix: Brakes keep working during "Brakes failure"
This was an error in the original implementation back in 2015.
Thanks to @duncanspumpkin for checking the assembly.
2020-07-30 22:21:19 +02:00
Aaron van Geffen 8325ec04ed Refactor ObjectLoadError 2020-07-30 22:05:11 +02:00
Aaron van Geffen 173c103573 Refactor NewRide 2020-07-30 21:56:51 +02:00
Aaron van Geffen 5e04508a59 Refactor NewCampaign 2020-07-30 21:54:26 +02:00
Aaron van Geffen 60e397abb9 Refactor Network 2020-07-30 21:51:13 +02:00
Aaron van Geffen 240e45d62d Refactor MusicCredits 2020-07-30 21:51:03 +02:00
Michael Steenbeek cd86d3d757
Fix #7969: Loading landscape resets money, inventions and objective (#12520) 2020-07-30 21:43:46 +02:00
Aaron van Geffen 24fc4119c9 Refactor Multiplayer 2020-07-30 21:28:48 +02:00
Aaron van Geffen 915dc5f07c Refactor MazeConstruction 2020-07-30 21:23:51 +02:00
Aaron van Geffen cd5b506b6b Refactor MapTooltip 2020-07-30 21:21:08 +02:00
Aaron van Geffen 768fcfcba2 Refactor MapGen 2020-07-30 21:18:32 +02:00
ζeh Matt b0c67762b7
Merge pull request #12485 from ZehMatt/network/cleanup-1
Refactor the Network a bit, setting the stones for further refactor work
2020-07-30 20:54:18 +02:00
Michael Steenbeek e03753c139
Fix #12498: Circus construction ghost does not rotate (#12519) 2020-07-30 20:29:26 +02:00
Matt f258c8034d Wrap code with macro test DISABLE_NETWORK 2020-07-30 20:29:16 +02:00
Matt af757fa58e Categorize members of NetworkBase 2020-07-30 20:29:15 +02:00
Matt 4cede91424 Introduce NetworkClient and NetworkServer 2020-07-30 20:29:15 +02:00
Matt cf1fb9ecff Move some types into NetworkTypes.h 2020-07-30 20:29:15 +02:00
Matt 37f6a11a1f Move Network declaration into header and rename to NetworkBase 2020-07-30 20:29:15 +02:00
Michael Steenbeek bb1d81471d
Fix #12506: Cannot advertise food if there are no rides in the park 2020-07-29 10:44:38 +02:00
Michael Steenbeek 469f894701
Fix #12505: Stores can only have the first product advertised 2020-07-29 00:08:16 +02:00
Tulio Leao 63f683853e
Merge pull request #12479 from pizza2004/news-enum
Refactor NewsItem to use strong enums
2020-07-28 18:21:45 -03:00
Michael Steenbeek f8ab48176a
Tile Inspector: remove hardcoded surface/edge style names 2020-07-28 22:37:52 +02:00
Sidney fbdd1042b8
Fix #12486: `set-rct2` has a broken g1.dat check 2020-07-28 22:32:28 +02:00
pizza2004 a3edeabb5c Refactor NEWS_FLAG_* to use strong enum 2020-07-28 12:54:31 -06:00
pizza2004 c2b11a9582 Close #12398: Refactor NEWS_TYPE_* to use strong enum 2020-07-28 12:54:31 -06:00
pizza2004 cee7f8d34c Close #12397: Refactor NEWS_ITEM_* to use strong enum 2020-07-28 12:54:18 -06:00
ζeh Matt 8490e87eeb
Close #12422: Refactor NETWORK_COMMAND to use strong enum (#12481)
* Refactor NETWORK_COMMAND to strong enum

* Refactor all uses of NETWORK_COMMAND

Closes #12422
2020-07-28 17:24:40 +01:00
frutiemax 67554a2aae
Close #12458 : Refactor STARTUP_ACTION to use strong enum (#12480) 2020-07-28 17:23:09 +01:00
wdarvin 95b4bca3d0
Close #12448: Refactor RAIN_LEVEL to use strong enum (#12488)
* Close #12448: Refactor RAIN_LEVEL to use strong enum

* Refactor to remove enum suffix
2020-07-28 17:19:45 +01:00
Aaron van Geffen b34b573ad9
Refactor more widget definitions (#12354)
* Refactor Dropdown

* Refactor EditorMain

* Refactor EditorScenarioOptions

* Refactor InstallTrack

Increased window height to 460 (was 448); one line of text was overflowing.

* Refactor Guest

* Refactor LandRights

* Refactor LoadSave

* Refactor Main

* Refactor Map

* Add extra constants to EditorScenarioOptions
2020-07-27 19:54:22 -03:00
frutiemax af0fc89cf4
Close #12456: Refactor INPUT_STATE to use strong enum (#12484) 2020-07-27 19:51:10 -03:00
Michał Janiszewski 6a191224b5
Fix formatting of UiContext.macOS.mm 2020-07-27 17:20:28 +02:00
Michael Steenbeek 41162cc22f
Fix: bad kerning on lowercase 'j' character (original bug) 2020-07-26 23:19:16 +02:00
Michał Janiszewski 352870b503 Add OpenURL method, with implementation for Linux and Windows 2020-07-26 22:09:29 +02:00
Ted John cf9e8022a0 Fix #12297: OpenGL renderer causing artifacts
Do not re-allocate texture memory if we don't need to and aren't going to restore the old pixels.
2020-07-26 18:46:23 +01:00
Duncan 8a378ad236
Remove uses of GET_PEEP macro and replace with GetEntity (#12467)
* Use TryGetEntity and GetEntity instead of macro

* Use GetEntity for ui guest window

* Remove final GET_PEEP macro uses

* Fix remaining issues
2020-07-26 17:42:02 +01:00
Michael Steenbeek ba10b84789
Fix #12478: Crash in track_block_get_next() 2020-07-26 17:16:27 +02:00
Michael Steenbeek 9db2aac3bf
Merge pull request #12482 from frutiemax/Fix12457
Close #12457: Refactor INTRO_STATE to use strong enum
2020-07-26 15:40:22 +02:00
frutiemax 6598ae14aa Close #12457: Rename INTRO_STATE to use PascalCase 2020-07-26 09:32:53 -04:00
frutiemax 0f1788d273 Part of #12457: Refactor INTRO_STATE to use strong enum 2020-07-26 09:25:29 -04:00
Michał Janiszewski f1fa016400
Reset window pointer when cleaning up after dropdown 2020-07-26 10:09:56 +02:00
frutiemax 96a75f8c2c
Amend #12470: Make zooming at pointer take tile height into account 2020-07-26 01:28:29 +02:00
ζeh Matt b7e469cf33
Fix #11623: Erratic zoom behavior when pointing outside of the map 2020-07-26 00:27:40 +02:00
Michael Steenbeek 649757b77d
Merge pull request #12373 from ZehMatt/network/connect-update
Improve connecting to servers
2020-07-25 20:45:25 +02:00
Duncan 3de2de9814
Reduce use of get_sprite (#12382)
* Reduce use of get_sprite

* Update src/openrct2/world/Sprite.cpp

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-07-25 18:03:14 +01:00
Michael Steenbeek b70716d5f6
Fix #11804: Some RCT1 fences are imported at the wrong height 2020-07-25 16:58:22 +02:00
Matt 4b587e3989 Minor cleanup 2020-07-25 16:02:26 +02:00
Matt ab48c00a89 Fix client being stuck on empty object list 2020-07-25 15:23:26 +02:00
Matt 241ff111dd Address reviews 2020-07-25 14:10:01 +02:00
Matt fa2bd4cad6 Refactor PeepType to use strong enum 2020-07-25 11:54:37 +02:00
Michał Janiszewski 3b60740128
Add int64_t support to INI parser (#12374) 2020-07-25 09:37:35 +02:00
Michael Steenbeek 6ba6184602
Merge pull request #12362 from Gymnasiast/refactor/object-entry-index-null-to-0xFFFF
Change ObjectEntryIndex null value to 0xFFFF
2020-07-25 09:25:04 +02:00
chaitanyathengdi 33a88fbdbd
Fix #10946: On-ride photo profit assumes every guest buys one (#12285)
* Use stored values of customers to adjust income from on-ride photos

Use stored values of photos sold and total customers to calculate ratio
and use that to predict income per hour for rides that include
on-ride-photo sections.

* Get rid of float

* Fix formatting

* Fix formatting - again

* Review changes

* Fix formatting

* Use new method of checking on-ride photo

* Use constants

* Add a changelog and contributors entry
2020-07-25 07:19:51 +01:00
frutiemax f549698e96
Close #12338: Remove goto from Tick128UpdateGuest (#12367) 2020-07-25 07:16:40 +01:00
Matt 6c40d9f3d5 Fix formatting 2020-07-24 23:11:28 +02:00
Matt e31317e025 Rename function to be consistent 2020-07-24 23:11:28 +02:00
Matt d230bc8914 Bump up network version 2020-07-24 23:11:28 +02:00
Matt 908090104a Send client heartbeats to keep connection alive 2020-07-24 23:11:28 +02:00
Matt 1eedaf32dd Refactor sending the object list including status reporting 2020-07-24 23:11:28 +02:00
Matt 0f31b82af0 Add missing network command 2020-07-24 23:11:28 +02:00
Matt 8ef5d0e838 Rename some things to clarify purpose, add constant for map requests 2020-07-24 23:11:12 +02:00
ζeh Matt 76b7c4e676
Merge pull request #12372 from ZehMatt/path-underflow-warnings
Fix GetAdditionEntry trying obtain the object when no additions exist
2020-07-24 19:20:30 +02:00
Aaron van Geffen 4d0d41dfbe
Restore spinner decrease button width (#12370) 2020-07-24 19:12:11 +02:00
Matt 4b17b2ea76 Fix GetAdditionEntry trying obtain the object when no additions exist 2020-07-24 15:58:17 +02:00
Gymnasiast 682add27dd
Change ObjectEntryIndex null value to 0xFFFF 2020-07-23 12:45:42 +02:00
Gymnasiast 3060c2d8cb
Add const to conversion functions 2020-07-23 12:05:00 +02:00
Aaron van Geffen 37a1a1c0a2
Fix #12356: Opening SC4 or SV4 centres viewport on void (#12361) 2020-07-23 11:41:34 +02:00
Michael Steenbeek f567da04eb
Fix #12353: Research window shows wrong ride type 2020-07-22 23:21:08 +02:00
Duncan 4a235e3bb6
Refactor ResearchItem Type to an enum class (#12346)
* Change type of ResearchItem.type to enum class

This is to prevent any future issues caused by confusion as to what the type is and further improves the codebase.

* Specifiy a size for the type

Also remove the static cast where not required

* Apply review comments
2020-07-22 14:25:05 +01:00
0ro8lu 4416565e47
Close #12269: remove goto from x8_drawing_engine (#12274)
Refactored the function into a separate get dirty rows function.
2020-07-22 11:51:41 +01:00
Duncan 2d1a6bd13b
Fix research import/export (#12345)
Old version incorrectly tried to convert the research type not the base ride type causing crashes when new saves were used on older versions of OpenRCT2 or vanilla.
2020-07-22 09:42:16 +01:00
Aaron van Geffen 205fc3332b
Refactor more widget definitions
* Increase height for changelog button in about window
* Tackle banner window
* Tackle changelog window
* Tackle custom currency window
* Tackle finance summary
* Tackle quit prompt widgets
* Tackle debug paint widgets
* Tackle demolish and refurbish prompt widgets
2020-07-21 17:38:57 +02:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Aaron van Geffen 8f57c22bfe
Refactor options window widget definitions into new format (#12316) 2020-07-21 14:14:44 +02:00
Gymnasiast bc3ad044f8
Consistently use 'Circus' 2020-07-21 13:55:48 +02:00
Gymnasiast c2153ae797
Consistenly use 'Swinging Ship' 2020-07-21 13:55:48 +02:00
Michael Steenbeek 09ece01096
Merge pull request #12303 from AaronVanGeffen/refactor/cheats
Refactor cheats window
2020-07-21 11:36:24 +02:00
Tulio Leao d10b615eb3
Remove assert on ScreenLine (#12333)
Code is not always constructing a valid line
2020-07-20 18:49:15 -03:00
0ro8lu 6e077c42ea
Close #12270: Remove goto track_remove_station_element (#12323)
Refactored the goto statement
2020-07-20 20:55:50 +01:00
Aaron van Geffen 3d7c0a567e Introduce local constants per review suggestion 2020-07-20 00:12:04 +02:00
Aaron van Geffen 0a5b75e882
Refactor more windows into new-style widget format
* Ride Construction
* Ride List
* Save Prompt
* Scenery
* Scenery Scatter
* Server List
* Server Start
* Shortcut Keys
2020-07-19 19:36:54 +02:00
Umdlye 84c0ee42bd
Fix #12314: Swinging Ship colour tab shows Suspended Sw.c. track preview 2020-07-19 14:38:30 +02:00
ζeh Matt 2d81e9c51c
Fix #12229, fix #12312: No error message when loading a save fails 2020-07-19 14:33:32 +02:00
Aaron van Geffen b966173550
Fix #12315: Re-introduce titles in Finances and Research windows. (#12317) 2020-07-19 14:31:24 +02:00
Aaron van Geffen d303f0b1ef Add constants for common cheat widget sizes. 2020-07-19 11:54:41 +02:00
Michael Steenbeek 5c411390bd
Fix #12226: Crash in FindVehicleToEnter (#12310) 2020-07-18 23:54:55 +02:00
Michael Steenbeek 90129f669c
Fix #12305: Can no longer build boosters on Hyper-Twister 2020-07-18 21:43:36 +02:00
Aaron van Geffen 15704d6d33 Refactor cheat window widget definitions into new format 2020-07-17 22:46:50 +02:00
Aaron van Geffen 6375d79c27 Cheats window: unfold existing window-specific macros 2020-07-17 22:46:48 +02:00
Michael Steenbeek 33898936b0
Merge pull request #12007 from Gymnasiast/refactor/remove-ride-groups
Close #11971: Replace ride groups with new ride types
2020-07-17 12:35:30 +02:00
frutiemax 77d02c5e2b
Close #12290: Refactor of object_manager_unload_objects (#12291) 2020-07-17 05:25:35 +01:00
rdbaris 8aa8d77ca1
Fix for smart pointer bug (#12293)
Don't allocate a ton of memory on load.
2020-07-17 05:23:05 +01:00
Gymnasiast 742ae947c7
Add null checks throughout 2020-07-17 00:32:47 +02:00
Gymnasiast d703768d5d
Use old ride types in RideTypesBeenOn 2020-07-17 00:19:49 +02:00
Gymnasiast 470497d868
Limit S6 Importer object lookup to ride types that need conversion 2020-07-17 00:19:49 +02:00
Gymnasiast f596d8de58
Limit track design object lookup to ride types where it's needed 2020-07-17 00:19:49 +02:00
Gymnasiast c6f0bb92a8
Add mutex during track design cache creation 2020-07-17 00:19:49 +02:00
Gymnasiast cf664c8340
Close #11971: Replace ride groups with new ride types 2020-07-17 00:19:49 +02:00
rdbaris a2493af9ce
Part of #11159 (purge malloc() & free()) (#11893)
* Used smart pointers

* Changed functions to take vector as input
2020-07-16 22:35:30 +01:00
frutiemax f49149222e
Close #12245: Use coords objects for SetLocation (Window_internal.h) 2020-07-16 23:01:42 +02:00
Helio Nunes Santos 2812be8c9a
Close #12252: remove of goto in function wall_remove_at (#12279)
* Removed use of goto in function wall_remove_at
* Implemented overload of function map_get_wall_element_at
2020-07-16 17:52:45 -03:00
Aaron van Geffen 79ae0786c0
Refactor more widgets definitions into new format
* About
* Editor Bottom Toolbar
* Editor Inventions List
* Editor Object Selection
* Error
* Finances
* Footpath
* Game Bottom Toolbar
* Guest List
* Network Status
* News
* News Options
* Player
* Research
* Staff List
* Title Options
* About window.

And fix MakeSpinnerWidgets declaration order.
2020-07-16 20:48:25 +02:00
frutiemax 31efe32ade
Related to #12160: Refactor viewport_coord_to_map_coord using Rotate (#12247) 2020-07-16 06:55:48 +01:00
frutiemax a961d9784f
Part of #12243: Use coords for MazeRemoveTrack (#12251) 2020-07-15 23:34:26 -03:00
frutiemax 0fa0ca451e
Part of #12245: Use coords for window_scroll_to_location (#12282) 2020-07-15 23:26:27 -03:00
frutiemax c474f2ddc0
Close #12096: Use only ScreenRect on gfx_fill_rect (#12280) 2020-07-15 22:34:57 -03:00
Tulio Leao 289dc96f25
Remove goto from window_create_auto_pos (#12256)
* Reduce code duplication on window_create_auto_pos

* Remove deadcode from window_create_auto_pos

Cascadin window offset deadcode

* Extract ClampWindowToScreen from window_create_auto_pos

* Remove goto usage from window_create_auto_pos
2020-07-15 22:59:35 +01:00
frutiemax cd92597ec4
Part of #12096: Use ScreenRect on gfx_fill_rect in Tile*.cpp (#12248) 2020-07-15 16:19:49 -03:00
Tulio Leao f36a86e9e6
Use MakeWidget for most Title windows and the ToolTip (#12264)
* Use MakeWidget for windows/Tooltip.cpp

* Use MakeWidget for windows/TitleScenarioSelect.cpp

* Use MakeWidget for windows/TitleMenu.cpp

* Use MakeWidget for windows/TitleExit.cpp

* Use MakeWidget for windows/TitleLogo.cpp

* Clarify initial size of TitleMenu buttons
2020-07-15 15:48:41 +02:00
Michael Steenbeek d80f9b511f
Merge pull request #12255 from Gymnasiast/refactor/more-constants-in-track-curve
Refactor/more constants in track curve
2020-07-15 15:36:42 +02:00
frutiemax 31bea18ad6
Part of #12166: remove switch-case in bolliger_mabillard_track_flat 2020-07-15 13:34:36 +02:00
Tulio Leao 0951c0c5cc
Remove goto from input_state_widget_pressed (#12265) 2020-07-15 07:50:01 -03:00
michael coates 01d0287ee2
Close #12253: Refactor Vehicle sound to remove goto (#12267)
* Refactor Vehicle Scream Sound goto

* updated contributors
2020-07-15 07:48:47 +01:00
frutiemax f94c3bc2f3
Close #12242: Convert TrackDesignPlace static globals to use Coords (#12249) 2020-07-15 04:01:16 +02:00
Tulio Leao eaa53a3b8a Mark origin and size parameters as const 2020-07-14 23:36:24 +02:00
Aaron van Geffen 5344bc2e38 Convert terraforming tools to new widget defintions 2020-07-14 23:36:22 +02:00
Aaron van Geffen f2df096053 Introduce new way of defining widgets
Inspired by OpenLoco's widget routines.
2020-07-14 23:36:20 +02:00
Michael Steenbeek 5c42765d2b
Merge pull request #12156 from tupaschoal/coords-train-creation
Change train creation to use CoordsXYZ
2020-07-14 15:54:36 +02:00
frutiemax c8b66dd289
Fix #12257: Fix refactoring of is_sprite_interacted_with_palette_set (#12258)
* Fix #12257: Change type of paint x/y to int32_t

This corrects an issue with integer conversions due to signness.

* Change types to 16bit and correct functions parameters

* Fix test paint.

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-07-14 12:20:53 +01:00
Gymnasiast b948302dc6
Use constants in gTrackCurveChain 2020-07-14 01:37:33 +02:00
Gymnasiast e080d4655e
Use RideConstructionSpecialPieceSelected in two more places 2020-07-14 01:10:47 +02:00
Michael Steenbeek 1034aadb72
Merge pull request #12238 from frutiemax/Fix12223
Close #12223: Assert that Formatter::Add() only receives desired types
2020-07-14 00:05:37 +02:00
Michael Steenbeek 821dc60a7d
Merge pull request #12246 from Gymnasiast/refactor/constants
Small constants cleanup
2020-07-14 00:05:03 +02:00
frutiemax 5f4e1ba344 Forbid usage of uint8_t* in formatter::Add 2020-07-13 17:40:04 -04:00
frutiemax 0272777d13 Close #12223: Assert that Formatter::Add() only receives desired types 2020-07-13 17:37:08 -04:00
frutiemax 84a4c4e473
Part of #12096: ScreenRect on gfx_fill_rect in windows/Ride.cpp (#12239) 2020-07-13 17:49:12 -03:00
Gymnasiast 88a5e4cd2a
Remove some unused constants 2020-07-13 22:09:28 +02:00
Gymnasiast 3c4721d014
Move some constants to RCT12.h 2020-07-13 22:04:50 +02:00
frutiemax b39a0037f0
Close #12164: Use Coords for place_virtual_track (#12240) 2020-07-13 16:37:10 -03:00
frutiemax 78e40f5358
Close #12160: Coords for is_sprite_interacted_with_palette_set (#12241) 2020-07-13 16:31:06 -03:00
frutiemax bcc27f4c73
Close #12161: Use CoordsXYE on peep_interact_with_shop (#12236) 2020-07-13 14:39:59 -03:00
frutiemax 09ad720dfc
Part of #12164: Use Coords for track_design_place_ride (#12233) 2020-07-13 14:38:39 -03:00
frutiemax 59618327af
Part of #12096: Use ScreenRect on gfx_fill_rect in Map.cpp (#12230) 2020-07-13 14:36:49 -03:00
Michael Steenbeek e99f4a23c5
Add missing header (#12235)
std::memcpy is defined in <cstring>. The Docker CI would fail because this header was not included.
2020-07-13 18:26:20 +02:00
frutiemax b34381f030
Part of #12160: Use Coords for viewport_redraw_after_shift (#12231) 2020-07-13 13:22:40 -03:00
Duncan 7f28d65bf9
Fix #12213: Incorrect viewport invalidation on load (#12232)
Mistake made during implementation but issue only surfaces recently when the types were increased to 32bit. Removed #12210 as this was hiding the source issue and is no longer required.
2020-07-13 18:20:16 +02:00
frutiemax 6cc52bfb72
Part of #12161: Use CoordsXYE on peep_footpath_move_forward (#12217) 2020-07-13 17:51:57 +02:00
Michael Steenbeek 1cf89362f0
Merge pull request #12184 from IntelOrca/sea
Add support for reading .sea (RCT classic) files
2020-07-13 17:23:16 +02:00
Michael Steenbeek 132b2e5966
Fix #12071: Crash in Guest List when a guest dies (#12126)
Send refresh guest list intent on peep removal

Also added protection to guest list to prevent accessing invalid peeps
2020-07-13 09:31:04 -03:00
Aaron van Geffen b0a3fd82d9
Fix #12221: Map generation tool doesn't place any trees (#12222) 2020-07-13 12:35:49 +02:00
frutiemax e2ef82ca0a
Part of #12164: Use Coords for track_design_place_maze (#12218) 2020-07-12 19:02:28 -03:00
Thamara Andrade 0fb2a6216c
Close #12099: Use ScreenLine on gfx_draw_line (#12143) 2020-07-12 18:50:52 -03:00
frutiemax 27734e2971
Part of #12160: Use Coords for viewport_coord_to_map_coord (#12216) 2020-07-12 18:42:54 -03:00
Duncan b1f80efbe3
Use u8path on file path (#12205) 2020-07-12 21:56:02 +01:00
Ted John 3a93525a11 Add rename error message if sea file fails to open 2020-07-12 00:15:21 +01:00
frutiemax bc7f7248bb
Part of #12164: Use Coords for track_design_add_selection_tile 2020-07-11 19:13:57 +02:00
frutiemax 75afcb85c5
Part of #12161: Use CoordsXYE on peep_interact_with_entrance 2020-07-11 18:58:56 +02:00
frutiemax 508344a088
Close #12174: Remove Formatter additions with uintptr_t 2020-07-11 18:56:12 +02:00
Tulio Leao 76e7bfbf78
Fix load game showing edge of map 2020-07-11 18:19:28 +02:00
Tulio Leao 0758d0fe5c Prefer reference on ride_create_vehicles parameter 2020-07-11 12:21:46 -03:00
Tulio Leao de8bb169de Use CoordsXYZ on vehicle_create_trains 2020-07-11 12:21:44 -03:00
Tulio Leao 47db30f1d7 Use CoordsXYZ on vehicle_create_train 2020-07-11 12:21:09 -03:00
Tulio Leao 7921740938 Use CoordsXYZ on vehicle_create_car 2020-07-11 12:21:07 -03:00
Michael Steenbeek b43ce35ef5
Fix: Map Generator shows incorrect map sizes (#12211) 2020-07-11 12:19:01 -03:00
frutiemax 76d899c8da
Part of #12160: Use Coords for is_sprite_interacted_with (#12207) 2020-07-11 16:55:27 +02:00