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

130 Commits

Author SHA1 Message Date
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
Gymnasiast
2477933c51 Turn font sprite base into a strong enum 2021-02-28 00:23:00 +01:00
ζeh Matt
cb5b1fb9ef Eliminate copying of paint_struct, initialize data in-place 2021-01-11 19:37:39 +01:00
Matt
9c88cc7589 Collapse function template in PaintSessionArrange 2021-01-05 01:02:06 +02: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
Duncan
556c786b12 Paint Setup refactor (#13633)
* Simplify paint session generate

* Add template to improve performance

* Add comments and fix minor issues
2020-12-25 08:05:57 +00:00
duncanspumpkin
b89e0240ca Fix AddAsParent overload 2020-11-07 14:15:26 +00:00
duncanspumpkin
ae87d81fe8 Adjust names further 2020-11-07 14:15:26 +00:00
duncanspumpkin
f6d2db48dc Name 98196C 2020-11-07 14:15:25 +00:00
duncanspumpkin
a6a95bd28e Add overload for function 2020-11-07 14:15:25 +00:00
duncanspumpkin
99d4e8a10b Simplify functions further 2020-11-07 14:15:25 +00:00
duncanspumpkin
d6669be939 Rename main paint add image functions 2020-11-07 14:15:24 +00:00
duncanspumpkin
6abeeae4b7 Create helper function for calculating position hash 2020-11-07 14:15:24 +00:00
duncanspumpkin
4adcde42f6 Refactor to add allocators to paint session 2020-11-07 14:15:24 +00:00