Commit Graph

6582 Commits

Author SHA1 Message Date
Gymnasiast 682add27dd
Change ObjectEntryIndex null value to 0xFFFF 2020-07-23 12:45:42 +02:00
Gymnasiast 3060c2d8cb
Add const to conversion functions 2020-07-23 12:05:00 +02:00
Aaron van Geffen 37a1a1c0a2
Fix #12356: Opening SC4 or SV4 centres viewport on void (#12361) 2020-07-23 11:41:34 +02:00
Michael Steenbeek f567da04eb
Fix #12353: Research window shows wrong ride type 2020-07-22 23:21:08 +02:00
Duncan 4a235e3bb6
Refactor ResearchItem Type to an enum class (#12346)
* Change type of ResearchItem.type to enum class

This is to prevent any future issues caused by confusion as to what the type is and further improves the codebase.

* Specifiy a size for the type

Also remove the static cast where not required

* Apply review comments
2020-07-22 14:25:05 +01:00
0ro8lu 4416565e47
Close #12269: remove goto from x8_drawing_engine (#12274)
Refactored the function into a separate get dirty rows function.
2020-07-22 11:51:41 +01:00
Duncan 2d1a6bd13b
Fix research import/export (#12345)
Old version incorrectly tried to convert the research type not the base ride type causing crashes when new saves were used on older versions of OpenRCT2 or vanilla.
2020-07-22 09:42:16 +01:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Gymnasiast bc3ad044f8
Consistently use 'Circus' 2020-07-21 13:55:48 +02:00
Gymnasiast c2153ae797
Consistenly use 'Swinging Ship' 2020-07-21 13:55:48 +02:00
Tulio Leao d10b615eb3
Remove assert on ScreenLine (#12333)
Code is not always constructing a valid line
2020-07-20 18:49:15 -03:00
0ro8lu 6e077c42ea
Close #12270: Remove goto track_remove_station_element (#12323)
Refactored the goto statement
2020-07-20 20:55:50 +01:00
Umdlye 84c0ee42bd
Fix #12314: Swinging Ship colour tab shows Suspended Sw.c. track preview 2020-07-19 14:38:30 +02:00
ζeh Matt 2d81e9c51c
Fix #12229, fix #12312: No error message when loading a save fails 2020-07-19 14:33:32 +02:00
Michael Steenbeek 5c411390bd
Fix #12226: Crash in FindVehicleToEnter (#12310) 2020-07-18 23:54:55 +02:00
Michael Steenbeek 90129f669c
Fix #12305: Can no longer build boosters on Hyper-Twister 2020-07-18 21:43:36 +02:00
Michael Steenbeek 33898936b0
Merge pull request #12007 from Gymnasiast/refactor/remove-ride-groups
Close #11971: Replace ride groups with new ride types
2020-07-17 12:35:30 +02:00
frutiemax 77d02c5e2b
Close #12290: Refactor of object_manager_unload_objects (#12291) 2020-07-17 05:25:35 +01:00
rdbaris 8aa8d77ca1
Fix for smart pointer bug (#12293)
Don't allocate a ton of memory on load.
2020-07-17 05:23:05 +01:00
Gymnasiast 742ae947c7
Add null checks throughout 2020-07-17 00:32:47 +02:00
Gymnasiast d703768d5d
Use old ride types in RideTypesBeenOn 2020-07-17 00:19:49 +02:00
Gymnasiast 470497d868
Limit S6 Importer object lookup to ride types that need conversion 2020-07-17 00:19:49 +02:00
Gymnasiast f596d8de58
Limit track design object lookup to ride types where it's needed 2020-07-17 00:19:49 +02:00
Gymnasiast c6f0bb92a8
Add mutex during track design cache creation 2020-07-17 00:19:49 +02:00
Gymnasiast cf664c8340
Close #11971: Replace ride groups with new ride types 2020-07-17 00:19:49 +02:00
rdbaris a2493af9ce
Part of #11159 (purge malloc() & free()) (#11893)
* Used smart pointers

* Changed functions to take vector as input
2020-07-16 22:35:30 +01:00
frutiemax f49149222e
Close #12245: Use coords objects for SetLocation (Window_internal.h) 2020-07-16 23:01:42 +02:00
Helio Nunes Santos 2812be8c9a
Close #12252: remove of goto in function wall_remove_at (#12279)
* Removed use of goto in function wall_remove_at
* Implemented overload of function map_get_wall_element_at
2020-07-16 17:52:45 -03:00
Aaron van Geffen 79ae0786c0
Refactor more widgets definitions into new format
* About
* Editor Bottom Toolbar
* Editor Inventions List
* Editor Object Selection
* Error
* Finances
* Footpath
* Game Bottom Toolbar
* Guest List
* Network Status
* News
* News Options
* Player
* Research
* Staff List
* Title Options
* About window.

And fix MakeSpinnerWidgets declaration order.
2020-07-16 20:48:25 +02:00
frutiemax 31efe32ade
Related to #12160: Refactor viewport_coord_to_map_coord using Rotate (#12247) 2020-07-16 06:55:48 +01:00
frutiemax a961d9784f
Part of #12243: Use coords for MazeRemoveTrack (#12251) 2020-07-15 23:34:26 -03:00
frutiemax 0fa0ca451e
Part of #12245: Use coords for window_scroll_to_location (#12282) 2020-07-15 23:26:27 -03:00
frutiemax c474f2ddc0
Close #12096: Use only ScreenRect on gfx_fill_rect (#12280) 2020-07-15 22:34:57 -03:00
Michael Steenbeek d80f9b511f
Merge pull request #12255 from Gymnasiast/refactor/more-constants-in-track-curve
Refactor/more constants in track curve
2020-07-15 15:36:42 +02:00
frutiemax 31bea18ad6
Part of #12166: remove switch-case in bolliger_mabillard_track_flat 2020-07-15 13:34:36 +02:00
michael coates 01d0287ee2
Close #12253: Refactor Vehicle sound to remove goto (#12267)
* Refactor Vehicle Scream Sound goto

* updated contributors
2020-07-15 07:48:47 +01:00
Tulio Leao eaa53a3b8a Mark origin and size parameters as const 2020-07-14 23:36:24 +02:00
Aaron van Geffen f2df096053 Introduce new way of defining widgets
Inspired by OpenLoco's widget routines.
2020-07-14 23:36:20 +02:00
Michael Steenbeek 5c42765d2b
Merge pull request #12156 from tupaschoal/coords-train-creation
Change train creation to use CoordsXYZ
2020-07-14 15:54:36 +02:00
frutiemax c8b66dd289
Fix #12257: Fix refactoring of is_sprite_interacted_with_palette_set (#12258)
* Fix #12257: Change type of paint x/y to int32_t

This corrects an issue with integer conversions due to signness.

* Change types to 16bit and correct functions parameters

* Fix test paint.

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-07-14 12:20:53 +01:00
Gymnasiast b948302dc6
Use constants in gTrackCurveChain 2020-07-14 01:37:33 +02:00
Michael Steenbeek 1034aadb72
Merge pull request #12238 from frutiemax/Fix12223
Close #12223: Assert that Formatter::Add() only receives desired types
2020-07-14 00:05:37 +02:00
frutiemax 5f4e1ba344 Forbid usage of uint8_t* in formatter::Add 2020-07-13 17:40:04 -04:00
frutiemax 0272777d13 Close #12223: Assert that Formatter::Add() only receives desired types 2020-07-13 17:37:08 -04:00
Gymnasiast 88a5e4cd2a
Remove some unused constants 2020-07-13 22:09:28 +02:00
Gymnasiast 3c4721d014
Move some constants to RCT12.h 2020-07-13 22:04:50 +02:00
frutiemax b39a0037f0
Close #12164: Use Coords for place_virtual_track (#12240) 2020-07-13 16:37:10 -03:00
frutiemax 78e40f5358
Close #12160: Coords for is_sprite_interacted_with_palette_set (#12241) 2020-07-13 16:31:06 -03:00
frutiemax bcc27f4c73
Close #12161: Use CoordsXYE on peep_interact_with_shop (#12236) 2020-07-13 14:39:59 -03:00
frutiemax 09ad720dfc
Part of #12164: Use Coords for track_design_place_ride (#12233) 2020-07-13 14:38:39 -03:00
Michael Steenbeek e99f4a23c5
Add missing header (#12235)
std::memcpy is defined in <cstring>. The Docker CI would fail because this header was not included.
2020-07-13 18:26:20 +02:00
frutiemax b34381f030
Part of #12160: Use Coords for viewport_redraw_after_shift (#12231) 2020-07-13 13:22:40 -03:00
Duncan 7f28d65bf9
Fix #12213: Incorrect viewport invalidation on load (#12232)
Mistake made during implementation but issue only surfaces recently when the types were increased to 32bit. Removed #12210 as this was hiding the source issue and is no longer required.
2020-07-13 18:20:16 +02:00
frutiemax 6cc52bfb72
Part of #12161: Use CoordsXYE on peep_footpath_move_forward (#12217) 2020-07-13 17:51:57 +02:00
Michael Steenbeek 1cf89362f0
Merge pull request #12184 from IntelOrca/sea
Add support for reading .sea (RCT classic) files
2020-07-13 17:23:16 +02:00
Michael Steenbeek 132b2e5966
Fix #12071: Crash in Guest List when a guest dies (#12126)
Send refresh guest list intent on peep removal

Also added protection to guest list to prevent accessing invalid peeps
2020-07-13 09:31:04 -03:00
Aaron van Geffen b0a3fd82d9
Fix #12221: Map generation tool doesn't place any trees (#12222) 2020-07-13 12:35:49 +02:00
frutiemax e2ef82ca0a
Part of #12164: Use Coords for track_design_place_maze (#12218) 2020-07-12 19:02:28 -03:00
Thamara Andrade 0fb2a6216c
Close #12099: Use ScreenLine on gfx_draw_line (#12143) 2020-07-12 18:50:52 -03:00
frutiemax 27734e2971
Part of #12160: Use Coords for viewport_coord_to_map_coord (#12216) 2020-07-12 18:42:54 -03:00
Duncan b1f80efbe3
Use u8path on file path (#12205) 2020-07-12 21:56:02 +01:00
Ted John 3a93525a11 Add rename error message if sea file fails to open 2020-07-12 00:15:21 +01:00
frutiemax bc7f7248bb
Part of #12164: Use Coords for track_design_add_selection_tile 2020-07-11 19:13:57 +02:00
frutiemax 75afcb85c5
Part of #12161: Use CoordsXYE on peep_interact_with_entrance 2020-07-11 18:58:56 +02:00
frutiemax 508344a088
Close #12174: Remove Formatter additions with uintptr_t 2020-07-11 18:56:12 +02:00
Tulio Leao 76e7bfbf78
Fix load game showing edge of map 2020-07-11 18:19:28 +02:00
Tulio Leao 0758d0fe5c Prefer reference on ride_create_vehicles parameter 2020-07-11 12:21:46 -03:00
Tulio Leao de8bb169de Use CoordsXYZ on vehicle_create_trains 2020-07-11 12:21:44 -03:00
Tulio Leao 47db30f1d7 Use CoordsXYZ on vehicle_create_train 2020-07-11 12:21:09 -03:00
Tulio Leao 7921740938 Use CoordsXYZ on vehicle_create_car 2020-07-11 12:21:07 -03:00
frutiemax 76d899c8da
Part of #12160: Use Coords for is_sprite_interacted_with (#12207) 2020-07-11 16:55:27 +02:00
Ted John cca43eb9e1 Fix mingw build 2020-07-11 11:45:50 +01:00
Ted John 2b962577b9 Change mask to a vector 2020-07-11 11:40:34 +01:00
Ted John 8c81cacc6f Add sea decryption 2020-07-11 11:40:34 +01:00
frutiemax 805eec4153
Part of #12160: Use Coords for viewport_move (#12195) 2020-07-10 22:39:24 -03:00
frutiemax 98dbaae461
Part of #12161: Use CoordsXYE on peep_interact_with_path (#12193) 2020-07-10 22:35:29 -03:00
frutiemax 123d0cceb6
Close #12173: Remove Formatter additions with void* (#12196) 2020-07-11 03:06:23 +02:00
frutiemax 3948600cd0
Part of #12164: track_design_update_max_min_coordinates Coords (#12194) 2020-07-10 15:34:13 -03:00
Helio Santos 925d21eeda Part of #12159: update check_for_adjacent_station to use CoordsXYZ&
Update check_for_adjacent_station to use CoordsXYZ&. Updated caller(s) accordingly.
2020-07-10 11:00:00 -07:00
Helio Santos b0a4f2a97e Part of #12159: updated get_station_platform to use CoordsXYRangedZ
Updated get_station_platform function to use CoordsXYRangedZ. Updated caller(s) accordingly. Implemented constructor for CoordsXYRangedZ that takes a CoordsXYZ as argument.
2020-07-10 10:59:52 -07:00
Helio Santos fb9fab69a9 Part of #12159: Uses CoordXY on find_closest_mechanic
Updated find_closest_mechanic prototype to use CoordXY. Updated caller(s) accordingly.
2020-07-10 09:41:51 -07:00
Duncan 4dc4bbea92
Improve Sprite Misc Update (#12191)
* Use better types for SpriteMiscUpdate

* Change all sprite misc update functions to member functions
2020-07-10 14:16:03 +01:00
Tulio Leao e5e70688c5
Use big Z coords on some Ride station functions (#12192) 2020-07-10 08:40:42 -03:00
frutiemax 29e6db982b
Part of #12096: Prefer ScreenRect on gfx_fill_rect (#12187) 2020-07-09 23:32:38 -03:00
Jim b1600e14ae
Close #12177: Extract patrol offset and index calculation into method 2020-07-09 23:47:21 +02:00
Helio Santos f85319ec8e Part of #12165: Use CoordsXYZ on try_add_synchronised_station
Updated try_add_synchronised_station function prototype to use CoordsXYZ. Updated caller(s) accordingly.
2020-07-09 10:41:00 -07:00
Helio Santos a524b2d5ba Part of #12165: Use CoordsXYZ on vehicle_check_collision
Updated vehicle_check_collision function prototype to use CoordsXYZ. Updated caller(s) accordingly.
2020-07-09 10:41:00 -07:00
Helio Santos 69221606ef Part of #12165: Use CoordsXYZ on steam_particle_create
Updated steam_particle_create function prototype to use CoordsXYZ. Updated caller(s) accordingly.
2020-07-09 10:41:00 -07:00
Tulio Leao f29abf6953
Part of #11389: Use Formatter on Ride::FormatStatusTo (#12172) 2020-07-09 18:54:30 +02:00
Jimver bda0126539
Part of #12162: Use CoordsXY on staff_is_patrol_area_set 2020-07-09 14:20:37 +02:00
Jimver e4c4c611eb
Part of #12162: Use CoordsXY on staff_set_patrol_area 2020-07-09 14:17:41 +02:00
Jimver eb753261a1
Part of #12162: Use CoordsXY on staff_toggle_patrol_area 2020-07-09 14:12:32 +02:00
Tulio Leao 2d169bc5a2
Merge pull request #12158 from tupaschoal/ratings-coords
Generic RideRatingCalculationData improvements
2020-07-08 15:51:38 -03:00
Jim 0248621502
Increase handyman randomness in queue (#12145)
* Increase randomness when handyman is on queue path

* Add myself to contributors

* Refactor hex variable probabilities

* Add check if queue is connected to a ride

* Update changelog

* Bump network version

* Update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-07-08 19:48:08 +01:00
Tulio Leao bd9cf4ceaa Rename RideRatingCalculationData::NumOf.. to AmounfOf 2020-07-08 14:15:33 -03:00
Tulio Leao d2d48cf0ac Use TitleCase on RideRatingCalculationData 2020-07-08 14:10:43 -03:00
frutiemax bf2b8073cb
Part of #12096: ScreenRect for gfx_fill_rect in libopenrct2 (#12109) 2020-07-08 14:07:26 -03:00
Tulio Leao 2f32a094ee Use CoordsXYZ for RideRatingCalculationData::proximity_start 2020-07-08 13:41:40 -03:00
Tulio Leao d662de202f Use CoordsXYZ for RideRatingCalculationData::proximity 2020-07-08 13:36:54 -03:00
Tulio Leao 2b91d432f3 Use CoordsXYE for ride_ratings_score_close_proximity_loops_helper 2020-07-08 13:18:04 -03:00
frutiemax 280a21fa30
Fix #12095: Use ScreenRect on gfx_set_dirty_blocks (#12106) 2020-07-08 13:16:24 -03:00
Tulio Leao b69d48c3ed
Merge pull request #12154 from tupaschoal/coords-text
Use only ScreenCoordsXY for Text.cpp
2020-07-08 12:30:21 -03:00
Tulio Leao d95a0268ef
Merge pull request #11909 from Gymnasiast/fix/more-constants
Use more constants/specific types
2020-07-08 10:18:11 -03:00
Tulio Leao 59236443ba Make StaticLayout::Draw use ScreenCoordsXY 2020-07-08 10:15:02 -03:00
Tulio Leao dabde880cd Make DrawTextEllipsisedCompat use ScreenCoordsXY 2020-07-08 10:13:03 -03:00
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
Gymnasiast 7cc510f6b7
Increment network version 2020-07-07 21:14:16 +02:00
Gymnasiast bf5ffdf497
Clean up favourite ride 2020-07-07 21:13:42 +02:00
Gymnasiast e8d6383f57
Clean up voucher arguments 2020-07-07 21:13:40 +02:00
Gymnasiast db764445ed
Clean up photo refs 2020-07-07 21:13:10 +02:00
Gymnasiast 65fa08ef35
Clean up GuestHeadingToRideId 2020-07-07 21:13:10 +02:00
Gymnasiast 0dd5b3bbda
Clean up current_ride 2020-07-07 21:13:09 +02:00
Duncan 8c1aa43ef4
Add TryGetEntity to fetch entity objects easily (#11979)
Implement TryGetEntity and use it
2020-07-07 13:13:22 -03:00
Duncan 94b3598102
Tiny GetEntity Refactor (#12124)
* Use default template parameter instead of specialising

* Fix null deref issues
2020-07-06 22:02:25 +01:00
Hudson Oliveira 8b5f3b58c5
Part of #9473: Create Vehicle::UpdateMotionCollisionDetection (#11949)
Converted from vehicle_update_motion_collision_detection
2020-07-06 13:57:09 -03:00
Michael Steenbeek f7b42a0254
Merge pull request #11980 from duncanspumpkin/CreateSprite8
SpriteList enum class
2020-07-06 15:21:16 +02:00
Thamara Andrade 8ce799a72e
Close #12118: Prefer foward declaration of *Coords* in headers (#12142)
* Removing unnecessary world/Location includes in headers
* Prefer foward declaration of *Coords* in header files
Closes #12118
2020-07-06 10:10:39 -03:00
Tulio Leao f725fff2da
Clarify CoordsRange-derived interface methods (#12127) 2020-07-06 14:42:11 +02:00
duncanspumpkin 57d2877e67 Provide accesor function for get entity list count 2020-07-05 07:28:38 +01: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
frutiemax bee0b4b82d
Part of #11159: Optimize util_zlib_deflate return (#12111) 2020-07-04 09:21:50 -03:00
duncanspumpkin 64ab101b4e Fix formatting and comment 2020-07-04 07:38:11 +01:00
duncanspumpkin e51bbeed23 Convert SPRITE_LIST to an enum class 2020-07-04 07:38:11 +01:00
duncanspumpkin 2d28ca3b28 Remove broken check_for_spatial_index_cycles
There were a number of issues with this function. It was calling index_is_in_list with invalid SPRITE_LISTs. The spatial index is no longer needed to be correct on save/load as it is rebuilt so that it is kept in order.
2020-07-04 07:38:11 +01:00
DrunkBlood 55f0f34fe0
Close #12101: gfx_draw_dashed_line to use ScreenLine (#12116) 2020-07-03 18:05:18 -03:00
frutiemax d969e93ea1
Fix #12112: Move TrackColourPreviews to RideTypeDescriptors (#12114) 2020-07-03 22:15:11 +02:00
Tulio Leao 3ba505e5bd
Merge pull request #11956 from hdpoliveira/loc_6DB38B
Simplify code related to V-angle and bank
2020-07-03 15:16:08 -03:00
Tulio Leao 99b39f04e7
Do not try to force dimensions of a rectangle (#12115) 2020-07-03 09:28:30 +02: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
frutiemax 26ae2dbf04
Part of #11437: Move PlatformFileExists to Platform2.h (#12077) 2020-07-02 12:03:31 -03:00
annoyingdroid 5056872676
Close #12087: Use ScreenCoordsXY on gfx_filter_pixel (#12102) 2020-07-02 11:08:46 -03:00
Duncan cd716ca4aa
Fix #12093. Incorrect position and animation of staff tab. (#12094)
Mistake made when refactoring transposed two digits. Additional mistake made when removing a variable that was unused that changed the memory layout of the window. This meant that a part of the code that accessed a different variable in a union fetched the wrong memory. This was a mistake ultimately made during implementation.
2020-07-02 09:19:19 -03:00
Michael Steenbeek 920115448e
Merge pull request #12088 from tupaschoal/coords-extract-reuse
Generic coords structs for reusability
2020-07-02 12:07:10 +02:00
Casey Johnson 2e0f0d3821
Fix #12062: Add chain lift to Flying Coaster pieces when inverted (#12091) 2020-07-02 10:40:59 +02:00
Casey Johnson fc43494d74
Feature: Add Boosters to Wooden Roller Coaster (#12090) 2020-07-02 01:52:33 +02:00
Tulio Leao b5195f77c4 Reuse Rectangle definitions for ScreenRect and MapRange 2020-06-30 09:44:28 -03:00
Tulio Leao a86a60cbf5 Extract ScreenRect from Graph for reusability 2020-06-30 09:32:22 -03:00
Tulio Leao 5ce65eb7dc Create ScreenLine struct 2020-06-30 09:26:42 -03:00
Tulio Leao 70e245a1c3 Add Coords constructor to Map and CoordsRange 2020-06-30 09:12:14 -03:00
Tulio Leao 701f7f6d67 Extract base CoordsRange class from MapRange
Enforce MapRange to be rectangle shaped
2020-06-30 09:00:20 -03:00
Gymnasiast 8b6cb7e943
Add config enum name for Forint 2020-06-30 11:27:01 +02:00
Gymnasiast fe402f8bc4
Fix name of 'Deutsche mark' 2020-06-30 11:24:42 +02: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
Duncan c723a1a314
Fix #12079: incorrect drawing of attached paint structs (#12082)
* Fix #12079: incorrect drawing of attached paint structs

The issue is caused by the paint_struct x and y coordinates being incorrectly marked as unsigned. Unfortunately they cannot easily be converted without careful rework. Therefore this is a stop gap until the type is changed to preferably a ScreenCoords.
2020-06-29 19:13:23 -03: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
frutiemax 5ae592ec79
Part of #11437: Move GetDateLocal and GetTimeLocal in Platform2.h 2020-06-28 21:46:14 +02:00
frutiemax fec55f590f
Part of #11159: limit_autosave_count uses std::vector instead of utf8** (#12054) 2020-06-28 09:12:13 +01:00
TomasZilinek f08206a5d0
Fix #11963 - Refactor Peep::OutsideOfPark (#12060)
* Fix #11963 - Refactor Peep::OutsideOfPark

Changed the definition of Peep::OutsideOfPark from uint8_t to bool and refactored all its occurences in code accordingly.

* Fix #11963 - Refactor Peep::OutsideOfPark

One forgotten instance of Peep::OutsideOfPark occurrence

* Fix #11963 - Refactor Peep::OutsideOfPark

Fix code according to a review suggestion.
2020-06-28 08:39:30 +01:00
Aaron van Geffen 2cb5402069 Introduce widget::textTop 2020-06-26 19:39:30 +02:00
Aaron van Geffen 2e153a7e95 Introduce widget::midX and widget::midY helper functions 2020-06-25 10:31:15 +02:00
Aaron van Geffen 681b8d7938
Introduce widget::width and widget::height helper functions (#12053) 2020-06-24 22:44:00 -03:00
frutiemax 14a07359b3
Part of #11389: Use formatter class for Ride::FormatNameTo (#12041) 2020-06-24 21:02:08 -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
Michael Steenbeek f330a22df1
Merge pull request #12030 from tupaschoal/more-coords-stuff
Small CoordsXY* Refactor
2020-06-24 13:07:37 +02: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 d2542194fa
Part of #11437: move window_setup_file_association(s) in Platform2.hpp 2020-06-23 22:58:40 +02:00
frutiemax 6e47385b90
Part of #11389 : in peep class, FormatTo* use Formatter class (#12035) 2020-06-23 14:52:08 +01:00
frutiemax 32c342e88d
Part of #11389: Remove FormatTexto that take void* in banner struct (#12034) 2020-06-23 14:50:56 +01:00
Tulio Leao abcb50ff96 Make staff_can_ignore_wide_flag use CoordsXYZ 2020-06-23 00:13:01 -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
Tulio Leao caeed92cf0 Make staff_is_location_on_patrol_edge use CoordsXY 2020-06-21 16:41:18 -03:00
Tulio Leao 1a7943a5ab Make DrawOpenRCT2 use ScreenCoordsXY 2020-06-21 16:30:58 -03:00
Tulio Leao f535a4a0c4 Remove undefined and unused wall_remove function 2020-06-21 16:26:51 -03:00
Tulio Leao ad529c7f6c Use const ref on MoneyEffect::Create 2020-06-21 14:32:01 -03:00
Tulio Leao f6dae982a6 Make MoneyEffect::CreateAt use CoordsXYZ 2020-06-21 14:32:01 -03:00
Tulio Leao 3c75481d8a Make litter_can_be_at use CoordsXYZ 2020-06-21 14:32:01 -03:00
Tulio Leao 40a7dfbb24 Make litter_create use CoordsXYZD 2020-06-21 14:32:01 -03:00
Tulio Leao 7622ca513e Make litter_remove_at use CoordsXYZ 2020-06-21 14:06:56 -03:00
Tulio Leao e24de95b82 Make sprite_get_first_in_quadrant use CoordsXY 2020-06-21 14:03:35 -03:00
Tulio Leao f329644dd5 Make sprite_misc_explosion_flare_create use CoordsXYZ 2020-06-21 14:00:37 -03:00
Tulio Leao 2e31a7d64d Make sprite_misc_explosion_cloud_create use CoordsXYZ 2020-06-21 13:58:13 -03:00
Tulio Leao ae1e9b75ed Make sprite_set_coordinates use CoordsXYZ 2020-06-21 13:50:54 -03:00
Tulio Leao d5c7063214 Make create_balloon use CoordsXYZ 2020-06-21 13:43:42 -03:00
Tulio Leao 15bad3898d Make crash_splash_create use CoordsXYZ 2020-06-21 13:41:11 -03:00
Tulio Leao 030686dc6b Make crashed_vehicle_particle_create use CoordsXYZ 2020-06-21 13:35:43 -03:00
Hudson Oliveira 0d20b52949
Part of #9473: Vehicle sounds update functions (#12001)
* Extract functions for sound frequency

* Pass only SoundId and volume to sounds update

* Create class Sound

* Pass only the corresponding Sound object

* Unify update sound functions

* Fix compilation errors

* Rename Sound1|2 to TrackSound and OtherSound
2020-06-21 17:16:32 +01: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
Hudson Oliveira d82789733e
Part of #9473: Create Vehicle::Sub6DBF3E (#12013) 2020-06-20 16:21:23 -03:00
Duncan f204785c5c
Fix Action Location for SurfaceSetStyle (#12012)
LocationValid function was not being called in LandSmoothAction. This did not cause issues as the nested call to land set height would check for valid locations.
2020-06-20 16:17:52 -03: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
Michael Steenbeek 82618f2441
Merge pull request #11972 from Gymnasiast/fix/7324
Fix #7324: Research window shows vehicle name instead of ride name
2020-06-20 13:46:31 +02:00
Hudson Oliveira 28c9ddd706
Part of #9473: Create Vehicle::GetRideEntry (#12003) 2020-06-20 00:25:40 -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 8c77d31c54
Merge pull request #11998 from hdpoliveira/move_info
Part of #9473: Create GetMoveInfo and GetTrackProgress
2020-06-20 00:09:28 -03:00
Michael Steenbeek 934673115f
Merge pull request #11993 from hdpoliveira/animate_door
Part of #9473: Scenery door functions
2020-06-19 23:43:31 +02:00
Gymnasiast f8699d1244
Apply review requests; fix error; remove debug code 2020-06-19 23:35:18 +02:00
frutiemax 57b50e46df
Part of #11964: Move RideTypeEnumNames to RideTypeDescriptors 2020-06-19 23:03:24 +02:00
Gymnasiast 5029f754ed
Fix #7324: Research window shows vehicle name instead of ride name 2020-06-19 22:50:53 +02:00
hdpoliveira f5ac20176b Use template parameter 2020-06-19 17:42:09 -03:00
hdpoliveira 92584d57f0 Use CamelCase on function name 2020-06-19 17:38:57 -03:00
hdpoliveira c35556d754 Use CamelCase on track functions 2020-06-19 17:35:21 -03:00
frutiemax 51f32130b3
Part of #11964: Merge RideColourKey in RideTypeDescriptor (#11996) 2020-06-19 20:21:16 +02:00
hdpoliveira 0bdbcbcd88 Part of #9473: Create Vehicle::GetTrackProgress 2020-06-19 15:02:35 -03:00
hdpoliveira f33f3c07bd Part of #9473: Create Vehicle::GetMoveInfo 2020-06-19 15:02:35 -03:00
hdpoliveira 23afe3c453 Extract function animate_scenery_door 2020-06-19 14:41:07 -03:00
hdpoliveira 066ae4d58d Add const to methods 2020-06-19 14:41:05 -03:00
hdpoliveira 06a3f01730 Create Vehicle::UpdateSceneryDoorBackwards 2020-06-19 14:40:36 -03:00
hdpoliveira 64b6e2a2ee Create Vehicle::UpdateSceneryDoor 2020-06-19 14:40:32 -03:00
Hudson Oliveira ea9dd60b91
Part of #9473: Create Vehicle::UpdateGoKartAttemptSwitchLanes (#11995) 2020-06-19 14:06:21 -03:00
frutiemax 57b121d448
Part of 11964: move RideColourPresets to RideTypeDescriptors 2020-06-19 18:04:43 +02:00
hdpoliveira 93b2872747 Rename v-angle to pitch and bank to roll 2020-06-19 12:23:16 -03:00
hdpoliveira 4ce425b436 Fix type issues 2020-06-19 11:18:59 -03:00
hdpoliveira 23cf4b580e Remove global _vehicleVAngleAndBank 2020-06-19 11:17:46 -03:00
hdpoliveira affa0dd30b Create struct VAngleAndBank and simplify code 2020-06-19 11:16:52 -03:00
Tulio Leao 6a8d9007e2
Close #11614: Require plugins to specify their license 2020-06-19 16:14:33 +02:00
hdpoliveira d3d853b7d6 Make loc_6DB38B receive only the update flag 2020-06-19 11:14:02 -03:00
Olivier Wervers e280b413c0
Fix plugin get car entities returning null elements (#11988) 2020-06-18 21:50:06 +01:00
Michael Steenbeek ab9b8cd57e
Merge pull request #11983 from frutiemax/11964_RatingsCalculate 2020-06-18 18:22:11 +02:00
frutiemax 642f4f83a8 Merge RideRatingsCalculateFuncTable in RideTypeDescriptor 2020-06-18 09:29:27 -04:00
Michael Steenbeek 5e8a3a709d
Merge pull request #11976 from Gymnasiast/refactor/vehicle-preference
Move build menu preference to objects themselves
2020-06-17 23:41:10 +02:00
Duncan bb34213b93
MapCanConstructAt refactor (#11977)
* Start using MapCanConstructAt

* Fix #11675. Pass the full error message arguments on peep pickup

This was causing a crash as the error message arguments were being cleared which would mean eventually a nullptr dereference would happen.
2020-06-17 22:35:13 +01:00
Michael Steenbeek 2013e1a36f
Merge pull request #11974 from Gymnasiast/refactor/ride-type-misc
Refactor/ride type misc
2020-06-17 23:15:30 +02:00
Michael Steenbeek 8a4724a691
Move covered track piece availability to RTD 2020-06-17 23:15:05 +02:00
frutiemax f6eb9f1cc5
Merge RideRatings in RideTypeDescriptor structure (#11975) 2020-06-17 22:22:52 +02:00
Gymnasiast 2ee21e360c
Bump network version 2020-06-17 21:46:54 +02:00
Gymnasiast c77d500394
Move build menu preference to objects themselves 2020-06-17 21:46:37 +02:00
Michael Steenbeek e2b187c24a
Merge pull request #11921 from duncanspumpkin/CreateSprite6
Entity List Iterator
2020-06-17 21:28:36 +02:00
Gymnasiast 2a9c2be7d0
Remove unused function 2020-06-17 19:11:02 +02:00
Gymnasiast 682b15343b
Create RCT2_RIDE_TYPE_COUNT 2020-06-17 19:10:39 +02:00
frutiemax de1c172c74
Move RideProperties and rideBonusValue to RideTypeDescriptors
Part of #11964.
2020-06-17 18:59:04 +02:00
Gymnasiast f0872ab7b8
Replace 'bumper cars' with 'dodgems' 2020-06-17 18:13:00 +02:00
Gymnasiast 9e702d9e01
Replace 'Bathroom' with 'Toilet' 2020-06-17 18:12:13 +02:00
Olivier Wervers 66c3d8d828
Expose park name to plugins (#11970) 2020-06-17 17:33:38 +02:00
Michael Steenbeek 5e3a99a9ac
Move RideTypeTrackPaintFunctionsOld declaration to TestPaint (#11969) 2020-06-17 13:52:10 +02:00
Michael Steenbeek 97b99122de
Merge pull request #11962 from Gymnasiast/refactor/rtd-rtd-rtd
Move RideNaming, RideHeights and max mass to RTDs
2020-06-17 13:06:26 +02:00
Michael Steenbeek ba5e730c06
Rename UpdateFlag to HasUpdateFlag; refactor to bool (#11966) 2020-06-17 00:05:37 -03:00
Gymnasiast f16a80a481
Fix typo in VEHICLE_UPDATE_FLAG_ON_BREAK_FOR_DROP 2020-06-16 23:31:34 +02:00
Gymnasiast 96678a14eb
Move ride naming to RTD
This also means that all unused ride types will now have the same name. I have made an exception for the 'arbitrary ride type change' dropdown only.
2020-06-16 22:52:48 +02:00
Duncan 50d22ededd
Create a hookable location checking function for actions (#11860)
* Create a hookable location checking function for actions

* Add location valid to a number of game actions

Actually pass the coordinates to the script

Use LocationValid on further game actions

Add further actions to the LocationValid. Update api

Update remaining actions to use LocationValid

* Fix bug with peep pickup

Adjust api
2020-06-16 20:57:11 +01:00
duncanspumpkin 8eb7356320 Simplify iterator class 2020-06-16 20:27:44 +01:00
duncanspumpkin 6ed17b4ff9 Remove FOR_ALL_PEEPS/GUESTS/STAFF macros
Replaced with an EntityList iterator

Fix formatting

Fix nullptr issues
2020-06-16 20:27:44 +01:00
duncanspumpkin c45a0536eb Use new class 2020-06-16 20:27:40 +01:00
duncanspumpkin 225ae3a0a9 Add EntityList iterator 2020-06-16 20:26:56 +01:00
duncanspumpkin a30374d200 Use new iterator
Fix mac builds

Fix minor mistake

Fix vehicle loops
2020-06-16 20:25:47 +01:00
duncanspumpkin 133d8c4a0a Implement GetSprite and use it in a number of places
This will eventually replace all of the get_sprite and try_get_sprite calls

Further use of GetSprite

Use GetSprite in all remaining easy to use functions

Correct formatting

Rename GetSprite to GetEntity

Make suggested changes

Remove const to allow for building

Fix crashes due to next sprite
2020-06-16 20:25:03 +01:00
duncanspumpkin 904e6c6987 Implement GetSprite and use it in a number of places
This will eventually replace all of the get_sprite and try_get_sprite calls

Further use of GetSprite

Use GetSprite in all remaining easy to use functions

Correct formatting

Rename GetSprite to GetEntity

Make suggested changes

Remove const to allow for building

Fix crashes due to next sprite
2020-06-16 20:21:56 +01:00