Commit graph

429 commits

Author SHA1 Message Date
Matt
965041b437
Remove direct access to DirectionX and DirectionY 2021-02-21 09:52:33 +02:00
Ted John
1523597b50 Fix test failures 2021-02-16 20:25:11 +00:00
ζeh Matt
6186766a05
Introduce TileElementsView (#13975)
* Simplify TileElement type conversation

* Introduce TileElementsView

* Move TileElementsView code into TileElementsView.h

* Cleanup code and move into OpenRCT2 namespace

* Use reference instead of pointer

* Fix include

* Make GCC happy

* Move the cast functions into base

* Use the cast function instead of reinterpret_cast

* Add TileElementsView tests

* Fix iterating on TileElementBase, return pointer not reference
2021-02-04 18:58:45 +02:00
Michael Steenbeek
e3a1af3d05
Use getters/setters for track type and direction 2021-01-30 15:16:17 +01:00
Duncan
eb52391b9a
Remove next_in_quadrant (#13754)
* Use std::vector of quadrants

* Prevent ptr invalidation issues

* Remove next_in_quadrant

* Make review changes

* Rebuild next_in_quadrant for S6Export

* Fix formatting

* Constexpr where possible

* Increment network version and update replays
2021-01-23 07:36:46 +00:00
Matt
6034cef358
Fix replay snapshots comparing states with different ticks 2021-01-22 15:35:16 +02:00
Duncan
f80531070b
Implement EntityLists (#13853)
* Implement EntityLists

* Remove dead code

* Use alternative name for iterator

* Add comments

* Increment network version

* Update replays

* Remove further dead code

* Update replays again
2021-01-21 18:36:34 +00:00
ζeh Matt
78f6e3e8e3
Fix replays not failing when last tick is the cause (#13834)
* Fix replays never failing

* Change replay dependency meta

* Stop replay when state mismatches
2021-01-14 13:48:12 +00:00
skdltmxn
7ef4d7762f
Refactor to avoid unnecessary copies (#13736)
* Refactor to avoid unnecessary copies

* Fix dangling references
2021-01-11 18:14:15 -03:00
Mathias Gibbens
b1e5a11bf3
Several more spelling fixes (#13752)
Signed-off-by: Mathias Gibbens <mathias@calenhad.com>

Co-authored-by: Mathias Gibbens <mathias@calenhad.com>
2021-01-10 18:23:35 +00:00
Duncan
d5ada2dca1
Remove type from SpriteBase (#13735)
* Move type field into sub structures

* Use type for misc_type

* Use type for l_type

* Rename to SubType

* Rename SpriteGeneric to MiscEntity

* Rename generic to misc

* Add extra nullptr checks for compilers that cant understand

* Make review changes

* Increment network version

* Update replays
2021-01-10 15:14:34 +00:00
Michael Steenbeek
1da6ae6b51
Merge pull request #13710 from skdltmxn/refactor/string_view
Refactor/string view
2021-01-10 13:37:01 +01:00
skdltmxn
b0a8ebc808
Refactor to use push_back more efficient (#13726) 2021-01-08 20:59:55 +00:00
skdltmxn
e1cfa8693f Use c_str() instead of data() 2021-01-07 04:28:19 +09:00
skdltmxn
c093a50f3f Refactor to use string_view more properly 2021-01-07 01:52:10 +09:00
Matt
c442ef6207
Improve performance of tweening entities between ticks 2021-01-05 00:26:58 +02:00
Matt
c2fd7708ad
Use char_traits for length 2021-01-02 16:46:05 +02:00
Matt
2ef4dd23aa
Replace std::stringstream with custom string buffer 2021-01-02 16:46:05 +02:00
Matt
cb719a6e10
Add missing case statements for entity scripting 2021-01-02 15:31:26 +02:00
Matt
5f2945d238
Refactor MISC_SPRITE to strong enum 2021-01-02 15:30:44 +02:00
csunday95
51faec5c50
Close #13637: Refactor sprite compiler for filesystem efficiency
- sprite building would save a file with just the sprite file header
   and then immediately open it again at the beginning of compilation
 - sprite file generation is now entirely in memory until the final
   output file is saved on success
 - added validation of no file activity in the failed build test case;
   failed builds will not generate a file or edit an existing one
2020-12-29 13:12:55 +01:00
Tulio Leao
af0ec60bed Close #13626: Refactor RCT2LanguageId to strong enum 2020-12-23 20:07:54 -03:00
csunday95
fa5437f920
Fix #13611: Zero under decimal is not displayed (#13618)
* fix for bug #13611; handled too few sig figs fixed point case

* added unit test cases to cover modified fixed point code

* removed blank line to satistfy clang-format

* sorted includes in formatting tests for clang-format

* removed redundant static_cast

 - already a char literal and assigning to char[] so code
 is functionally equivalent
2020-12-22 09:45:45 +00:00
Adam
f09b14ef2b
Split actions hpp files into separate h and cpp files (#13548)
* Split up SmallSceneryPlace/Remove

Added undo function for Remove Scenery

* Refactor: Balloon and Banner actions hpp=>h/cpp

* Refactor: rename all action *.hpp files to *.cpp

This is preparation for separation in later commits. Note that without
the complete set of commits in this branch, the code will not build.

* Refactor Clear, Climate, Custom, and Footpath actions hpp=>h/cpp

* VSCode: add src subdirectories to includePath

* Refactor Guest actions hpp=>h/cpp

* Refactor Land actions hpp=>h/cpp

* Refactor LargeScenery actions hpp=>h/cpp

* Refactor Load, Maze, Network actions hpp=>h/cpp

* Refactor Park actions hpp=>h/cpp

* Refactor/style: move private function declarations in actions *.h

Previous action .h files included private function declarations with
private member variables, before public function declarations. This
commit re-orders the header files to the following order:
- public member variables
- private member variables
- public functions
- private functions

* Refactor Pause action hpp=>h/cpp

* Refactor Peep, Place, Player actions hpp=>h/cpp

* Refactor Ride actions hpp=>h/cpp

* Refactor Scenario, Set*, Sign* actions hpp=>h/cpp

* Refactor SmallScenerySetColourAction hpp=>h/cpp

* Refactor Staff actions hpp=>h/cpp

* Refactor Surface, Tile, Track* actions hpp=>h/cpp

* Refactor Wall and Water actions hpp=>h/cpp

* Fix various includes and other compile errors

Update includes for tests.
Move static function declarations to .h files
Add explicit includes to various files that were previously implicit
(the required header was a nested include in an action hpp file, and the
action .h file does not include that header)
Move RideSetStatus string enum to the cpp file to avoid unused imports

* Xcode: modify project file for actions refactor

* Cleanup whitespace and end-of-file newlines

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-12-10 06:39:10 +00:00
Duncan
9cbdae2ef1
Peep::ItemFlags merging (#13511)
* Merge standard and extra item flags for peeps

* Update replays
2020-12-09 09:21:23 +00:00
Ted John
ec03ce5317 Improve handling of braces 2020-11-27 18:54:57 +00:00
Ted John
9173ec2111 Handle int64 edge cases in Format 2020-11-27 18:54:57 +00:00
Ted John
fd605d7399 Apply review comments and fix build 2020-11-27 18:54:57 +00:00
Ted John
c7fea71db5 Add test for codepoint view 2020-11-27 18:54:57 +00:00
Ted John
92fcdfbd9b Fix GCC compiler errors 2020-11-27 18:54:57 +00:00
Ted John
644f7f07b3 Implement legacy format string 2020-11-27 18:54:56 +00:00
Ted John
6294188e93 Implement multi-level formatting for template FormatString 2020-11-27 18:54:56 +00:00
Ted John
6c23da4965 Implement multi-level formatting for any implementation 2020-11-27 18:54:56 +00:00
Ted John
43842bb668 Refactor some formatting code 2020-11-27 18:54:56 +00:00
Ted John
0e0c581258 Implement for format token types 2020-11-27 18:54:56 +00:00
Ted John
b07bc6b0ab Add FmtString class 2020-11-27 18:54:56 +00:00
Ted John
8cb3103cc7 Add a dynamic format string function 2020-11-27 18:54:55 +00:00
Ted John
14377be487 Create new templated format string 2020-11-27 18:54:55 +00:00
Hielke Morsink
f0c1ea1d37
Split declarations and definitions to improve compile times when editing (#13332)
* Split FileStream declarations and definitions

* Split JobPool declarations and definitions

* Split StringBuilder declarations and definitions

* Split StringReader declarations and definitions

* Split ZoomLevel declarations and definitions

* Fix missing include in FileClassifier.cpp

* Remove pragma once from source files

* Fix missing include in StringBuilder.h

* Update Xcode project

* Fix compilation of tests

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-11-07 12:42:04 +00:00
Michael Steenbeek
92a5f1aa24
Merge pull request #13310 from ju-pinheiro/sprite-identifier-strong-enum
Close #12450: Refactor SPRITE_IDENTIFIER to use strong enum
2020-11-06 16:55:01 +01:00
Richard Fine
438b197b80
Debunch peeps (#12917)
* Stop guests from being forced to the center line of a path over time

Change the way we apply randomness to peep destinations when moving from one tile to the next, to allow peeps that are moving along a straight path to maintain their perpendicular offset relative to the path direction, instead of being (eventually) forced back to the center line.

* Update test expectations

The changes to guest movement mean that the number of steps taken for these expected paths are now slightly different to before.
2020-11-03 22:30:36 -03:00
ju-pinheiro
a31c958004 Adding missing SpriteIdentifier enumerations to switch statements 2020-10-27 18:52:56 -03:00
ju-pinheiro
bb16ca075b Close #12450: Refactor SPRITE_IDENTIFIER to use strong enum 2020-10-27 13:26:27 -03:00
aw20368
0c195d14b9
Close #8848 Refactor TimeInPark (#13146)
Split TimeInPark into a union: ParkEntryTime for guests, HireDate for staff
2020-10-12 21:36:38 -03:00
Duncan
1207434afa
Add test cases for updated logical sort (#13143) 2020-10-10 13:37:56 +01:00
Tulio Leao
bace4d62f8 Specify SYSTEM includes on CMAKE builds 2020-10-09 01:28:34 -03:00
Łukasz Pękalski
d1cd2e08b5
Close #12388, refactor PeepState to use strong enum (#12927)
* Close #12388, refactor:PeepState to use strong enum

* refactor: refactored file PlayTests.cpp

* refactor: change PEEP_STATE_ to PeepState:: and camel case after merging

chore: code reformatting
2020-09-28 15:51:49 -03:00
Michael Steenbeek
6b9f83a5a4
Fix compilation on Linux and macOS 2020-09-18 19:46:12 +02:00
Gymnasiast
4ff77ebc35
Split RTL implementations to files; add preprocessor guards 2020-09-18 19:46:12 +02:00
Tulio Leao
c72f547606
Merge pull request #12916 from richard-fine/pathfinding
Pathfinding cleanup
2020-09-17 17:58:31 -03:00
Matt
16fc41e6bf
Always return unique_ptr for the IniReader/IniWriter interface 2020-09-16 20:23:39 +03:00
Richard Fine
542eb873fc Consolidate pathfinding code
Consolidate all the guest pathfinding code from Peep.cpp into GuestPathfinding.cpp, and make a dedicated header for GuestPathfinding to help make it easier to see what the actual public interface is to the pathfinding system.
2020-09-12 14:59:40 -04:00
Gymnasiast
c83ddefe47
Convert remaining C-style casts to C++-style ones 2020-09-10 21:36:20 +02:00
Simon J
d3d5cfbdc4
Add test for #12728: map edge footpath connections in scenario editor (#12736)
Co-authored-by: Simon Jarrett <simonjjarrett@gmail.com>
2020-08-20 20:32:23 +02:00
Matt
83355e35cc Move IStream, MemoryStream, FileStream into OpenRCT2 namespace 2020-08-05 16:29:36 +02:00
Duncan
3de2de9814
Reduce use of get_sprite (#12382)
* Reduce use of get_sprite

* Update src/openrct2/world/Sprite.cpp

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-07-25 18:03:14 +01:00
Michał Janiszewski
3b60740128
Add int64_t support to INI parser (#12374) 2020-07-25 09:37:35 +02:00
Michał Janiszewski
13842198fa
Disable HTTP for targets that don't need it (#12375) 2020-07-25 09:09:15 +02:00
Gymnasiast
cf664c8340
Close #11971: Replace ride groups with new ride types 2020-07-17 00:19:49 +02:00
Ted John
06f1b58004 Add test case for DecryptSea 2020-07-11 11:40:34 +01:00
Gymnasiast
e8d6383f57
Clean up voucher arguments 2020-07-07 21:13:40 +02:00
frutiemax
67a8d833ea
Part of #11159: ImageImporter::ImportResult uses std::vector (#12076) 2020-07-02 14:04:49 -03: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
frutiemax
57b50e46df
Part of #11964: Move RideTypeEnumNames to RideTypeDescriptors 2020-06-19 23:03:24 +02:00
frutiemax
f6eb9f1cc5
Merge RideRatings in RideTypeDescriptor structure (#11975) 2020-06-17 22:22:52 +02:00
Tulio Leao
e54a3d89f2
Rename some Peep member variables to use TitleCase (#11931)
* Rename Peep::destination_tolerance to use TitleCase

* Rename Peep::destination_y to use TitleCase

* Rename Peep::destination_x to use TitleCase

* Rename Peep::trousers_colour to use Title Case

* Rename Peep::tshirt_colour to use TitleCase

* Rename Peep::no_of_rides to use Title Case

* Rename Peep::staff_type to use TitleCase

* Rename Peep::type to use TitleCase

* Rename Peep::sprite_type to use TitleCase

* Rename Peep::sub_state to use TitleCase

* Rename Peep::state to use TitleCase

* Rename Peep::outside_of_park to use TitleCase

* Rename Peep::next_flags to use TitleCase

* Rename Peep::name to use TitleCase

* Rename Peep::NoOfRides to GuestNoOfRides

* Rename Peep::Type to AssignedPeepType

* Rename Peep::GuestNoOfRides to GuestNumRides
2020-06-14 06:31:08 +01:00
Tulio Leao
5d57012390 Rename Peep::var_37 to Var37 2020-06-08 23:47:45 -03:00
Tulio Leao
a993ad8408 Rename Peep::energy to Energy 2020-06-08 23:34:35 -03:00
Tulio Leao
1c59cc2aae Rename Peep::energy_target to EnergyTarget 2020-06-08 23:32:22 -03:00
Tulio Leao
92fbb9fc04 Rename Peep::happiness to Happiness 2020-06-08 23:30:27 -03:00
Tulio Leao
1b7223462f Rename Peep::happiness_target to use TitleCase 2020-06-08 23:27:47 -03:00
Tulio Leao
e387539802 Rename Peep::nausea to Nausea 2020-06-08 23:25:37 -03:00
Tulio Leao
71dc82e79a Rename Peep::nausea_target to NauseaTarget 2020-06-08 23:21:17 -03:00
Tulio Leao
533695cbe6 Rename Peep::hunger to Hunger 2020-06-08 23:18:12 -03:00
Tulio Leao
aad80d3390 Rename Peep::thirst to Thirst 2020-06-08 23:12:38 -03:00
Tulio Leao
3dd4adeb81 Rename Peep::toilet to Toilet 2020-06-08 23:10:18 -03:00
Tulio Leao
05cc016132 Rename Peep::mass to Mass 2020-06-08 23:07:31 -03:00
Tulio Leao
2fdf38a0a9 Rename Peep::time_to_consume to use TitleCase 2020-06-08 23:04:04 -03:00
Tulio Leao
4f9227fd83 Rename Peep::intensity to Intensity 2020-06-08 22:55:07 -03:00
Tulio Leao
f1337768f5 Rename Peep::nausea_tolerance to use TitleCase 2020-06-08 22:41:15 -03:00
Tulio Leao
f732c2f1cd Rename Peep::window_invalidate_flags to use TitleCase 2020-06-08 22:25:54 -03:00
Tulio Leao
1c566eebcb Rename Peep::paid_on_drink to PaidOnDrink 2020-06-08 20:23:14 -03:00
Tulio Leao
61a598edba Rename Peep::ride_types_been_on to use TitleCase 2020-06-08 20:10:15 -03:00
Tulio Leao
958ffabf15 Rename Peep::item_extra_flags to use TitleCase 2020-06-08 20:07:44 -03:00
Tulio Leao
1ee5653c8c Rename Peep::photo2_ride_ref to use TitleCase 2020-06-08 17:36:35 -03:00
Tulio Leao
397c1137db Rename Peep::photo3_ride_ref to use TitleCase 2020-06-08 17:36:35 -03:00
Tulio Leao
df87daaa6e Rename Peep::photo4_ride_ref to use TitleCase 2020-06-08 17:36:35 -03:00
Tulio Leao
ccd76f8fc4 Rename Peep::current_ride to CurrentRide 2020-06-08 17:36:35 -03:00
Tulio Leao
c302b16386 Rename Peep::current_ride_station to use TitleCase 2020-06-08 17:36:34 -03:00
Tulio Leao
1ac3b3d2dc Rename Peep::current_train to use TitleCase 2020-06-08 17:36:34 -03:00
Tulio Leao
7d25480a4d Rename Peep::time_to_sitdown to TimeToSitdown 2020-06-08 17:36:34 -03:00
Tulio Leao
3ad2471a24 Rename Peep::special_sprite to SpecialSprite 2020-06-08 17:36:34 -03:00
Tulio Leao
89a084cbc9 Rename Peep::action_sprite_type to use TitleCase 2020-06-08 17:36:34 -03:00
Tulio Leao
0d84779763 Rename Peep::next_action_sprite_type to TitleCase 2020-06-08 17:36:34 -03:00
Tulio Leao
d9e36e5592 Rename Peep::action_sprite_image_offset to TitleCase 2020-06-08 17:36:34 -03:00
Tulio Leao
e98cea3615 Rename Peep::action* to Action* 2020-06-08 17:36:33 -03:00
Tulio Leao
c953da800a Rename Peep::step_progress to StepProgress 2020-06-07 20:00:07 -03:00
Tulio Leao
95624c748e Prefix Peep::NextInQueue with Guest 2020-06-07 10:46:18 -03:00
Tulio Leao
d195c9fb1d Rename Peep::next_in_queue to NextInQueue 2020-06-06 11:53:51 -03:00
Tulio Leao
f1f915b540 Rename Peep::maze_last_edge to MazeLastEdge 2020-06-06 11:53:51 -03:00