Commit Graph

208 Commits

Author SHA1 Message Date
Michael Bernardi 8c7d1d149a Added OpenGL TTF hinting 2023-12-08 01:13:17 +01:00
Michael Bernardi f64706e1d9 Add insetting and outlining to OpenGL TTF rendering 2023-12-08 01:13:17 +01:00
Aaron van Geffen d425e0a8bb Remove const qualifier from constexpr statements 2023-06-24 11:45:26 +02:00
Gymnasiast 2941f6f7a5 Use dpi ref in misc drawing folder places 2023-04-11 22:57:25 +01:00
Gymnasiast fc0e0d029a Use dpi ref in ui context and weather 2023-04-11 22:57:25 +01:00
Gymnasiast 16c5c1b752 Use dpi ref in interface folder 2023-04-11 22:57:25 +01:00
Gymnasiast 96d77ed8f7 Using dpi refs in most remaining window defs 2023-04-11 22:57:23 +01:00
Matthias Moninger 5462c28b8c
Fix dereferencing nullptr for bad loaded g2 using OpenGL renderer (#19855) 2023-04-06 21:56:52 +02:00
kyphii 39790779bb
Extend color selection dropdown with more colors (#19446)
* Setup for extended palette

* Define order for color picker cells

* Init G2 Palettes in ColoursInitMaps

* Add Glass Palettes

* Use special sprite for Invisible color

* Set up new cheat for special colors

* Add glass palettes to palette_to_g1_offset

* Add entries for new colors in TranslucentWindowPalettes

* Finish implementation of special colors cheat

* Some cleanup

* New colors almost work

* Correct g2 palette loading indices

* Invisible color sprite displays properly

* Repaint works with large scenery and walls

* Prevent random shop items from overflowing to junk palettes

* More cleanup

* Fix glass palettes

* Add mapping of new colors to original colors for UI themes

* Fix junk palettes for random shop items

* Fix missing highlight color in software renderer

* Convert small scenery support flag to allow use of new colors

* Progress on displaying new colors in software renderer

* Fix invisible color scheme sprite

* Formatting cleanup

* Resolve comparison of integer expressions of different signedness

* Index g2 palette maps to fix visible chain lift

* Progress on fixing new colors in software renderer

* Fix station and support colors

* Fix dropdown selected index

* Get invisible color (mostly) working in software renderer

* Use forceBmp for palette resources

* Remove test function definition left in by mistake

* Remove some obsolete range checks for original color values

* Add changelog entry

* Reorder color dropdown based on NE user feedback

* Some cleanup

* Further cleanup

* Formatting

* Add include for GetPaletteMapIndexForColour

* Fix a couple things I broke

* Fix function placement

* Revert "Add include for GetPaletteMapIndexForColour"

This reverts commit 0af9611e6656d792adb7a36efe7dbf3387a4a759.

* Use color constants for color order list

* Make remappable colors contiguous

* turn off clang format for ordered color list

* Appease clang

* Use all colors for random shop item animation

* Improvements to palette map resources

* Fix chain lifts again + adjustments to a few colors

* Update changelog and contributors.md

* Revert changes to S4 and S6 importers which are no longer needed

* Bump network, plugin, and minimum park versions

* Revert "Progress on displaying new colors in software renderer"

This reverts commit 337602e4a7.

* Remove unnecessary comment

---------

Co-authored-by: Trevor Finney <8711258+finneyt@users.noreply.github.com>
2023-04-06 08:36:07 +01:00
ζeh Matt cc64ab530c
Fix #19811: Use the correct SDL event for window resize handling 2023-04-03 17:09:50 +03:00
Duncan 859b071ddc
Rename classes with snakes OpenRCT2/A*-F* (#19215)
* Rename classes with snakes OpenRCT2/A*-F*

* Clang format files
2023-01-19 08:16:44 +00: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
Gymnasiast 5309c80e29
Remove snake_case in interface folder 2023-01-16 22:20:41 +01:00
Hielke Morsink 6dafbbfb65
Rename global window functions to TitleCase (#19167) 2023-01-16 20:13:42 +00:00
Duncan 7f5934cc95
Remove snake_case from second chunk of Drawing (#19166) 2023-01-16 18:52:17 +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
ccahiggins 76d491b9a2
Improve OpenGL Rectangle SetInstances Performance
Change to use glBufferSubData instead of glBufferData

An initial buffer size is set with glBufferData.
glBufferSubData is then used to copy to the existing buffer,
rather than creating a new one for each frame.

We keep track of the buffer size, and if instances size increases
above the buffer size, a new buffer is created with glBufferData
2022-12-08 21:14:31 +01:00
Michał Janiszewski 3e4e8bccc5 Pass ImageId by value instead by const-ref
ImageId struct is 8-bytes large and can fit in CPU register. Passing it
by value lets compiler pass it in register instead of forcing to
reference it from memory.

In my tests this brings
[dome park](https://github.com/OpenRCT2/OpenRCT2/files/6134362/dome-export.zip)
benchgfx results from 42.16s down to 41.08s, or by 2.5%.
2022-11-12 00:06:05 +01:00
Hielke Morsink 31dd4bf604
Use lower-case u integral suffix 2022-10-29 16:33:05 +02:00
Hielke Morsink 97a7fcc110
Consistently use literal suffix in upper-case 2022-10-29 16:28:53 +02:00
Hielke Morsink abac080d3e
Rename public general config data members 2022-10-16 21:46:01 +02:00
Michael Steenbeek 6fe19878f6
More ImageId cleanup (#18258)
* Remove more usages of uint32 image indices

* Remove unused gfx_get_sprite_size()

* Remove uint32 images from text drawing

* Remove now-unused ImageId overload

* Default-initialise ttfRunIndex

* Suppress false-alarm GCC error
2022-10-10 19:42:40 +01: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
Gymnasiast cedccf9b0e
Use const ImageId in drawing functions 2022-09-29 21:17:15 +02: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
Duncan 3edcc91e40
Fix #17339. Reset Scaleing frame buffers on scale change (#17598)
* Fix #17339. Poor visuals due to scalling incorrectly

Mistake made during refactor meant that the scaleing framebuffers were
kept enabled even though at integer numbers of scale they are not meant
to be used.

* Update changelog
2022-07-23 20:11:00 +00:00
Raymond Zhao 71ad3af930
Use more smart pointers in openrct2-ui (#17582)
* Use more smart ptrs

* Use move instead of copy ctor
2022-07-22 11:48:43 +01:00
Michał Janiszewski 7832288ff9
Plug memory leak in OpenGL engine (#17250) 2022-05-20 21:43:16 +00:00
Hielke Morsink ba85cf4873
Close #15896: Refactor out the ZoomLevel operators 2022-02-26 23:14:59 +01:00
Hielke Morsink fea9254368
Remove unused GetEngine functions (#16722) 2022-02-26 07:27:48 -03:00
frutiemax cb16511d48
Use smart pointers in OpenGLDrawingEngine.cpp
Co-authored-by: ζeh Matt <5415177+ZehMatt@users.noreply.github.com>
2022-02-26 09:49:41 +01: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 d427098e39 Refactor terrain and path to use ImageId 2021-12-07 20:46:15 +00: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
Duncan fccd298d2f
Clang tidy Part 2: Ui Project Class Names (#15976)
* Apply clang-tidy on class names in the ui project

* Rename classes to more appropriate names

* Adjust name again
2021-11-24 16:16:52 +00:00
Duncan bb2c7dbaca
Clang tidy Part 1: Ui Project Function Names (#15956)
* Add NOLINT around STL using classes and vendor functions

* Apply clang-tidy to ui project function names

* Undo scripting clang-format

* Upper case OpenRCT2 and RCT2
2021-11-23 13:18:07 +00:00
Michael Steenbeek 9134bd4788
Update RCT1 path names + British spelling for ‘grey’ 2021-11-13 23:38:04 +01:00
ζeh Matt 6a219b2481
Fix #15006: Prevent allocating empty texture atlases 2021-10-20 19:02:15 +03:00
ζeh Matt b4cd8e4628
Fix #15560: Memory leak due to OpenGL Renderer not releasing a texture 2021-10-11 21:01:11 +02:00
ζeh Matt a0e7752f26
Pass rct_drawpixelinfo explicit to avoid races 2021-10-06 23:48:07 +03:00
Hielke Morsink 4b4b3333d6
Remove unnecessary else blocks 2021-09-16 18:31:12 +02:00
ζeh Matt 59a6c34db4
Make use of std::optional strict 2021-09-13 20:02:32 +03:00
Ted John 6e2b79a895
Get basic TTF support working in OpenGL
co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2021-08-26 19:46:18 +03:00
Hielke Morsink 956e77f4c3
Use [[nodiscard]] for allocator and RAII functions (#15244) 2021-08-23 20:09:43 +02:00
Hielke Morsink c887a049d2
Fix various Cppcheck warnings (#15081) 2021-07-24 23:41:50 +02:00
Duncan 975ed665f8
Fix opengl extra zoom bugs (#14601)
* Fix #14449: Surface smoothing not working at extra zooms

Caused by two issues. One was spotted by @AaronVanGeffen in that surface smoothing was turned off. The other was caused by a bug in the opengl renderer that went unnoticed due to never being hit during normal play.

* Fix merrygoround and enterprise extra zoom peep drawing

* Add changelog entry
2021-05-10 12:43:46 -03:00
frutiemax cd9873a78d
Use ScreenLine on gfx_draw_line_software 2021-03-13 16:52:58 +01:00