1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00
Commit Graph

187 Commits

Author SHA1 Message Date
Hielke Morsink
0f2dffcc16 Apply review suggestions 2021-12-01 00:11:45 +01:00
Hielke Morsink
53d9bfa8b4 Update implicit zoom conversions 2021-12-01 00:08:35 +01:00
Hielke Morsink
3f669cae85 Use zoomlevel some more 2021-11-30 19:11:32 +01:00
Hielke Morsink
f3735dc076 Use ZoomLevel for viewport and ride window 2021-11-30 19:11:08 +01:00
ζeh Matt
9f23449ffb Move Staff/Guest/Peep to entity 2021-11-26 18:26:19 +02:00
ζeh Matt
7c726e2a0c Fix includes 2021-11-24 16:48:33 +02:00
Duncan
3f19d6f7d7 Split Peep header Guest into separate header (#15810)
* Move guest functions and classes to guest header

* Reduce includes of Peep.h
2021-10-28 21:38:23 +01:00
Sijmen
cec8447c6f Refactor Viewport.cpp to use ScreenRect (#15790) 2021-10-27 00:13:38 -03:00
Michał Janiszewski
1b4875e528 Extract math-related functions from common.h to Math.hpp
Saves wide inclusion of <stdexcept> header, which pulls in <string>
2021-10-09 21:43:06 +02:00
ζeh Matt
fa340cb5a1 Add parallel drawing if engine allows it 2021-10-06 17:24:39 +03:00
ζeh Matt
6ad4150085 Introduce rendering engine flag for parallel drawing 2021-10-06 17:15:40 +03:00
Michael Steenbeek
317e562845 Merge pull request #15495 from ZehMatt/refactor/xyz-access
Use GetLocation in more places
2021-10-01 14:02:34 +02:00
Hielke Morsink
94144bcd89 Remove some dead code
Reported by clang
clang-analyzer-deadcode.DeadStores
2021-09-30 10:40:32 +02:00
ζeh Matt
eb2de0222b Use GetLocation in more places 2021-09-28 03:16:04 +03:00
Hielke Morsink
53c22c9b4b Check for nullptr explicitly (#15458) 2021-09-24 20:05:50 +02:00
Duncan
a268350615 Fix #15439: Ride viewport is partially grey
The ride viewport does not work the same as other viewports due to the selection of views that it has. After refactoring the focus system to use a more streamlined approach the ride viewport lost its invalidation on resizing. If the ride window was to use the same viewport update code as say the guest window then the viewport focus still ends up incorrect due to it no longer centring the focus. Therefore the best approach was to lose the focus on resize and force a recalculation of it.

Also renamed Focus2 to Focus as Focus2 was meant to just be fill in whilst removing the original focus structs.
2021-09-21 11:06:04 +02:00
Duncan
fa57b6aea0 Remove focus union and replace with typed focus (#15426)
* Remove focus union and replace with typed focus

This if for the NSF to allow for CoordsXYZ

* Remove legacy structures

* Rework viewport_create to deduplicate logic

* Simplify yet further

* Apply review comments

* Remove intermediate
2021-09-18 20:34:38 +01:00
Hielke Morsink
4b4b3333d6 Remove unnecessary else blocks 2021-09-16 18:31:12 +02:00
Hielke Morsink
28681eebc0 Merge pull request #15407 from ZehMatt/refactor/optional-use
Make use of std::optional strict
2021-09-14 17:45:18 +02:00
Kane
b35fd28c55 Feature #7682: Lock camera to vehicle in main window
Pressing the "Locate" button in the Ride window when selected on a "Vehicle/Train" will now have the main viewport track the vehicle.
2021-09-13 20:44:52 +02:00
ζeh Matt
59a6c34db4 Make use of std::optional strict 2021-09-13 20:02:32 +03:00
Hielke Morsink
d42bc9a469 Merge pull request #15383 from Broxzier/refactor/smart-follow-cleanup 2021-09-10 20:13:23 +02:00
Hielke Morsink
f966c229c0 Refactor out unnecessary Is<Guest/Staff> checks 2021-09-09 18:44:52 +02:00
Michael Steenbeek
624a32e93b Make Coords isNull/setNull functions TitleCase (#15382) 2021-09-08 20:48:53 -03:00
Hielke Morsink
2b51b91524 Make peep argument const 2021-09-08 22:59:58 +02:00
Hielke Morsink
d3263ef6b7 Make smart follow functions easier to follow
Opted for a switch case instead of if-else if-else if-else
Reuse entity - is already checked for null and doesn't change
Remove unnecessary else blocks after if-block that returns
2021-09-08 22:55:08 +02:00
Duncan
b2d0b54d13 Fix viewport interaction when zoomed (#15318)
Mistake made when increasing the type size from 16 to 32bit
2021-09-01 06:15:45 +01:00
ζeh Matt
5bf882587a Use constexpr where applicable in Viewport.cpp 2021-08-27 18:24:08 +03:00
ζeh Matt
55add9883f Implement DirectionFlipXAxis 2021-08-24 22:57:13 +02:00
Duncan
940cab87d3 Map size refactors from NSF (#15112)
* Support large map sizes

* Fix top spin painting

* Fix crooked house

* Increase bb size

* Decrease limit back

* Clang format

* Remove asserts and apply review comments

* Fix rebase mistake

Co-authored-by: Ted John <ted@brambles.org>
2021-08-16 20:51:16 +01:00
duncanspumpkin
98f9f24909 Remove sprite.h includes where possible 2021-05-29 08:54:33 +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
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 Morsink
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