1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 03:23:15 +01:00
Commit Graph

128 Commits

Author SHA1 Message Date
frutiemax
af0fc89cf4 Close #12456: Refactor INPUT_STATE to use strong enum (#12484) 2020-07-27 19:51:10 -03: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
Matt
fa2bd4cad6 Refactor PeepType to use strong enum 2020-07-25 11:54:37 +02:00
Aaron van Geffen
7b5087f057 Update copyright year to 2020 2020-07-21 15:04:34 +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
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
frutiemax
78e40f5358 Close #12160: Coords for is_sprite_interacted_with_palette_set (#12241) 2020-07-13 16:31:06 -03: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
27734e2971 Part of #12160: Use Coords for viewport_coord_to_map_coord (#12216) 2020-07-12 18:42:54 -03:00
Tulio Leao
76e7bfbf78 Fix load game showing edge of map 2020-07-11 18:19:28 +02:00
frutiemax
76d899c8da Part of #12160: Use Coords for is_sprite_interacted_with (#12207) 2020-07-11 16:55:27 +02:00
frutiemax
805eec4153 Part of #12160: Use Coords for viewport_move (#12195) 2020-07-10 22:39:24 -03:00
frutiemax
29e6db982b Part of #12096: Prefer ScreenRect on gfx_fill_rect (#12187) 2020-07-09 23:32:38 -03:00
frutiemax
280a21fa30 Fix #12095: Use ScreenRect on gfx_set_dirty_blocks (#12106) 2020-07-08 13:16:24 -03:00
Duncan
8c1aa43ef4 Add TryGetEntity to fetch entity objects easily (#11979)
Implement TryGetEntity and use it
2020-07-07 13:13:22 -03:00
Duncan
94b3598102 Tiny GetEntity Refactor (#12124)
* Use default template parameter instead of specialising

* Fix null deref issues
2020-07-06 22:02:25 +01:00
duncanspumpkin
904e6c6987 Implement GetSprite and use it in a number of places
This will eventually replace all of the get_sprite and try_get_sprite calls

Further use of GetSprite

Use GetSprite in all remaining easy to use functions

Correct formatting

Rename GetSprite to GetEntity

Make suggested changes

Remove const to allow for building

Fix crashes due to next sprite
2020-06-16 20:21:56 +01:00
Tulio Leao
e54a3d89f2 Rename some Peep member variables to use TitleCase (#11931)
* Rename Peep::destination_tolerance to use TitleCase

* Rename Peep::destination_y to use TitleCase

* Rename Peep::destination_x to use TitleCase

* Rename Peep::trousers_colour to use Title Case

* Rename Peep::tshirt_colour to use TitleCase

* Rename Peep::no_of_rides to use Title Case

* Rename Peep::staff_type to use TitleCase

* Rename Peep::type to use TitleCase

* Rename Peep::sprite_type to use TitleCase

* Rename Peep::sub_state to use TitleCase

* Rename Peep::state to use TitleCase

* Rename Peep::outside_of_park to use TitleCase

* Rename Peep::next_flags to use TitleCase

* Rename Peep::name to use TitleCase

* Rename Peep::NoOfRides to GuestNoOfRides

* Rename Peep::Type to AssignedPeepType

* Rename Peep::GuestNoOfRides to GuestNumRides
2020-06-14 06:31:08 +01:00
Tulio Leao
ccd76f8fc4 Rename Peep::current_ride to CurrentRide 2020-06-08 17:36:35 -03:00
Tulio Leao
1ac3b3d2dc Rename Peep::current_train to use TitleCase 2020-06-08 17:36:34 -03:00
Tulio Leao
335cbc900e Rename Peep::current_car to CurrentCar 2020-06-08 17:36:34 -03:00
Michael Steenbeek
9ef8d6da42 Convert most remaining C-style casts to C++-style ones (#11867) 2020-06-07 23:18:11 +02:00
Ted John
d3f7ec4844 Create new PaletteMap type to replace byte pointers 2020-05-28 20:00:23 +01:00
Michael Steenbeek
d7637cd70f Replace many C-style casts (#11720) 2020-05-11 14:32:56 +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
Aaron van Geffen
34d8572d85 Patch GCC9 in more places. 2020-03-23 17:42:16 +01:00
Ted John
bd0265f1bc Fix GCC9 2020-03-23 16:37:18 +00:00
Ted John
6e7a7c23c9 Fix odd issues at certain positions of the map 2020-03-23 15:54:03 +00:00
Ted John
d34dec9c27 Create ZoomLevel struct to add two new zoom levels 2020-03-23 15:54:03 +00:00
Michael Steenbeek
8351a0477d Merge pull request #10854 from tupaschoal/coords-3
Increase usage of ScreenCoordsXY on viewport functions and structs
2020-03-05 12:21:04 +01:00
Michael Steenbeek
5e2b1180f8 Fix Viewport.cpp copyright header (#10874) 2020-03-05 12:15:51 +01:00
Tulio Leao
d0717c2748 Remove padding from rct_window 2020-03-05 08:03:33 -03:00
Tulio Leao
724a6d4dcf Make rct_window use ScreenCoordsXY 2020-03-02 20:51:01 -03:00
Tulio Leao
2cfac98342 Make gSavedView use ScreenCoordsXY 2020-03-02 20:51:01 -03:00
Tulio Leao
09fad0ef7f Change rct_viewport to use ScreenCoordsXY 2020-03-02 20:50:58 -03:00
Tulio Leao
87f724d038 Use Coords objects for viewport_create() 2020-03-02 20:49:59 -03:00
Michael Steenbeek
d395d67b95 Merge pull request #10846 from tupaschoal/const-ref-screencoords
Prefer const ref to send ScreenCoordsXY over
2020-03-01 14:17:51 +01:00
Tulio Leao
91c4735917 Revert to copy instead of const-ref for functions that edit content 2020-03-01 00:49:00 -03:00
Tulio Leao
9bcd20e0e6 Prefer const ref to send ScreenCoordsXY over 2020-02-29 08:25:48 -03:00
Tulio Leao
98781e7596 Revert change to commented line 2020-02-23 09:19:45 -03:00
Tulio Leao
1b3f0e9a44 Create ScreenCoordsXY gSavedView from separate x,y variables 2020-02-22 16:01:21 -03:00
ζeh Matt
1272c0c043 Crash using benchspritesort with dimensions not divisible by 32 (#10743)
Fixes #10740
2020-02-19 21:50:13 +01:00
Matt
0f50697ceb Fix unused variable warning 2020-02-16 15:50:35 +01:00
Matt
c440b8f918 Fix #10705: Apply multithreaded rendering to all viewports 2020-02-16 14:06:08 +01:00
Matt
758a7e432f Use const reference instead of copy for location structures 2020-02-13 11:53:14 +01:00
Michał Janiszewski
1b7639238a Fix #9559: benchspritesort is broken after #8481 (#9590)
* Fix #9559: benchspritesort is broken after #8481

This takes multithreading into account as well

* Apply review fixes

* Fix detection of newer Google Benchmark (>= 1.5.0)

* Review fix
2020-02-12 22:18:00 +01:00
Michael Steenbeek
d16fbb0cd2 Change ride->overall_view to CoordsXY (#10673) 2020-02-08 17:19:59 +01:00
Duncan
d486ac4d3b Reduce direct usage of LOCATION_NULL (#10480)
* Reduce direct usage of Location_Null

Ideally we want to refactor these out to use std::optional as much as possible but for now move to using the standard interfaces.

* Remove incorrect AND with LOCATION_NULL

In the original this was a simple comparison to check for negative. Unsure how it ended up as an AND with the negative bit.
2019-12-31 09:01:17 +01:00
Duncan
7a64eb4402 Fix #10470. Mistake caused by reusing variable names for different functions. (#10476)
Added in comments to clarify why function is required. Renamed variables again to clarify what they are used for
2019-12-30 12:26:58 +01:00