1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 05:53:02 +01:00
Commit Graph

56 Commits

Author SHA1 Message Date
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
Ted John
0c3c998177 Refactor lightfx.c to C++ 2018-01-05 22:57:55 +01:00
Michał Janiszewski
b2bc974fe7 Use nullptr where possible 2018-01-04 06:58:44 +01:00
Michael Steenbeek
c4f44e5e7a Compile files in paint folder as C++ 2017-12-17 17:24:36 +01:00
LRFLEW
eed00ea363 Add Vsync Toggle to Options 2017-12-14 11:18:28 +01:00
Michael Steenbeek
60d8865efb Compile game.c and game.h as C++ 2017-12-05 09:10:27 +01:00
Philip Goto
19abb62586 Add Smooth NN scaling to OpenGL renderer 2017-11-06 23:05:21 +01:00
Philip Goto
360cd813b7 include cmath in HardwareDisplayDrawingEngine 2017-11-06 23:05:21 +01:00
Philip Goto
36bece4cf1 Destroy _scaledScreenTexture on destroying hardware engine 2017-11-06 23:05:21 +01:00
Philip Goto
6377ac7bfb Create enum for scale quality 2017-11-06 23:05:21 +01:00
Philip Goto
b66df2d6db Add smooth nearest neighbor scaling
This commit implements smooth nearest neighbor scaling, this scaling method looks sharper than linear scaling and not deformed like NN scaling.
2017-11-06 23:05:21 +01:00
Michał Janiszewski
00fd18809c Move extern "C" {} blocks to headers (#6282) 2017-09-18 17:05:28 +02:00
Ted John
3f1991804a Add debug option to show dirty blocks 2017-08-31 22:36:15 +01:00
Michał Janiszewski
d698ad1100 Convert NULL -> nullptr in C++ 2017-08-15 11:51:56 +02:00
Michał Janiszewski
70793f65a5 Verify queried renderer information 2017-07-28 08:06:11 +02:00
Ted John
01b0047675 Invert Painter dependency
Make painter call into the drawing engine, rather than the drawing engine create and call the painter.
2017-07-16 23:25:11 +01:00