Commit Graph

53 Commits

Author SHA1 Message Date
Hielke Morsink 7e2e6e2b2f
Merge branch 'develop' into new-save-format 2021-10-19 22:26:08 +02:00
Hielke Morsink 9dd20ec619
Improve array formatting
For most of these cases, adding a trailing comma to the array block makes clang-format put each item on a new line, and clang-format exception blocks could be reduced where clang-format does not handle them properly.
2021-10-17 18:21:45 +02:00
Ted John 80e0f990ab Fix remaining merge conflicts 2021-09-17 22:16:47 +01:00
Gymnasiast c390e9f521
Merge remote-tracking branch 'upstream/develop' into new-save-format
Some conflicts intentionally unresolved
2021-09-17 10:15:09 +02:00
Gymnasiast bdab3219cb
Modify object loading for JSON-only objects 2021-09-15 11:28:39 +02:00
ζeh Matt 50d7b8bb1c
Remove unused function get_loaded_object_entry 2021-09-11 16:50:30 +03:00
ζeh Matt 38ec042a52
Refactor object_entry_get_chunk wrapper 2021-09-11 16:50:30 +03:00
ζeh Matt c416c7ca27
Remove unused function get_loaded_object_chunk 2021-09-11 16:50:30 +03:00
Michael Steenbeek 7b2554cdae
Addendum to #15340: guard size of object_entry_group_counts 2021-09-05 16:06:34 +02:00
Hielke Morsink fd2a572f9a
Fix #15319: Clicking on Object Selection Cheat Freezes the Game
This fixes it by adding limits for the missing path types.

