Commit Graph

55 Commits

Author SHA1 Message Date
Michael Steenbeek c2565bfe1c
Merge pull request #10407 from duncanspumpkin/refactor_stations
Fixing COORDS_NULL: Refactor stations
2019-12-21 16:13:48 +01:00
Gymnasiast dcc720c1ec
Remove MakeXY16() 2019-12-21 13:51:59 +01:00
duncanspumpkin b3dafc64c3 Refactor to improve readability as per suggestions 2019-12-21 12:12:10 +00:00
duncanspumpkin 45403ac2d3 Move station_starts to TileCoordsXY 2019-12-21 11:48:13 +00:00
Michael Steenbeek a2b9598341
Modify code using Location8 to use isNull()/setNull() (#10403) 2019-12-21 11:34:46 +01:00
Tulio Leao 780e3265d1 Standardize Coords and TileCoords objects 2019-12-20 08:29:42 -03:00
Michael Steenbeek 6ede67d50a
Merge pull request #10371 from tupaschoal/coords-for-get-surface-element-at
Make map_get_surface_element_at only accept Coords objects
2019-12-19 13:24:17 +01:00
Michael Steenbeek f59f5d9b1f
Merge pull request #10375 from tupaschoal/coords-for-map-entrance-exit
Make map entrance/exit fetching functions use Coords objects
2019-12-19 11:39:37 +01:00
Tulio Leao aea755bd70 Allow TileCoordsXYZD to generate CoordsXYZD equivalent 2019-12-19 00:11:26 -03:00
Tulio Leao 5c657bde9f Remove map_get_surface_element_at operating with TileCoordsXY 2019-12-18 23:47:17 -03:00
Tulio Leao af281817c3 Use CoordsXYZD on map_get_wall_element_at() (#10374)
* Use CoordsXYZD on map_get_wall_element_at()

* Add CoordsXYZ::ToTileStart()
2019-12-18 11:23:53 +01:00
Tulio Leao 4f615c5802 Make const some methods of location objects (#10392) 2019-12-18 11:21:16 +01:00
duncanspumpkin 63b8f83f4f Make suggested changes 2019-12-15 08:23:21 +00:00
Tulio Leao 2ff4c28cb5 Use CoordsXY on action rotation (#10332)
* Use CoordsXY on action rotation

* Don't use intermediate CoordsXY variable just for Rotating it next

* Standardize operations on Coords and Rotated Coords

* Remove unwanted linebreak addition
2019-12-12 08:09:46 +00:00
Duncan 90bde58852
Merge pull request #10329 from tupaschoal/coords-for-windows-rotate
Use CoordsXY on TopToolbar and TrackDesignPlace rotations
2019-12-11 08:44:06 +00:00
Tulio Leao 68e0519c5e Remove Map::map_offset_with_rotation() 2019-12-09 17:55:57 -03:00
Tulio Leao aca4d39107 Allow TileCoordsXYZ conversion to CoordsXYZ 2019-12-05 21:43:20 -03:00
Tulio Leao 1532ee2b23 Create CoordsXY::ToTileStart() and CoordsXY::ToTileCentre() 2019-11-30 16:47:23 +01:00
Tulio Leao 2acdc577f7 Use Coords for windows/RideConstruction 2019-11-18 19:17:54 -03: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
Sijmen Schoon f7fd98fcf2
Add constexpr keywords 2019-11-01 02:07:14 +01:00
Duncan 28e7d90efb
Merge pull request #10127 from tupaschoal/fix-10126
Fix #10126: window movement inversed
2019-10-21 07:46:02 +01:00
Tulio Leao 6c35a0234e Fix CoordsXY sum and subtract operators (#10128) 2019-10-21 07:23:01 +02:00
Tulio Leao 08db611dd5 Fix #10126: window movement inversed 2019-10-20 23:44:26 -03:00
Tulio Leao 5f916b79ae Use ScreenCoordsXY for MouseInput (#10120) 2019-10-20 19:10:30 +02:00
Richard Fine 92f50efedc Formatting fixes 2019-09-01 19:10:27 +01:00
Richard Fine caa6ad71c7 Add direction_next and direction_prev helpers 2019-09-01 18:40:17 +01:00
Richard Fine 9123fa74d3 Add ALL_DIRECTIONS array 2019-09-01 18:40:14 +01:00
Richard Fine 6a673cc7be Introduce INVALID_DIRECTION constant 2019-09-01 16:08:01 +01:00
duncanspumpkin 927c8a4e85 Create ScreenCoords struct. Refactor 3d_to_2d again 2019-08-19 20:04:58 +01:00
duncanspumpkin cd81c1b45b Make CoordsXYZ derive from CoordsXY 2019-08-19 20:04:58 +01:00
duncanspumpkin 5ba9d55415 Refactor map_is_location_owned_or_has_rights to use CoordsXY 2019-08-19 20:04:57 +01:00
duncanspumpkin d7a725f1d5 Refactor fountain to use CoordsXY(Z) 2019-08-11 07:21:07 +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 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Michał Janiszewski a2bfb77b4a Make sure the header-only function `direction_valid` is `static` 2019-03-03 08:18:15 +01:00
duncanspumpkin 650e8291d0 Start moving track place into GameAction framework 2019-02-19 12:30:33 +00:00
Michał Janiszewski 838289abce Mark functions as static 2019-02-10 00:20:34 +01: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
IntelOrca b9fd90ffd3 Implement ClearAction. 2019-01-07 09:04:51 +01:00
Richard Fine 3b9dd87caf Make direction_reverse constexpr and pass arg by value
To make totally sure that the compiler understands it can fully compute the value at compile time when dealing with constant inputs, and to make totally sure there are no aliasing problems.
2019-01-06 11:58:28 +00:00
Richard Fine fd60654238 Add comments and direction_reverse function
Add a bit of Javadocs, and introduce helper function for reversing directions because the ^2 trick used elsewhere in the codebase is not immediately obvious exactly what it does.
2019-01-05 14:28:24 +00:00
Richard Fine 613c7e9bf3 Introduce 'Direction' typedef
Directions are used quite widely across the codebase, but right now we just use uint8_t for them. Defining a proper type makes the intention clearer.
2019-01-05 13:58:32 +00:00
Richard Fine b845304656 Equality operators for TileCoordsXYZ
Introduce operator == and operator != for TileCoordsXYZ, so that we can more easily operate on them in tests.
2019-01-02 14:11:28 +00:00
clang-format 5c55fd6132 clang-format world 2018-07-23 16:00:12 +02:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +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
Ted John c300f873f5 Refactor peep check for vehicle 2018-06-10 22:59:58 +01:00
Hielke Morsink 278f67e627 Consistent coords/tile definition order 2018-05-05 11:42:44 +01:00
duncanspumpkin 6efe2ab1c7 Further Tile conversion. Actually make it compile 2018-05-05 11:42:38 +01:00