Commit Graph

179 Commits

Author SHA1 Message Date
Ted John 1af2720518 Create stub magnify versions of software blitters 2020-03-23 15:54:04 +00:00
Ted John d34dec9c27 Create ZoomLevel struct to add two new zoom levels 2020-03-23 15:54:03 +00:00
Tulio Leao 0c4623a39f
Replace typedef aliasing by using (#10712) 2020-02-17 11:43:47 +01:00
Matt d6c3373b5e
Remove unused parameter and minor cleanup 2020-02-15 21:28:28 +01:00
Tulio Leao 84928cb4ef Comment why GetOrLoadImageTexture returns BasicTextureInfo 2019-12-27 15:05:28 -03:00
Tom Lankhorst efea8856ed Clean up OpenGL engine.
Code de-duplication and improved namespacing.
2019-11-04 15:10:42 +01: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
Tom Lankhorst 6eea943083 Pass SDL_WINDOW_ALLOW_HIGHDPI to SDL_CreateWindow (#10125) 2019-10-21 22:36:05 +02:00
Ted John c653f13552 Add tertiary colour to ImageId 2019-08-24 22:40:19 +01:00
Ted John 3925a6162d Start using ImageId 2019-08-24 18:35:40 +01:00
Ted John a8f4db7b4b Fix #9717: Scroll bars do not render correctly when using OpenGL renderer 2019-08-03 11:02:44 +01:00
Matt 2cf4a42cbe
Add rain rendering to OpenGL renderer 2019-07-18 20:54:47 +02:00
Ted John 15cb3e1889 Remove unnecessary new line characters from log calls (#9237) 2019-05-12 13:48:56 +02:00
Ted John f842d8a693 Fix #5103: OpenGL: ride track preview not rendered 2019-05-02 00:07:43 +00:00
Michael Steenbeek 42a1a8704d
Use empty() for vectors; clean up bool comparisons (#9118) 2019-04-20 20:39:47 +02:00
Matt ce9d252ce5 Use correct lock. 2019-03-31 15:50:55 +02:00
Matt 65ef018e4e Move paint_session_alloc and paint_session_free into Painter. 2019-03-31 15:50:55 +02:00
Matt 37c3809744 Implement partial multicore rendering 2019-03-31 15:50:55 +02:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Michał Janiszewski 7655ba7746 Make screenshot return path to file 2019-01-31 23:36:41 +01: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
roosen5 d9806305b0 Fix #8358: infinite loop when changing vehicle count on stopped ride. (#8375)
The sprite_remove in Sprite.cpp tries to find itself inside the quadrant.
It does not find itself, and because the rest of the code assumes that it will always find it
The normal code tries to set the value of the next_in_quadrant so that whoever points at it, will now point at its next sprite.
But because it didn't find whoever was pointing to it, it would set the pointer to SPRITE_INDEX_NULL to its next sprite.
This would lead to cycles in the linked list

The reason that the sprite was not found is that during the entry of a ride, the position of a peep is set to LOCATION_NULL
Exiting a ride sets it back to whatever the location is of an exit.
However stopping a ride that still has people in it would go wrong, as the people are removed from the ride through ride_remove_peeps

This function was called during the PaintWindows.
The fact that this function is called during the painting is the problem, because of the tweening:
Before painting all the positions are stored (Which would at that point be the LOCATION_NULL), during the painting
the peep would be removed from the ride, setting their location to the enrance/exit
After painting is done all the positions are restored again, so the patched position is forgotten and then it would be
removing a sprite with location LOCATION_NULL and that goes wrong

The fix is to have the window update outside of paint
2018-12-09 20:46:04 +01:00
ζeh Matt dc7d14163f Fix OpenGL renderer causing infinite loop on hacked surfaces. (#8346) 2018-12-05 23:00:08 +01:00
Michał Janiszewski 63c6486a7f
Add missing header guards (#8081) 2018-10-10 23:27:25 +02:00
LRFLEW c41f862920 Fix some memory leaks 2018-10-04 09:42:22 +02:00
ζeh Matt 65659e2ab6 Fix OpenGL renderer stuttering when loading new textures into atlas 2018-09-07 10:21:28 +02:00
Linus Unnebäck fd07be587a
Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01:00
clang-format d787872cbe Indent preprocessor directives 2018-07-23 16:00:23 +02:00
clang-format b02dfdbc93 Binpack function arguments together
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead.

Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00: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
Hielke Morsink 73a7e935c3 Correct formatting for files in the project root 2018-07-23 16:00:17 +02:00
clang-format 16720f0182 clang-format UI drawing 2018-07-23 16:00:13 +02:00
Hielke Morsink ce59ed0ba2 Fix include order and defines for Windows builds 2018-07-23 15:57:59 +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
Hielke Morsink de3cab59bb Fix warnings reported by travis 2018-06-05 16:07:54 +02:00
Ted John f0348dafb7 Fix MSVC warning 2018-05-13 01:11:56 +01:00
Ted John 7eb1703f36 Remove old bitmap code via UiContext 2018-05-13 01:11:56 +01:00
Ted John 229c50dff9 Add bitmap reading support 2018-05-13 01:11:56 +01: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
Michał Janiszewski b26d484726 Fix remaining headers 2018-03-31 23:48:15 +02:00
Hielke Morsink b62017657b Fix header dependencies for openrct2-ui 2018-03-31 23:07:14 +02:00
Michał Janiszewski 764520076f
Reduce header inclusion
* Update includes in PlatformEnvironment.cpp

* Update includes in ParkImporter.h

* Update includes of OpenRCT2.h

* Update includes in Intro.h

* Remove unused include from Input.cpp

* Update includes of Imaging.h

* Update includes in Game.h

* Update includes in Editor.h

* Update includes of Context.cpp

* Update includes in Cheats.cpp, CmdlineSprite.cpp

* Update includes of some source files

* Update includes in some cpp files

* Update includes in some cpp files

* Update includes in TextureCache.h

* Fix tests

* Update includes in Font.cpp

* Update includes in LightFX files

* Update some includes

* Fix GCC builds

* Update some includes

* Update some includes

* Update includes in FontsFamilies.*

* Update includes of Console.h

* Improve includes in Window.h

* Improve headers in Viewport.h/Window.h

* Fix MSVC build

* Fix network-less builds

* Reduce inclusion of Map.h
2018-03-13 13:14:02 +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
Hielke Morsink 55979a3fff Remove and replace C typedefs
`typedef struct/union/enum name { ... } name_again;` is not needed whe compiling C++, moving the name at the back to be in front of the object and removing `typedef` makes it usable the very same way.
This also replaces typedefs with the using keyword. They have better readability, especially for function pointer types, and would allow more flexibility when used with templates.
2018-02-14 09:42:26 +01:00
Michał Janiszewski 8b72c4f1ad Fix mismatched deleter in TextureCache (#7138) 2018-02-06 20:51:40 +00:00
Ted John df26354376 Fix drawing glyphs in OpenGL 2018-01-24 18:49:30 +00:00
Ted John 02d783a993 Fix build 2018-01-21 12:41:42 +00:00
Ted John cebe13984f Remove most of remaining memory functions from libopenrct2ui 2018-01-21 11:17:41 +00:00
Ted John 131286f758 Refactor memory handling in OpenGLShaderProgram.cpp 2018-01-21 11:17:41 +00:00
Marijn van der Werf 4c956def67 Update UI imports 2018-01-18 22:57:55 +01:00
Michał Janiszewski 6a65f791b6 Add const to arguments 2018-01-10 23:58:57 +01:00
Michał Janiszewski 9c84ae30fb Hide colliding "struct VDStruct" definitions to anon namespaces 2018-01-09 11:01:03 +00:00
Ted John c3eab7ead6 Refactor window.c to C++ 2018-01-07 12:39:58 +01:00
ZehMatt d25c46ef93 Refactor image cache to fixed size. 2018-01-07 02:18:12 +00:00
Ted John 3dcbebcf68 Refactor drawing.c to C++ 2018-01-05 22:57:57 +01:00
Ted John 0c3c998177 Refactor lightfx.c to C++ 2018-01-05 22:57:55 +01:00
Ted John 02c58a6c5a Remove custom base Exception class 2018-01-05 18:11:47 +00:00
Michał Janiszewski b2bc974fe7
Use nullptr where possible 2018-01-04 06:58:44 +01:00
Michał Janiszewski 4d0c88fb94 Mark constructors explicit (#6928) 2018-01-04 01:12:34 +00: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 6dc49d643a Compile files in base dir as C++ 2017-12-13 08:03:48 +01:00
Michael Steenbeek 60d8865efb Compile game.c and game.h as C++ 2017-12-05 09:10:27 +01:00
Ted John b5137b0e37
Merge pull request #6574 from IntelOrca/protect-g1-access
Refactor g1 access
2017-11-16 18:51:32 +00:00
kitsunenokenja 04f0048430 Add missing header include for std::ceil call (#6655)
OpenGLDrawingEngine::ConfigureCanvas calls std::ceil which is defined by
the cmath include. Adding the include directive resolves a compilation
failure to due std::ceil being otherwise undefined.
2017-11-12 14:02:30 +00:00
Michał Janiszewski cabed0cef5 Remove unused field 2017-11-08 06:53:17 +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
Ted John 444a8c1602 Const protect get_g1_element 2017-11-03 22:18:10 +00:00
Ted John 5a05bd51e5 Use get_g1_element and add null checks 2017-11-03 22:18:10 +00:00
Michał Janiszewski 076be24bb9 Default-initialise fields in DrawRectShader 2017-10-30 16:21:49 +01:00
LRFLEW 778cb9d024 Rename CopyFramebufferShader to ApplyPaletteShader 2017-10-30 16:21:49 +01:00
LRFLEW 50600f6195 Move MaxTransparencyDepth 2017-10-30 16:21:49 +01:00
LRFLEW 7db8d0f00a OpenGL: Fix linear DPI scaling 2017-10-30 16:21:49 +01:00
LRFLEW aac1c59714 OpenGL: Add multi-pass transparency 2017-10-30 16:21:49 +01:00
LRFLEW d3d41ea724 OpenGL: Add single-pass transparency 2017-10-30 16:21:49 +01:00
LRFLEW 3d2d99817c OpenGL: Add Depth Buffer and Depth Test 2017-10-30 16:21:49 +01:00
LRFLEW 6bf2e0157b OpenGL: Improve Shaders 2017-10-30 16:21:49 +01:00
LRFLEW f105237a2e OpenGL: Delay Palette Mapping Until Final Framebuffer Copy to Screen 2017-10-30 16:21:49 +01:00
LRFLEW 0868902f11 Rework OpenGL API declarations 2017-10-10 22:26:35 +02:00
ZehMatt 5187946bc9 Fix #6309: Lightfx being enabled with incompatible drawing engine. 2017-09-28 08:01:25 +02:00
ZehMatt c238265834 Minor performance improvements 2017-09-26 15:52:04 +02:00
Michał Janiszewski 00fd18809c Move extern "C" {} blocks to headers (#6282) 2017-09-18 17:05:28 +02:00
Dennis-Z 859faa4bad Fix ghosting when moving over transparent map elements 2017-09-01 21:02:11 +02:00
Ted John 3f1991804a Add debug option to show dirty blocks 2017-08-31 22:36:15 +01:00
Dennis-Z abf440d01c Fix viewport clipping issues with the OpenGL renderer (#6188) 2017-08-16 22:11:43 +01:00
Dennis-Z 2c2c5a6fde Remove unused hardcoded color table
Was previously used for the old FiltRect stuff
2017-08-16 00:43:52 +02:00
Dennis-Z 75b784c107 Flush OpenGL command buffers before drawing a rectangle instead of after
This fixes an issue causing the first rectangle that is being drawn
to not be over whatever was previously drawn.
2017-08-16 00:43:47 +02:00
Dennis-Z 634ee96f54 Implement OpenGL renderer FilterRect through palette remapping
Replace the previous "filtering" of rectangles based on
luminance, now using a remap palette like the software renderer for
better output colors.
Various other simplifications regarding to rectangle rendering are
included here too.
2017-08-16 00:43:41 +02:00
Dennis-Z 97ad4ac402 Register/load glUniform1iv function 2017-08-16 00:43:25 +02:00
Michał Janiszewski d698ad1100 Convert NULL -> nullptr in C++ 2017-08-15 11:51:56 +02:00
Dennis-Z 85c89481a5 Recreating the atlasses texture instead of changing the format of the existing atlasses texture (#6159)
This improves performance
2017-08-12 13:04:26 +01:00
Duncan 77330ac257 Fix #5890. Primary and secondary colours now work in zoomed opengl. (#6109)
Mistake made due to a missunderstanding of how the software renderer works. At this point in the software renderer the primary and secondary colours are already calculated into the palette so can be ignored. In opengl the colours still need to be passed to the command queue. Fixes #4715 as well.

Update changelog
2017-08-02 20:58:11 +01:00