Commit Graph

578 Commits

Author SHA1 Message Date
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
Matt 2cf4a42cbe
Add rain rendering to OpenGL renderer 2019-07-18 20:54:47 +02:00
Michael Steenbeek 3706581073
Add support for drawing en-dash and multiplication sign (#9570) 2019-07-14 15:58:33 +02:00
Aaron van Geffen cfd863ef12 Prevent making unnecessary copies in certain tile loops (#9549) 2019-07-11 18:43:33 +02:00
ζeh Matt 7c0f04903e Fix crash with truetype fonts and multi threading (#9424) 2019-06-16 17:43:53 +02:00
Ted John f842d8a693 Fix #5103: OpenGL: ride track preview not rendered 2019-05-02 00:07:43 +00:00
Matt 4e264bd45d Use mutex to protect scrolling banner cache from data race 2019-04-02 20:14:50 +02:00
Matt 1153b97ace Use thread_local to protect globals from data race 2019-03-31 17:15:15 +02:00
Matt 37c3809744 Implement partial multicore rendering 2019-03-31 15:50:55 +02:00
ζeh Matt 0b41c0f9a1 Fix #8988: Improve lookups for codepoint offsets 2019-03-30 21:50:49 +01:00
Gymnasiast ff12d5c202 Add Z with caron 2019-03-27 10:06:25 +01:00
Gymnasiast cf65d01ac0 Add U with ring 2019-03-27 10:06:25 +01:00
Gymnasiast ef5472c566 Add S with caron 2019-03-27 10:06:25 +01:00
Gymnasiast fd1f763b83 Add R with caron 2019-03-27 10:06:25 +01:00
Gymnasiast 43d4a20b79 Add N with caron 2019-03-27 10:06:25 +01: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 7655ba7746 Make screenshot return path to file 2019-01-31 23:36:41 +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
8d9fcb7f98/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
ζeh Matt 7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01:00
Ted John 06f203a7e7 Implement surfaces, edges and stations as objects 2018-12-09 23:30:40 +00: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
Matt 468d94a6ca Remove gCurrentViewportFlags 2018-12-05 23:09:17 +01:00
Hielke Morsink 354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
Gymnasiast a2033bc8ab Add non-breaking spaces 2018-11-09 23:41:18 +01:00
Gymnasiast 72d2ebd4d7 Add Russian rouble sign 2018-11-09 23:40:18 +01:00
Michael Steenbeek f8add7f62e
Rename rct_tile_element to TileElement 2018-11-01 13:53:50 +01:00
ζeh Matt e5eb61d38d Fix scrolling banners drawing invalid text 2018-10-23 19:44:14 +02:00
Michał Janiszewski 63c6486a7f
Add missing header guards (#8081) 2018-10-10 23:27:25 +02:00
Michał Janiszewski b05e66e67d Fix invalid access to font descriptor 2018-10-03 21:20:04 +02:00
Michael Steenbeek fd12aff8f7
Add D and E with caron
This also adds the Unicode codepoints for the remaining Czech letters.
2018-09-23 22:23:37 +02:00
Gymnasiast f07e677af1 Replace switch towers with std::map 2018-09-23 11:31:04 +02:00
Gymnasiast 7d7d0aeab5 Adopt OpenLoco's UTF-8 handling 2018-09-23 11:31:04 +02:00
Gymnasiast c46155bbda Use constant instead of raw number 2018-09-16 15:07:32 +02:00
Gymnasiast 3b5a766f34 Add glyphs for Ő, ő, Ű and ű 2018-09-01 21:03:56 +02:00
Gymnasiast 3b97f6d9f6 Add y with acute 2018-09-01 20:42:24 +02:00
Gymnasiast ab1044d2de Add C with caron 2018-09-01 20:42:24 +02:00
Gymnasiast 3a8bf352ac Fix #7804: Russian ride descriptions cut off 2018-08-13 20:35:46 +02:00
Michael Steenbeek 6d530002bc
Add ellipsis character 2018-08-13 19:57:43 +02:00
Linus Unnebäck fd07be587a
Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01:00
Michael Steenbeek fdd18dd29b
Fix #7830: Add font sprites for Romanian characters 2018-07-30 17:54:02 +02:00
Gymnasiast 8481c4ec58 Add sprite font glyph for interpunct 2018-07-24 21:07:02 +02:00
Michael Steenbeek e6472eec00 Add Turkish sprite font glyphs 2018-07-24 13:54:19 +02:00
Gymnasiast ad3528a7f1 Add sprite font glyph for the guilder sign 2018-07-23 23:44:13 +02:00
Michael Steenbeek fd133aae8a
Fix #4039: Add sprite font glyph for German opening quotes (#7811) 2018-07-23 22:02:28 +02:00
Gymnasiast 86aee96c3d Add sprite glyphs for Cyrillic/Russian 2018-07-23 18:34:59 +02: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 9bfa8bdbe8 Apply format on new/updated code before rebase 2018-07-23 16:00:17 +02:00
Hielke Morsink 472320d8f3 Correct formatting up to the management folder
I went over the commits ab7f22f..8726712 (bulk format commits for game actions to management inclusive) and corrected all mistakes I found. Most of them have to do with arrays missing trailing commas, making clang-format indent the entire array or not add breaks between the values.
2018-07-23 16:00:15 +02:00
clang-format 602aac47ba clang-format drawing 2018-07-23 16:00:04 +02:00
Michael Steenbeek 5fdc4637cd Add drawing code for new sprite glyphs 2018-07-20 17:33:20 +02:00
Michael Steenbeek 93bc11a93a Refactor _spriteFontCharacterWidths 2018-07-20 15:56:21 +02:00
Michael Steenbeek 41dcae581a Remove support for the unused big font 2018-07-20 15:56:21 +02:00
Michael Steenbeek b2873d2f86 Use more constants 2018-07-20 15:08:25 +02:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Michael Steenbeek ec3a1e575e
Replace Math::Min and Max with std variants 2018-06-20 17:11:35 +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 aad1e69d7e
Add parentheses to macro arguments (#7686)
This adds parentheses around macro arguments that are either negative or used for calculations inside the macro itself. Doing this avoids getting errors in code that may look right.
2018-06-15 10:54:05 +02:00
Ted John fdb1d98868
Move rain window loop to libopenrct2ui (#7684) 2018-06-15 07:46:04 +01:00
Aaron van Geffen 2cb0947620 Fix #7535: Render ẞ ligature in sprite font. 2018-06-11 22:34:01 +02:00
Aaron van Geffen 760f274d81 Fix #7616: Use unicode dingbats for +/- buttons in CJK languages. 2018-06-11 22:20:51 +02:00
Michał Janiszewski 5174119491 Disable -Wdocumentation for FreeType includes 2018-06-11 10:17:10 +02:00
Hielke Morsink 204dd4439b Mark unused arguments in the libopenrct2 project
For dummy classes and functions with empty bodies I've only commented out the arguments, for all others I used C++17's [[maybe_unused]].
2018-06-06 21:03:11 +02:00
Hielke Morsink 5d0022a5cb Remove argument list from zero-initializers with zero/false/nullptr value 2018-06-04 19:50:46 +02:00
Hielke Morsink 7aada25ed2 Clarify disabling of warnings for unused function (#7617) 2018-06-02 22:30:41 +02:00
Ted John b3c17b215f Use single output folder for msbuild obj files
This requires unique named source files within a project.
2018-06-01 09:37:49 +02:00
ζeh Matt ee56021067 Minor code cleanup. (#7538) 2018-05-18 22:50:57 +02:00
Michał Janiszewski a2ef4bd699
Exclude pre-formatted blocks from clang-format (#7520)
[ci skip]
2018-05-16 20:41:29 +02:00
Hielke Morsink 6c65c3d64d
Merge pull request #6774 from janisozaur/fixes
Various code improvements
2018-05-15 14:38:43 +02:00
Ted John afdcff8f9a
Merge pull request #7512 from IntelOrca/feature/parkobj
Introduce parkobj and json object .png support
2018-05-14 18:08:54 +01:00
Ted John 20fdd46b96
Fix #7513: OpenRCT2 freezes on shutdown (#7514)
Store drawing engine and painter inside Context so that it is disposed before Context.
2018-05-13 15:52:59 +01:00
Ted John 0f0bb021d6 Add support for raw images 2018-05-13 11:36:35 +01:00
Ted John 580f1baff2 Get basic relative .png loading 2018-05-13 11:36:35 +01:00
Ted John f212894eb0 Fix clang builds 2018-05-13 01:11:56 +01:00
Ted John 428dd05dcf Refactor ImageImporter 2018-05-13 01:11:56 +01:00
Ted John bffbf5857d Refactor image importer out into new class 2018-05-13 01:11:56 +01:00
Hielke Morsink f9dd981234 Further fixes
- Use `= 0` for initializing types
- Add default values to some structs, instead of zero-initializing their instances with `{}`
- Use `std::make_unique` in Network.cpp
- Remove trivial constructors and destructors
- Improve readability of expression in Vehicle.cpp
2018-05-12 16:58:08 +02:00
Ted John 302fe00805 Always pass shared_ptr by reference 2018-05-11 20:39:00 +01:00
Ted John 7b28078da2 Remove use of gUseTrueTypeFont 2018-05-11 20:37:48 +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 7dc170ef85 Use shared_ptr for long-life objects
Use unique_ptr and shared_ptr for IContext, IPlatformEnvironment, IUiContext, and IAudioContext.
2018-05-11 20:37:48 +01:00
Michał Janiszewski 0a92e74ced Minor fixes 2018-05-11 15:38:30 +02:00
Hielke Morsink 8d10bfb5a1 Add namespace closing comments 2018-05-04 22:54:43 +02:00
Hielke Morsink bc44792da9 Pack nested namespaces together 2018-05-04 22:54:43 +02:00
Michael Steenbeek 3aac52cf44 Fix rendering of inverted exclamation mark 2018-04-25 13:47:07 +02:00
Ted John 42f46d15e3
Merge pull request #7414 from OpenRCT2/refactor/string-conversions
Refactor string conversion between RCT2 and UTF8
2018-04-25 10:14:39 +01:00
Hielke Morsink bf4f68fe33 Use enum type that guarantee to support its values
By default enumerators use type `int` which can store values up to `1 << 31 - 1`. The clang compiler generates this error for enums values that use the sign bit: `enumerator value is not representable in the underlying type 'int'.`

To get rid of those warnings (and technically improve the code) the erroneous enums are now of type of `uint32`.

Note: I've skipped peep.h to prevent conflicts with the peep refactor branch.
2018-04-24 16:51:42 +02:00
Hielke Morsink 30063984e6
Delete unused function arguments or mark them so (#7426)
This aims to make future refactoring easier. The arguments are removed where possible, but kept and marked with C++17's [[maybe_unused]] where they could not be removed (e.g. when they are used as a callback, rather than called directly).

I've skipped the rides/<category>/* and peep/* source files, because the rides source files are mostly generated and have a ton of unused variables, and the peep source files are being refactored.
I've also skipped most of window/* source files, because most of the functions are used as callbacks and will be bulk-renamed at some point.
2018-04-20 13:56:37 +02:00
Ted John deaa60f8f1 Refactor string conversion between RCT2 and UTF8
Use Win32 API for conversion on Windows for non-1252 code pages instead of built-in tables.
2018-04-18 13:16:20 +02:00
Duncan 0ab3d0955c
Merge pull request #7310 from OpenRCT2/json-objects
Add support for new JSON object format
2018-04-08 10:45:55 +01:00
Hielke Morsink a51462b0fd Include necessary files for compiling headers
This commits works towards #7289. It includes files that it depends on, or forward declares types when possible. It may seem like this only increases compilation time, but before this commit they depended on the other includes of the source files that use them.
2018-03-31 23:07:14 +02:00
Ted John 3ead0f4289 Finish loading water JSON objects 2018-03-26 21:37:23 +02:00
Ted John bf7c3931e7 Parse images from JSON 2018-03-26 21:35:44 +02:00
Ted John f6fd79eca4 Move length calculation to ImageTable.cpp 2018-03-26 21:35:44 +02:00
Ted John 32d588d765 Fix toilets image loading 2018-03-26 21:35:44 +02:00
Michał Janiszewski 67f74119cf Fix missing headers 2018-03-20 00:27:58 +01:00
Michał Janiszewski cd065d4f41 Reduce includes in common header 2018-03-20 00:27:58 +01:00
Michał Janiszewski 3303246b09 Reduce header inclusions 2018-03-20 00:27:58 +01:00