Tulio Leao
06fb16ee88
Use CoordsXYZ for gMapSelectArrowPosition ( #10442 )
2019-12-30 16:51:35 +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
Tulio Leao
98110c0544
Make Map::map_invalidate*() use CoordsXY ( #10437 )
...
* Make Map::map_invalidate_element() use CoordsXY
* Make Map::map_invalidate_tile_full() use CoordsXY
* Make Map::map_invalidate_tile_zoom0() use CoordsXY
* Make Map::map_invalidate_tile_zoom1() use CoordsXY
* Make Map::map_invalidate_tile() use CoordsXY
* Use CoordsXYRangedZ for map invalidation
* Fix vehicle tile invalidation use Z instead of Y coord
* Fix BannerRemoveAction sending Z TileCoords to invalidate tile
* Fix wrong tile invalidation on peep_update_walking_break_scenery
* Prefer ToTileStart over bitwise and
2019-12-28 08:44:33 +00:00
Michael Steenbeek
d0744df22f
Merge pull request #10443 from tupaschoal/reduce-locationxy
...
Remove LocationXY usage on windows and actions
2019-12-27 15:58:26 +01:00
Michael Steenbeek
8ca0cf52a7
Replace more direct accesses to base/clearance Z with getter/setter ( #10454 )
2019-12-27 15:26:40 +01:00
Tulio Leao
3c3e179e7f
Remove LocationXY usage on openrct2-ui\windows\RideConstruction.cpp
2019-12-27 09:22:51 -03:00
Gymnasiast
62fcbb07ca
Rename methods to GetBaseZ/GetClearanceZ
2019-12-23 20:08:37 +01:00
Gymnasiast
85ecb52e7c
Manually replace more Z occurrences
2019-12-23 20:05:26 +01:00
Gymnasiast
7d11858dbe
Create getter for GetBaseHeight()/GetClearanceHeight()
2019-12-23 20:05:24 +01:00
Tulio Leao
a2c7ecc6e5
Make Map::map_get_first_element_at() use CoordsXY ( #10413 )
...
* Make Map::map_get_first_element_at() use CoordsXY
* Fix clang-format on ClearAction.hpp
* Prefer TileDIrectionDelta over hardcoded delta on RideConstruction
* Use named Direction constants
* Make Compat::map_get_first_element_at() use CoordsXY
2019-12-23 07:35:41 +00:00
Tulio Leao
461095ab6c
Fix #10417 : Ride preview incorrectly centered
2019-12-22 01:48:28 -03:00
Michael Steenbeek
30b03d998c
Merge pull request #10409 from tupaschoal/coords-for-set-tile-elements
...
Make Map::map_set_tile_elements() use TileCoordsXY
2019-12-21 19:12:51 +01:00
Tulio Leao
5fcfc6af00
Rename map_set_tile_elements to singular
2019-12-21 10:28:52 -03:00
Tulio Leao
d7efe4de90
Make Map::map_set_tile_elements() use TileCoordsXY
2019-12-21 10:28:33 -03:00
duncanspumpkin
f346e439fc
Change type of map selection a and b
2019-12-21 12:18:34 +00:00
Tulio Leao
918624e090
Fix #10396 : Function returning TileCoordsXYZD'z coord in a CoordsXYZD object ( #10398 )
2019-12-19 15:41:22 +01:00
Tulio Leao
7c75db2b2d
Make map_get_surface_element_at only accept Coords objects
2019-12-18 23:46:50 -03:00
Tulio Leao
2cd3add373
Make CursorState store a ScreenCoordsXY object
2019-12-14 23:30:55 -03:00
Tulio Leao
af7b364946
Prefer map_is_location_valid over hardcoded map limits ( #10373 )
2019-12-14 22:50:34 +01:00
Duncan
fed417da03
Merge pull request #10356 from duncanspumpkin/label_var
...
Change the label on known var to reflect use.
2019-12-11 18:14:07 +00:00
Tulio Leao
01c62437b2
Remove Ride::ride_get_rotated_coords()
2019-12-09 16:52:47 -03:00
Tulio Leao
6f0ebfea27
Use CoordsXY and ScreenCoordsXY for rotate in Ride*.*
2019-12-04 08:02:09 -03: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
Tulio Leao
831050745c
Fix #10275 : Track element preview incorrect
2019-11-22 12:10:47 +01:00
Duncan
463ef9d218
Merge pull request #10238 from duncanspumpkin/viewport_get_xy_z
...
Refactor screen_get_map_xy_with_z to use CoordsXY structs
2019-11-19 15:02:50 +00:00
Tulio Leao
7718d83b21
Simplify assignment in RideConstruction.cpp ( #10266 )
2019-11-19 16:01:22 +01:00
duncanspumpkin
1d6a923298
Refactor screen_get_map_xy_with_z to use CoordsXY structs
2019-11-19 11:20:58 +00:00
Tulio Leao
2acdc577f7
Use Coords for windows/RideConstruction
2019-11-18 19:17:54 -03:00
Tulio Leao
72b4d93ad2
Avoid dereferencing map_get_surface_element_at nullptr on libopenrct2
2019-11-18 08:01:04 -03:00
Tulio Leao
93083780df
Use ScreenCoordsXY for windows/Map ( #10233 )
...
* Use ScreenCoordsXY for windows/Footpath
- Refactor `place_park_entrance_get_map_position()` to receive `ScreenCoordsXY` and return `CoordsXYZD`
- Refactor `sub_68A15E()` to receive `ScreenCoordsXY` and return `CoordsXY`. Some of its usage are narrowing the result on purpose, as same variable is used for contexts where `int16_t` is still a hard requirement.
* Properly increment for big Z and use LOCATION_NULL
2019-11-14 23:09:27 +01:00
Tulio Leao
7e65aeaea3
Fix issues in code review
...
Implement operator== and operator!= for CoordsXYZD
Set location to null before returning from ride_get_entrance_or_exit_position_from_screen_position
2019-11-13 18:46:02 -03:00
Tulio Leao
5dfe373061
Refactor ride_get_entrance_or_exit_position_from_screen_position()
2019-11-13 09:41:58 -03:00
Tom Lankhorst
027c09553b
Reformat code with clang-format 8.0.
2019-11-04 15:11:06 +01:00
Tulio Leao
afc14183e7
Use ScreenCoordsXY for tool_* functions
2019-10-29 19:02:58 -03: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
duncanspumpkin
213ba15ba5
Remove unused code and variables from function
2019-10-07 18:36:27 +01:00
duncanspumpkin
f10e4dc6b9
Remove unused variables from function call
2019-10-07 18:33:51 +01:00
Gymnasiast
f365bc3cb7
Create getters and setters for occupied quadrant
2019-08-27 21:12:48 +02:00
Gymnasiast
ec5ba20992
Create dedicated method for SetLastForTile()
2019-08-25 16:13:02 +02:00
Gymnasiast
6e200459d3
Refactor some accessors to tile element type and flags fields
2019-08-24 22:42:47 +02:00
duncanspumpkin
f39905bd2e
Clang format
2019-08-19 20:04:59 +01:00
duncanspumpkin
b77f15c4b7
Refactor map_get_highest_z to use CoordsXY
2019-08-19 20:04:59 +01:00
duncanspumpkin
5fe5f8e964
Refactor audio_play_sound_at_location to use CoordsXYZ
2019-08-19 20:04:58 +01:00
duncanspumpkin
5333dc4295
Return a SurfaceElement from get_surface_element
2019-08-19 20:04:56 +01:00
Gymnasiast
255ce3f62b
Extend tile element size to 16 bytes
2019-08-18 14:03:36 +02:00
Matt
cc6321048f
Refactor window_invalidate to use rct_window::Invalidate
2019-08-11 17:22:00 +02:00
Ted John
9954f0b725
Add nullptr checks for more instances of get_ride ( #9819 )
2019-08-09 14:20:59 +01:00
Ted John
93789b9034
Add nullptr checks for get_ride in libopenrct2ui ( #9795 )
2019-08-09 08:06:25 +01:00
Ted John
e23638548a
Reduce use of MAX_RIDES and RIDE_TYPE_NULL
2019-08-04 16:44:17 +01:00
Ted John
772475848b
Fix formatting
2019-07-29 19:18:16 +01:00
Ted John
3f45976009
Fix openrct2ui errors
2019-07-29 19:18:16 +01:00
Duncan
ab5f5b20cd
Use enum class for RCT2_SOUND ( #9618 )
...
* Use enum class for RCT2_SOUND
* Fix formatting. Fix mistaken declaration.
* Change name of enum to SoundId
* Fix clang format
2019-07-22 19:02:45 +01:00
Duncan
993709c087
Merge pull request #9321 from aw20368/fix/8723-use-rotate_map_coordinates
...
Fix #8723 Use rotate_map_coordinates to rotate coordinate
2019-06-08 07:52:52 +01:00
aw20368
e0cf476398
Fix #8723 Use rotate_map_coordinates to rotate coordinate
...
Added Rotate to CoordsXY, TileCoordsXY and used them to replace redundant rotation code.
2019-06-06 08:21:40 -04:00
Aaron van Geffen
f1ac847fce
Merge pull request #9222 from IntelOrca/implement/485-ghost-train-simulation
...
Implement #485 : ghost train simulation
2019-06-04 20:24:16 +02:00
aw20368
02ef545f1b
Fix #9314 : Trying to delete ride piece while paused moves the selection ( #9332 )
...
Failed track removal was triggering a move to the next piece. Changed to move only upon successful removal.
2019-05-30 20:51:56 +02:00
Aaron van Geffen
bab7711c5b
Add new simulate icon.
2019-05-28 16:50:38 +01:00
Ted John
26185b9e72
Change simulate to toggle button
2019-05-28 16:50:38 +01:00
Ted John
5289113c95
Add simulate button to ride construction window
2019-05-28 16:50:38 +01:00
Ted John
c4e18e570e
Add and implement simulation mode for rides
2019-05-28 16:50:08 +01:00
Filip Gawin
6833da77e3
Simplify boolean expresions
2019-05-10 22:00:38 +02:00
Michael Steenbeek
5a906b2378
Port more functions to Ride struct ( #9119 )
2019-04-20 22:22:39 +02:00
duncanspumpkin
561ce03d18
Fix formatting
2019-04-04 19:23:44 +01:00
duncanspumpkin
30a5194085
Use a vector for map selection tiles
2019-04-04 19:23:44 +01:00
Matt
7ed35dea70
Fix #9000 : Show correct error message if not enough money available
2019-03-31 19:04:47 +02:00
Nazey
9cbc308c40
Remove gTrackGroundFlags by returning it within GameActionResult ( #8930 )
...
Fix #8726
2019-03-24 19:48:37 +00:00
Michael Steenbeek
1c570c8eec
Move some ride functions to struct methods
2019-03-20 20:05:25 +01:00
Aaron van Geffen
2af13904c5
Update copyright notices for 2019. ( #8903 )
2019-03-17 07:16:15 +00:00
duncanspumpkin
7fbf11ac79
Implement TrackSetBrakeSpeedAction
2019-03-11 19:08:07 +00:00
duncanspumpkin
e128a78b91
Fix formating and other issues
...
Refactor as per comments.
Simplified some of the code as well
Use constants
2019-03-02 07:24:42 +00:00
duncanspumpkin
7f586f50e1
Move all callees to the game action framework. Fix CoordXY bug
2019-03-02 07:24:41 +00:00
duncanspumpkin
dffa56aca2
Create a class for the quarter tile
...
Finish implementing TrackQuarterTile
Rename class
2019-02-25 13:51:00 +00:00
Michael Steenbeek
336e2cafce
Fix #4094 : Long flat-to-steep pieces are offered in diagonal building mode
2019-02-25 12:02:27 +01:00
Nathaniel Ngo
300fd3a589
Fix for Issue#8725: refactoring _currentTrackBegin and _previousTrackPiece to use CoordsXYZ struct ( #8759 )
...
* Refactored _currentTrackBeginX, _currentTrackBeginY, _currentTrackBeginZ to use a CoordsXYZ struct
* Refactored _previousTracPieceX, _previousTrackPieceY, _previousTrackPieceZ to use a CoordsXYZ struct
* Refactored _currentTrackBegin and _previousTrackPiece in source files
* Fixed clang formatting
2019-02-24 09:15:31 +00:00
duncanspumpkin
3a615c2126
Use new game action for callees
2019-02-21 16:00:31 +00:00
duncanspumpkin
1418975d84
Fix shop construction on client
2019-02-19 15:20:55 +00:00
duncanspumpkin
6375d2537a
Move and refactor shop interact with path code to prevent possible desync
2019-02-19 15:20:49 +00:00
duncanspumpkin
09bb99d9e8
Fix clang format and travis errors
...
Minor refactor
Move key callback code into callbacks. Fixes shop placement
Use rotate_map_coordinates
2019-02-19 12:31:22 +00:00
duncanspumpkin
8bf3689d42
Introduce flag to prevent ghosts in multiplayer
...
Fix error message arguments
Remove dead code. Fix clang format
2019-02-19 12:31:11 +00:00
duncanspumpkin
77b25714ff
Move callbacks into GameActionCallbacks
...
Remove remaining references to game command
2019-02-19 12:30:42 +00:00
duncanspumpkin
650e8291d0
Start moving track place into GameAction framework
2019-02-19 12:30:33 +00:00
Ted John
ba445cb6ef
Pass Ride* instead of ride_id_t
2019-02-13 20:16:42 +00:00
Ted John
fdf9f36fab
Pass Ride* instead of ride_id_t
2019-02-12 23:58:45 +00:00
Ted John
9e461b2e34
Pass Ride* instead of ride_id_t
2019-02-12 23:29:38 +00:00
Ted John
9706dd8675
Pass Ride* instead of ride_id_t
2019-02-12 23:29:37 +00:00
Michael Steenbeek
b4bef2fe7d
Merge pull request #8560 from richard-fine/directions
...
Begin cleanup of direction handling
2019-01-18 19:09:39 +01:00
Ted John
8701286772
Use new ride_id_t typedef ( #8561 )
2019-01-12 10:11:55 +00:00
Richard Fine
e90e9dd73f
Introduce many uses of direction_reverse
...
Change many of the places doing the ^2 trick to use direction_reverse instead, for improved readability.
2019-01-05 15:41:46 +00: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
Michael Steenbeek
f8add7f62e
Rename rct_tile_element to TileElement
2018-11-01 13:53:50 +01:00
Michael Steenbeek
a8f526ae48
Allow on-ride photos and water S-bends on the Water Coaster
2018-11-01 10:12:45 +01:00
Michael Steenbeek
66cde65f87
Replace C style function for getting slope direction
2018-10-31 13:09:19 +01:00
ζeh Matt
3e457436b1
Refactor some painting code. ( #8144 )
2018-10-26 10:49:27 -07:00
Gymnasiast
37f59e17dc
Replace C-style isSloped() function
2018-10-04 12:13:17 +02:00
Michael Steenbeek
882a65e4c0
Port queue functions
2018-10-03 12:18:21 +02:00
Michael Steenbeek
897a2982a0
Move brake/booster speed functions to struct methods
2018-09-25 21:57:21 +02:00
Michael Steenbeek
e6d5638815
Move inverted() functions to struct methods
2018-09-25 21:57:21 +02:00
Michael Steenbeek
0cea008c18
Move cable lift functions to struct methods
2018-09-25 21:57:21 +02:00
Michael Steenbeek
69f02400f9
Move GetColourScheme to struct methods
2018-09-25 21:57:21 +02:00
Michael Steenbeek
a3e9c63fc3
Move GetRideIndex to struct methods
2018-09-25 21:57:21 +02:00
Michael Steenbeek
650971bc68
Move HasChain to struct methods
2018-09-25 21:57:21 +02:00
Gymnasiast
6bd732ce5a
Move getting seat rotation to struct methods
2018-09-25 21:57:21 +02:00
Gymnasiast
ae4c464ce7
Move getting track sequence to struct methods
2018-09-25 21:57:21 +02:00
Gymnasiast
8908f3f47e
Move getting track type to struct methods
2018-09-25 21:57:21 +02:00
Michael Steenbeek
1d3baef9b7
Remove some C-style tile element functions
2018-09-16 21:34:04 +02:00
Linus Unnebäck
fd07be587a
Remove Math::Clamp in favour of std::clamp
2018-08-12 16:47:12 +01:00
ζeh Matt
b25cb8c793
Scale mouse delta by zoom when using shift. ( #7868 )
...
* Scale mouse delta by zoom when using shift.
* Clamp maximum height of object drag.
* Address code review comments; add changelog entry.
2018-08-12 11:47:46 +02:00
Sijmen Schoon
f3f4776afd
Properly fix maze building when paused ( #7852 )
...
Also fixes two relevant bugs:
- The error message having no title
- Fixes the controls in the construction window activating when the initial placement fails because of e.g. the game being paused.
2018-08-04 14:30:13 +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
clang-format
e558660860
clang-format UI windows
2018-07-23 16:00:14 +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
36d123b272
Revert renaming of spinners ( #7650 )
2018-06-10 21:31:08 +02:00
Andy Ford
1acb1c4b35
Fix #7434 : Diagonal ride segments cannot be deleted if they are isolated
...
Mimic vanilla RCT2:
- If the isolated track is the last piece on the ride, delete and
set the construction mode to a straight piece. Rotate said piece
45 degrees anti-clockwise.
- If other track still exists, delete and rotate as above but
set the track type to station-platform.
- If banked, set track type to the turn that entered the previous
orientation. For example, north west banked track would continue
with a banked 45 degree turn starting facing west.
2018-06-10 17:34:37 +02:00
Aaron van Geffen
5b6ae9d9cb
Fix appearance of brake/booster speed widgets
2018-06-04 18:51:37 +02:00
Aaron van Geffen
f2b0f7457e
Terminology change: rename spinners to steppers.
2018-06-01 23:25:07 +02:00
Aaron van Geffen
e5f184b01b
Spinners for CustomCurrency, RideConstruction, ServerStart, ViewClipping.
2018-06-01 15:20:13 +02:00
Hielke Morsink
2fed57d792
Check for ghost flag when removing track blocks ( #7596 )
2018-05-31 22:36:45 +02:00
jensj12
50e3f8b4f6
Cleanup of ride_demolish
2018-05-23 16:33:37 +02:00
Michał Janiszewski
a2ef4bd699
Exclude pre-formatted blocks from clang-format ( #7520 )
...
[ci skip]
2018-05-16 20:41:29 +02:00
duncanspumpkin
fcb66b7449
Start refactoring pathfinding to use tileCoords
2018-05-05 11:42:34 +01:00
Michael Steenbeek
b725916808
Use TitleCase
2018-05-02 13:27:53 +02:00
Michael Steenbeek
ef433df26a
Clean up tile element usage, introduce struct methods
2018-05-02 11:58:12 +02:00
Toby Hinloopen
2fc01cb698
Fix #7424 : Do not auto-rotate shops to face queue paths
2018-04-30 14:54:26 +02:00
Albert Morgese
a3b04a67b2
Implement #1675 : Auto-rotate shops to face footpaths
2018-04-16 20:02:46 +02:00
Michał Janiszewski
cd065d4f41
Reduce includes in common header
2018-03-20 00:27:58 +01:00
Michael Steenbeek
88af2d3954
Rename sub_6CA2DF() to window_ride_construction_update_state()
2018-03-09 09:17:24 +01:00
ZehMatt
e3708c0593
Split special direction to new parameter.
2018-03-05 00:17:34 +01:00
ZehMatt
bdc1cf8adc
Refactor GAME_COMMAND_MAZE_SET_TRACK to game action.
2018-03-05 00:17:34 +01:00
Michael Steenbeek
bde913ee16
Rename SmallCoords and BigCoords
2018-02-15 22:26:50 +01:00
Michael Steenbeek
a2260929dd
Replace rct_xy_element with BigCoordsXYE
2018-02-15 22:26:50 +01:00
Marijn van der Werf
4c956def67
Update UI imports
2018-01-18 22:57:55 +01:00
ZehMatt
84f2917f59
Use const and constexpr whenever possible.
2018-01-11 22:29:08 +01:00
Michael Steenbeek
cd5a1ba888
Compile files in world folder as C++
2018-01-11 13:25:09 +01:00
Jeroen D Stout
0268be92cb
Prevent ride construction from setting tiles when scenery tool is active
2018-01-11 10:37:40 +01:00
Michał Janiszewski
469e142c7b
Change casing of header files
2018-01-11 09:30:09 +01:00
Aaron van Geffen
ecc1cfed2a
Rename WWT_DROPDOWN_BUTTON to WWT_BUTTON.
...
The previous name implied an exclusive association with dropdowns.
While used to display the dropdown triangle button, this is not an
exclusive use.
2018-01-08 00:01:32 +01:00
Ted John
83d1b6eb8f
Refactor widget.c to C++
2018-01-07 12:39:58 +01:00
Ted John
f18595a1c1
Refactor viewport.c to C++
2018-01-07 12:39:58 +01:00
Michael Steenbeek
755add6c9a
Compile localisation folder as C++
2018-01-06 18:32:25 +01:00
Gymnasiast
23d70a4ac9
Compile ride.c as C++
2017-12-31 20:43:17 +01:00
Michael Steenbeek
c4f44e5e7a
Compile files in paint folder as C++
2017-12-17 17:24:36 +01:00
Marijn van der Werf
1e946fc0fe
Move Dropdown to UI project
2017-12-16 15:47:38 +02:00
Michael Steenbeek
1a9975d683
Compile util and cheats as C++
2017-12-14 10:03:21 +01:00
Michael Steenbeek
6dc49d643a
Compile files in base dir as C++
2017-12-13 08:03:48 +01:00
Michael Steenbeek
e3c52360db
Remove most usages of separate flag
...
This removes most usages of the separate flag, instead relying on ride groups to do its job.
Research is more complicated and will follow in another commit.
2017-12-08 10:28:29 +01:00