1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-31 02:35:46 +01:00
Commit Graph

120 Commits

Author SHA1 Message Date
ζ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
Bryan DiLaura
894be65b6d Closes #12415: Refactor CURRENCY_TYPE to strong enum (#13276)
* closes #12415 CURRENCY_TYPE enum refactor

* reverses unintended change in Linux.cpp

* closes #12415 CurrencyType strong enum
2020-10-25 01:33:06 -03:00
Duncan
214f6992dd Rename to TitleCase and name LastAttachedPS (#13260) 2020-10-22 18:13:54 +01:00
Ted John
609cde2304 Fix drawing of money text when zoomed in 2020-08-28 01:29:59 +01:00
frutiemax
33f3f5cc3b Use CoordsXYZ for sub_98199C in RiverRapids.cpp (#12289) 2020-08-18 09:27:23 -03:00
Aaron van Geffen
7b5087f057 Update copyright year to 2020 2020-07-21 15:04:34 +02: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
Thamara Andrade
0fb2a6216c Close #12099: Use ScreenLine on gfx_draw_line (#12143) 2020-07-12 18:50:52 -03:00
Michael Steenbeek
33e86ce0d8 Merge pull request #12016 from tupaschoal/screen-coords-string
Make interfaces use ScreenCoordsXY instead of x-y
2020-06-30 08:37:14 +02:00
Duncan
c723a1a314 Fix #12079: incorrect drawing of attached paint structs (#12082)
* Fix #12079: incorrect drawing of attached paint structs

The issue is caused by the paint_struct x and y coordinates being incorrectly marked as unsigned. Unfortunately they cannot easily be converted without careful rework. Therefore this is a stop gap until the type is changed to preferably a ScreenCoords.
2020-06-29 19:13:23 -03:00
Tulio Leao
b6f252f68e Make gfx_draw_sprite_raw_masked use ScreenCoordsXY 2020-06-29 10:29:05 -03:00