Commit Graph

780 Commits

Author SHA1 Message Date
Michael Steenbeek 9134bd4788
Update RCT1 path names + British spelling for ‘grey’ 2021-11-13 23:38:04 +01:00
Duncan a8d2d5fd44
Staff patrol area 2 from NSF (#15600)
* Port over changes from NSF for staff

* Fix import and export

* Fix crash on export

* Fix import issue

* Fix patrol import issue

* Remove staff id field

* Increment network version

* Actually remove all instances of staff id

* Update replays
2021-10-27 21:19:10 +01:00
Michał Janiszewski 6067048fd5 Reduce inclusion of NewsItem.h 2021-10-09 22:12:18 +02:00
Michael Steenbeek 987174e828
Merge pull request #15436 from duncanspumpkin/staff
Small Staff Refactor from NSF
2021-09-29 20:46:24 +02:00
Michael Steenbeek 1feac16bed
Merge pull request #15414 from frutiemax/develop
#15367: Encode RideType in TrackElement
2021-09-25 12:02:08 +02:00
ζeh Matt e5de2adc4f
Merge pull request #15429 from ZehMatt/backport/ticks
Remove scenario ticks and adjust export/import
2021-09-23 12:08:16 -07:00
ζeh Matt 74e8988dd8
Remove scenario ticks and adjust export/import
Co-authored-by: Ted John <ted@brambles.org>
2021-09-23 21:49:09 +03:00
ζeh Matt 719a5a9d8e
Merge pull request #15369 from ZehMatt/refactor/tile-coords
Refactor overload map_get_first_element_at
2021-09-21 14:36:03 -07:00
frutiemax 355019f97f
#15367: Encode RideType in TrackElement 2021-09-21 10:49:28 +02:00
duncanspumpkin ca689c3948 Introduce methods from NSF
These methods still call the same legacy functionality for now
2021-09-19 08:28:25 +01:00
Duncan c05068e8d1
Replace sprite_left,t,r,b with SpriteRect (#15408)
* Replace sprite_left,t,r,b with SpriteRect

This is required for the NSF. I had to add a silly constructor to rct_sprite for now. Will eventually be removed one day...

* Fix compilation and memory leak

* Add some UB to prevent some other UB

* Make review change
2021-09-18 19:07:35 +01:00
Hielke Morsink 4b4b3333d6
Remove unnecessary else blocks 2021-09-16 18:31:12 +02:00
Gymnasiast bdab3219cb
Modify object loading for JSON-only objects 2021-09-15 11:28:39 +02:00
ζeh Matt 59a6c34db4
Make use of std::optional strict 2021-09-13 20:02:32 +03:00
ζeh Matt e5eb8f84cf
Apply review suggestions 2021-09-10 19:36:14 +03:00
ζeh Matt 078d12a207
Fix S4 importer 2021-09-10 19:10:13 +03:00
Michael Steenbeek 624a32e93b
Make Coords isNull/setNull functions TitleCase (#15382) 2021-09-08 20:48:53 -03:00
ζeh Matt 07a7946caf
Remove redundant conversions 2021-09-07 22:36:16 +03:00
Gymnasiast 4cc717ccdb
Rework path surface and railings descriptor handling 2021-09-05 19:09:09 +02:00
Michael Steenbeek b1ecd9e89e
Merge pull request #15337 from ZehMatt/refactor/s4-ridetype
Make S4 RideType a strong enum
2021-09-04 15:23:53 +02:00
Michael Steenbeek a526caa1cb
Use std::copy for gParkRatingHistory
Co-authored-by: ζeh Matt <5415177+ZehMatt@users.noreply.github.com>
2021-09-04 00:03:24 +02:00
IntelOrca 600ce959d7
Use real values for gGuestsInParkHistory 2021-09-03 23:43:43 +02:00
ζeh Matt 8f5fb9d179
Convert switch to two conditional scopes 2021-09-03 23:53:04 +03:00
ζeh Matt 481f7565dc
Rename enum members 2021-09-03 23:48:35 +03:00
ζeh Matt af99bc28c7
Make S4 RideType a strong enum 2021-09-03 23:35:07 +03:00
Ted John 3c451a4af4
Use music objects instead of IDs 2021-09-01 10:26:23 +02:00
ζeh Matt 77dccb995c
Use RCT12PeepThoughtItemNone for importers 2021-08-30 21:13:34 +03:00
ζeh Matt 5d2c9d8be4
Merge pull request #15267 from spacek531/remove-var-CA
Remove var ca
2021-08-30 11:13:20 -07:00
Duncan 8cc833f905
Strip RCT1 out of RCT1 struct names in namespace (#15284)
* Strip RCT1 out of struct names in namespace

* Remove RCT1:: where not required
2021-08-30 11:28:50 +01:00
spacek531 6d7fd57f5b remove var_CA 2021-08-29 14:52:43 -07:00
ZehMatt de364aa15a
Rename type SpriteBase to EntityBase 2021-08-26 15:37:16 +03:00
Duncan b97c46421e
Move all RCT1 to RCT1 namespace (#15283) 2021-08-25 20:44:24 +01:00
Duncan 008f106242
Add constants for golf flags (#15072)
* Add constants for golf flags

* Reorg SubPositionData for minigolf

* Add enum for golf states

* Add golf animation enum

* Fix names of animations

* Correct spleing

* Revert stray change
2021-08-25 11:08:57 +01:00
spacek531 c49c6ca4a7
Rename animation vars 2021-08-21 19:23:27 +02:00
Hielke Morsink 15d3a4a9da
Update more include guards (#15254) 2021-08-21 12:55:28 +02:00
Duncan 223b926f8c
Use std::vector for ride use memory (#14884)
* Use std::vector for ride use memory

* Use new system for import/export

* Remove legacy field

* Add replay entity size protection to prevent crash

* Increment network version

* Update replays

* Move function to header

* Move constant to RCT12 header as used for both 1 and 2

* Align naming with nsf
2021-08-17 21:29:35 +01:00
Ted John 5f853df1fd
Remove gS6Info 2021-08-02 20:38:02 +02:00
Michael Steenbeek abc4a02ff5
Fix missed ToMoney64() occurrence 2021-08-01 15:14:43 +02:00
Gymnasiast efb3f8394b
Convert to/from money64 during export; convert completed company value 2021-08-01 15:14:43 +02:00
Gymnasiast 7f4927ced6
More money64 fixes 2021-08-01 15:14:42 +02:00
Gymnasiast f3337de260
Fix weekly profit import 2021-08-01 15:14:42 +02:00
Gymnasiast 8af70cf402
Correctly import ride profits 2021-08-01 15:14:42 +02:00
Ted John 70d9c1438e
Change most things and formatting to money64 2021-08-01 15:14:42 +02:00
Duncan e9eb1b8304
Banner Refactor from NSF (#14788)
* Banner refactor

* Fix mistake in fix_duplicated_banners

* Reduce limit back

* Fix export

* Free banner on delete

* Increment network version

* Fix potential banner pointer crashes

Co-authored-by: Ted John <ted@brambles.org>
2021-07-27 10:25:58 +01:00
Michael Steenbeek d880fbda56
Use constant for RCT1 max map size 2021-07-26 21:17:33 +02:00
Jamie Quigley 4f6d0a00fd
Refactor RIDE_STATUS to use strong enum (#14840)
* Refactor RIDE_STATUS to use strong enum

* Change platform-specific code to match RIDE_STATUS refactor

* Re-added check for valid RideStatus value

* Fixed errors in "g2" build target

* Use EnumValue instead of static_cast<uint8_t>

* Revert rct{1,2}.h to use uint8_t.

* Fix formatting

* Reverted from constexpr variable to additional enum variant

* Fix formatting
2021-06-10 07:09:58 +01:00
Ted John 81d7c3f02b Make tile elements dynamic and resizeable 2021-06-05 21:17:03 +01:00
Duncan 39fcc5d078
Split up Sprite header (#14764)
* Remove fields from rct_sprite union

* more header fun

* Fix guest include
2021-05-29 06:01:32 +01:00
duncanspumpkin 8282fde827
move Litter functions into class and refactor 2021-05-13 16:11:13 +02:00
ZxBiohazardZx 36b2742c19
Change Vehicle Rotation namings in accordance with OpenRCT2 Codestyle (#14616)
* Code Refactor: Rename vehicle_sprite_type to Pitch 

In some of the issues the vehicle_sprite_type is used to check for properties in regards to the pitch of the vehicle.Similarly bank_rotation is used to provide information on the Roll property. This is not in alignment with the https://github.com/OpenRCT2/OpenRCT2/wiki/Coding-Style and makes it harder to refactor other elements of the codebase and makes for undesired nested logics.

This PR also includes the change from rename bank_rotation to Roll in alignment with the OpenRCT2 Coding Style


Related to PullRequest #11956

* Apply formatting

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-05-12 12:38:46 +01:00
Michael Steenbeek 984a660ad7
Fix RCT1 American-style Steam Trains import 2021-05-09 18:53:35 +02:00
Michael Steenbeek c9943ee11d
Merge pull request #14458 from Gymnasiast/backport-nsf
Backport ride limit refactors from new-save-format
2021-04-20 23:25:53 +02:00
Duncan 8eabdf8c8f
Split guest and staff peep variables (#14462)
* Split guest and staff peep variables

* Move variable location

* Increment network version

* Update replays
2021-04-18 17:48:21 +01:00
Gymnasiast d857dca36d
Replace hardcoded max number of trains per ride 2021-04-16 18:56:16 +02:00
Duncan a9e1f2e89c
Remove SpriteBase::flags (#14460)
* Remove SpriteBase::flags

* Increment network version

* update replays
2021-04-11 18:02:19 +01:00
Michael Steenbeek 7344b7fbfd
Use 16-bit ride_id_t thoughout and raise RIDE_ID_NULL (#14411)
* Replace RIDE_ENTRY_INDEX_NULL with OBJECT_ENTRY_INDEX_NULL

Ride entries are objects like any other, so there is little point having separate constants.

* Use ride_id_t in many more places

* Change RIDE_ID_NULL to 0xFFFF

* Increment network version

* Update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-04-01 16:02:57 +01:00
Michael Steenbeek 9ee3c81768
Merge pull request #14397 from Gymnasiast/refactor/hardcoded-terrain-constants
Remove hardcoded terrain style constants from RCT1 and MapGen
2021-03-31 20:18:12 +02:00
Gymnasiast d7809c26f5
Use string_view instead of const char* 2021-03-31 19:22:09 +02:00
Duncan ee03ab71d7
Reorganise EntityImport for S4 to follow S6/park style (#14398) 2021-03-28 21:35:53 +01:00
Gymnasiast b3bbdcbfd5
Remove hardcoded terrain style constants from RCT1 and MapGen 2021-03-27 17:34:10 +01:00
Duncan 1be7457e30
Use entity list rather than MAX_ENTITIES loop (#14384)
* Use entity list rather than MAX_ENTITIES loop

* Use guest for variable names
2021-03-25 08:08:26 +00:00
Duncan 977d05ba29
Entity type5: Remove peep assigned type (#14380)
* Remove users of AssignedPeepType

* Remove AssignedPeepType

Field no longer required due to changes to EntityType

* Move enum to the RCT12 header

* Increment network version

* Update replays
2021-03-24 08:54:05 +00:00
Duncan ccfa22c230
Entity type4: Remove MiscEntityType and add FountainType (#14344)
* Move jumpingfountain type out of misc entity type

* Remove SubType for MiscEntities as it is no longer required

* Update replays

* Apply review comments

* Increment network version
2021-03-22 21:24:50 +00:00
Michael Steenbeek e89c37e7ae
Fix #11829: Glitches when using mismatched csg1/csg1i 2021-03-17 13:40:45 +01:00
Duncan df7a284822
Entity type 2: Remove sprite_identifier (#14334)
* Start changing the underlying type

* Further work

* Complete refactor

* Further cleanup

* Remove pointless check

* Increment network and plugin versions

* Add defaults

* Further defaults

* Fix test paint

* Update replays
2021-03-17 08:04:41 +00:00
Duncan 6ec379cd0e
Split Entity Lists by Entity type (#14326)
* Make initial changes to add entity type

* Make further corrections

* Revert header changes

* Fix mistakes
2021-03-16 11:18:06 +00:00
Duncan 5474194905
Implement train view and remove linked_list_index (#13956)
* Make train manager view

* Remove linked list index field

* Remove merge mistake

* Fix further rebase errors

* Rename and add comments

* Update replays

* Fix Xcode project

* Increment network version

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2021-03-15 08:13:00 +00:00
Michael Steenbeek 6a11dbf0c9
Fix #14247: Scenarios from RCT1 allow hiring too many staff 2021-03-07 13:54:01 +01:00
Michael Steenbeek 28c680f97f
Merge pull request #14163 from Gymnasiast/refactor/get-rtd
Use GetRideTypeDescriptor() in more places
2021-02-26 10:46:38 +01:00
Gymnasiast 44d0e77afb
Make all access to RTD table use the bounds checking function 2021-02-26 10:01:00 +01:00
Gymnasiast f118b2ede4
Replace ride_type_has_flag() with retrieving RTD 2021-02-26 09:49:09 +01:00
Michał Janiszewski ac6e4fc0d6 Move SPRITE_INDEX_NULL, MAX_SPRITES to their new homes 2021-02-25 10:56:27 +01:00
Michał Janiszewski 6baff43f52 Reduce inclusion of Sprite.h 2021-02-25 10:56:27 +01:00
Michael Steenbeek aa11a1ee96
Fix RCT1 shop import (#14157)
Regression from https://github.com/OpenRCT2/OpenRCT2/pull/14021
2021-02-23 19:13:26 -03:00
Gymnasiast 1b964c0f2e
Refactor flat ride track pieces 2021-02-18 17:50:19 +01:00
Matt c30bd1266f
Refactor IStream::ReadArray to return unique_ptr 2021-02-12 19:30:53 +02:00
Michael Steenbeek e3a1af3d05
Use getters/setters for track type and direction 2021-01-30 15:16:17 +01:00
Ted John 19f0d8dfe9
Fix #13842: News is imported incorrectly 2021-01-20 12:35:11 +01:00
Michael Steenbeek 830d2426bd
Import RCT1 tile elements by x/y (#13740)
* Import RCT1 tile elements by x/y

* Clean up wall import

* Move tile pointers creation to a separate function and to heap

* Create class for tile pointer index
2021-01-12 17:53:58 +00:00
Michael Steenbeek 60d1e94046
Close #7059: Implement landscape doors on Ghost Train (#13636)
* Implement landscape door updating

* Implement door drawing for Ghost Train

* Amend changelog and bump network version

* Apply review requests

* Always return default seat rotation for ride types with landscape doors

* Fix comment

* Update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-01-10 21:38:02 +00:00
Mathias Gibbens b1e5a11bf3
Several more spelling fixes (#13752)
Signed-off-by: Mathias Gibbens <mathias@calenhad.com>

Co-authored-by: Mathias Gibbens <mathias@calenhad.com>
2021-01-10 18:23:35 +00:00
Duncan d5ada2dca1
Remove type from SpriteBase (#13735)
* Move type field into sub structures

* Use type for misc_type

* Use type for l_type

* Rename to SubType

* Rename SpriteGeneric to MiscEntity

* Rename generic to misc

* Add extra nullptr checks for compilers that cant understand

* Make review changes

* Increment network version

* Update replays
2021-01-10 15:14:34 +00:00
Michael Steenbeek a95033e55f
Remove unused function (#13724) 2021-01-08 00:49:40 +01:00
Matt 19b63a1825
Refactor logic of MoveTo to always imply invalidation 2021-01-02 16:22:28 +02:00
Matt efa1db826e
Refactor invalidation logic to be generic to the callee 2021-01-02 16:22:28 +02:00
Matt cb719a6e10
Add missing case statements for entity scripting 2021-01-02 15:31:26 +02:00
Matt 5f2945d238
Refactor MISC_SPRITE to strong enum 2021-01-02 15:30:44 +02:00
Tulio Leao af0ec60bed Close #13626: Refactor RCT2LanguageId to strong enum 2020-12-23 20:07:54 -03:00
Tulio Leao 221aa8cece Close #12453: Refactor RCT2_EDITOR_STEP to strong enum 2020-12-23 20:07:53 -03:00
Ted John 9809df8de6
Fix #13549: Ride name is truncated/resetted in Korean
Handle multi-byte RCT2 strings when converting to string_view.
2020-12-23 20:19:25 +01:00
Gymnasiast 179b50358c
Add RCT1 surface styles 2020-12-20 21:45:21 +01:00
xuxf 14bc3b6359
Close #12449: Refactor DUCK_STATE to use strong enum (#13585)
* Refactor DUCK_STATE to use strong enum
2020-12-14 12:54:41 -03:00
Adam f09b14ef2b
Split actions hpp files into separate h and cpp files (#13548)
* Split up SmallSceneryPlace/Remove

Added undo function for Remove Scenery

* Refactor: Balloon and Banner actions hpp=>h/cpp

* Refactor: rename all action *.hpp files to *.cpp

This is preparation for separation in later commits. Note that without
the complete set of commits in this branch, the code will not build.

* Refactor Clear, Climate, Custom, and Footpath actions hpp=>h/cpp

* VSCode: add src subdirectories to includePath

* Refactor Guest actions hpp=>h/cpp

* Refactor Land actions hpp=>h/cpp

* Refactor LargeScenery actions hpp=>h/cpp

* Refactor Load, Maze, Network actions hpp=>h/cpp

* Refactor Park actions hpp=>h/cpp

* Refactor/style: move private function declarations in actions *.h

Previous action .h files included private function declarations with
private member variables, before public function declarations. This
commit re-orders the header files to the following order:
- public member variables
- private member variables
- public functions
- private functions

* Refactor Pause action hpp=>h/cpp

* Refactor Peep, Place, Player actions hpp=>h/cpp

* Refactor Ride actions hpp=>h/cpp

* Refactor Scenario, Set*, Sign* actions hpp=>h/cpp

* Refactor SmallScenerySetColourAction hpp=>h/cpp

* Refactor Staff actions hpp=>h/cpp

* Refactor Surface, Tile, Track* actions hpp=>h/cpp

* Refactor Wall and Water actions hpp=>h/cpp

* Fix various includes and other compile errors

Update includes for tests.
Move static function declarations to .h files
Add explicit includes to various files that were previously implicit
(the required header was a nested include in an action hpp file, and the
action .h file does not include that header)
Move RideSetStatus string enum to the cpp file to avoid unused imports

* Xcode: modify project file for actions refactor

* Cleanup whitespace and end-of-file newlines

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-12-10 06:39:10 +00:00
Michael Steenbeek 4a211278b2
Fix spelling of 'theming' 2020-12-09 11:33:33 +01:00
Duncan 9cbdae2ef1
Peep::ItemFlags merging (#13511)
* Merge standard and extra item flags for peeps

* Update replays
2020-12-09 09:21:23 +00:00
Michael Steenbeek 7df4f1835f
Rename incorrectly named RCT1 peep fields (#13528)
Photo2/3/4 and item extra flags are not present in RCT1, only in RCT2.
2020-12-06 01:10:25 -03:00
Ted John d58d834925
Merge pull request #13212 from IntelOrca/new-format-string
Eradicate all coded format tokens. All internal strings now contain raw tokens such as `{STRINGID}` and `{RED}`. New iterators have been created to iterate the tokens and the UTF-8 codepoints.

Formatting strings has been re-written and a new template version is available.
2020-12-04 13:56:54 +00:00
Łukasz Pękalski 3de233c796
Close #12395: Refactor PeepItem to use strong enum (#13311)
* refactor: integrated PEEP_ITEM into SHOP_ITEM

* refactor: converted merged enum to flag

Only former occurrences of PEEP_ITEM

* cleanUp: code cleaned after merging

* refactor: converted ShopItem to strong enum

code reformatting

* refactor: ShopItem enum items renamed

code formatted

* refactor: new getter and setter functions for Item...Flags

* refactor: replaced all occurrences of ItemStandardFlags

with appropriate getter and setter functions.
COMPARE_FIELD macro needs to be commented out or the flag has to stay public.

* refactor: all occurrences of ItemExtraFlags replaced

with proper function calls. COMPARE_FIELD macro issue not resolved.

* refactor: introduced new variable for unified item flags

* refactor: adapted accessor functions

accessor functions were modified to accommodate both standard and extra ShopItem flags

* refactor: ItemExtraFlags accessor functions are replaced

with general functions

* refactor: reverted to original uint32_t flag variables

* refactor: implemented suggested changes

* refactor: integrate additional comments

* refactor: incorporated requested changes

* refactor: incorporated requested changes

added static_cast<PeepThoughtType> in lines 1572 and 1590
2020-12-03 21:15:59 -03:00
Ted John 17edaae02b Improve banner formatting fix 2020-11-29 01:19:51 +00:00
Ted John 699103fe86 Fix banner text formatting, import / export 2020-11-28 16:52:19 +00:00