Commit Graph

149 Commits

Author SHA1 Message Date
Gymnasiast 3060c2d8cb
Add const to conversion functions 2020-07-23 12:05:00 +02:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Gymnasiast 3c4721d014
Move some constants to RCT12.h 2020-07-13 22:04:50 +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
Michael Steenbeek aff920c874
Add support for importing RCT Modified ride entrances (#11938) 2020-06-13 20:10:43 +02:00
Michael Steenbeek 1ea1d24f00
Use constant for 255 tile element height (#11928) 2020-06-10 23:18:26 +02:00
Michael Steenbeek 9ef8d6da42
Convert most remaining C-style casts to C++-style ones (#11867) 2020-06-07 23:18:11 +02:00
Michael Steenbeek f21ddb0723
Refactor checks for station pieces (#11876) 2020-06-05 17:55:15 -03:00
Gymnasiast cc65564521
Use (RCT12)ObjectEntryIndex in more places 2020-05-01 22:06:13 +02:00
Gymnasiast 99626e4fbb
Convert RCT12 research marker defines to constexpr 2020-04-28 08:38:16 +02:00
Gymnasiast 38748fc869
Create conversion functions for entry indices 2020-04-28 08:38:04 +02:00
Michael Steenbeek b89130e0f3
Use ObjectEntryIndex in more places (#11440) 2020-04-25 00:10:47 +02:00
Michał Janiszewski 2323cc1596
Use named casts instead of old-style casts
Change prepared with clang-tidy and google-readability-casting check
2020-04-22 17:09:29 +02:00
Michał Janiszewski eeef01f34b Remove redundant function declaration 2020-04-21 13:31:01 +02:00
Tulio Leao a4e4040a0c
Use named casts on openrct2/rct* (#11169) 2020-04-18 12:37:34 +02:00
Breno Rodrigues Guimarães 174a480870
Use utf8_remove_format_codes to remove format codes from user strings (#11289)
The previous code used RCT12::RemoveFormatCodes to remove format codes from RCT strings. But that function uses utf8 methods to identify format codes. In this new version, rct2_to_utf8 is called first to obtain an utf8 string, and then utf8_remove_format_codes can be used.
2020-04-15 07:17:43 +02:00
duncanspumpkin d4998a0ade Fix #10372, #10509, #10806. Lift base sections did not export correctly
Mistake made whilst refactoring that assumed that station indexes are set on only station pieces.
2020-04-11 08:16:53 +01:00
Michael Steenbeek 8a12ad8f6b
Fix #9719: Hacked walls in RCT1 saves are imported incorrectly (#11222) 2020-04-05 13:49:36 +02:00
Michael Steenbeek be13c1fc87
Refactor more TileCoords 2020-03-07 21:07:18 +01:00
Michael Steenbeek 4f86d0115c
Merge pull request #10866 from Gymnasiast/refactor/more-tile-element-prep
Refactor/more tile element prep
2020-03-06 09:25:32 +01:00
Michael Steenbeek d64b73c29a
Clean up RCT1/2 constants (#10855) 2020-03-05 22:49:16 +01:00
Gymnasiast c9afcaa5b3
Fix errors 2020-03-05 00:09:39 +01:00
Gymnasiast 3ed7694495
Move tile element-specific flags 2020-03-04 22:01:09 +01:00
Gymnasiast 57a40c0657
Extend PathElement 2020-03-04 21:57:42 +01:00
Michael Steenbeek 61175a4fbf
Confine use of LocationXY8 to RCT12 load/save code (#10698) 2020-03-01 21:16:10 +01:00
Gymnasiast 8c776dd61e
Use C++ way for max uint8 value 2020-02-15 14:18:58 +01:00
Gymnasiast 1e6efa6eb4
Extend BannerIndex to 16 bits 2020-02-15 10:37:34 +01:00
Gymnasiast e6c32230bc
Convert rawValue to uint32 2020-01-26 14:12:57 +01:00
Michael Steenbeek d798811c4a Make GetWaterHeight return big Z (#10579)
* Make GetWaterHeight return big Z

* Restore > 0 [ci skip]
2020-01-19 15:12:48 +00:00
Michael Steenbeek 0c9b1cec96
Correct max vehicles per ride value (#10504)
* Correct max vehicles per ride value

* Fix formatting

* Fix constant usage in TrackDesign.cpp
2020-01-04 18:10:33 +01:00
ζeh Matt a39bd39268 Fix #10036: Do not allocate large chunks of memory for save file classification (#10040) 2019-10-03 17:36:58 +02:00
Duncan b94b8880aa Fix ride station index related bugs 2019-09-19 22:56:54 +02:00
Gymnasiast bb73dd0dfb
Refactor track element to use 16 bytes 2019-08-31 13:14:19 +02:00
Gymnasiast f365bc3cb7
Create getters and setters for occupied quadrant 2019-08-27 21:12:48 +02:00
Gymnasiast abe721b308
Fix rebase errors and formatting 2019-08-23 22:41:50 +02:00
Gymnasiast daa00147d5
Split off RCT12ResearchItem 2019-08-23 22:41:43 +02:00
Gymnasiast 169d2980ca
Properly export tile elements to S6 2019-08-18 18:20:56 +02:00
Gymnasiast 18844f9244
Fix formatting [ci skip] 2019-08-18 14:36:16 +02:00
Gymnasiast 255ce3f62b
Extend tile element size to 16 bytes 2019-08-18 14:03:36 +02:00
duncanspumpkin e9b59064e0 Fix code and clang format. Delete dead code.
Use correct TD4 checksum for vanilla TD4's.

Simplified the code for version detection since checksum numbers do not match up to a version

Fix TD4 imports.

Oh yeah TD4 doesn't have scenery or entrances

Move track related structs to correct files
2019-08-09 20:43:02 +01:00
duncanspumpkin af92dcba3e Creating t6 exporter 2019-08-09 20:39:54 +01:00
duncanspumpkin e3c63b762e Create new TrackDesign format 2019-08-09 20:39:53 +01:00
Ted John c3234b1442 Refactor map animations and dynamically create on park load (#9705) 2019-08-03 22:18:33 +02:00
Ted John af5daaec70 Fix importing and exporting of banner strings containing colour 2019-07-29 21:20:22 +01:00
Ted John d28799ef18 Remove user strings 2019-07-29 20:01:37 +01:00
Ted John 85543bd1c8 Separate RCT2 and OpenRCT2 banner struct 2019-07-25 22:21:19 +01:00
Ted John 6f0298deb3 Refactor ride measurement storage 2019-06-09 11:55:41 +02:00
Gymnasiast 731af74732 Cast after std::min 2019-03-27 21:49:10 +01:00
Gymnasiast a27e04e5a3 Limit inversions and holes to 31 (for now) 2019-03-27 19:44:46 +01:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
duncanspumpkin 737c308e4e Use IsGhost() to access ghost state
Added set and clear ghost to further prevent direct access to flags
2019-02-25 15:12:35 +00:00
Ted John c0e4eff9f1 Start copying sprite structures for RCT1 and RCT2 2019-02-20 23:31:14 +00:00
Michael Steenbeek 4e9d2ce764
Split footpath object into two internally 2019-01-20 21:38:38 +01:00
Gymnasiast 75d094e135 Fix another omission from #8453 2018-12-16 10:10:26 +01:00
ζeh Matt 7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01:00
Michał Janiszewski 23dc14b286
Improve checks for object files (#8417) 2018-12-11 19:35:27 +01:00
Michał Janiszewski cec86469f0
Improve imported object handling (#8372)
Reject and report invalid objects rather than triggering assert.
2018-12-05 23:12:22 +01:00
Michael Steenbeek de12a8dda1
Import S4 elements property-by-property 2018-11-13 21:48:20 +01:00
Michael Steenbeek b01ff01e82 Extend support for 8 cars corrupt elements 2018-11-05 12:13:26 +01:00
Michael Steenbeek 00ba0c1f51 Define RCT12TileElement fields as private 2018-11-05 12:13:26 +01:00
Michael Steenbeek d4801e139d Import tile elements from SV6 using new methods 2018-11-05 11:55:33 +01:00
Michael Steenbeek fbecfe5a88 Define tile elements in save as RCT12TileElement 2018-11-05 11:55:33 +01:00
Linus Unnebäck fd07be587a
Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01:00
clang-format d787872cbe Indent preprocessor directives 2018-07-23 16:00:23 +02:00
clang-format 506d4221d3 clang-format rct1/2/12 2018-07-23 16:00:07 +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
Michał Janiszewski 1d28826b79 Fix -Wdocumentation and add it to default warnings 2018-06-11 09:52:54 +02:00
Ted John c28a42d877 Optimise SawyerChunkReader for MSVC debug builds
- Change std::copy_n and std::fill_n back to std::memcpy and std::memset. They do not have the overhead of checks.
- Change std::malloc to HeapAlloc as 16 MiB allocations are very slow due to it initialising all the memory to 0xCC.
2018-05-29 18:39:13 +01:00
Richard Jenkins 41f0b181bf Display flat rides correctly in previews 2018-05-10 20:54:53 +02:00
Hielke Morsink 8d10bfb5a1 Add namespace closing comments 2018-05-04 22:54:43 +02:00
Michael Steenbeek ea0566a3f5 Split PeepSpawn and rct12_peep_spawn 2018-02-21 09:50:07 +01:00
Michael Steenbeek 3e7161650c Replace LocationXYZD8 2018-02-15 22:26:50 +01:00
Hielke Morsink 55979a3fff Remove and replace C typedefs
`typedef struct/union/enum name { ... } name_again;` is not needed whe compiling C++, moving the name at the back to be in front of the object and removing `typedef` makes it usable the very same way.
This also replaces typedefs with the using keyword. They have better readability, especially for function pointer types, and would allow more flexibility when used with templates.
2018-02-14 09:42:26 +01:00
Ted John 8e7a0e9110 Fix memcpy to copy_n mistake from 0c71855 2018-02-05 18:32:23 +00:00
Gymnasiast 34a6b5ef92 Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
Ted John 0c71855769 Replace Memory::Copy with std::copy 2018-02-04 12:40:24 +00:00
Ted John 7851446a6f Replace Memory::Set with std::fill or similar 2018-02-04 12:35:02 +00:00
Michael Steenbeek 6a88d6e04d Move and rename RCT{1,2,12}.h 2018-01-09 13:36:41 +01:00
Ted John 02c58a6c5a Remove custom base Exception class 2018-01-05 18:11:47 +00:00
Michael Steenbeek 1a9975d683 Compile util and cheats as C++ 2017-12-14 10:03:21 +01:00
Christian F. Coors 06afeeda9a Apply some refactoring 2017-11-02 12:22:28 +01:00
Ted John 1f605db54b Extract RLE repeat to its own method 2017-10-22 16:21:13 +02:00
Ted John 8d1710d798 Fix #6460: Crash when reading corrupt object files
- Move sawyer coding functions to SawyerChunkReader.
- Replace assertions with exceptions to prevent crash on invalid chunks.
2017-10-22 16:21:13 +02:00
Michał Janiszewski 5ab9f938a7 Update files missed in the great extern "C" cleanup of 2017 2017-09-28 23:29:16 +02:00
Michał Janiszewski 00fd18809c Move extern "C" {} blocks to headers (#6282) 2017-09-18 17:05:28 +02:00
Michał Janiszewski e9e37d2aac Validate more inputs to SawyerChunk handlers 2017-08-03 00:29:56 +02:00
Michał Janiszewski 79d76759bb Fix #5516: Update copyrights for 2017
Not all files were necessarily _changed_, but all were touched, see
https://github.com/OpenRCT2/OpenRCT2/pull/4932
2017-06-01 21:55:10 +02:00
Paweł Bylica 660373cf38
Fix unmatched memory free
Before the memory of size 1 was deleted, more allocated.
2017-02-24 00:15:56 +01:00
Ted John 2518362112 Use streams for SV6 export 2017-02-05 15:45:23 +00:00
Ted John 0dcab94411 Remove chunk code from SawyerEncoding 2017-02-05 12:26:52 +00:00
Ted John 5eee31f69a Use SawyerChunkReader instead of SawyerEncoding 2017-02-05 12:18:07 +00:00
Ted John 7ab2723936 Create a reader class for sawyer encoded chunks. 2017-02-05 02:40:50 +00:00
Ted John afc8943e34 Fix #5169: Parks containing packed objects fail to open
Regression from 3b02b05dc6. Forgot to implement reading packed objects with IStream.
2017-02-04 00:34:14 +00:00
Ted John 44120b2e7e Fix build issues 2017-02-02 22:00:01 +00:00
Ted John bb62bbebb3 Re-introduce checksum validation 2017-02-02 22:00:01 +00:00
Ted John 8998b2ae18 Refactor S6 importer to use IParkImporter interface 2017-02-02 22:00:01 +00:00
Ted John c9d7cd8216 Refactor loading of SC6 information when scanning scenarios 2017-01-31 17:54:39 +00:00