1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 03:53:07 +01:00
Commit Graph

66 Commits

Author SHA1 Message Date
Tulio Leao
f94970b059 Use CoordsXY/ScreenCoordsXY for viewport*_with_z
Closes #10268
2019-11-19 18:33:40 -03:00
duncanspumpkin
3b8bf56b71 Use helper function 2019-11-19 11:20:59 +00:00
duncanspumpkin
421107436f Refactor helper function to take screen coords 2019-11-19 11:20:59 +00:00
duncanspumpkin
1d6a923298 Refactor screen_get_map_xy_with_z to use CoordsXY structs 2019-11-19 11:20:58 +00:00
duncanspumpkin
e4ee91f5ff Refactor get_map_coordiantes to enforce Coords struct 2019-11-14 20:28:54 +00:00
Duncan
8eb42867dd Merge pull request #10223 from duncanspumpkin/viewport_refactor
Remove global variables from get_map_coordinates_from_pos_window
2019-11-14 20:27:39 +00:00
Tulio Leao
30815f0886 Fix clang-format 2019-11-13 18:28:03 -03:00
Tulio Leao
054bc8e4ca Receive ScreenCoordsXY and return CoordsXY in Viewport 2019-11-13 18:27:59 -03:00
duncanspumpkin
0af10781f1 Remove unused globals 2019-11-13 19:04:01 +00:00
duncanspumpkin
57baeeaa3c Refactor to remove std::optional 2019-11-13 18:58:17 +00:00
duncanspumpkin
278dd9b1d2 Remove global variables from get_map_coordinates_from_pos_window 2019-11-12 20:11:48 +00:00
Tulio Leao
9776a0843d Make Viewport::screen_to_map_pos() return coords (#10171)
* Make Viewport::screen_to_map_pos() return coords

* Fix clang-format

* Update src/openrct2-ui/windows/TileInspector.cpp

* Update src/openrct2-ui/windows/TileInspector.cpp

* Apply suggestions from code review
2019-11-02 08:04:46 +00:00
Alan Berndt
a4181d10f4 Refactor get_map_coordinates_from_pos_window (#10109)
* Refactor get_map_coordinates_from_pos_window

This changes get_map_coordinates_from_pos_window to use the
ScreenCoordsXY and CoordsXY structs instead of bare ints as suggested
in #10065

* Use default constructor.

The default constructor initializes the coordinates to (0, 0) anyway so
doing that explicitly is redundant.

* Fix parentheses

* Fix formatting issues

* Manually fix clang formatting

Apparently my version of clang-format doesn't behave properly so I am
manually making the changes that CI suggests.
2019-11-01 20:57:44 +00:00
duncanspumpkin
5ca553dd08 Refactor viewport_coord_to_map_coord to return a CoordXY 2019-11-01 20:04:07 +00:00
Duncan
7546c846df Name functions and remove dead code
The dead code removed has been removed already from the draw sprite. Should have removed it from interaction at the same time.
2019-10-19 17:21:08 +02:00
Tulio Leao
ce1f38da25 Use ScreenCoordsXY for window functions (#10086)
* Use ScreenCoordsXY for window_create function

* Use ScreenCoordsXY for window_find_from_point function

* Use ScreenCoordsXY for window_find_widget_from_point

* Use ScreenCoordsXY for ride_contruction_tool*

* Use ScreenCoordsXY for window_event_tool*

* Use ScreenCoordsXY for window_event_scroll_mouse*

* Use ScreenCoordsXY for remaining window_event*

* Use ScreenCoordsXY for window_(set|move)_position
2019-10-19 13:07:03 +02:00
Ted John
f4079434dc Fix #4927: Giant screenshot cut off at bottom and top 2019-08-21 20:11:06 +01:00
duncanspumpkin
37ef48890f Move various to use CoordsXYZ funcs instead of LocationXYZ 2019-08-19 20:04:58 +01:00
duncanspumpkin
c6452095ca Refactor tile_element_height to use CoordsXY 2019-08-19 20:04:57 +01:00
Matt
cc6321048f Refactor window_invalidate to use rct_window::Invalidate 2019-08-11 17:22:00 +02:00
Ted John
ab7b17fc4e Add nullptr checks for get_ride in libopenrct2 (#9788) 2019-08-08 22:58:56 +01:00
Hielke Morsink
6b7fee86bb Don't clear the screen to black for giant screenshots
When certain viewport flags were set (underground view, hide base land,
hide vetical faces, clip view), the viewport would always be cleared,
including for giant screenshots.
2019-06-16 16:42:21 +02:00
Matt
951f5009ef Refactor window storage to use std::list instead of std::vector 2019-05-29 19:32:18 +02:00
Ted John
f842d8a693 Fix #5103: OpenGL: ride track preview not rendered 2019-05-02 00:07:43 +00:00
Nicole
d38fb6a7a2 Fix #8800: ensure tile_element_height is used correctly (#9087)
* Changed calls to tile_element_height to tile_element_water_height

* Changes to calls to tile_element_height

* Removed tile element_height, map_get_highest_land_height, and map_get lowest_land_height

3 functions removed due to relocation.

* Added function tile_element_height back to map.cpp

Added tile_element height back to map.cpp. Was unnecessarily deleted.

* Update Map.h

* water_height changes

* Update Scenario.cpp

* Update Scenario.cpp

* Fix 8800: applied clang format

* Removed unnecessary ANDs
2019-04-23 18:26:48 +01:00
Michael Steenbeek
42a1a8704d Use empty() for vectors; clean up bool comparisons (#9118) 2019-04-20 20:39:47 +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
Ted John
ca023f7c5e Fix #8829: invalid read in window_guest_open 2019-03-09 13:05:12 +00:00
Ted John
cdec457abd Refactor peep struct 2019-02-28 20:28:58 +01: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
304840069d Add sprite sorting benchmark 2019-01-22 19:45:56 +01:00
ζeh Matt
7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01:00
Matt
468d94a6ca Remove gCurrentViewportFlags 2018-12-05 23:09:17 +01:00
Michael Steenbeek
f8add7f62e Rename rct_tile_element to TileElement 2018-11-01 13:53:50 +01:00
ζeh Matt
3e457436b1 Refactor some painting code. (#8144) 2018-10-26 10:49:27 -07:00
Matt
a89b352fb2 Rename rct_sprite::unknown to rct_sprite::generic 2018-08-20 18:27:40 +02:00
Linus Unnebäck
fd07be587a Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01: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
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
17d2693422 clang-format interface 2018-07-23 16:00:04 +02:00
Michael Steenbeek
1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Ted John
98905fdbc3 Change g_window_list to use the heap for windows 2018-06-16 16:04:01 +01:00
Ted John
0f6138f8b6 Convert g_window_list to a std::vector 2018-06-16 16:04:01 +01:00
Ted John
a716b4aa28 Remove use of window list in Viewport.cpp 2018-06-16 16:04:01 +01:00
Ted John
26666b1da9 Remove empty function: viewport_update_pointers 2018-06-15 23:15:52 +01: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
5d0022a5cb Remove argument list from zero-initializers with zero/false/nullptr value 2018-06-04 19:50:46 +02:00
Hielke Morsink
f1bbf077d6 Add clip selection
This allows the user to select an area of tiles. Anything outside of this area won't be drawn.
2018-05-12 14:24:01 +02:00