Commit Graph

578 Commits

Author SHA1 Message Date
Michael Steenbeek 4a79e9305f
Replace gfx_draw_string_right() with DrawTextBasic (#12966) 2020-09-18 21:39:00 -03:00
Matt 38e03ae45d
Use the Formatter for News items 2020-09-17 22:14:36 +03:00
Matt 2639349925
Move storage into Formatter class and refactor usage 2020-09-17 22:14:36 +03:00
Brett c9de4f49fe
Add snow as a weather type
Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-09-14 21:58:00 +02:00
Gymnasiast 31d20cefb2
Rename rain to weather where appropriate
Co-authored-by: Brett Penzer <brettpenzer123@live.co.uk>
2020-09-14 21:57:54 +02:00
Michael Steenbeek cf5b48a9dd
Rename Rain.{cpp,h} to Weather.{cpp,h} (#12914) 2020-09-12 19:32:26 -03:00
Gymnasiast c83ddefe47
Convert remaining C-style casts to C++-style ones 2020-09-10 21:36:20 +02:00
tellovishous 96945183f5
Add stroke to lowercase 'L' to differentiate from capital 'I' (#12890)
The problem with many sans-serif fonts, such as those in RCT2, is that it can be difficult to tell between a lowercase L and an uppercase I, and can be visually ambiguous. What I've done is add a small stroke to the bottom of the lowercase L's so that it will stand out better when it's used next to capital I's.
2020-09-10 20:07:12 +02:00
Gymnasiast d140dd72c6
Remove const void* overload from DrawTextEllipsised() 2020-09-10 18:13:13 +02:00
Gymnasiast b788a099b5
Replace gfx_draw_string_clipped() calls with DrawTextEllipsised 2020-09-10 18:13:13 +02:00
Hielke Morsink 96d1db97e0
Fix: Unused variable warning because of if constexpr (#12871)
This moves the variable in question to the scope where it gets used. Since it's a reference, this shouldn't be a performance hit.
2020-09-06 22:22:49 +02:00
Gymnasiast d5ff5712b9
Add drawing code for the Esperanto characters 2020-09-05 22:58:00 +02:00
Ted John 3a0bff4b93 Add comment about remX, remY 2020-08-28 01:30:17 +01:00
Ted John 65e3d20156 Refactor drawing 2020-08-28 01:30:15 +01:00
Ted John 7f0510e444 Fix sub pixel clip issues with OpenGL 2020-08-28 01:29:59 +01:00
Ted John f51ad862c9 Refactor window drawing 2020-08-28 01:29:59 +01:00
Ted John 25581fa4ef Share blit methods between BMP and RLE 2020-08-28 01:29:59 +01:00
Ted John f16a46b872 Refactor RLE minify 2020-08-28 01:29:59 +01:00
Ted John 1645c64e87 Implement RLE magnify 2020-08-28 01:29:59 +01:00
Ted John 247c950c60 Implement magnify for bitmap 2020-08-28 01:29:59 +01:00
Gymnasiast 17bac8c57b
Use colour_t 2020-08-26 15:38:27 +02:00
Gymnasiast 972e6e80ab
Allow passing Formatter to DrawTextBasic() and DrawTextEllipsised() 2020-08-26 15:08:42 +02:00
Gymnasiast 39bc73c394
Deprecate text draw functions with 1:1 replacements 2020-08-26 14:53:59 +02:00
Gymnasiast 9a31a94128
Use const args in DrawTextEllipsised() 2020-08-26 14:49:28 +02:00
Gymnasiast ceace1a3ad
Remove draw_string_left_underline() 2020-08-26 14:47:47 +02:00
Gymnasiast f1caddc9fe
Remove draw_string_right_underline() 2020-08-26 14:46:37 +02:00
Gymnasiast 5f468da9cf
Remove draw_string_centred_underline() 2020-08-26 14:44:57 +02:00
Gymnasiast e1b778832b
Expose DrawTextBasic() and DrawTextEllipsised() 2020-08-26 14:44:30 +02:00
Łukasz Pękalski 399e0abe2e
Close #12497: Remove extra SPRITE_INDEX_NULL checks (#12601) 2020-08-08 09:12:52 -03:00
Matt 0dc43d66e4 Remove the use of INTERFACE macro and macro its self 2020-08-05 16:30:44 +02:00
Matt 30376085cf Include missing headers 2020-08-05 16:29:29 +02:00
Tom Parsons d9129bca0f
Fix #12405: Make LIGHTFX_LIGHT_TYPE a strong enum (LightType) (#12569)
* Fix #12405: Make LIGHTFX_LIGHT_TYPE a strong enum

* Fix #12405: Make LIGHTFX_LIGHT_TYPE a strong enum

- New strong enum LightType

- Remove unused enum members

- GetLightTypeSize and SetLightTypeSize modify size of light (0-3)

* actually save the change to lightType
2020-08-04 15:55:14 +01:00
frutiemax 2c350fa416
Part of #12097: Use ScreenRect in gfx_fill_rect_inset (#12284) 2020-08-01 00:51:29 -03:00
Duncan cd1d573c39
Pass the formatter directly to scrolling_text_setup 2020-07-31 12:31:26 +02:00
Michael Steenbeek 402570adb6
Refactor usage of TextPaint
Eliminating a global variable in the process.
2020-07-31 11:13:28 +02:00
Duncan c6e26267a4
Reduce the use of GET_VEHICLE (#12494)
* Start removing GET_VEHICLE macro use

* Further work

* Remove further GET_VEHICLE's

* Further removal of GET_VEHICLE

* Remove the last of GET_VEHICLE

* Fix testpaint

* Fix nullptr deref

* Make review changes

Also swapped in helper functions and used a standard patern for iterating the train cars

* Further simplify loops for train cars
2020-07-31 07:48:27 +01:00
wdarvin 95b4bca3d0
Close #12448: Refactor RAIN_LEVEL to use strong enum (#12488)
* Close #12448: Refactor RAIN_LEVEL to use strong enum

* Refactor to remove enum suffix
2020-07-28 17:19:45 +01:00
Michael Steenbeek 41162cc22f
Fix: bad kerning on lowercase 'j' character (original bug) 2020-07-26 23:19:16 +02:00
frutiemax 6598ae14aa Close #12457: Rename INTRO_STATE to use PascalCase 2020-07-26 09:32:53 -04:00
frutiemax 0f1788d273 Part of #12457: Refactor INTRO_STATE to use strong enum 2020-07-26 09:25:29 -04:00
0ro8lu 4416565e47
Close #12269: remove goto from x8_drawing_engine (#12274)
Refactored the function into a separate get dirty rows function.
2020-07-22 11:51:41 +01:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Gymnasiast cf664c8340
Close #11971: Replace ride groups with new ride types 2020-07-17 00:19:49 +02:00
frutiemax c474f2ddc0
Close #12096: Use only ScreenRect on gfx_fill_rect (#12280) 2020-07-15 22:34:57 -03:00
Thamara Andrade 0fb2a6216c
Close #12099: Use ScreenLine on gfx_draw_line (#12143) 2020-07-12 18:50:52 -03:00
frutiemax 29e6db982b
Part of #12096: Prefer ScreenRect on gfx_fill_rect (#12187) 2020-07-09 23:32:38 -03:00
frutiemax bf2b8073cb
Part of #12096: ScreenRect for gfx_fill_rect in libopenrct2 (#12109) 2020-07-08 14:07:26 -03:00
frutiemax 280a21fa30
Fix #12095: Use ScreenRect on gfx_set_dirty_blocks (#12106) 2020-07-08 13:16:24 -03:00
Tulio Leao 59236443ba Make StaticLayout::Draw use ScreenCoordsXY 2020-07-08 10:15:02 -03:00
Tulio Leao dabde880cd Make DrawTextEllipsisedCompat use ScreenCoordsXY 2020-07-08 10:13:03 -03:00
Tulio Leao 16147dec64 Make DrawTextCompat use ScreenCoordsXY 2020-07-08 10:13:03 -03:00
Tulio Leao 69b3c97537 Make DrawText use ScreenCoordsXY 2020-07-08 10:13:03 -03:00
Tulio Leao 2ee1a9d9db
Use TitleCase on StaticLayout (#12155) 2020-07-08 09:43:23 -03:00
Tulio Leao f725fff2da
Clarify CoordsRange-derived interface methods (#12127) 2020-07-06 14:42:11 +02:00
annoyingdroid ad86f7b023
Part of #12098: Use ScreenRect on gfx_filter_rect (#12120)
* Added a gfx_filter_rect function using ScreenRect
2020-07-04 15:16:09 -03:00
DrunkBlood 55f0f34fe0
Close #12101: gfx_draw_dashed_line to use ScreenLine (#12116) 2020-07-03 18:05:18 -03:00
frutiemax 4661262572
Fix #12085: Use ScreenCoordsXY on clip_drawpixelinfo (#12105) 2020-07-02 14:06:28 -03:00
frutiemax 67a8d833ea
Part of #11159: ImageImporter::ImportResult uses std::vector (#12076) 2020-07-02 14:04:49 -03:00
annoyingdroid 53e8816881
Close #12086: Use ScreenCoordsXY on gfx_draw_pixel (#12104) 2020-07-02 12:10:37 -03:00
annoyingdroid 5056872676
Close #12087: Use ScreenCoordsXY on gfx_filter_pixel (#12102) 2020-07-02 11:08:46 -03:00
Michael Steenbeek 33e86ce0d8
Merge pull request #12016 from tupaschoal/screen-coords-string
Make interfaces use ScreenCoordsXY instead of x-y
2020-06-30 08:37:14 +02:00
finicu212 ec33551b24
Fix #12021: Tie coords on gfx_draw_sprite_raw_masked_software (#12080)
Make gfx_draw_sprite_raw_masked_software use ScreenCoordsXY object
2020-06-29 18:38:03 -03:00
Tulio Leao b6f252f68e Make gfx_draw_sprite_raw_masked use ScreenCoordsXY 2020-06-29 10:29:05 -03: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
TomasZilinek cd6076b5bc
FIx #12017 - Create gfx_draw_sprite overload (#12049)
Second and final part. replaces the rest of the calls and removes the old function.
2020-06-24 12:48:17 -03:00
TomasZilinek 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
frutiemax f86931d8a0
Close #12019: Use ScreenCoordsXY on gfx_draw_sprite_software 2020-06-22 23:52:54 +02:00
frutiemax 4a17d1d64e
Fix #12020 - Use ScreenCoordsXY on gfx_draw_sprite_palette_set_software (#12028)
* Fix #12020 - Use ScreenCoordsXY on gfx_draw_sprite_palette_set_software

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-06-21 22:52:48 -03:00
TomasZilinek 69db54f770
Fix #12018 - gfx_draw_sprite_solid overload (#12023)
Creates the overload, replaces all calls to the old function and removes the old function.
2020-06-21 11:50:05 -03:00
TomasZilinek 9efe43fa59
Fix #11562 - gfx_draw_string_left_wrapped overload (#12015)
I created the overload, replaced remaining calls with the new function and removed the old function.
2020-06-21 06:25:31 -03:00
Hudson Oliveira ef5f117373
Part of #9473: Create Vehicle::GetRide (#12002)
* Part of #9473: Create Vehicle::GetRide

* Redefine Vehicle::GetRide in Compat.cpp
2020-06-21 08:38:53 +01:00
TomasZilinek c1546059ad
Close #11571 - Remove <x,y> gfx_draw_string_left overload (#12010)
Third and final part. replaces the rest of the calls to x,y overload
2020-06-20 16:09:45 -03:00
TomasZilinek e93e32d139
Part of #11571: create gfx_draw_string_left() overload (#11984)
Replaces a third of all occurrences of the old function
2020-06-20 00:22:01 -03:00
Tulio Leao 613cec3f7a Part of #11564: gfx_draw_string_centred_clipped with ScreenCoordsXY 2020-06-14 12:26:53 -03:00
Tulio Leao fab0ea131f Part of #11569: Use gfx_draw_string_right with ScreenCoordsXY 2020-06-11 10:11:20 -03:00
Michael Steenbeek e83b86df4d
Replace occurrences of OpenRCT with OpenRCT2 (#11898) 2020-06-08 15:11:07 +02: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 58f32a0afd Make use of gfx_sprite_to_buffer 2020-06-01 21:15:25 +01:00
Ted John 21a9d8f934 Refactor RLE drawing, one arg struct 2020-06-01 20:46:21 +01:00
Ted John d0b1bfbe87 Refactor bitmap drawing, one arg struct 2020-06-01 20:46:21 +01:00
Ted John 1b6899a954
Fix #11845: Disabled icons are not shown as disabled (#11857) 2020-06-01 20:01:37 +01:00
Michael Steenbeek da54f19a34
Fix compilation on Docker CI (#11826) 2020-05-30 15:23:48 +02:00
Ted John 626178a70e Add constants for palette indexes 2020-05-28 22:37:50 +01:00
Ted John 28e4b6ba07 Add blend helper and strict param checking 2020-05-28 21:44:24 +01:00
Ted John d3f7ec4844 Create new PaletteMap type to replace byte pointers 2020-05-28 20:00:23 +01:00
Ted John 46bb30f8a1 Refactor rct_palette to GamePalette 2020-05-27 20:52:51 +01:00
Michael Steenbeek 6ddd1b6563
Merge pull request #11781 from Gymnasiast/cleanup/import-palette
Merge cmdline and JSON object palette
2020-05-19 21:50:16 +02:00
Gymnasiast 4b25345d8d
Create GamePalette struct 2020-05-19 21:09:51 +02:00
TomasZilinek 7da9c7b234
Fix #11566 - draw_string_right_underline() overload (#11780)
created the overload, changed all calls from the old function to the new one and deleted the old function
2020-05-19 16:02:39 -03:00
TomasZilinek a687a13185
Fix #11563 - gfx_draw_string_right_clipped() overload (#11782)
created the overload, changed all calls from the old function to the new one and deleted the old function
2020-05-19 13:54:07 -03:00
Gymnasiast eb25b0db33
Merge cmdline and JSON object palette 2020-05-19 15:42:58 +02:00
Sohil Adwani 310ff84b23
Part of #11562: gfx_draw_string_left_wrapped() overload
* gfx_draw_string_left_wrapped overload added


Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-05-18 22:52:49 -03:00
TusharSariya 2cf95adc4b
Fix #11565: gfx_draw_string_left_clipped to use ScreenCoordsXY (#11765)
* Issue #11565, created overload for gfx_draw_string_left_clipped

Co-authored-by: Tushar <tushar.97@hotmail.com>
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-05-17 19:30:58 -03:00
TomasZilinek 4c88630070
Fix #11567 - create draw_string_centred_underline() overload (#11771)
Created the overload and deleted the old function (there were no calls)
2020-05-17 17:10:36 -03:00
TomasZilinek 7582ed849a
Fix #11568 - create draw_string_left_underline() overload (#11770)
* Fix #11568 - create draw_string_left_underline() overload

created the overload, changed all calls from the old function to the new (just 1 call) and deleted the old function
2020-05-17 16:18:15 -03:00
TomasZilinek 277080de74
Fix #11570 - create gfx_draw_string_centered() overload (#11760)
* Fix #11570 - create gfx_draw_string_centered() overload

I created the overload, updated all calls from the old function to the new and deleted the old one
2020-05-17 15:29:56 -03:00
Michael Steenbeek f0bd05cf6d
Part of #11158: Remove more C-style casts (#11743) 2020-05-13 21:22:50 -03:00
Michael Steenbeek d7637cd70f
Replace many C-style casts (#11720) 2020-05-11 14:32:56 +02:00
Michael Steenbeek a261b4ce33
Remove commented out code (#11721) 2020-05-11 13:54:15 +02: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
frutiemax c447cde63c
Close #11561: Use ScreenCoordsXY in gfx_draw_string_centred_wrapped()
* Add gfx_draw_string_centred_wrapped overload using ScreenCoordsXY

* Update calls to gfx_draw_string_centred_wrapped

* Remove old signature of gfx_draw_string_centred_wrapped

* Meaningful coordinate variable names and constructor calls
2020-05-10 01:00:26 -03:00
Aryaman Singh 3417c10a61
Part of #11569: gfx_draw_string_right() w/ ScreenCoordsXY (#11654)
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-05-07 22:27:53 -03:00
hdpoliveira d69cc1c877 Part of #9473: Create Vehicle::TrainHead and Vehicle::TrainTail
Converted from vehicle_get_head and vehicle_get_tail
2020-04-30 20:53:17 -03:00
Michael Steenbeek 0ecc64f781
Fix #11407: Setting an RCT1 path needs better error messages (#11418) 2020-04-25 15:36:44 +02: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
Michał Janiszewski 5f97637d5e Only suggest final when using non-LTO builds
In LTO builds GCC issues the suggestion-warning from linking stage,
when pragmas are already gone and do nothing.
2020-04-21 13:31:01 +02:00
Michael Steenbeek e1e8e2bec0
Add drawing code for ō (#11201) 2020-04-01 14:31:53 +02:00
Peter Ryszkiewicz fa1ddbd9e3
Show hovered values on finance charts (#10925) 2020-03-28 11:03:10 +01:00
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
WantDiscussion 828eef7411
Introduced optional light effects for vehicles at night. (#10970) 2020-03-20 11:47:31 +01:00
WantDiscussion d6c7aaf69c
Fix: Light effects are drawn off-centre in some rotations 2020-03-18 15:04:57 +01:00
Tulio Leao 09fad0ef7f Change rct_viewport to use ScreenCoordsXY 2020-03-02 20:50:58 -03:00
Tulio Leao 475eed0a56 Receive CoordsXY by const ref instead of copy 2020-02-29 01:16:19 -03:00
Matt d6c3373b5e
Remove unused parameter and minor cleanup 2020-02-15 21:28:28 +01:00
duncanspumpkin a5ef8d6240 Rename rct_vehicle 2020-01-19 17:14:56 +00:00
Michael Steenbeek 77494bbc73 Create definitions for some coords related stuff (#10456)
* Create definitions for some coords related stuff

* Use constexpr; add define for Z step
2019-12-30 15:03:51 +00:00
Michael Steenbeek 8ca0cf52a7
Replace more direct accesses to base/clearance Z with getter/setter (#10454) 2019-12-27 15:26:40 +01:00
duncanspumpkin 44998481f6 Use tile Offset 2019-12-01 15:15:44 +00:00
duncanspumpkin ef10cb243b minor code cleanup 2019-12-01 14:53:52 +00:00
duncanspumpkin 813ed4fdac Remove commented out dead code 2019-12-01 14:52:17 +00:00
duncanspumpkin f964d38e7d Renable light occlusion 2019-12-01 14:51:14 +00:00
duncanspumpkin ace59e6a73 Make lights work for all rotations.
Mistake made with the coordinates confusing viewport and screen coordinates. In addition occlusion code that is depretiated was culling all lights in two rotations due to dead code.
2019-12-01 14:07:48 +00:00
Duncan 9bf2cffbb7
Merge pull request #10169 from SijmenSchoon/feature/refactor-coordinates
Change a sizable portion of LocationXY(Z) to (Tile)CoordsXY(Z)
2019-11-01 20:02:26 +00:00
Sijmen Schoon ab2dbea32a
Change a sizable portion of LocationXY(Z) to (Tile)CoordsXY(Z) 2019-10-31 00:19:14 +01:00
Tulio Leao 9123b597a9 Use constexpr on openrct2/* 2019-10-29 18:44:14 -03:00
ζeh Matt b82d1bbc64 Fix #10015: Crash when certain images are drawn (#10016) 2019-09-23 22:37:28 +02:00
Michael Steenbeek 5e1d14f061
Merge pull request #9939 from IntelOrca/refactor/image-id
Create new ImageId struct
2019-09-22 17:07:49 +02:00
Ted John 9be0130f2d
Show image limit in show_limits console command (#9935) 2019-08-26 12:28:37 +01:00
Ted John fa792d04e1 Add constexpr modifiers 2019-08-25 12:56:42 +01: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 583855d639 Add new ImageId struct 2019-08-24 17:30:39 +01:00
Ted John 6d80e65783 Increase the capacity of dynamic / object images 2019-08-23 20:14:05 +01:00
duncanspumpkin 37ef48890f Move various to use CoordsXYZ funcs instead of LocationXYZ 2019-08-19 20:04:58 +01:00
Ted John ab7b17fc4e
Add nullptr checks for get_ride in libopenrct2 (#9788) 2019-08-08 22:58:56 +01:00
Ted John a57a4f2059 Fix #9724: Park/Ride entrance/exit sign's colour is weird 2019-08-04 17:04:12 +01:00
Ted John b7121553b4 Fix #9715: large scenery banners have incorrect colour and scrolling (#9716) 2019-08-02 21:18:42 +02:00
Ted John 7ce2f38c92 Fix formatting 2019-07-29 20:01:49 +01:00
Ted John 61d64ab8c5 Do not use user strings for banners 2019-07-29 19:18:16 +01:00
Michał Janiszewski 83e26804e5 Limit scrolling text colour to valid options (#9639) 2019-07-27 14:23:34 +02:00
Matt 98a17fe8d9
Refactor create_sprite and remove unnecessary move_sprite_to_list 2019-07-24 17:53:51 +02:00
ζeh Matt 5a6f573f6b
Merge pull request #9466 from ZehMatt/opengl/rain
Fix #6515: Add rain rendering to OpenGL renderer
2019-07-21 19:29:03 +02:00
Ted John 5733d666b3 Do not store park name as a user string 2019-07-21 11:33:15 +02:00