ζeh Matt
a2470c0573
Rename ride_id_t to RideId
2022-02-12 18:11:18 +02:00
frutiemax
adb692b74e
Forward declare Formatter
2021-12-30 12:17:51 -05:00
Michael Steenbeek
27cbb6c6ae
Merge pull request #16190 from Gymnasiast/refactor/normalised-tile-element-type-3
...
Part of #15485 : normalise all OpenRCT2 tile element types
2021-12-12 09:53:09 +01:00
ζeh Matt
cec30e093d
Merge pull request #15991 from ZehMatt/refactor/bannerid
...
Use TIdentifier for BannerIndex
2021-12-11 08:08:27 -08:00
Gymnasiast
aa34f0f760
Drop the N postfix
2021-12-11 00:39:39 +01:00
Michael Steenbeek
2d1af0ec42
Replace many GetType() calls with GetTypeN()
2021-12-10 22:43:17 +01:00
ζeh Matt
e6187a0af4
Use BannerIndex::UnderlyingType for iterations
2021-12-01 14:41:59 +02:00
ζeh Matt
810521bd5b
Remove BANNER_INDEX_NULL
2021-12-01 14:41:59 +02:00
ζeh Matt
63a2e9d716
Refactor uses of old BannerIndex
2021-12-01 14:41:59 +02:00
Hielke Morsink
c2d3ca5f85
Automatically deduce std::array types
...
This also improves formatting of some arrays with weird or no indention.
2021-10-14 23:27:28 +02: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
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
ζeh Matt
4ada04c7ca
Fix #15289 : Duplicated banner correction using the wrong index
2021-08-29 12:20:17 +03:00
Duncan
465d1c5414
Cleanup of Banner related actions ( #15126 )
...
* Close #15107 . Use correct type and provide appropriate error messages
* Add further error messages to actions
* Apply review comments
2021-07-30 20:53:13 +01:00
Duncan
d76611e0f2
Actually allocate a banner when using GetOrCreateBanner
...
When importing a file this function is used to create a banner at a certain index. Previously this was not assigning the id to the banner id. Luckily as banner id is a new field this did not cause any issues except in the nsf which does use the banner id more extensively
2021-07-27 19:58:09 +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
Duncan
8f59fe91cb
BannerSceneryEntry Refactor ( #14810 )
...
* Refactor BannerSceneryEntry to enforce type
* Remove old comment
* Fix incorrect renameing
2021-06-03 21:43:30 +01:00
Duncan
425f968a67
Rearrange WallSceneryEntry to enforce types ( #14808 )
...
* Rearrange WallSceneryEntry to enforce types
* Clang format
Correct inverted nullptr check
2021-06-03 13:26:00 +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
Gymnasiast
56399e7188
Use the RTD instead of ride_type_has_flag()
2021-02-24 14:10:30 +01:00
Gymnasiast
841d6a5f24
Avoid truncating banner index; check for NULL
2021-02-10 15:22:49 +01:00
Gymnasiast
2aae1cb84e
Fix #13235 : NPE in fix_duplicated_banners()
...
Co-authored-by: IntelOrca <ted@brambles.org >
2021-02-10 15:14:46 +01:00
Michael Steenbeek
1b686816db
Move tile element banner functions to methods
2021-01-02 11:28:39 +01: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
Ted John
b6a688e540
Refactor format tokens
2020-11-27 18:54:57 +00: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
Matt
2639349925
Move storage into Formatter class and refactor usage
2020-09-17 22:14:36 +03:00
Aaron van Geffen
7b5087f057
Update copyright year to 2020
2020-07-21 15:04:34 +02:00
frutiemax
32c342e88d
Part of #11389 : Remove FormatTexto that take void* in banner struct ( #12034 )
2020-06-23 14:50:56 +01:00
Breno Rodrigues Guimarães
374b744477
Use Formatter to handle argument formatting for tooltips ( #11379 )
2020-04-21 12:38:59 +02:00
Breno Rodrigues Guimarães
2479256bc1
Adjust Formatter function names according to coding style ( #11378 )
2020-04-20 18:55:15 -03:00
Breno Rodrigues Guimarães
d4a2a98e20
Replacing set_format_arg_on macro in favor of a more C++zy solution ( #11350 )
2020-04-20 07:10:33 +02:00
Breno Rodrigues Guimarães
3c1bdcd201
Create a compile-time table for converting color codepoints to utf8 ( #11349 )
...
For this to be possible, the function to convert a codepoint to urf8 was
moved to the header and made constexpr.
Now it's not necessary to store a std::string just to serve as a buffer
for holding this string. All the computation is done at compile time.
2020-04-19 15:51:01 +02:00
Tulio Leao
64e4a8420e
Use named casts on openrct2/world ( #11141 )
2020-04-17 21:08:22 +02:00
Gymnasiast
edd31d9f16
Move flags to RideTypeDescriptors
2020-04-17 17:03:33 +02:00
Breno Guimaraes
347c402984
Fix #11286 : Fix coloring of banners on tooltip
...
This patch moves the function that adds coloring to the buffer text into the Buffer struct with a flag.
It also changes both Banner printing and Banner tooltip to use the colored version
2020-04-16 08:06:07 -03:00
Gymnasiast
1e6efa6eb4
Extend BannerIndex to 16 bits
2020-02-15 10:37:34 +01:00
Michael Steenbeek
d16fbb0cd2
Change ride->overall_view to CoordsXY ( #10673 )
2020-02-08 17:19:59 +01:00
Tulio Leao
49bd8e0c67
Use CoordsXYZ on banner_get_ride_index_at()
2020-01-19 13:28:24 -03:00
Tulio Leao
5a74d057b0
Use CoordsXY on banner_get_closest_ride_index()
2020-01-19 13:28:24 -03:00
duncanspumpkin
58339cff2b
Prepare overall_view for type change
2019-12-24 08:39:20 +00:00
Gymnasiast
62fcbb07ca
Rename methods to GetBaseZ/GetClearanceZ
2019-12-23 20:08:37 +01:00
Gymnasiast
7d11858dbe
Create getter for GetBaseHeight()/GetClearanceHeight()
2019-12-23 20:05:24 +01:00
Tulio Leao
a2c7ecc6e5
Make Map::map_get_first_element_at() use CoordsXY ( #10413 )
...
* Make Map::map_get_first_element_at() use CoordsXY
* Fix clang-format on ClearAction.hpp
* Prefer TileDIrectionDelta over hardcoded delta on RideConstruction
* Use named Direction constants
* Make Compat::map_get_first_element_at() use CoordsXY
2019-12-23 07:35:41 +00:00
Michael Steenbeek
a2b9598341
Modify code using Location8 to use isNull()/setNull() ( #10403 )
2019-12-21 11:34:46 +01:00
Tulio Leao
b793d7e79a
Avoid dereferencing map_get_first_element_at nullptr on libopenrct2 ( #10013 )
...
* Avoid dereferencing map_get_first_element_at nullptr on Map.cpp
* Avoid dereferencing map_get_first_element_at nullptr on MapAnimation.cpp
Returning true or internal control variable, based on what was seen on `map_animation_invalidate_track_onridephoto`
* Avoid dereferencing map_get_first_element_at nullptr on Park.cpp
* Avoid dereferencing map_get_first_element_at nullptr on Scenery.cpp
* Avoid dereferencing map_get_first_element_at nullptr on Sprite.cpp
* Avoid dereferencing map_get_first_element_at nullptr on TileInspector.cpp
* Avoid dereferencing map_get_first_element_at nullptr on Wall.cpp
* Avoid dereferencing map_get_first_element_at nullptr on Fountain.cpp
* Avoid dereferencing map_get_first_element_at nullptr on Footpath.cpp
* Avoid dereferencing map_get_first_element_at nullptr on Entrance.cpp
* Avoid dereferencing map_get_first_element_at nullptr on Banner.cpp
* Avoid dereferencing map_get_first_element_at nullptr on Vehicle.cpp
* Avoid dereferencing map_get_first_element_at nullptr on TrackDesignSave.cpp
* Avoid dereferencing map_get_first_element_at nullptr on TrackDesign.cpp
* Avoid dereferencing map_get_first_element_at nullptr on Track.cpp
* Avoid dereferencing map_get_first_element_at nullptr on Station.cpp
* Avoid dereferencing map_get_first_element_at nullptr on RideRatings.cpp
* Avoid dereferencing map_get_first_element_at nullptr on Ride.cpp
* Avoid dereferencing map_get_first_element_at nullptr on S4Importer.cpp
* Avoid dereferencing map_get_first_element_at nullptr on Staff.cpp
* Avoid dereferencing map_get_first_element_at nullptr on Peep.cpp
* Avoid dereferencing map_get_first_element_at nullptr on GuestPathfinding.cpp
* Avoid dereferencing map_get_first_element_at nullptr on Guest.cpp
* Avoid dereferencing map_get_first_element_at nullptr on VirtualFloor.cpp
* Avoid dereferencing map_get_first_element_at nullptr on Paint.TileElement.cpp
* Fix issues raised on review
* Fix remaining review issues.
* Early exit on loops if tileElement is nullptr
* Fix clang-format issues
2019-10-09 15:02:21 +01:00
Ted John
ab7b17fc4e
Add nullptr checks for get_ride in libopenrct2 ( #9788 )
2019-08-08 22:58:56 +01:00
Ted John
a863c7ae50
Remove rest of FOR_ALL_RIDES instances
2019-08-04 16:44:17 +01:00