Commit Graph
155 Commits
Author SHA1 Message Date
Ted John 7854d94599 Fix benchmarking 2021-05-03 02:38:42 +01:00
Ted John bba967d62e Start working on benchmark changes 2021-05-02 22:02:09 +01:00
Ted John cb6d471560 Increase paint struct limit by using shared pool 2021-04-27 01:27:49 +01: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 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
Michał Janiszewski 67b61478cf Reduce inclusion of EntityList.h 2021-02-25 10:56:27 +01:00
Ted John 762b6ee816 Refactor viewport interaction flags and add plugin API 2021-02-18 18:10:29 +00:00
Ted John 27013d147a Invalidate viewport when moving without scrolling 2021-02-18 18:10:29 +00:00
ζeh Matt db4841ca45 Avoid copy and allocation for rendering the viewport (#13911) 2021-01-27 07:28:07 +00:00
skdltmxn 7ef4d7762f Refactor to avoid unnecessary copies (#13736)
* Refactor to avoid unnecessary copies

* Fix dangling references
2021-01-11 18:14:15 -03:00
ζeh Matt a6080b7996 Refactor code to dynamically add and remove viewports (#13687) 2021-01-07 19:06:49 +00:00
Dennis Devriendt 3073cca6aa Close #13624: Refactor ViewportInteractionItem to use strong enum (#13657)
* Closes #13624: Refactor ViewportInteractionItem to use strong enum
2020-12-29 15:09:15 -03:00
Łukasz Pękalski 4adf745237 Close #12403: Refactor FILTER_PALETTE_ID to use strong enum (#13273) 2020-12-05 15:13:59 -03:00
Hielke MorsinkandMichael Steenbeek f0c1ea1d37 Split declarations and definitions to improve compile times when editing (#13332)
* Split FileStream declarations and definitions

* Split JobPool declarations and definitions

* Split StringBuilder declarations and definitions

* Split StringReader declarations and definitions

* Split ZoomLevel declarations and definitions

* Fix missing include in FileClassifier.cpp

* Remove pragma once from source files

* Fix missing include in StringBuilder.h

* Update Xcode project

* Fix compilation of tests

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-11-07 12:42:04 +00:00
ju-pinheiro bb16ca075b Close #12450: Refactor SPRITE_IDENTIFIER to use strong enum 2020-10-27 13:26:27 -03:00
Duncan 214f6992dd Rename to TitleCase and name LastAttachedPS (#13260) 2020-10-22 18:13:54 +01: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
Bryan DiLaura 7c95f594d3 Close #12413: Refactor VISIBILITY_CACHE to use strong enum (#13136) 2020-10-09 19:12:14 -03:00
Julia Pinheiro 8800c32e52 Close #12404: Refactor DRAWING_ENGINE to use strong enum (#13070) 2020-10-02 22:41:30 -03: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
Ted John a1cd02c61c Disable closer zoom levels for software rendering 2020-08-28 01:29:59 +01:00
Ted John 7f0510e444 Fix sub pixel clip issues with OpenGL 2020-08-28 01:29:59 +01:00
Ted John 2b51eaeaa1 Fix weather gloom when zoomed in 2020-08-28 01:29:59 +01:00
Matt ThomsonandMatt Thomson a8f8f06e2d Fix #12402: Refactor MEASUREMENT_FORMAT to use strong enum (#12642)
* Fix #12402: Refactor MEASUREMENT_FORMAT to use strong enum

* Remove redundant default branches

Co-authored-by: Matt Thomson <matt-thomson@users.noreply.github.com>
2020-08-13 21:51:28 +01:00
Duncan aa11773da3 Fix #12566, #12565, #12562, #12560, #12558: Nullptr deref (#12567)
Mistake made in refactor meant that a nullptr deref took place when the screen coords were outside of the normal play area
2020-08-02 20:13:09 +01:00
Duncan 733bc5a981 Close #12518: Viewport Refactor (#12541)
* Remove viewport pointer from get_map_coordinates_from_pos

* Removed viewport from get_window

* Return a InteractionInfo from get_map_coord...

* Remove viewport_interaction_info struct

* Add Entity union to simplify code

* Name the enum used for viewport interaction

* Simplify functions further by returning the info struct

* Add default switches
2020-08-02 08:32:59 +01:00
Duncan c6e26267a4 Reduce the use of GET_VEHICLE (#12494)
* Start removing GET_VEHICLE macro use

* Further work

* Remove further GET_VEHICLE's

* Further removal of GET_VEHICLE

* Remove the last of GET_VEHICLE

* Fix testpaint

* Fix nullptr deref

* Make review changes

Also swapped in helper functions and used a standard patern for iterating the train cars

* Further simplify loops for train cars
2020-07-31 07:48:27 +01:00
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
frutiemaxandduncanspumpkin 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