Commit Graph

15820 Commits

Author SHA1 Message Date
Gymnasiast b47163c06c
Remove orphaned declaration of object_entry_get_type() 2020-10-17 22:46:52 +02:00
Gymnasiast 13fb0b43da
Refactor legacy GetSourceGame() to method 2020-10-17 22:45:12 +02:00
Haven Kim 8a4df108ba
Close #12428: Refactor OBJECT_SOURCE_GAME to use strong enum 2020-10-17 22:27:02 +02:00
Aaron van Geffen a9316869fc
Fix #13158: Cursors are drawn incorrectly in text input fields (#13228) 2020-10-17 22:24:24 +02:00
Łukasz Pękalski 384e0ee718
Close #12418: Refactor RESEARCH_CATEGORY_* to use strong enum (#13216) 2020-10-17 22:15:46 +02:00
duncanspumpkin 54a33674d3 Introduce tables to group information 2020-10-17 20:44:26 +01:00
Hielke Morsink 0cf049c2f7 Replace deprecated function call 2020-10-17 20:00:38 +02:00
Hielke Morsink 085a0e9452 Reduce branching and duplicated lines in limit_autosave_count 2020-10-17 20:00:38 +02:00
Aidan Waite d287653cb5
Fix #4022: Mac cursor offset on launch (#13095)
Update config when forcing windowed mode
2020-10-17 11:57:03 +02:00
Duncan cd39c30989
Tooltip 2 (#13159)
* Use ScreenCoords for tooltip

* Remove temporary variables

* Small refactor

* Fix #13151. Not passing tooltip arguments correctly for ride window

* Fix Server List window version tooltip

* Fix cheats tooltip event

* Add static to function decl

* Remove unreachable break statements in Ride.cpp

* Apply review suggestions

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-10-17 09:10:08 +01:00
Aaron van Geffen af26a2cef0
Improve park cheats tab layout (#13186)
* Remove 'Park parameters…' button
  The scenario options are already accessible through the cheats menu

* Split off Objective group from General group
* Split off new Maintenance group from Staff group

* Shrink 'Force park rating' spinner to make room for label
* Change label 'Force weather' to 'Change weather to'
* Change label "Plants don't age" to 'Disable plants withering'
* Change some strings for consistent capitalisation
2020-10-16 21:52:27 +02:00
X7123M3-256 11f2199476 Fix formatting 2020-10-15 20:45:39 +01:00
X7123M3-256 5c81d7deb9 Use block brake sprite for last station tile 2020-10-15 20:27:33 +01:00
X7123M3-256 dd8dcc6136 Fix incorrect bounding boxes 2020-10-15 20:27:33 +01:00
X7123M3-256 15aca5fbb5 Remove unnecessary comments 2020-10-15 20:27:33 +01:00
X7123M3-256 6ca16e0a06 Make JSON objects able to use hybrid track 2020-10-15 20:27:33 +01:00
Simon Jarrett 65a8c58af7 Fix missing direction arrow for stations 2020-10-15 19:44:36 +01:00
Simon Jarrett 25ce8b3f6e Fix #7443: Construction arrows pulse at irregular intervals. 2020-10-15 19:44:10 +01:00
Łukasz Pękalski 26720eb345
Fix #5178: Lighting effects cannot be disabled in software mode (#13206)
Lighting effect are now automatically turned off when software renderer is selected.
2020-10-15 17:05:39 +02:00
ζeh Matt 645289f4ec
Rename GameActionResult and use GameActions namespace instead (#13184) 2020-10-14 22:04:39 -03:00
ζeh Matt 92e7b6244b
Fix #13192: Crash because of objects not properly loading (#13197) 2020-10-14 21:54:22 -03:00
Vinicius Sa 711dd00cde
Close #13000: Refactor ObjectFactory to use unique_ptr
Employs the smart pointer unique_ptr for safer memory management.

Classes involved:
 - ObjectRepository
 - ObjectManager
2020-10-14 21:56:48 +02:00
Aaron van Geffen 0c283ba3e7
Ride window: position graph buttons properly 2020-10-14 17:51:58 +02:00
Duncan 250586cb45
Port some OpenLoco helper functions (#13113)
* Port some OpenLoco helper functions

Added a few helper functions from OpenLoco to make viewport code a bit simpler
2020-10-12 22:25:11 -03:00
aw20368 0c195d14b9
Close #8848 Refactor TimeInPark (#13146)
Split TimeInPark into a union: ParkEntryTime for guests, HireDate for staff
2020-10-12 21:36:38 -03:00
Duncan feb188ecb2
Remove incorrect variable from interval names (#13175)
Not sure why this has ended up in the interval names as it is not a rct_string_id. Luckily nothing at present was accessing this.
2020-10-12 21:35:08 -03:00
Aaron van Geffen a5a65fe974
Fix #13167: Broken dropdown menu in rendering engine options (#13169) 2020-10-11 23:06:35 +02:00
Michael Steenbeek 0bf851cfb2
Merge pull request #13164 from Gymnasiast/feature/objective-options-in-cheats
Add Objective Options to Cheats menu
2020-10-11 19:28:50 +02:00
Gymnasiast eb2f40f35c
Fix typo in WC_EDITOR_OBJECTIVE_OPTIONS 2020-10-11 19:28:25 +02:00
Gymnasiast 16ca892449
Add Objective Options to Cheats menu 2020-10-11 19:28:25 +02:00
Keith Stellyes 2265938e9b
Fix old-style-cast build errors on BenchSpriteSort.cpp (#13148) (#13150) 2020-10-11 17:43:22 +01:00
Julia Pinheiro cba1d48226
Close #12408: Refactor CURSOR_ID to use strong enum 2020-10-11 18:01:14 +02:00
Tulio Leao f56039abfd
Close #5520: Use std::filesystem over fts.h for recursive deletion 2020-10-11 17:15:05 +02:00
Simon J d7b9a99a0f
Entrance/exit construction state fixes in ride and maze construction (#13098)
* Fix #1324: track selection visible when placing entrance or exit

* Improve maze construction window UX in entrance/exit mode

- Arrows are disabled when entrance and exit are being placed
- Clicking a construction mode will disable the entrance and exit mode
- Previous state restored when leaving entrance/exit construction mode
- Fix entrance/exit buttons not changing when the mode switches after placing the first entrance/exit

Co-authored-by: Simon Jarrett <simonjjarrett@gmail.com>
2020-10-11 12:22:41 +01:00
Aaron van Geffen 8726b37951
Remove remaining old style casts from macos.mm (#13153) 2020-10-10 23:45:50 +02:00
X123M3-256 9681ea4cea
Add "Hybrid Coaster" ride type (#12110)
* Add "Hybrid coaster" ride type

* Add turns

* Add diagonal slopes

* Add bank transitions

* Add diagonal bank transitions

* Add banked turns

* Add sloped turns

* Add sloped bank transitions

* Add sloped banked turns

* Add s bends

* Add helices

* Add barrel rolls

* Add half loops

* Start changing supports to wooden

* Switch diagonals and banked turns to wooden supports

* Finish switching supports to wooden

* Alter default supports for small turns and steep turns

* Split track sprites that were glitching

* Fix incorrect sprite indices on small helices

* Add supports for large flat to steep pieces

* Fix bug with b supports

* Add supports for quarter loops

* Finalize set of track elements

* Fix strange colors when track piece is highlighted

* Update sprites.json

* Add support for corkscrews

* Fix incorrect remap colors and default supports

* Add slope to banked turn transitions

* Add support for preview image in color selection window

* Fix static glitches

* Correct Z offset

* Set segment heights (and fix more static glitches)

* Improve sloped curve supports

* Fix slope to banked turn transitions

* Fix dynamic glitches

* Fix boosters

* Remove corkscrews

* Set ride data and implement ride rating function

* Fix glitches on steep turns and gentle to steep

* Format code

* Add sprites

* Add track color preview image

* Fix formatting

* Add files to MSVC project

* Fix Testpaint

* Revert removal of RIDE_TYPE_50 from GetClassification

* Introduce constant instead of hard coded number

* Fix stray change

* Improve legibility of ride_ratings_calculate_hybrid_coaster()

* Fix comments on byte_97B23C

* Fix two other stray changes

* Fix Xcode project

* Adjust bounding boxes to make clipping behaviour more consistent

* Fix two glitches on medium and large turns

* Address comments from DuncansPumpkin

* Fix incorrect ride ID

* Fix steep turn sprites

* Run PNG images through OptiPNG

* Update changelog

* Fix namespace error

* Use arrays for supports to handle additional elements

* Rename functions to TitleCase and add namespace

* Increment network version

Co-authored-by: Edward Calver <hx010973@reading.ac.uk>
Co-authored-by: tylerleamon <59478575+tylerleamon@users.noreply.github.com>
Co-authored-by: Gymnasiast <m.o.steenbeek@gmail.com>
Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
Co-authored-by: Aaron van Geffen <aaron@aaronweb.net>
2020-10-10 20:27:12 +01:00
Michał Janiszewski 0c3de1fa00
Fix potential nullptr dereference (#13149)
This fixes optimised builds on ARM
2020-10-10 14:49:33 -03:00
Julia Pinheiro b628bba704
Close #12429: Refactor OBJECT_ERROR to use strong enum and typo fix in build.sh (#13145)
* Close #12429: Refactor OBJECT_ERROR to use strong enum

* Typo Fix in build.sh: Unknown
2020-10-10 16:21:07 +01:00
Duncan f28907a87d
Rework tooltip to be more logical (#13137) 2020-10-10 10:49:56 -03:00
Tulio Leao 61c8cbf88b
Fix #13118: Closing construction window resets ride viewport (#13123) 2020-10-10 10:01:28 -03:00
Tulio Leao f418acfe19
Merge pull request #11493 from OpenRCT2/Wold-style-cast
Enable -Wold-style-cast
2020-10-10 09:15:59 -03:00
Bryan DiLaura 7c95f594d3
Close #12413: Refactor VISIBILITY_CACHE to use strong enum (#13136) 2020-10-09 19:12:14 -03:00
Keith Stellyes 3468d1fc6b
Close #13125: Selecting the RCT2 files now uses localised dialogs 2020-10-09 21:13:14 +02:00
Duncan e23c1cded7
Fix logical sort 2020-10-09 20:59:43 +02:00
Duncan 197bb897bb
Fix #7748. Move tooltip timeout reset to correct location (#13132)
* Fix #7748. Move tooltip timeout reset to correct location

Mistake made in implementation

* Add changelog entry
2020-10-09 16:53:31 +01:00
Duncan 84c9ff833a
Move formatter to separate file. Rework GetMeasurement (#13131)
* Move formatter to seperate file. Rework GetMeasurement

* Add Formatter source files to Xcode project

Co-authored-by: Aaron van Geffen <aaron@aaronweb.net>
2020-10-09 08:02:07 -03:00
Tulio Leao bace4d62f8 Specify SYSTEM includes on CMAKE builds 2020-10-09 01:28:34 -03:00
Tulio Leao 32c2b7d449
Merge pull request #13122 from vjavs/strong-enum/PeepSpriteType
Refactor PeepSpriteType to use strong enum
2020-10-08 23:48:45 -03:00
Duncan 4fb4feb83c
Fix missing error message on ride graph (#13129)
* Fix missing error message on ride graph

Mistake made during implementation meant that the ride graph would not show the error message when the ride had not left the station. Another mistake meant that the tertiary colour of the ride window was not set to green. The tertiary colour was only used by this error message though so was not noticed.
2020-10-08 15:22:23 -03:00
Tulio Leao 1cf0f91199
Fix #4041: Garbled park option on scenario editor with custom theme (#13126)
* Fix #4041: Garbled park option on scenario editor with custom theme

* Remove duplicate string draw
2020-10-08 14:35:25 +01:00
aw20368 119bacdd44
Fix #13083: Dialog cropped for conflicting track design rename (#13124)
Change description drawing from gfx_draw_string_centred to gfx_draw_string_centred_wrapped.
2020-10-07 23:17:52 -03:00
Ben Johnston 2524e9201a
Fixed console cursor rendering. (#13025)
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-10-07 21:45:57 -03:00
Vinicius Sa 01d237ad27
Use helper function GetSpriteBounds
It's intended to retrieve a rct_sprite_bounds from the global array
g_peep_animation_entries, given PeepSpriteType and PeepActionSpriteType
as parameters.
2020-10-07 17:34:27 -03:00
Vinicius Sa 80718f1774
Use helper function GetPeepAnimation
It's intended to retrieve a rct_peep_animation_entry from the global
array g_peep_animation_entries, given PeepSpriteType and
PeepActionSpriteType as parameters.
2020-10-07 17:34:25 -03:00
Vinicius Sa 4d28901cb0
Refactor PeepSpriteType to use strong enum
Issue: 12396
2020-10-07 17:34:21 -03:00
ζeh Matt 61b510db66
Merge pull request #13073 from ZehMatt/refactor/audio-cleanup
Minor cleanup around audio code
2020-10-07 21:18:59 +03:00
Tulio Leao a1b058f648
Fix #10186: Placing multiple saved rides ignores design name (#13120) 2020-10-07 12:45:19 -03:00
Tulio Leao 076544f490
Merge pull request #13084 from vjavs/PVS-Studio/Fixes
Make some PVS-Studio fixes
2020-10-07 08:24:59 -03:00
Mike Jones 7441001c4e
Close #12407: Refactor CHAT_INPUT to use strong enum (#13116) 2020-10-06 21:37:08 -03:00
Tulio Leao db728d61a7
Fix signed/unsigned mismatch 2020-10-06 21:32:59 -03:00
Matt 7045fd9e9f
Minor cleanup 2020-10-07 01:10:53 +03:00
Matt 091145037e
Move the audio code into OpenRCT2 namespace 2020-10-07 00:34:42 +03:00
Vinicius Sa 22a1df32d7
Remove redundant assignment in CustomListView::MouseUp
Reported by PVS-Studio (Warning: V1048).

Fix 7/7.

Issue: 12523
2020-10-06 18:21:28 -03:00
Vinicius Sa c6b7893d77
Verify pointer against nullptr before using it
Reported by PVS-Studio (Warning: V1004).

Fix 6/7.

Issue: 12523
2020-10-06 18:21:26 -03:00
Vinicius Sa 579e008590
Refactor process_mouse_over()
- Remove unnecessary local variables and assignments

 - Remove unreached if-statement branch

Reported by PVS-Studio (Warning: V587).

Fix 5/7.

Issue: 12523
2020-10-06 18:21:24 -03:00
Vinicius Sa 59e9162137
Give a variable for an arithmetic operation used as a condition
Avoid reverse logic around if-statement for the sake of readability.

Reported by PVS-Studio (Warning: V793).

Fix 4/7.

Issue: 12523
2020-10-06 18:21:21 -03:00
Vinicius Sa d583911997
Avoid variable shadowing in derived struct RCT12BannerElement
Give a more meaningful name to its private member that caused the
shadowing, as well as in the struct BannerElement.

Reported by PVS-Studio (Warning: V703).

Fix 3/7.

Issue: 12523
2020-10-06 18:21:19 -03:00
Vinicius Sa b93024039a
Remove redundant sub-expression involving or bitwise
Reported by PVS-Studio (Warning: V501).

Fix 2/7.

Issue: 12523
2020-10-06 18:21:11 -03:00
Vinicius Sa 8e73dfd440
Fix possible memory leak in CreateObjectFromJson
As reported by PVS-Studio. Warning: V773.

Fix 1/7.

Issue: 12523
2020-10-06 18:20:37 -03:00
Matt 86b1c0dbe1
Minor cleanup around audio code 2020-10-06 23:31:51 +03:00
Tulio Leao e53cde1d5d
Fix #6086: Cannot install existing track design with another name (#13082) 2020-10-06 08:27:38 -03:00
Duncan eb3f3edc1b
Use RemoveViewport helper function (#13104) 2020-10-06 10:27:56 +01:00
Ishmael King fb47b3bb90
Close #9568: Replace RRC lift sounds LiftWood to match SFRC (#13071)
* refactor: Replace RRC lift sounds LiftWood to match SFRC

* refactor: Replace SLC lift sounds with Classic lift sound

* Update replays for change in lift sound

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-10-05 23:14:43 -03:00
Vinicius Sa bd8c633ea3
Close #12394: Refactor PeepNauseaTolerance to use strong enum (#13106) 2020-10-05 22:13:44 -03:00
Aaron van Geffen 797fe48b0f
Merge pull request #13068 from mwnciau/json-compilation-performance
Fix #13055: Replace includes of Json.hpp in header files with json_fwd.hpp
2020-10-06 01:09:41 +02:00
Aaron van Geffen 0ad7e9787e Add JsonFwd.hpp to the Xcode project 2020-10-06 00:16:21 +02:00
Simon Jarrett 134371f03c Change includes of nlohmann/json_fwd.hpp to new core/JsonFwd.hpp 2020-10-06 00:16:21 +02:00
Michael Steenbeek b835477542
Add Esperanto to language list (#13096) 2020-10-05 08:21:27 -03:00
Aaron van Geffen fe54eee07c
Tab-specific event functions for Options window (#13058)
* Options window: move event lists and open function.

* Options: split off display tab events; add event lists for each tab

* Options: split off rendering tab events

* Options: split off culture tab events

* Options: split off audio tab events

* Options: split off control/interface tab events

* Options: split off misc tab events

* Options: split off advanced tab events; remove old event functions

* Reduce code duplication with common mouseup event
2020-10-04 17:08:10 +02:00
Tulio Leao f4b588256d
Merge pull request #13066 from tupaschoal/fix-5904
Light Tile Inspector Improvements
2020-10-03 15:16:10 -03:00
Michael Steenbeek 8e60ecc022
Do not output error if the sourceGame parameter is omitted (#13079)
Since >90% of objects in the wild are custom objects, it make sense if this
parameter can be safely omitted. Only warn if this field contains garbage.
2020-10-03 14:41:52 -03:00
Simon J 7f963c4901
Fix entrance and exit ghosts not being removed for mazes (#13074)
* Fix entrance and exit ghosts not being removed for mazes

Co-authored-by: Simon Jarrett <simonjjarrett@gmail.com>
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-10-03 09:33:28 -03:00
Matt 0d43f1fd91
Directly use enums for serialisation 2020-10-03 06:15:13 +03:00
Matt 13f332d5b8
Ensure/Cleanup member initialization for game actions 2020-10-03 05:58:57 +03:00
Matt 82916f6824
Use default constructor 2020-10-03 05:55:33 +03:00
Julia Pinheiro 6a76547c5b
Close #12412: Refactor PROMPT_MODE to use strong enum (#13076) 2020-10-02 23:04:59 -03:00
Mike Jones 4c26fb09b3
Close #12435: Refactor FILEDIALOG_TYPE to use strong enum (#13072)
* Close #12435: Refactor FILEDIALOG_TYPE to use strong enum
2020-10-02 22:43:06 -03:00
Julia Pinheiro 8800c32e52
Close #12404: Refactor DRAWING_ENGINE to use strong enum (#13070) 2020-10-02 22:41:30 -03:00
Simon Jarrett 9c5e9f8dbc Replace includes of Json.hpp in header files with json_fwd.hpp 2020-10-02 11:31:20 +01:00
Tulio Leao 09bb66848c Change windowTileInspectorTile to TileCoordsXY type 2020-10-02 01:45:08 -03:00
Tulio Leao e4d72cefaa Fix #5904: Empty errors on tile inspector base height change 2020-10-02 01:06:54 -03:00
Tulio Leao 0981b49e99
Fix #8957: Error title missing when building w/ insufficient funds (#13020) 2020-10-01 23:19:34 -03:00
Julia Pinheiro c36ec5c5ce
Close #12425: Refactor SOCKET_STATUS to use strong enum (#13064) 2020-10-01 22:10:51 -03:00
Julia Pinheiro 657106d4c6
Close #12424: Refactor NetworkStatisticsGroup to use strong enum (#13056) 2020-10-01 22:07:48 -03:00
Tulio Leao 29955f28e0
Merge pull request #12976 from mwnciau/Refactor-TRACK_ELEM-enum
Refactor TRACK_ELEM_* enum
2020-10-01 22:05:44 -03:00
Simon Jarrett 088db4a7c3 Fix incorrect const names of long base pieces
- Fix function names referring to that of the renamed consts
- Fix incorrect mirror of TrackType::FlatToDown60Long in TrackData
2020-10-01 19:57:52 +01:00
Simon Jarrett 52209af94d Rename TRACK_ELEM_* enums to TrackElemType::*
- Replace enum in Track.h with namespace and constexpr
- Find and replace all instances of TRACK_ELEM_* enums
2020-10-01 19:57:52 +01:00
Sam J Gunner 55b4c4c6f1
Fix #13046: Simplify block sectioned comparisons (#13049) 2020-10-01 09:06:28 -03:00
Duncan ea036a38fd
Use MapCanConstructWithClear in LandSetHeightAction (#13037) 2020-10-01 08:41:35 -03:00
Michael Steenbeek e255c7bb58
Fix #13044: Rides in RCT1 saves all have "0 customers per hour" (#13045) 2020-10-01 10:32:51 +01:00
Bryan DiLaura 56e8cc77c6
Close #12409: Refactor CONSOLE_INPUT to use strong enum (#13052) 2020-10-01 10:31:03 +01:00
Duncan afbc983a94
Fix #13050: Mistake during refactor removed drawing cached track count (#13051) 2020-10-01 09:57:46 +02:00
Duncan 2063aea5ef
Remove common format formatter where possible (#13034)
* Remove common format formatter where possible

Eventually should have it limited to tooltips, window titles and widget args

* Remove remaining paint functions using common

* Remove misuse of gCommonFormatArgs
2020-09-30 22:42:04 +01:00
Michael Steenbeek e4068b9fa8
Fix #8015: RCT2 files are not found when put into the OpenRCT2 folder (#13043)
As mentioned in #8015, gExePath is never set, so I removed that variable altogether.
2020-09-30 18:37:50 -03:00
rpstester 3508bdc37d
Close #12390: Refactor PeepRideSubState to enum class
Also made a RideSubState as a union with SubState and SittingSubState
Updated all values across all files, and the corresponding assert.
2020-09-30 23:33:58 +02:00
Vinicius Sa 41820cd3c2
Close #12392: Refactor PeepActionType to use strong enum 2020-09-30 23:19:10 +02:00
Tulio Leao b92328ce34
Merge pull request #13004 from vjavs/strong-enum/PeepActionSpriteType
Refactor PeepActionSpriteType to use strong enum
2020-09-29 23:38:23 -03:00
ζeh Matt 30307ec42d
Merge pull request #13030 from ZehMatt/fix-4617-2
Fix #4617: Crash when rotating with invalid viewport open
2020-09-30 00:53:32 +03:00
Matt 005e1e0e1f
Final cleanup
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:23:51 +03:00
Matt 850b10f1fd
Fix memory leak
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:23:41 +03:00
Matt f765ed2f94
Use unique_ptr for TitleSequenceParkHandle Stream
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:23:28 +03:00
Matt e3a4d6a245
Use std::string for TitleSequenceParkHandle HintPath
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:23:01 +03:00
Matt 17bff41e82
Use std::unique_ptr for TitleSequenceParkHandle
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:22:44 +03:00
Matt 464545b907
Cleanup remnants
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:22:35 +03:00
Matt 668bd8dc9b
Use std::string for TitleSequence paths
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:22:25 +03:00
Matt f586981cd3
Use std::string for TitleSequence names
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:22:12 +03:00
Matt 612249bd74
Use vector for TitleSequence commands
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:21:58 +03:00
Matt 7245f23422
Use vector for TitleSequence saves
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:21:42 +03:00
Matt ccb6eb06f8
Use unique_ptr for TitleSequence instances
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:21:27 +03:00
Matt c23e2621a5
Cleanup string usage
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
2020-09-29 23:21:03 +03:00
Matt d6c2ec898d
Fix #4617: Crash when rotating with invalid viewport open 2020-09-29 21:44:59 +03:00
Michael Steenbeek a850d76d60
Fix: Not all Junior RC pieces shown with "Show all track pieces" on 2020-09-29 19:57:34 +02:00
Vinicius Sa ca8fa55fdb
Use EnumValue to get the underlying value of an enum
Applied to objects of the enum class PeepActionSpriteType when they are
used as arrays subscripts.
2020-09-29 11:15:07 -03:00
Vinicius Sa f8dd0a57aa
Refactor PeepActionSpriteType to use strong enum 2020-09-29 11:15:04 -03:00
Ben Johnston 147daa8f01
Refactor PARK_AWARD to use strong enum (#13017)
* Refactor PARK_AWARD to use strong enum
2020-09-28 21:48:03 -03:00
Duncan 3c8adb1fc1
Remove gMapTooltip format args global (#12971)
Fix mistake
2020-09-28 21:45:28 -03:00
Aaron van Geffen a0341a7aeb
Fix #13021: Mowed grass and weeds don't show up (#13031) 2020-09-28 21:44:29 -03:00
Gymnasiast 84201678ca
Add comment 2020-09-28 21:41:50 +02:00
Matt 213b6cc672
Use unique_ptr for GetStreamFromRCT2Scenario 2020-09-28 21:17:28 +02:00
Gymnasiast 5f0aed0929
Add .sea support to New Scenario list and extension handling 2020-09-28 21:17:28 +02:00
Łukasz Pękalski d1cd2e08b5
Close #12388, refactor PeepState to use strong enum (#12927)
* Close #12388, refactor:PeepState to use strong enum

* refactor: refactored file PlayTests.cpp

* refactor: change PEEP_STATE_ to PeepState:: and camel case after merging

chore: code reformatting
2020-09-28 15:51:49 -03:00
Aaron van Geffen d27e14f45b
Compact, statically initialized syntax for event lists (#12973) 2020-09-28 20:36:15 +02:00
ζeh Matt 54edba2272
Merge pull request #13023 from gsckoco/make_add_news_item_assoc_optional
Make add_news_item assoc optional
2020-09-28 20:28:45 +03:00
Łukasz Pękalski 065da23b3b
Close #12437, refactor: RIDE_MODE_* to strong enums (#12833)
* partial refactor: RIDE_MODE_* to strong enums

* Close #12437, refactor: RIDE_MODE_* to strong enums

* chore: code formatting

* refactor: RideMode, change enum names to CamelCase

and resolve casting order.

* chore: refactor due to code formatting

* Close #12437, refactor: RIDE_MODE_* to strong enums

Resolved comments

* chore: Formatting correction.

* Use EnumsToFlags constexpr

* refactor: resolved comments

added newline at the end of file

* refactor: Change case stack to default in Switch

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-09-28 14:09:59 +01:00
gsckoco 391dabc4f9 Made add_news_item argument assoc optional 2020-09-28 12:28:31 +01:00
Tulio Leao 8f5ee758ee
Fix #3200: Close Construction window upon selecting vehicle page (#13022) 2020-09-28 07:37:22 -03:00
Michael Steenbeek 3c07a9e49b
Allow opening Objective options via console (#13000) 2020-09-27 21:53:31 -03:00
Duncan 4ec10837a6
Remove Formatter::Common where not required (#12972)
* Remove Formatter::Common where not required

* Remove common from Guest window where possible
2020-09-27 21:09:08 -03:00
Richard Fine a1222fa4ca
Staff code cleanup (#12907)
* Make UpdateFixing*() methods use const where possible

To make it clearer which steps actually modify the ride being fixed and which do not, pass const Ride* instead of Ride* where possible.

* Extract maximum litter search distance to a constant

* Make peep_update_*() methods return bool

* Use Direction type and helpers where applicable

* Const correctness and other cleanup

Make many functions take a const Peep* / const Staff* to clarify that they do not modify the peep being passed in. Also use the Direction type for some return values, and simplify staff_is_location_on_patrol_edge.

* Use clearer expression of constant value

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

* Convert staff functions to members

* Remove AsStaff const overload

* Use As<Staff>() instead of static_cast

* Simplify direction selection code

* Clean up use of magic constants

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-09-27 21:07:09 -03:00
Tulio Leao d01dcea98a Release v0.3.1
- Feature: [#10807] Add 2x and 4x zoom levels (currently limited to OpenGL).
- Feature: [#12703] Add scenario plugin APIs.
- Feature: [#12708] Add plugin-accessible names to all game actions.
- Feature: [#12712] Add TCP / socket plugin APIs.
- Feature: [#12840] Add Park.entranceFee to the plugin API.
- Feature: [#12884] Add BaseTileElement.occupiedQuadrants to the plugin API.
- Feature: [#12885] Add SmallSceneryElement.quadrant to the plugin API.
- Feature: [#12886] Make all scenery placement and remove actions available to the plugin API.
- Feature: [#2350, #12922] Add snow, heavy snow and blizzard to weather types.
- Fix: [#400] Unable to place some saved tracks flush to the ground (original bug).
- Fix: [#5753] Entertainers make themselves happy instead of the guests.
- Fix: [#7037] Unable to save tracks starting with a sloped turn or helix.
- Fix: [#12691] Ride graph tooltip incorrectly used count instead of number string.
- Fix: [#12694] Crash when switching ride types with construction window open.
- Fix: [#12701] Silent NSIS setup flag /S isn't silent, upgrade pop-up appears anyway.
- Fix: [#12737] Space Rings draw the same vehicle 4 times.
- Fix: [#12756] Scenario Editor crashing the game on macOS.
- Fix: [#12764] Rides don't start aged anymore.
- Fix: [#12818] Ride price not ignored in free-rides parks.
- Fix: [#12820] Title menu buttons not invalidating properly
- Fix: [#12845] Deleting ride with active ad campaign creates incorrect notification.
- Fix: [#12857] Incorrect Peep thoughts in imported RCT1 parks.
- Fix: [#12881] Guests' favourite rides are not listed in the guest window.
- Fix: [#12910] Plugin API: getRide sometimes returns null for valid ride IDs.
- Fix: [#12912] Plugin: selectedCell of CustomListView is being ignored on creation.
- Fix: [#12918] Cannot place vanilla TD6 tracks of the Hypercoaster, Monster Trucks, Classic Mini Roller Coaster, Spinning Wild Mouse and Hyper-Twister types.
- Fix: Incomplete loop collision box allowed overlapping track (original bug).
- Improved: [#12806] Add Esperanto diacritics to the sprite font.
- Improved: [#12837] Arabic text is now drawn and shaped correctly on Windows.
- Improved: [#12890] Add stroke to lowercase 'L' to differentiate from capital 'I'.
- Technical: [#12749] The required version of macOS has been lowered to 10.13 (High Sierra).
2020-09-27 17:57:34 -03:00
Tulio Leao afff2c10f2 Add new backtrace token for v0.3.1 2020-09-27 17:35:46 -03:00
Michał Janiszewski 8daca5b69e Add better controls over MinGW jobs to CMake 2020-09-27 20:29:49 +02:00
Matt 958f3824c9
Fix #12969: Crash opening ride window with invalid mechanic assigned 2020-09-27 13:40:40 +03:00
Aaron van Geffen 62b13e68bc
Fix #13005: Last player action is not truncated (#13007) 2020-09-27 11:41:28 +02:00
Michał Janiszewski 17e86a61c9
WinNT5.1 networking fixes (#12759) 2020-09-24 10:28:24 +02:00
Michael Steenbeek e5ec74feaf
Fix #12918: Cannot place "Blue Hurricane" (hypercoaster) (#12982)
The track design was recognised as a Corkscrew RC, not as a Hypercoaster. Moved the conversion code from the track design repository to the TD6Importer (where it should have been, really).

This also fixes the issue that Hypercoasters, Monster Trucks, Classic Mini Roller Coasters, Spinning Wild Mouses and Hyper-Twisters placed from a track design have the wrong ride type.
2020-09-21 22:42:25 +02:00
Michał Janiszewski 0ae86d0558
Don't use empty resolutions (#12980) 2020-09-20 23:13:10 -03:00
Richard Fine 4030d9050e
Fix #12974: unable to build fences on slopes (#12975)
Fix the casing of 'isAllowedOnSlope' to match the way it is cased in the JSON files, which causes the flag to be read correctly and re-enables building on slopes for the scenery pieces which have it specified.
2020-09-20 06:54:01 +01:00
Duncan 124161b459
Implement copy constructors (#12970) 2020-09-19 13:58:05 +01:00
Michael Steenbeek 4a79e9305f
Replace gfx_draw_string_right() with DrawTextBasic (#12966) 2020-09-18 21:39:00 -03:00
Michael Steenbeek fd194d0e32
Allow compilation with nlohmann/json < 3.9.0
According to the [API docs](https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp#L23219-L23222), the fourth argument (which allows ignoring comments) was only introduced in version 3.9.0 (released on 27 July 2020), which is not present in Ubuntu 20.04 (it only has 3.7.3-1).

Since comments are not part of the JSON spec, this option is not terribly useful anyway. I have removed it, so that it can now compile on Ubuntu 20.04, and possibly also earlier versions.
2020-09-19 00:19:39 +02:00
Gymnasiast a896d238b1
Remove optional arguments to json_t::parse 2020-09-18 23:46:07 +02:00
Michael Steenbeek 77e22851cc
Merge pull request #12925 from richard-fine/dropdown-menus-static-data
RFC: Dropdown menus static data
2020-09-18 23:37:26 +02:00
Gymnasiast 72c13c8e77
Allow compilation with nlohmann/json < 3.9.0 2020-09-18 23:31:09 +02:00
Gymnasiast 265429c85a
Fix compilation on 32-bit Windows and MinGW 2020-09-18 20:54:36 +02:00
Ted John c204767176
Fix RTL for Windows 2020-09-18 19:46:12 +02:00
Gymnasiast 4ff77ebc35
Split RTL implementations to files; add preprocessor guards 2020-09-18 19:46:12 +02:00
Gymnasiast f11d1294fe
Use FriBidi on Windows, ICU on the rest 2020-09-18 19:46:12 +02:00
Gymnasiast 751810fc24
Use FriBidi for Bidi and shaping instead of ICU 2020-09-18 19:46:12 +02:00
Duncan da82144bfb
Fix #12944. Mistake from refactor meant formatter optimised away (#12961)
Not sure why it should get optimised away but this will fix the crashes.
2020-09-18 09:25:17 +01:00
Tulio Leao c72f547606
Merge pull request #12916 from richard-fine/pathfinding
Pathfinding cleanup
2020-09-17 17:58:31 -03:00
Matt b3b9a348c5
Apply review suggestions 2020-09-17 22:16:05 +03:00
Matt 38e03ae45d
Use the Formatter for News items 2020-09-17 22:14:36 +03:00
Matt ccde06ab0f
Explicitly pass formatter arguments to ShowError and family 2020-09-17 22:14:36 +03:00
Matt 2639349925
Move storage into Formatter class and refactor usage 2020-09-17 22:14:36 +03:00
Michael Steenbeek 1982e8491b
Merge pull request #12667 from mwnciau/json-refactor
Migrate JSON library to JSON for Modern C++
2020-09-17 21:11:06 +02:00
Richard Fine b57ed85098 Fixes from review feedback 2020-09-16 21:24:35 -04:00
Simon Jarrett f3aba68e46 Update project build files 2020-09-16 20:18:54 +01:00
Simon Jarrett 660c137958 Refactor Version to use new JSON library 2020-09-16 20:18:54 +01:00
Simon Jarrett 2c92c652e2 Refactor ObjectLoadError to use new JSON library 2020-09-16 20:18:54 +01:00
Simon Jarrett 57a57b0c02 Refactor Theme to use new JSON library 2020-09-16 20:18:54 +01:00
Simon Jarrett 12dfa74eef Refactor CmdlineSprite to use new JSON library 2020-09-16 20:18:54 +01:00
Simon Jarrett 0c58dfa1b3 Refactor objects to use new JSON library 2020-09-16 20:18:53 +01:00
Simon Jarrett 97b44a7181 Refactor ObjectFactory to use new JSON library
- Removed a few try-catch blocks as this is now handled in Json::Read[...]
2020-09-16 20:18:53 +01:00
Simon Jarrett 5f17554c25 Refactor ObjectJsonHelpers
Move functions in ObjectJsonHelpers to their relevant namespaces and classes
- Move ParseColour to Colour::FromString
- Move ParseCursor to Cursor::FromString
- Move LoadStrings to StringTable::ReadJson
- Move LoadImages to ImageTable::ReadJson
- Move ParseObjectEntry to Object::ParseObjectEntry
- Move GetString, etc. to Json::GetString, etc.
- Delete ObjectJsonHelpers .cpp and .h files
2020-09-16 20:18:53 +01:00
Simon Jarrett 1b821c1059 Refactor ServerList to use new JSON library 2020-09-16 20:18:53 +01:00
Simon Jarrett 651a2951a1 Refactor NetworkUser to use new JSON library
- Removed the ToJson(json_t) method
- The FromJson method expects to receive a JSON node of type object (as per added documentation)
- Unlike elsewhere, we need to use iterators for the Save() method to allow us to remove items from the array
2020-09-16 20:18:53 +01:00
Simon Jarrett de9a16404b Refactor NetworkServerAdvertiser to use new JSON library
- the body.dump() calls throughout use the default indent parameter of -1 so will produce JSON with no whitespace
- OnRegistrationReponse must be passed a JSON node of type object
2020-09-16 20:18:53 +01:00
Simon Jarrett c655d47dd3 Refactor NetworkGroup to use new JSON library 2020-09-16 20:18:53 +01:00
Simon Jarrett f1bcf20050 Refactor NetworkBase to use new JSON library 2020-09-16 20:18:52 +01:00
Simon Jarrett 324e94e6ce Fix #9088: refactor JSON code to use a more modern C++ library
- Removed dependency on jansson
- Implemented nlohmann JSON for Modern C++
- Moved generic GetString, etc., helper functions out of ObjectJsonHelpers.hpp to Json.hpp
- Added GetEnum helper function
- Added AsObject and AsArray helper functions
- Removed GetStringArray, etc., helper functions as they're not needed with the better language features
- Added second GetFlags definition that allows specifying inverted flags - this is a bit cleaner than previous hacks
- Comments!
2020-09-16 20:18:52 +01:00
Matt 3eff713765
Remove unused Registration.hpp 2020-09-16 20:23:39 +03:00
Matt 16fc41e6bf
Always return unique_ptr for the IniReader/IniWriter interface 2020-09-16 20:23:39 +03:00
Matt d0d5cc5179
Remove unused declarations 2020-09-16 20:23:34 +03:00
frutiemax af591c834b
Part of #12097: Use ScreenRect on gfx_fill_rect_inset (1) (#12938)
* Part of #12097: Use ScreenRect on gfx_fill_rect_inset (1)

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-09-16 00:02:22 -03:00
Michael Steenbeek 3acbb92074
Merge pull request #12922 from Gymnasiast/LetItSnow2 2020-09-15 18:11:45 +02:00
Tulio Leao c1729c8a87
Merge pull request #12858 from ju-pinheiro/network-strong-enums
NETWORK_PERMISSION and NETWORK_AUTH replaced by strong enums
2020-09-15 08:07:19 -03:00
Gymnasiast a46a21973f
Amend changelog; bump network version 2020-09-14 22:00:54 +02:00
Gymnasiast ce325fdb9b
Also set proper temperature when using weather cheat 2020-09-14 22:00:54 +02:00
Gymnasiast ac985a8d61
Do not transition to snow for now 2020-09-14 22:00:54 +02:00
Brett c9de4f49fe
Add snow as a weather type
Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-09-14 21:58:00 +02:00
Gymnasiast 31d20cefb2
Rename rain to weather where appropriate
Co-authored-by: Brett Penzer <brettpenzer123@live.co.uk>
2020-09-14 21:57:54 +02:00
rpstester f7348b1f06
Close #12389: Refactor PeepSittingSubState (#12908)
* Refactor PeepSittingSubState

* Fix formatting
2020-09-14 20:11:17 +01:00
frutiemax 2857f9d276
Part of #12097: Use ScreenRect on gfx_fill_rect_inset in Widget.cpp (#12906)
* Part of #12097: Use ScreenRect on gfx_fill_rect_inset in Widget.cpp

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-09-14 08:44:50 -03:00
Richard Fine 4f31ddaca4 Make menu data declarations local to the functions using them 2020-09-13 16:30:17 -04:00
Richard Fine a51d8e4deb Convert cheats menu to use new constexpr menu specification 2020-09-13 16:16:05 -04:00
Richard Fine ce99928b81 Convert view menu to use new constexpr menu specification 2020-09-13 16:15:53 -04:00
Richard Fine 4a9974fda6 Introduce mechanism for configuring dropdown menu with static data
For menus with static content, provide a mechanism for building the menu items as a constexpr array, allowing developers to specify menus more concisely and to put the data into the .rodata section where it can be quickly copied through.
2020-09-13 16:15:28 -04:00
Michael Steenbeek 0fb307c12e
Merge pull request #12921 from OpenRCT2/plugin/extras
Add quadrants and scenario info to plugin API
2020-09-13 20:37:53 +02:00
Richard Fine d21da12f9f
Fix 11414: ‘Possible misuse of comma operator’ warnings (#12919)
Fix the ‘possible misuse of comma operator’ warnings reported by XCode - the two original ones reported in #11414, plus one more in Util.cpp.
2020-09-13 17:43:59 +01:00
Ted John e79d4be5a5 Add quadrant and occupiedQuadrants to plugin API 2020-09-13 17:02:12 +01:00
Ted John 146a754001 Add plugin API for scenario and objective 2020-09-13 17:02:12 +01:00
Ted John e5107141e9 Add plugin API for park flags 2020-09-13 15:00:09 +01:00
Michael Steenbeek cf5b48a9dd
Rename Rain.{cpp,h} to Weather.{cpp,h} (#12914) 2020-09-12 19:32:26 -03:00
Sadret a9cd89d02e
Fix #12912: Plugin: selectedCell of CustomListView (#12913) 2020-09-12 19:24:23 -03:00
Richard Fine 4a20ed38a8 Document public API for pathfinder
Add comments explaining the externally-visible points in the pathfinding code.
2020-09-12 14:59:40 -04:00
Richard Fine 542eb873fc Consolidate pathfinding code
Consolidate all the guest pathfinding code from Peep.cpp into GuestPathfinding.cpp, and make a dedicated header for GuestPathfinding to help make it easier to see what the actual public interface is to the pathfinding system.
2020-09-12 14:59:40 -04:00
Gymnasiast 247de81e3b
Apply requested fixes 2020-09-12 13:45:50 +02:00
Ron4u 5fe542dd25
fixed issue 12335 2020-09-12 13:18:00 +02:00
Ted John eb18a5db81
Fix #12910: Plugin API: getRide sometimes returns null for valid IDs 2020-09-12 12:18:24 +02:00
Tulio Leao 917fb77f0e Revert regressed warning on window_install_track_paint 2020-09-10 21:19:53 -03:00
Tulio Leao c2f42cd908 Fix #12901: Guest thoughts show up as guest actions or names 2020-09-10 21:18:42 -03:00
Tulio Leao 2f3d455b3a
Merge pull request #12899 from Gymnasiast/refactor/c-style-casts
Remove most remaining C-style casts
2020-09-10 20:49:15 -03:00
Aaron van Geffen c0e551056f
Fix #12900: Garbled/distorted date lines in file browser (#12902)
* Fix #12900: Garbled/distorted date lines in file browser
2020-09-10 20:47:39 -03:00
ju-pinheiro 214620951f Close #12421: Refactor NETWORK_AUTH to use strong enum
Replacing enum NETWORK_AUTH with enum class NetworkAuth.
2020-09-10 19:32:28 -03:00
ju-pinheiro 20a8bbc322 Close #12420: Refactor NETWORK_PERMISSION to use strong enum
First approach, instead of a bigger refactor to avoid the need of "static_cast".
2020-09-10 19:32:27 -03:00
Tulio Leao 55f2eeb04d
Favour constexpr function over macro on Crypt.CNG.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao 720c17eea6
Cleanup c-style casts from Platform.Win32.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao e032ba091d
Cleanup c-style casts from Shared.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao 2a85374c6a
Cleanup c-style casts from Windows.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao cf5f3da0df
Cleanup c-style casts from Socket.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao fc59cb55a5
Cleanup c-style casts from Path.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao 9d2a9d76d3
Cleanup c-style casts from String.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao 5f47546392
Cleanup c-style casts from Http.WinHttp.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao 5afe6407a1
Cleanup c-style casts from FileWatcher.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao 5abbbf1357
Cleanup c-style casts from Crypt.CNG.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao cb7e190c8a
Cleanup c-style casts from File.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao de58f0f7a0
Cleanup c-style casts from FileScanner.hpp 2020-09-10 21:36:21 +02:00
Gymnasiast c83ddefe47
Convert remaining C-style casts to C++-style ones 2020-09-10 21:36:20 +02:00
Michał Janiszewski d8ffec0ed7
Use correct count of research items when importing park
Co-authored-by: Hielke Morsink <Broxzier@users.noreply.github.com>
Co-authored-by: Michael Steenbeek <Gymnasiast@users.noreply.github.com>
2020-09-10 21:01:14 +02:00
Duncan 353c02b596
Add visitors for all scenery placement and removes (#12886)
* Add visitors for all scenery placement and removes

This should allow greater flexibility for plugin developers

* Add CoordsXYZ visitor

* Increment plugin API version. Update changelog
2020-09-10 15:15:46 -03:00
tellovishous 96945183f5
Add stroke to lowercase 'L' to differentiate from capital 'I' (#12890)
The problem with many sans-serif fonts, such as those in RCT2, is that it can be difficult to tell between a lowercase L and an uppercase I, and can be visually ambiguous. What I've done is add a small stroke to the bottom of the lowercase L's so that it will stand out better when it's used next to capital I's.
2020-09-10 20:07:12 +02:00
Tulio Leao 4afbbed9bd
Fix #12881: Guests' favourite rides not listed in the guest window 2020-09-10 19:11:17 +02:00
Gymnasiast d140dd72c6
Remove const void* overload from DrawTextEllipsised() 2020-09-10 18:13:13 +02:00
Gymnasiast b788a099b5
Replace gfx_draw_string_clipped() calls with DrawTextEllipsised 2020-09-10 18:13:13 +02:00
Tom Parsons 9a30100a81
Make all GameAction types accessible to plugins (#12708)
* add ActionType

* Make all game actions available to plugins

Includes list of game actions in the .d.ts

* Add an overload for internal game actions

This allows things like Visual Studio Code to autocomplete

* action can be a string (custom gameactions)

* Increment OPENRCT2_PLUGIN_API_VERSION

* Add #12708 to changelog and tombomp to contributors.
2020-09-10 12:30:56 +01:00
Aaron van Geffen 11ebe78328
Refactor window offset std::arrays into regular arrays (#12799) 2020-09-09 22:51:51 +02:00
Michael Steenbeek ba7b08acfc
Merge pull request #12665 from Gymnasiast/refactor/objective-struct
Create Objective struct and use it for global objective
2020-09-09 22:34:33 +02:00
Michael Steenbeek bd28b74655
Make all game actions take an ObjectEntryIndex where applicable (#12384)
* Make all game actions take an ObjectEntryIndex where applicable

* Update replays for parameter size change

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-09-09 17:03:20 +01:00
Gymnasiast e23089d255
Make scenario check into member functions 2020-09-09 15:39:07 +02:00
Gymnasiast 6e22eade67
Create Objective struct and use it for global objective 2020-09-09 15:38:03 +02:00
Richard Fine d2d9750a5b Fix #5753: Entertainers make themselves happy instead of the guests
After identifying guests that are near an entertainer, modify the guest's HappinessTarget and TimeInQueue values instead of the entertainer's own values.
2020-09-08 16:40:29 -04:00
Jacob Schwartz fe71ce437d
Close #12434: Refactor ENTERTAINER_COSTUME to use strong enum (#12865) 2020-09-08 16:29:18 -03:00
Michael Steenbeek 30ffced8b9
Merge pull request #12880 from richard-fine/directions
Further clean up of direction-handling code
2020-09-08 18:16:25 +02:00
Richard Fine 6e176e725c Fix formatting 2020-09-07 22:27:33 -04:00
Richard Fine 51fdf84763 Use Direction type for TrackPaint functions
Many TrackPaint functions take a direction, but they used a mixture of uint8_t and int32_t types for the parameters. To make the semantics of the code clearer, use the dedicated Direction type for all of them.

This does mean that some parameters which were previously 32 bits (int32_t) will now be 8 bits (Direction) but from what I could see none of the usages make use of anything beyond the bottom 4 bits.
2020-09-07 21:20:34 -04:00
Richard Fine 74b581c572 Remove unused 'direction' parameter
The get_track_paint_function functions have all been taking an extra 'direction' parameter, but nothing is actually using it. To simplify things, remove the parameter.
2020-09-07 21:20:34 -04:00
Richard Fine 4d3ba7a6f0 Rename PathElement::Edges for clarity
PathElement::Edges actualy stores both 'edges' (in the lower 4 bits) and 'corners' in the upper four. Rename the variable to make this dual usage easier to see.
2020-09-07 21:20:34 -04:00
Michael Steenbeek 6ac23fbabb
Make Arabic font easier to read 2020-09-07 19:21:32 +02:00
Hielke Morsink 96d1db97e0
Fix: Unused variable warning because of if constexpr (#12871)
This moves the variable in question to the scope where it gets used. Since it's a reference, this shouldn't be a performance hit.
2020-09-06 22:22:49 +02:00