Co-authored-by: ζeh Matt <5415177+ZehMatt@users.noreply.github.com>
2021-09-04 01:09:09 +02:00
Ted John 978adf541f Implement new surface objects 2021-04-20 22:04:08 +01:00
Ted John 24a29a8a4c Add path surface object type 2021-04-20 01:30:38 +01:00
Ted John 977a703534 Remove find_object_in_entry_group 2021-04-14 11:24:24 +01:00
Ted John 6329e8fdfe Reduce use of rct_object_entry 2021-04-14 10:36:21 +01:00
Ted John 0a8f810e5d Add path railings object 2021-04-12 02:02:01 +01:00
Ted John fce02c21c3 Implement handling of new object types 2021-04-03 00:23:15 +01:00
Michał Janiszewski b1e43f828b Add nullptr check in get_loaded_object_entry 2021-01-23 22:26:02 +01:00
Michael Steenbeek 406967c71f
Refactor object_entry_get_entry() to return Object 2021-01-03 23:01:52 +01:00
Łukasz Pękalski 832fd69822 refactor: changed ObjectType enum to strong enum
code does not compile yet
2020-11-11 16:07:01 +01:00
Łukasz Pękalski 6e5105ab3b refactor: ObjectType to use strong enum
enum renaming complete
2020-11-11 16:07:01 +01: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 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Michael Steenbeek 9ef8d6da42
Convert most remaining C-style casts to C++-style ones (#11867) 2020-06-07 23:18:11 +02:00
Michael Steenbeek b89130e0f3
Use ObjectEntryIndex in more places (#11440) 2020-04-25 00:10:47 +02:00
Michał Janiszewski 2323cc1596
Use named casts instead of old-style casts
Change prepared with clang-tidy and google-readability-casting check
2020-04-22 17:09:29 +02:00
Michael Steenbeek c519512cfe
Create ObjectEntryIndex (#10980) 2020-03-20 19:28:39 +01:00
Michael Steenbeek d86dce17e8
Prepare object indices for uint16_t (part 2) (#10966) 2020-03-18 21:27:53 +01:00
Michael Steenbeek 18ebe73dfa
Replace object_entry_get_type() with method (#10937) 2020-03-15 12:07:04 +01:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
ζeh Matt 7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01:00
Ted John 06f203a7e7 Implement surfaces, edges and stations as objects 2018-12-09 23:30:40 +00:00
Hielke Morsink 354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
Matt 04928d4b84 Refactor reference over std::shared_ptr. 2018-08-31 07:18:48 +02:00
Linus Unnebäck fd07be587a
Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01:00
Michael Steenbeek 2a64ec7aff Use sourceGame parameter in JSON files instead of originalId 2018-07-30 21:39:27 +02:00
clang-format a6a12af1ec clang-format object 2018-07-23 16:00:06 +02:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Michael Steenbeek ec3a1e575e
Replace Math::Min and Max with std variants 2018-06-20 17:11:35 +02:00
Hielke Morsink 0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
Hielke Morsink dc673a64d8 Give context the ownership of repositories and the object manager (#7340)
This makes them no longer a singleton, which fixes annoying behaviour when launching multiple contexts in one game session.
2018-04-10 13:19:23 +01:00
Michał Janiszewski 28391eaf5d Move cstring out of common.h 2018-03-18 23:29:13 +01:00
Michał Janiszewski 92c4c39b96 Guard from nullptr dereference in object_entry_get_entry
While looking at
https://github.com/OpenRCT2/OpenRCT2/issues/7176#issuecomment-365399194
I got a crash with stacktrace:

    #0 0x7f9e81fa2e30 in object_entry_get_entry(int, unsigned long) ../src/openrct2/object/ObjectList.cpp:181
    #1 0x7f9e81fa24ae in get_loaded_object_entry(unsigned long) ../src/openrct2/object/ObjectList.cpp:142
    #2 0x7f9e8215d64f in S6Exporter::Export() ../src/openrct2/rct2/S6Exporter.cpp:169
    #3 0x7f9e8216de71 in scenario_save(char const*, int) ../src/openrct2/rct2/S6Exporter.cpp:757
    #4 0x7f9e81c932b0 in game_autosave() ../src/openrct2/Game.cpp:1590
    #5 0x7f9e828625b6 in scenario_autosave_check() ../src/openrct2/scenario/Scenario.cpp:297
    #6 0x7f9e81c8a958 in game_update() ../src/openrct2/Game.cpp:439
    #7 0x7f9e81c6731f in OpenRCT2::Context::Update() (/home/janisozaur/workspace/OpenRCT2/build/libopenrct2.so+0x10f331f)
    #8 0x7f9e81c6674c in OpenRCT2::Context::RunVariableFrame() (/home/janisozaur/workspace/OpenRCT2/build/libopenrct2.so+0x10f274c)
    #9 0x7f9e81c6402d in OpenRCT2::Context::RunFrame() (/home/janisozaur/workspace/OpenRCT2/build/libopenrct2.so+0x10f002d)
    #10 0x7f9e81c638f4 in OpenRCT2::Context::RunGameLoop() (/home/janisozaur/workspace/OpenRCT2/build/libopenrct2.so+0x10ef8f4)
    #11 0x7f9e81c627bf in OpenRCT2::Context::Launch() (/home/janisozaur/workspace/OpenRCT2/build/libopenrct2.so+0x10ee7bf)
    #12 0x7f9e81c5b08a in OpenRCT2::Context::RunOpenRCT2(int, char const**) ../src/openrct2/Context.cpp:170
    #13 0x56323695b95e in main ../src/openrct2-ui/Ui.cpp:60

Sadly I cannot reproduce it anymore
2018-02-14 09:48:34 +01:00
Ted John 9cc8d36a03 Fix #7171: Clicking any ride that has custom designs crashes
Wrong argument was being passed to object_entry_get_entry.
2018-02-13 17:30:47 +00:00
Ted John 7e01dcdaaf Remove legacy object list 2018-02-12 12:48:41 +00:00
Ted John 51321a71e7 Get entries directly from object manager 2018-02-12 12:48:41 +00:00
Ted John d22572d0b9 Remove rct_object_entry_extended 2018-02-12 12:48:41 +00:00
Ted John 4d8fe051e8 Remove most usages of object_entry_groups 2018-02-12 12:48:41 +00:00
Gymnasiast b1ab852fb7 Add object_entry_get_type() 2018-02-09 13:47:15 +01:00
Michał Janiszewski 5a8cfb16c8 Clang-format guards for static data
This guards most of the hardcoded data from clang-format.

[ci skip]
2018-01-11 09:19:56 +01:00