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

143 Commits

Author SHA1 Message Date
Michael Steenbeek
7bb7d97bdc More bound box refactors 2022-09-27 21:20:49 +02:00
Gymnasiast
d3fd31c611 Rename rct_string_id to StringId 2022-07-31 22:30:13 +02:00
Duncan
d09140aaed Minor Paint refactor (#17144)
* Tidy up masked paint code

Its only used by surface elements and only then by attached ps's so no need to support it in the normal ps.

* Remove unneeded function
2022-05-06 06:46:50 +01:00
Ted John
c68359662d Refactor visibility control 2022-03-14 21:57:05 +00:00
Ted John
9794be6a09 Hide trees using colourify function 2022-03-14 21:55:15 +00:00
Ted John
8aafab2a70 Split paint item into element and entity 2022-03-14 21:55:15 +00:00
Ted John
79989a5e84 Fix transparency issues 2022-03-14 21:55:15 +00:00
Kane
b83e21a953 Improve code readability (added parentheses) 2022-03-14 21:43:12 +00:00
Kane
3d3271a5ec Misc. clean ups
Define see-through paint colours in Paint.h for global use
Color staff sprite button
Change ride->is_visible bool to ignore_invisible_flag bool
Add shortcut to open transparency options (CTRL+T)
2022-03-14 21:41:49 +00:00
Kane
2e93e42a71 More finishing touches
- Changes all references of `VIEWPORT_FLAG_INVISIBLE_PEEPS` to `VIEWPORT_FLAG_INVISIBLE_GUESTS` and `VIEWPORT_FLAG_INVISIBLE_STAFF`
- Updates Invisible People menu item and shortcut.
- Added new viewport flags into the `viewport_set_visibility` function
- Invisible options only work if see-through is activated as well
- Added see-through supports

- Regression: Exclude ride from invisible no longer works (ride is still see-through)
2022-03-14 21:40:27 +00:00
Kane
204f8ceac1 Add new Transparency options window.
Remove added options from Top Toolbar.
Move invisible ride code into ride paint functions.
Move invisible vehicle code into sprite paint function.
2022-03-14 21:37:41 +00:00
Kane
4856c3adaf Implement invisible rides, paths & scenery 2022-03-14 21:37:18 +00:00
Kane
9f78c6f0ce Add option to see-through vehicles 2022-03-14 21:36:47 +00:00
duncanspumpkin
68d0d05d49 Remove extra non rotated PaintAddImageAsChild 2022-03-11 21:45:12 +00:00
ζeh Matt
269673e3aa Profiler update (#16463)
* Add more functions to be profiled

* Add isEnabled method to Profiler scripting interface

* Bump up scripting version

* Apply review suggestions
2022-01-29 15:29:08 +02:00
ζeh Matt
993b168bfd Implement profiler (#16194)
* Implement profiling API

* Add console commands for the profiler

* Remove accidental line

* Correct csv output

* Add copyright notice

* Add missing override

* Add default virtual destructor

* Explicitly pass template argument

* Use static

* Add plugin API for profiler

* Add more profile calls

* Workaround for GCC hopefully

* Add missing static keyword

* Use uint64 for call count

* Reduce name length see if CI passes

* Improve handling of function names

* Work around (broken) static inline variables

* Fix missing include

* Disable profiler for clang 5 and older

* Update copyright date

* Profile UpdateAllMiscEntities

* Apply review suggestions

Co-authored-by: Ted John <ted@brambles.org>
2022-01-18 20:21:20 +02:00
Michael Steenbeek
25cb49f8ce Pass paint_session as reference 2021-12-19 14:48:00 +00:00
Ted John
e165de7482 Refactor paint structs to use ImageId and extend size of image list (#16258)
* Move to image ID for paint struct

* Move image list to be past the end of legacy limit

* Extend image list size

* Introduce constants for image list size

* Use std::array to store internal paint struct
2021-12-18 07:40:10 +00:00
Ted John
4288589f11 Refactor large scenery to use ImageId 2021-12-11 23:07:56 +00:00
Ted John
c55fa94af5 Refactor paint wall to use ImageId 2021-12-11 23:06:21 +00:00
Ted John
bd9f7d56c5 Fix #16130: Crash when using see-through rides or scenery 2021-12-05 23:33:09 +01:00
Ted John
5f9d03e9df Refactor ImageId and use in more functions 2021-12-03 19:59:33 +01:00
Hielke Morsink
53d9bfa8b4 Update implicit zoom conversions 2021-12-01 00:08:35 +01:00
ζeh Matt
9f2e8372ae Rename sprite_paint_setup to EntityPaintSetup 2021-11-27 16:17:02 +02:00
ζeh Matt
7a0fb048f8 Move reorganize structure of Paint.Sprite 2021-11-27 16:16:10 +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
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
Soham Roy
4d27417fd2 Fix #11354: Coding style causes undefined behaviour
An underscore followed by a capital letter used as a prefix might cause
undefined behaviour
2021-10-05 13:58:50 +02:00
ζeh Matt
4ea8902587 Refactor arg passing to sprite_paint_setup 2021-09-27 22:48:06 +03:00
Hielke Morsink
53c22c9b4b Check for nullptr explicitly (#15458) 2021-09-24 20:05:50 +02:00
ζeh Matt
2e8d40b5e3 Fix out of bounds regression from #15391 2021-09-10 22:34:18 +03:00
ζeh Matt
0b12076f2f Fix #15390: Revert quadrant distribution change and cleanup 2021-09-10 17:35:44 +03:00
ζeh Matt
6a7fe6a5e2 Fix #15376: Extend the X axis on rotation 0 to cover corners
Also make the code branchless
2021-09-08 23:13:19 +03:00
ζeh Matt
876329da87 Fix hash bucketing of paint entries 2021-09-07 18:04:09 +03:00
ζeh Matt
55add9883f Implement DirectionFlipXAxis 2021-08-24 22:57:13 +02:00
Michael Steenbeek
7b3258b17e Merge pull request #15248 from ZehMatt/refactor/paint-hierarchy
Refactor PaintAddImageAsParent overloads
2021-08-21 21:33:06 +02:00
Michael Steenbeek
a38ae68f09 Remove Paint.cpp assertions
Before the refactor, the assertion read like this:
```
assert(static_cast<uint16_t>(bound_box_length_x) == static_cast<int16_t>(bound_box_length_x));
```
which meant that bound_box_length_x = 0 was valid. The refactor (likely accidentally) changed this, which causes assertions to get hit within 2 seconds after opening on my machine.

According to Duncan, the asserts are no longer necessary at all, so remove them altogether.
2021-08-20 23:27:58 +02:00
ZehMatt
7feea62ab3 Remove overload of PaintAddImageAsParent with bbox offset 2021-08-20 23:34:44 +03:00
ZehMatt
6c233ac802 Remove first overload of PaintAddImageAsParent 2021-08-20 23:34:44 +03:00
ζeh Matt
4bc5f70581 Minor refactor work around the painting (#15226)
* Remove unused variables and drop packing of paint structs

* Move PAINT_QUADRANT_FLAGS out of the header

* Rename enum and variable to SortFlags

* Rename variable and document the sorting

* Apply review
2021-08-17 09:32:58 +01: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
Ted John
70d9c1438e Change most things and formatting to money64 2021-08-01 15:14:42 +02:00
ζeh Matt
751c419594 Minor cleanups (#14954)
* Fix uninitialized variables in InputManager

* Use constexpr for const values

* Add break statements instead of implicit fallthrough

* Default initialize variables in Cheats window

* Default initialize variables in News window

* Default initialize window event pointers
2021-06-26 01:43:05 -03:00
Duncan
35ba734669 Minor paint refactor (#14905)
Names a few unknown flags
2021-06-22 07:36:17 +01:00
Matt
4d62a7396c Add CoordsXYZ overload for PaintAddImageAsParent 2021-06-05 17:16:00 +03: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
1caf47e45e Use unrolled linked list for paint entries 2021-04-28 20:33:51 +01:00
Ted John
cb6d471560 Increase paint struct limit by using shared pool 2021-04-27 01:27:49 +01:00
Gymnasiast
7fd049c22e Remove last remnants of gCurrentFontSpriteBase 2021-02-28 00:26:53 +01:00