1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 21:43:06 +01:00
Commit Graph

71 Commits

Author SHA1 Message Date
Matt
42df41efdb Remove the use of shared_ptr for the Context (#24404)
* Replace shared_ptr with unique_ptr for Context systems, return refs

* Fix all the users

* clang-format fix

* Fix linux builds
2025-05-15 22:46:06 +03:00
ζeh Matt
f241973585 Fix paint debug to visualize invalidation 2025-05-07 23:26:33 +03:00
ζeh Matt
7aca569363 Silence warning about final 2025-04-25 17:48:38 +03:00
ζeh Matt
576a757200 Add safe guards to make sure we have a valid drawing context 2025-04-25 17:48:37 +03:00
ζeh Matt
4e8ac7ea12 Fix invalidation debug paint 2025-04-24 21:15:49 +03:00
Michael Steenbeek
cfb4b008b2 Create weak enum for PaletteIndex 2025-04-09 16:47:22 +02:00
Alex ZH
a8aa41f098 Fix debug dirty visuals scaling on high DPI displays (#23697) 2025-02-10 19:42:39 +00:00
Michael Steenbeek
be9f27e4f9 Mass rename constants (#23656) 2025-01-19 15:59:45 +00:00
Aaron van Geffen
fa06a49302 Update copyright year to 2025 (#23514) 2024-12-31 20:30:04 +01:00
Aaron van Geffen
23d4032eed Move LightFX into its own namespace (#23506) 2024-12-30 11:04:39 +00:00
Michał Janiszewski
2ac91f79e5 Add more descriptive information for renderer faults (#23327) 2024-12-06 11:28:03 +01:00
Matt
06501b0e9a Fix #22316: Always recreate the window when changing drawing engine 2024-08-12 23:49:58 +02:00
Matt
bbba91de78 Actually toggle vsync instead of re-initialising the entire thing again 2024-08-11 09:54:40 +02:00
Duncan
a07b56a655 Move Viewport functions into Ui (#22454)
* Move viewport functions into ui

* Move footpath function to ui

* Don't include viewport in footpath.h

* Include missing includes
2024-08-02 06:01:31 +01:00
ζeh Matt
348df5a986 Clear the screen with color in the drawing engine and not each tick 2024-08-01 23:48:54 +03:00
Aaron van Geffen
65bf7753a1 Revert "Fix renderer creation for HW display engine (#22445)"
This reverts commit b1e14c676d.
2024-08-01 22:37:03 +02:00
Michał Janiszewski
b1e14c676d Fix renderer creation for HW display engine (#22445)
SDL requires a renderer to be created in an empty window, i.e. one
without any other renderer nor surface. Leaving the window with earlier
surface from another engine (e.g. when switching from SW to SW+HWD)
caused no renderer to be created (_sdlRenderer set to nullptr) and
setting up a bomb to explode next time we try to render a frame.

I think this can also get triggered when resizing/switching the focus of
a window.

While SDL already has internal checks for window surface presence in
`SDL_DestroyWindowSurface` _in the SDL version I checked_, I have no
certainty if this is correct for all of them. I added check for window
surface presence to better express the code intent as well.

`SDL_DestroyWindowSurface` was introduced in SDL 2.28

This should take care of most of the `BlitPixel`, `DrawRLESpriteMinify`
issues reported by backtrace.
2024-08-01 19:31:34 +02:00
Aaron van Geffen
b5ef2693b0 Remove common.h include from all units 2024-07-09 16:45:19 +02:00
Aaron van Geffen
51873dc0f6 Include Diagnostic.h at unit level 2024-07-09 16:23:31 +02:00
Aaron van Geffen
a63d86c488 Introduce Config namespace and struct 2024-05-10 12:10:21 +02:00
James103
1d8dc111f1 Replace 2023 with 2024 in copyright headers (#21139)
Replace all instances of the year 2023 with 2024 in all copyright headers
2024-01-01 12:52:28 +01:00
ζeh Matt
cc64ab530c Fix #19811: Use the correct SDL event for window resize handling 2023-04-03 17:09:50 +03:00
Hielke Morsink
6b7dc8fcdb Rename snake_case functions in openrct2/src folder
Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2023-01-17 13:24:51 +01:00
Duncan
8504c8d05e Finish Removing snake_case from Drawing Methods 2023-01-16 22:31:34 +00:00
James103
73738bbdc8 Replace 2022 with 2023 in copyright headers
Replace all instances of the year 2022 with 2023 in all copyright headers
2023-01-01 11:58:01 +01:00
Hielke Morsink
abac080d3e Rename public general config data members 2022-10-16 21:46:01 +02:00
73
b9e677945d Replace 20XX with 2022 (#18158)
* Replace 2020 with 2022

Replace all 2020 headers with 2022

* replace other years with 2022

add missing years
2022-10-01 08:42:14 +01:00
Hielke Morsink
e2da19f0f7 Add missing includes 2022-07-29 18:45:10 +02:00
Michael Steenbeek
2b859c7099 Remove __ENABLE_LIGHTFX__ define
It is already enabled for all our builds, and upcoming changes to RTD would add a slew more.
Discussed in team chat with Duncan and Hielke.
2022-07-28 21:34:02 +00:00
Michael Steenbeek
9134bd4788 Update RCT1 path names + British spelling for ‘grey’ 2021-11-13 23:38:04 +01:00
Hielke Morsink
c887a049d2 Fix various Cppcheck warnings (#15081) 2021-07-24 23:41:50 +02:00
Tom Parsons
9cdae2d1e2 Fix #12401: Refactor SCALE_QUALITY to use strong enum (#12673) 2020-08-20 23:32:56 -03:00
Aaron van Geffen
7b5087f057 Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Ted John
46bb30f8a1 Refactor rct_palette to GamePalette 2020-05-27 20:52:51 +01:00
Tulio Leao
abfd41c35f Use named casts in openrct2-ui/drawing 2020-03-28 17:18:21 -03:00
Tulio Leao
2bb3a34274 Convert C-style pointer casts to named casts 2020-03-28 16:41:23 -03:00
Krisztián Csordás
8f7c95e425 Fix SDL_Texture double free (#10156)
Double freeing of SDL_Texture caused assertion failure when calling
HardwareDisplayDrawingEngine::SetVSync. According to SDL documentation,
SDL_DestroyRenderer frees the associated textures.
2019-10-28 20:43:22 +01:00
Aaron van Geffen
2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Michał Janiszewski
ecfbf60cc4 Drop SDL2/ prefix on includes
pkg-config, cmake, all demos and tests define the path with SDL2/
already included.
2019-01-06 17:29:29 +01:00
LRFLEW
c41f862920 Fix some memory leaks 2018-10-04 09:42:22 +02:00
clang-format
95ce592579 Enforce not breaking before assignments and function names
Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:19 +02:00
clang-format
16720f0182 clang-format UI drawing 2018-07-23 16:00:13 +02:00
Michael Steenbeek
1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Hielke Morsink
0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
Ted John
302fe00805 Always pass shared_ptr by reference 2018-05-11 20:39:00 +01:00
Ted John
466c465d44 Use unique_ptr and shared_ptr for IDrawingEngine 2018-05-11 20:37:48 +01:00
Ted John
7b610fd3c0 Use shared_ptr more for UiContext in relation to DrawingEngine 2018-05-11 20:37:48 +01:00
Ted John
39a38dc193 Include SDL2 using sub directory 2018-03-09 16:28:47 +01:00
Ted John
e318e0948a Fix a few assertions that were found when using debug CRT 2018-03-09 16:28:47 +01:00
Michał Janiszewski
6a65f791b6 Add const to arguments 2018-01-10 23:58:57 +01:00