Commit Graph
58 Commits
Author SHA1 Message Date
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
Gymnasiast d3fd31c611 Rename rct_string_id to StringId 2022-07-31 22:30:13 +02:00
Michał Janiszewski 575bae7ac4 Rename global variable text_palette -> gTextPalette (#17647) 2022-07-30 23:21:34 +02:00
Hielke Morsink 218030dcd9 Add missing emojis that have inline sprites 2022-05-02 22:07:10 +02:00
Ted John 561dd13330 Limit inline sprites to <= 32x32 (#16991)
This is to prevent abuse of the feature in the master server list.
2022-04-23 14:36:49 +01:00
Michael Steenbeek 5edc561715 Close #11437: Migrate old platform methods 2022-02-18 21:57:00 +01:00
Michał Janiszewski 7b0e6ad0b6 Reformat with clang-format-12 from updated CI image 2021-12-12 17:48:52 +01:00
ζeh Matt a0e7752f26 Pass rct_drawpixelinfo explicit to avoid races 2021-10-06 23:48:07 +03:00
Hielke Morsink 94144bcd89 Remove some dead code
Reported by clang
clang-analyzer-deadcode.DeadStores
2021-09-30 10:40:32 +02: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 JohnandMichael Steenbeek 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
ζeh Matt 8fc7e06116 Move gLastStringPos into rct_drawpixelinfo (#14811) 2021-06-03 22:10:09 -03:00
A.N 4d3328c7bb Add preprocessor directives to stop unused variable/function warnings. (#14422) 2021-04-02 14:41:11 +02:00
Gymnasiast 50da55eaf3 Fix #14212: Multiline news messages are shown incorrectly 2021-03-02 22:48:33 +01:00
Gymnasiast 7fd049c22e Remove last remnants of gCurrentFontSpriteBase 2021-02-28 00:26:53 +01:00
Gymnasiast c40701d997 Make gfx_draw_string() take a TextPaint argument 2021-02-28 00:26:20 +01:00
Gymnasiast 503273793a Remove gCurrentFontSpriteBase from some functions 2021-02-28 00:26:20 +01:00
Gymnasiast 826f6c7442 Reduce usage of gCurrentFontSpriteBase 2021-02-28 00:25:30 +01:00
Gymnasiast 2477933c51 Turn font sprite base into a strong enum 2021-02-28 00:23:00 +01:00
Ted John c1b0df5de6 Improve graphics plugin API 2021-02-24 22:37:31 +00:00
ζeh Matt 9ff2138f3f Remove unused variable gCurrentFontFlags 2021-01-30 16:46:22 +01:00
skdltmxn c093a50f3f Refactor to use string_view more properly 2021-01-07 01:52:10 +09:00
Ted John 503a383301 Do not format characters in text input 2020-11-27 18:54:57 +00:00
Ted John ec03ce5317 Improve handling of braces 2020-11-27 18:54:57 +00:00
Ted John 167aaac633 Fix TTF issues 2020-11-27 18:54:57 +00:00
Ted John 92fcdfbd9b Fix GCC compiler errors 2020-11-27 18:54:57 +00:00
Ted John b6a688e540 Refactor format tokens 2020-11-27 18:54:57 +00:00
Ted John 157c984d4c Fix more string functions 2020-11-27 18:54:56 +00:00
Ted John 80537832e9 Implement MOVE_X and INLINE_SPRITE 2020-11-27 18:54:56 +00:00
Ted John c6152efa4e Fix scrolling text 2020-11-27 18:54:56 +00:00
Ted John 2f7c1aab14 Start eradicating old format codes 2020-11-27 18:54:56 +00:00
Aaron van Geffen 7b5087f057 Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Tulio Leao b0c10f979b Make gfx_draw_glyph use ScreenCoordsXY 2020-06-29 10:26:35 -03:00
Tulio Leao 79d007c780 Make ttf_draw_string use ScreenCoordsXY 2020-06-29 10:25:49 -03:00
Tulio Leao 592b54d354 Make gfx_draw_string_with_y_offsets use ScreenCoordsXY 2020-06-29 10:25:49 -03:00
Tulio Leao b7dc5057e5 Make gfx_draw_string_centred_wrapped_partial use ScreenCoordsXY 2020-06-29 10:25:44 -03:00
Tulio Leao 1717f2a9a3 Make draw_string_centred_raw use ScreenCoordsXY 2020-06-29 10:23:54 -03:00
Tulio Leao a0ed2c181e Make gfx_draw_string_left_centred use ScreenCoordsXY 2020-06-29 10:23:54 -03:00
TomasZilinekandTulio Leao 9d965ccfb6 Part of #12017 - create gfx_draw_sprite overload (#12026)
* Part of #12017 - create gfx_draw_sprite overload

Part 1. Creates the overload and replaces about a half of the calls since there are too many for one PR.

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-06-23 18:32:34 -03:00
Michael Steenbeek 9ef8d6da42 Convert most remaining C-style casts to C++-style ones (#11867) 2020-06-07 23:18:11 +02:00
Ted John d3f7ec4844 Create new PaletteMap type to replace byte pointers 2020-05-28 20:00:23 +01:00
Tulio Leao ed84c2dab0 Fix #11705: Drawing tooltips out of box (#11707) 2020-05-10 15:22:47 -03:00
TomasZilinek 9fde6a74c3 Close #11561: Use ScreenCoordsXY in gfx_draw_string()
* Fix #11572 create gfx_draw_string() overload

created the overload and changed all calls of the old function to the new (using const ScreenCoordsXY&)

...
2020-05-10 09:49:15 -03:00
Michał Janiszewski 2323cc1596 Use named casts instead of old-style casts
Change prepared with clang-tidy and google-readability-casting check
2020-04-22 17:09:29 +02:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Michał Janiszewski 8a395e3706 Fix misaligned access (#8665)
Platforms like ARM are very sensitive to unaligned access. This change
makes sure the addresses obey the C++ standard and are properly aligned.
2019-02-04 23:15:14 +01:00
Michał Janiszewski 5b467ffc68 Fix rendering of text shadows with TTF (#8533)
Only render shadow if it is within the bounds of allocated buffer.
This fixes most if not all crashes seen with rendering TTF. The cause of
the problem is rendering of shadows which is done by taking a solid
rendered text and moving it by one pixel to up, left, right and *down*.
In some cases rendering the shadow in the one-down offset will write
past the allocated surface (see
https://github.com/OpenRCT2/OpenRCT2/blob/8d9fcb7f982e7fc60aab45a71e5a8f915866564e/src/openrct2/drawing/Drawing.String.cpp#L594)
it can easily happen when trying to render a shadowed text (e.g. map
tooltip) on a peep that's just above the bottom of the viewport.
2018-12-28 11:47:08 -08:00