Duncan
d486ac4d3b
Reduce direct usage of LOCATION_NULL ( #10480 )
...
* Reduce direct usage of Location_Null
Ideally we want to refactor these out to use std::optional as much as possible but for now move to using the standard interfaces.
* Remove incorrect AND with LOCATION_NULL
In the original this was a simple comparison to check for negative. Unsure how it ended up as an AND with the negative bit.
2019-12-31 09:01:17 +01:00
Duncan
7a64eb4402
Fix #10470 . Mistake caused by reusing variable names for different functions. ( #10476 )
...
Added in comments to clarify why function is required. Renamed variables again to clarify what they are used for
2019-12-30 12:26:58 +01:00
Tulio Leao
9ec25e85cb
Coords for map_get_tile* ( #10440 )
...
* Make Map::map_get_tile_side() use CoordsXY
* Make Map::map_get_tile_quadrant() use CoordsXY
2019-12-27 12:36:47 +01:00
Duncan
e61401e48c
Fix #10410 : Tile Inspector does not hightlight tile correctly
...
Mistake made when refactoring not passing the error up through the chain and silently working.
2019-12-22 13:59:24 +01:00
Michael Steenbeek
d012c8141b
Merge pull request #10316 from duncanspumpkin/light_fx
...
Make lights work for all rotations.
2019-12-04 14:11:26 +01:00
duncanspumpkin
f964d38e7d
Renable light occlusion
2019-12-01 14:51:14 +00:00
duncanspumpkin
0c6e062d5a
Refactor return value of screen_coord_to_viewport_cord
2019-12-01 09:15:07 +00:00
Tulio Leao
1532ee2b23
Create CoordsXY::ToTileStart() and CoordsXY::ToTileCentre()
2019-11-30 16:47:23 +01:00
Tulio Leao
4537c061d9
Prefer std::optional over LOCATION_NULL on Viewport ( #10297 )
2019-11-29 17:17:01 +01:00
Duncan
b316f447a4
Merge pull request #10285 from tupaschoal/useCoords-get-map-coords
...
Remove raw coordinates overload of get_map_coordinates_from_pos
2019-11-29 09:20:12 +00:00
Tulio Leao
47935288d0
Remove raw coordinates overload of get_map_coordinates_from_pos
2019-11-25 17:45:02 -03:00
duncanspumpkin
0c4fffb2ec
Refactor viewport_adjust_for_map_height to use CoordsXYZ.
2019-11-24 21:37:35 +00:00
Duncan
966ba6b018
Merge pull request #10269 from duncanspumpkin/centre_2d
...
Refactor centre_2d_coordinates to use screenCoords.
2019-11-24 14:28:18 +00:00
duncanspumpkin
d4c15cd774
Refactor centre_2d_coordinates to use screenCoords.
2019-11-20 18:44:03 +00:00
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