Commit Graph

471 Commits

Author SHA1 Message Date
Denis Khabenkov de53ac84b8
Fix #10052: Create a TrackDesignEntranceElement struct to replace rct_td6_entrance_element 2019-10-07 21:59:07 +03:00
Michael Steenbeek a63395eb1c
Fix #10028: Saved park--brakes all set to 0mph 2019-09-29 22:53:41 +02:00
Duncan b94b8880aa Fix ride station index related bugs 2019-09-19 22:56:54 +02:00
Gymnasiast 0aca04256b
Fix #9978: Mazes are imported incorrectly 2019-09-12 23:12:54 +02:00
Gymnasiast bb73dd0dfb
Refactor track element to use 16 bytes 2019-08-31 13:14:19 +02:00
Gymnasiast b1fb75e496
Move everything to research vectors 2019-08-23 22:41:43 +02:00
Hielke Morsink 371f1fd016 Fix #9926: Africa - Oasis park has wrong peep spawn (#9927) 2019-08-23 21:54:54 +02:00
Gymnasiast bf1f14b441
Correct memcpy usage 2019-08-18 19:46:44 +02:00
Gymnasiast 169d2980ca
Properly export tile elements to S6 2019-08-18 18:20:56 +02:00
Ted John a094c5b0ce Create RCT2 version of ride rating calc data (#9751) 2019-08-18 12:53:56 +02:00
duncanspumpkin 748a6338a9 Fix #9885. Catch exceptions in track design writing 2019-08-17 10:59:36 +01:00
kennycastro007 9708e3a043 Fixed issue #8376 (#9866)
#8376: Added static function show_error in S6Importer.cpp
2019-08-15 16:02:03 +02:00
Ted John 132a1916d6
Fix #9832: Access violation in ride_measurement_update (#9842)
We can not store a ride pointer in ride measurement as rides are now stored in a vector which means their addresses can change when rides are constructed / removed.
2019-08-10 15:14:22 +01:00
duncanspumpkin 996cbdec02 Correctly input num_holes, inversions 2019-08-09 20:43:03 +01:00
duncanspumpkin af31404472 Use std::string and cleanup unused functions
Use CoordsXY for save pop scenery functions

Use CoordsXY for push save scenery functions

Further refactoring to use coordsxy and standard functions
2019-08-09 20:43:03 +01: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 54d6722bf2 Link everything together 2019-08-09 20:40:35 +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
Duncan 659b4d8f9f
Clean up some litter in the codebase (#9753)
13CA740 and 141F568 have been doing mostly nothing since the game action refacotr. Before that they didn't do much as I've never found any instance where the code was hit.
2019-08-08 06:05:58 +01:00
Ted John b17e9b1b18 Fix #9755: Crash when importing ride measurement for null ride 2019-08-07 23:11:11 +01:00
Ted John cd4eb86a7c
Merge pull request #9725 from IntelOrca/refactor/ride-manager
Refactor ride list
2019-08-07 21:03:17 +01:00
Ted John 16a2046032 Fix #9745: CJK characters are broken in ride names 2019-08-07 12:34:05 +01:00
Ted John 414b53b56d Remove ride classifications 2019-08-04 16:43:50 +01:00
Ted John a3fe00f0a3 Refactor ride list to a manager with iterator 2019-08-04 16:43:50 +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 b3531624a1 Fix saving of banner frame colour 2019-07-30 18:27:50 +01:00
Ted John af5daaec70 Fix importing and exporting of banner strings containing colour 2019-07-29 21:20:22 +01:00
Ted John 7287b8cf1a Fix formatting 2019-07-29 20:40:25 +01:00
Ted John f539fdd79c Convert user strings to RCT2 encoding when exporting to S6 2019-07-29 20:01:49 +01:00
Ted John 7ce2f38c92 Fix formatting 2019-07-29 20:01:49 +01:00
Ted John d28799ef18 Remove user strings 2019-07-29 20:01:37 +01:00
Ted John 767b3c8328 Build up the user string list and export in one go 2019-07-29 19:18:16 +01:00
Ted John 40d49b93d3 Do not use user strings for peep names 2019-07-29 19:18:16 +01:00
Ted John 61d64ab8c5 Do not use user strings for banners 2019-07-29 19:18:16 +01:00
Ted John 3f8890afde Fix remaining errors and a few bugs 2019-07-29 19:18:16 +01:00
Ted John 3ee7824df4
Fix #9678: Korean scenario name is not saved (#9679) 2019-07-29 19:17:49 +01:00
Ted John 0b4d989a67 Rename get_banner to GetBanner 2019-07-26 17:24:19 +01:00
Ted John 3bff25ab22 Use TileCoordsXY 2019-07-26 17:14:09 +01:00
Ted John 5c07c53faf Refactor get banner 2019-07-25 22:21:19 +01:00
Ted John 85543bd1c8 Separate RCT2 and OpenRCT2 banner struct 2019-07-25 22:21:19 +01:00
Matt 3395079737
Remove NUM_SPRITE_LISTS macro and replace with SPRITE_LIST_COUNT for consistency 2019-07-24 17:53:54 +02:00
Ted John 3e28073981 Log path when loading / saving park 2019-07-22 22:15:01 +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
Ted John 5733d666b3 Do not store park name as a user string 2019-07-21 11:33:15 +02:00
Duncan 4e44818a04
Merge pull request #9449 from ZehMatt/refactor/sprite-list-pow2
Remove unnecessary multiplication and division for sprite lists
2019-07-13 09:37:35 +01:00
duncanspumpkin fc657e2571 Revert name change in RCT12 struct to reflect its use.
The new linked_list_index is only for the internal sprite base struct. When importing we are referring to the old linked_list_type_offset. If the names were the same it would not provide any information as to why one was a factor of two different.
2019-07-13 07:20:15 +01:00
Jim Armstrong 9c976daa51 Refactor #9474: Refactor jumping fountain code (#9475)
* Refactor jumping_fountain_update to Update

* Refactor jumping_fountain_get_type to GetType

* Refactor jumping_fountain_continue to Continue

Fix typos and misc refactoring

* Refactor begin and create functions into static member functions

Move jumping_fountain_begin and jumping_fountain_create into the rct_jumping_fountain struct and make them static

* Refactor remaining fountain functionality into member functions

* Rename JumpingFountain struct and move to proper header file

JumpingFountain code was refactored to conform to variable naming conventions and moved into the Fountain.h file.

rct_sprite_generic struct was moved to SpriteBase.h - this was done to get around a circular header dependency between Fountain.h and Sprite.h

* Set access modifier for private functions

* Change JumpingFountain variable names to TitleCase

* Refactor #9474: Clarify where auto is being used with pointers

* Refactor #9474: Change function names for clarity

* Refactor #9474: Fix incorrect function names
2019-07-11 20:38:30 +01:00
Matt fc3afb3349
Remove unnecessary multiplication and division for sprite lists 2019-06-22 17:38:28 +02:00
Matt df30d5d9bc
Fix MarketingCampaignFlags::FIRST_WEEK not being imported/exported with sv6 2019-06-19 03:20:19 +02:00
Gymnasiast 3933e2ffc6 Fix #9402: Ad campaigns disappear when you save and load the game 2019-06-12 22:20:00 +02:00
Peter dd948f99c4 #9295 Refactor rct_vehcile->status to rct_vehicle::SetState() (#9329)
Fix #9295. Refactor rct_vehicle->status to rct_vehicle::SetState()

Created rct_vehicle::SetState() and refactored all assignments to
rct_vehcile->status. SetState also includes a call to
vehicle_invalidate_window(), so it cannot be forgotten.
2019-06-09 15:45:56 +01:00
Ted John 6f0298deb3 Refactor ride measurement storage 2019-06-09 11:55:41 +02:00
Greg Hennis 1fcedae3bc Fix #9258: Rename SPRITE_LIST_NULL to ..._FREE (#9260) 2019-05-15 19:07:01 +02:00
Ted John 15cb3e1889 Remove unnecessary new line characters from log calls (#9237) 2019-05-12 13:48:56 +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
Gymnasiast 921e426605 Increase size of inversions and holes to uint16_t 2019-03-27 15:55:34 +01:00
Gymnasiast ba404338cc Max out inversions value instead of truncating 2019-03-27 14:02:32 +01:00
Gymnasiast 64e51cd34b Close #8965: Refactor ride->inversions 2019-03-27 11:30:18 +01:00
Gymnasiast 8b1330ec57 Add comment [ci skip] 2019-03-19 22:13:02 +01:00
Gymnasiast 14c2925ae5 Add import code to make Ice Cream Stalls light blue 2019-03-19 22:11:18 +01:00
duncanspumpkin f28be1ae30 Merge #8881 branch 'set_park_open' into game_actions 2019-03-18 19:57:50 +00:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
duncanspumpkin cb087e3b4e Fix formatting. Initialise to bad value 2019-03-16 16:41:18 +00:00
duncanspumpkin 24e9428731 Use 64bit values to simplify code 2019-03-16 07:33:21 +00:00
Phillip Walters 0e50d438d7 Added console logging for failed map saves 2019-03-15 20:35:41 -07:00
ζeh Matt e776faee97
Merge pull request #8812 from ZehMatt/import-export-fixes
Fix #8811: Import export fields not copied correctly.
2019-03-02 07:47:36 +01:00
Matt 8b6012a44b Add missing field "no_of_food" to importer/exporter. 2019-03-02 04:46:31 +01:00
Matt 5f6ae6ac8c Fix copying the wrong field. 2019-03-02 04:45:47 +01:00
Ted John cdec457abd Refactor peep struct 2019-02-28 20:28:58 +01:00
Ted John 3b7b46706c Export sprites field by field 2019-02-20 23:51:43 +00:00
Ted John b77bc56a52 Copy vehicle structure for S6 2019-02-20 23:31:14 +00:00
Ted John c0e4eff9f1 Start copying sprite structures for RCT1 and RCT2 2019-02-20 23:31:14 +00:00
Ted John ddaddf59c6 Import misc sprites field by field 2019-02-20 23:31:14 +00:00
Ted John 67ae973ac8 Import peep field by field 2019-02-20 23:31:14 +00:00
Ted John 1b83b9881b Import vehicle field by field 2019-02-20 23:31:14 +00:00
Ted John 9960397f2c Import litter field by field 2019-02-20 23:31:14 +00:00
Ted John 4013479094 Refactor marketing to be a single vector 2019-02-20 16:49:02 +00:00
Michał Janiszewski 604da7ce01
Merge pull request #8661 from tomlankhorst/refactor-random
Refactor random engine
2019-02-03 23:29:10 +01:00
Tom Lankhorst 16691b22ba
Use state struct 2019-02-01 19:29:43 +01:00
Tom Lankhorst 6a42a95495
Refactor random engine
Introduce RotateEngine and Rct2Engine, FixedSeedSequence and Rct2Seed.
Adhere respectively to requirements `RandomNumberEngine` and `SeedSequence`.
Can be used with C++11 adaptors and distributions in <random>.
2019-02-01 14:32:04 +01:00
ζeh Matt 6668a1fa86 Refactor remaining number values to RideStation::NO_TRAIN (#8655) 2019-01-30 13:49:46 +00:00
Ted John 92412d4bab Store ride index inside ride struct 2019-01-18 11:46:18 +01:00
Ted John 8701286772
Use new ride_id_t typedef (#8561) 2019-01-12 10:11:55 +00:00
Michael Steenbeek 31298bd772
Merge pull request #8543 from IntelOrca/refactor-ride
Refactor ride structure
2019-01-02 22:38:20 +01:00
Michael Steenbeek b5317ee9e9
Split drawing of path and railing 2019-01-02 19:52:53 +01:00
Ted John 38f632074b Merge ride track colour arrays into one 2019-01-01 21:25:34 +00:00
Ted John 37f76d1687 Move station fields into new station struct 2019-01-01 02:26:14 +00:00
Ted John 8e6497fc1d Merge vehicle_colours and vehicle_colours_extended 2018-12-31 19:25:07 +00:00
Ted John 92bb4a5897 Fix #8498: Advertisement campaigns less effective than they used to be
0x8000 was being checked instead of 0xFFFF when importing and exporting peep spawns to and from S4, S6.
2018-12-20 09:25:31 +00:00
Ted John 1d6d734c1c Fix build 2018-12-16 19:01:15 +00:00
Ted John 08b02943d3 Use std::string for scenario name, details etc. 2018-12-16 19:01:14 +00:00
Ted John 4195f0d9c9 Change gPeepSpawns to a vector so we can now have more than 2 2018-12-16 19:00:16 +00:00
Ted John 19a687f2fa Change gParkEntrance to a vector so we can now have more than 4 2018-12-16 19:00:16 +00:00
ζeh Matt 7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01:00
Michael Steenbeek 6d0f0334d7
Merge pull request #8339 from ZehMatt/realtime-ticks
Use real time ticks for UI effects.
2018-12-15 21:00:44 +01:00
Michał Janiszewski c845924956
Validate news item type on import (#8334)
News items use queue split into two logical partitions. When detected an
invalid news item type, simply drop remaining items to avoid having to
handle all the possible cases of where the invalid items falls.
Additionally, as normal use case wouldn't have triggered such an invalid
type, it must have come from some invalid file anyway, so assume it is
fine to drop other items.
2018-12-03 20:06:05 +01:00
Michael Steenbeek 3c63402e1d
Fix number of free sprites on SV6 import 2018-12-01 17:34:02 +01:00
Matt 4bc69a0111 Introduce gCurrentRealTimeTicks and refactor some variable names. 2018-12-01 16:36:00 +01:00
Hielke Morsink 354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
Michael Steenbeek b01ff01e82 Extend support for 8 cars corrupt elements 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
Aaron van Geffen cf6f8a356f
Merge pull request #7920 from ZehMatt/sprite-structs
Simplify sprite structs
2018-09-13 23:04:02 +02:00
Matt ccf12befd5 Formating. 2018-08-31 07:18:51 +02:00
Matt 8c6f6a18ab Remove unused passing of object manager. 2018-08-31 07:18:50 +02:00
Matt 04928d4b84 Refactor reference over std::shared_ptr. 2018-08-31 07:18:48 +02:00
Matt dcc4827833 Use reference instead of copy. 2018-08-20 21:12:06 +02:00
Matt a89b352fb2 Rename rct_sprite::unknown to rct_sprite::generic 2018-08-20 18:27:40 +02:00
Michael Steenbeek 13c326eb50
Fix part of #7415: Korean scenario descriptions are mangled
OpenRCT2 used to incorrectly write UTF-8 to SV6 names and descriptions. This fixes reading such scenarios. It should also fix the game crashing when attempting to load such a scenario.

What this doesn't do is add support for the encoding that vanilla used for CJK, or add support for creating scenarios with Korean descriptions. That will only be feasible when switching to our own format.
2018-08-13 15:53:44 +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
Hielke Morsink 9cf4ea675f Correct formatting for source files up to the rct2 folder 2018-07-23 16:00:16 +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
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 204dd4439b Mark unused arguments in the libopenrct2 project
For dummy classes and functions with empty bodies I've only commented out the arguments, for all others I used C++17's [[maybe_unused]].
2018-06-06 21:03:11 +02:00
Hielke Morsink 5d0022a5cb Remove argument list from zero-initializers with zero/false/nullptr value 2018-06-04 19:50:46 +02:00
Ted John 1e7560e7da Do not include GameState.h in Context.h 2018-05-30 12:50:25 +01:00
Aaron van Geffen dcff6895b5 Refactor game_init_all into GameState::InitAll. 2018-05-30 11:53:32 +02:00
Ted John d6ac74f4bd Fix loading SC6 files in editor 2018-05-29 18:39:13 +01:00
Ted John f5e77a9e15 Load objects for title editor and scenario editor 2018-05-29 18:39:12 +01:00
Ted John 6af0cb2b88 Fix import of S4 and S6 2018-05-29 18:39:12 +01:00
Ted John 96a0a22cd1 Make start on loading objects only once 2018-05-29 18:39:12 +01:00
Hielke Morsink 6c65c3d64d
Merge pull request #6774 from janisozaur/fixes
Various code improvements
2018-05-15 14:38:43 +02:00
Michael Steenbeek fcf507e051
Spin off shop item stuff to separate files 2018-05-14 19:21:43 +02:00
Ted John 529c744276 Use unique_ptr and shared_ptr for services in Context 2018-05-13 00:43:50 +01:00
Michał Janiszewski 0a92e74ced Minor fixes 2018-05-11 15:38:30 +02:00
oli414 3bff12c081 Seperate surface tile element 2018-05-01 16:33:16 +02:00
Ted John 42f46d15e3
Merge pull request #7414 from OpenRCT2/refactor/string-conversions
Refactor string conversion between RCT2 and UTF8
2018-04-25 10:14:39 +01:00
Hielke Morsink bf4f68fe33 Use enum type that guarantee to support its values
By default enumerators use type `int` which can store values up to `1 << 31 - 1`. The clang compiler generates this error for enums values that use the sign bit: `enumerator value is not representable in the underlying type 'int'.`

To get rid of those warnings (and technically improve the code) the erroneous enums are now of type of `uint32`.

Note: I've skipped peep.h to prevent conflicts with the peep refactor branch.
2018-04-24 16:51:42 +02:00
Ted John deaa60f8f1 Refactor string conversion between RCT2 and UTF8
Use Win32 API for conversion on Windows for non-1252 code pages instead of built-in tables.
2018-04-18 13:16:20 +02:00
Gymnasiast 60b864441a Fix encoding of scenario index names 2018-04-12 13:13:14 +02:00
Hielke Morsink dc673a64d8 Give context the ownership of repositories and the object manager (#7340)
This makes them no longer a singleton, which fixes annoying behaviour when launching multiple contexts in one game session.
2018-04-10 13:19:23 +01:00
Michał Janiszewski fc97c8c5db Reduce inclusion of <string> header 2018-03-21 22:39:19 +01:00
Michał Janiszewski 764520076f
Reduce header inclusion
* Update includes in PlatformEnvironment.cpp

* Update includes in ParkImporter.h

* Update includes of OpenRCT2.h

* Update includes in Intro.h

* Remove unused include from Input.cpp

* Update includes of Imaging.h

* Update includes in Game.h

* Update includes in Editor.h

* Update includes of Context.cpp

* Update includes in Cheats.cpp, CmdlineSprite.cpp

* Update includes of some source files

* Update includes in some cpp files

* Update includes in some cpp files

* Update includes in TextureCache.h

* Fix tests

* Update includes in Font.cpp

* Update includes in LightFX files

* Update some includes

* Fix GCC builds

* Update some includes

* Update some includes

* Update includes in FontsFamilies.*

* Update includes of Console.h

* Improve includes in Window.h

* Improve headers in Viewport.h/Window.h

* Fix MSVC build

* Fix network-less builds

* Reduce inclusion of Map.h
2018-03-13 13:14:02 +01:00
Michael Steenbeek bf580625f8 Fix calcutation of number of riders on import
Made a little mistake with this last time. This will now use the same logic as the Guest List window and the increment/decrement counters.
2018-03-13 11:45:06 +01:00
Michael Steenbeek 1fa2fa8f80
Refactor ride->entrances and ride->exits 2018-03-07 19:10:50 +01:00
Michael Steenbeek 2de6529cf5 Use big coordinates for PeepSpawn's Z coordinate 2018-02-21 09:50:07 +01: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
Michael Steenbeek 34c8409251 Clean up ride struct and num_riders import, update changelog 2018-02-08 15:33:43 +01:00
Gymnasiast 02196a1919 Fix #3330: Current number of passengers overflows 2018-02-08 15:33:43 +01:00
Gymnasiast 34a6b5ef92 Remove __cplusplus ifdefs 2018-02-05 16:20:15 +01:00
Gymnasiast 778ba466c5 Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Ted John a84c05f1eb Fix gcc 2018-02-04 12:40:25 +00:00
Ted John 7851446a6f Replace Memory::Set with std::fill or similar 2018-02-04 12:35:02 +00:00
Gymnasiast d91fd1364d Create passageways in European Extravaganza 2018-02-01 13:52:28 +01:00
Gymnasiast 2c8ab6fb68 Fix #7065: Guests cannot enter Great Wall Of China scenario 2018-01-23 19:03:00 +01:00
Ted John aa0d7645da Refactor ride_ratings.c to C++ 2018-01-18 22:33:06 +00:00
Ted John 83cdd56825 Unify current and next climate state into common struct 2018-01-14 01:06:47 +00:00
Michael Steenbeek cd5a1ba888 Compile files in world folder as C++ 2018-01-11 13:25:09 +01:00
Gymnasiast ce9a72a4e9 Fix export of invented scenery items 2018-01-10 23:24:10 +01:00
Gymnasiast 8fb0046136 Fix #6990: Scenery not correctly marked as available 2018-01-10 20:29:20 +01:00
Michael Steenbeek 37cec95ce2 Move research list import/export to separate functions 2018-01-10 16:31:13 +01:00
Michael Steenbeek 0995ab9910 Fold gResearchNextCategory into gResearchNextItem 2018-01-10 15:31:47 +01:00
Michael Steenbeek b11f59ba6c Refactor gResearchedSceneryItems 2018-01-10 15:31:47 +01:00
Michael Steenbeek d2de1a4a95 Abstract access to gResearchedRide{Types,Entries} 2018-01-10 15:31:47 +01:00
Michael Steenbeek 55b473d866 Rename gResearchLastItemSubject to gResearchLastItem 2018-01-09 21:35:10 +01:00
Michael Steenbeek 6a88d6e04d Move and rename RCT{1,2,12}.h 2018-01-09 13:36:41 +01:00
Michael Steenbeek 0296608623 Name/fix various RCT1/RCT2 limits 2018-01-09 13:36:41 +01:00
Michael Steenbeek 7d5de63484 Refactor rct_research_item, refactor access to rct_research_item
This takes away a lot of the bitshift and bit mask trickery previously used.
2018-01-07 15:33:44 +01:00
Ted John c3eab7ead6 Refactor window.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 c3e79b1948 Fix Amity Airport coordinate adjustment 2018-01-06 21:46:18 +01:00
Michael Steenbeek 755add6c9a
Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
Ted John 02c58a6c5a Remove custom base Exception class 2018-01-05 18:11:47 +00:00
Michael Steenbeek 31bf792538 Refactor research - spike 1
This involves refactoring gResearchedRideTypes and gResearchedRideEntries
and the functions involved.

Also renames some functions in order to better express what they do.
2018-01-04 17:44:51 +01:00
Ted John 49f5611bd1 Rename scenario.c|h to cpp 2018-01-03 15:07:17 +01:00
Michael Steenbeek 347ff702d0 Refactor objects 2018-01-03 10:16:51 +01:00
Michael Steenbeek c5e966292b Fix #3171: Guests entering from the corner of the tile in Amity Airfield 2018-01-02 16:07:39 +01:00
Gymnasiast 1626f86acc Compile park.c as C++ 2018-01-01 01:18:12 +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
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 3868b100df Stop encrypting money
It serves no purpose any more. Of course, we still need the ENCRYPT_MONEY() and DECRYPT_MONEY() functions for importing and exporting S6 files.
2017-12-07 23:22:24 +01:00
Michael Steenbeek 60d8865efb Compile game.c and game.h as C++ 2017-12-05 09:10:27 +01:00
Ted John 99d7aaa2d6 Remove RCT2 interop 2017-12-04 19:04:06 +00:00
Michael Steenbeek b0aaf13cec Clean up and future-proof peep spawn import 2017-11-30 23:08:59 +01:00
Michael Steenbeek 7feb0f8f7e Fix #4760: Correct guest entry points on loading scenario 2017-11-29 09:10:09 +01:00
Michael Steenbeek 1011d6172d
Clean up string IDs 2017-11-23 15:52:06 +01:00
Michał Janiszewski 9bc9e20778 Stub interop for NO_RCT2 builds 2017-11-06 22:05:36 +01:00
Martin Müller 7089ec80fc Fix highscores for savegames
When loading a savegame, its filename gets stored as gScenarioFileName.
However, that isn't necessarily the same name as the filename of the
corresponding scenario (or any, for that matter, due to the different
file extension). This broke highscores, so for savegames we have to
take the scenario filename stored in the file.
2017-11-05 12:25:40 +01:00
Martin Müller 8422556bc1 Fix #6566 and #6573: Highscores don't get saved
For some RCT2 parks the scenario name in the sv6 file is wrong, so take the real filename.
2017-11-02 19:31:01 +01:00
Christian F. Coors 06afeeda9a Apply some refactoring 2017-11-02 12:22:28 +01:00
Michael Steenbeek 3d8ec4e393 Warn when loading incompatible RCTC saves 2017-11-01 20:23:06 +01:00
Michael Steenbeek af845beb61 Replace mapElement with tileElement 2017-10-31 19:59:06 +01:00
Michael Steenbeek ce8d9cc71b Rename map_element to tile_element 2017-10-31 19:59:06 +01:00
Michał Janiszewski 90a14205c8 Compile track_data.c as C++ 2017-10-25 23:53:47 +02:00
Ted John be4fe7b681 Rename total ride value to total ride value for money 2017-10-25 13:38:06 +02:00
Michael Steenbeek ce4899c60c Compile station.c as C++ 2017-10-23 14:47:12 +02:00
Tomas Dittmann e393ff1f22 Stop using (void*)-1 for invalid pointers 2017-10-15 15:53:16 +02:00
Michał Janiszewski ab3835719a Compile peep and staff logic as C++ 2017-10-13 10:06:36 +02:00
Tomas Dittmann 88742dce80 Ensure null objects are written as -1 to SV6 2017-10-12 21:23:54 +02:00
Michael Steenbeek 3a2aeda398 Refactor expenditure table and history graph 2017-10-12 20:35:59 +02:00
Michael Steenbeek 42d6a10952 Compile management as C++ 2017-10-11 21:38:26 +02:00
Michael Steenbeek 17557569d0 Turn 'unlock all prices' into a regular option
This uses a previously unused S6 flag to save this option persistently.
This should not make S6 import much harder, but should reduce the amount of questions about S4 import.

Also refactor the checks whether the user can ask money for rides or entry. This should make it a lot easier
when our own save format comes around.
2017-10-11 08:33:17 +02:00
Michael Steenbeek 31e1ad43a8 Compile finance.c as C++, clean up 2017-10-07 16:28:35 +02:00
Michael Steenbeek 25b72260d7 Compile research.cpp as C++, small refactor 2017-10-06 21:41:50 +02:00
Michael Steenbeek 7cb464af6e Clean up animated object limit and import 2017-10-06 11:33:55 +02:00
Michał Janiszewski 5ab9f938a7 Update files missed in the great extern "C" cleanup of 2017 2017-09-28 23:29:16 +02:00
Martin Müller e38a77da2a Set gScenarioFileName when loading an RCT1 park
This fixes bugs when completing an RCT1 scenario, where the highscore
would be saved for the wrong park because gScenarioFileName hasn't been updated on load.
2017-09-26 15:53:06 +02:00
Michał Janiszewski 00fd18809c Move extern "C" {} blocks to headers (#6282) 2017-09-18 17:05:28 +02:00
Ted John 8677793624 Fix #6267: Ride count is 255 for clients that join a server
For S6 export and import, unused ride slots were not set to RIDE_TYPE_NULL.
2017-09-13 20:04:55 +01:00
Michael Steenbeek 671a7bcbe1 Improve and extend constant usage 2017-09-13 18:13:38 +02:00
Gymnasiast 3a65ef79a7 Use field-wise assignments for rides in S6Exporter
Also fixes some limit constant usage
2017-09-12 14:00:56 +02:00
Gymnasiast a28509e24c Split Ride and rct2_ride 2017-09-12 11:16:57 +02:00
Richard Jenkins 71e580a58f Refactor game load functions, resolves #6011 2017-08-23 08:04:36 +02:00
Tomas Dittmann 14f92bef80 Remove unnecessary cast 2017-08-14 20:58:33 +02:00
Gymnasiast 8eec684545 Use more constants, isolate SV6 limits further 2017-08-14 19:56:29 +02:00
Ted John 8b2eb8a13e Move screen variables to OpenRCT2.h 2017-07-29 20:29:29 +01:00
CharlesLove 88290337f6 Fix #5881: gCheatsUnlockAllPrices persists when loading new scenarios 2017-07-22 22:20:52 +02:00
Ted John 4852633a1b Fix #5966: Issue with Ride Time 2017-07-22 09:24:51 +01:00
Michael Steenbeek 343e436e45 Import rides in SV6 files per ride and per field 2017-07-19 22:00:48 +02:00
Ted John c33a9f06d9 Remove subsitute_path and refactor gScenarioFilename 2017-07-16 23:25:11 +01:00
Michał Janiszewski 12500dd802 Fixup the disjoint null sprites 2017-07-07 00:14:45 +02:00
Michał Janiszewski ab95988c66 Improve error reporting for detected cycles 2017-07-06 22:28:10 +02:00
Michał Janiszewski 029aea0fc2 Remove reset_empty_sprites
Leave in sprite_clear_all_unused as the safer version
2017-07-06 22:20:07 +02:00
Michał Janiszewski bed085d329 Remove unneeded sprite reset
This is done in all exports now
2017-07-06 22:18:05 +02:00
rwjuk 247d72b1aa Implement sprite cycle checking 2017-07-06 19:57:37 +02:00
Michał Janiszewski ec7bcfce34 Revert "Fix #5795: Implement sprite cycle checking" 2017-07-06 11:13:12 +02:00
rwjuk 22f88f80b0 Implement sprite cycle checking 2017-07-05 23:34:47 +01:00
Ted John ddb96ec267 Refactor load park result
Use a C++ struct and pass that to C.
2017-07-01 01:29:35 +01:00
rwjuk ab38c07fb9 Make object window work with S4s and scenarios 2017-07-01 01:29:34 +01:00
rwjuk 214bf3988b Implement 'missing objects' window
Implement 'missing objects' window

Basic implementation of 'bad objects' window

Add new object_load_error.c

Add object_load_error.c

Faffing about

String stuff

Stuff

Get window basically displaying

Proper col header for object

Display object types

Display file name and explanatory message

Probably about time I added myself to the dev list

Cleanup and comments

Make bad object window work with SC6

Fix whitespace, string IDs, flip core function sense

Fix spacing in string_ids.h

Fix string ID snafu

Fix HasNoInvalidObjects() sense

Attempt to refactor this to pass data properly

Move typedefs to separate header

Fix up signatures

Add park_load_result_types.h

Clean up includes and remnants of prev implementation

Split duplication into function, free invalid entries list on close

Use pointer for object_validity_result param

Fixup string IDs

Use LoadObject() directly

Use dependency injection, fix string termination

Xcode fix, make helper function static

Fix buffer overrun and memory leak

Use SDL for clipboard functionality

Fix function & variable declarations

Rework editor_read_s6() to use new park load result type

Update changelog for #5624

[ci skip]

Fix mem leak, function signature and whitespace
2017-07-01 01:28:51 +01:00
Ted John f275e5ba9b Remove all platform.h includes from header files
System headers, particularly windows.h polute the namespace too much with macros and unwanted definitions. Do not use them in header files.
2017-06-25 18:59:56 +01:00
Ted John b9e9ddfc1c Use more dependency injection 2017-06-24 09:56:51 +02:00
Michał Janiszewski 9bfc9a91e3 Pre-emptively reset sprites on export for higher compression ratios (#5668)
The sprites need to be reset anyway before they get used, so reset them
on every export just so they can be compressed better
2017-06-20 16:34:04 +02:00
Ted John 7e9f7df7d1 Use standard platform defines 2017-06-12 18:01:51 +01:00
Michał Janiszewski 61d38511bc Expand tabs to spaces
This commit expands tabs to spaces (ts=4) in all the files under src/
and test/.

Until now we had two wildly different code styles with C using tabs and
new C++ using spaces. It is painful to maintain as none of the commonly
used tools support this kind of setup and in reality is needless, as we
can simply convert all the sources to spaces and have opened PRs do the
same, where needed.

Additionally, trailing whitespace has been removed.
2017-06-06 23:46:14 +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
Michael Steenbeek e725672d23 Clean up alternative track pieces and types, remove remnants of researched track pieces 2017-05-16 19:11:51 +02:00
CraigCraig 26287f5a3e More readability, grammar, spelling fixes 2017-05-15 09:28:43 +02:00
CraigCraig 58deb3a54a Grammar, readability, and spelling fixes
[ci skip]
2017-05-11 11:45:59 +02:00
Ted John 4ba60cbf52 Replace SDLRW with fopen in interop.c 2017-05-04 17:29:05 +01:00
Michał Janiszewski ee7ad17a30 Align field assignments in S6Importer.cpp 2017-04-24 22:40:22 +02:00
Michał Janiszewski ad7ecc0d85 Format S6Exporter.cpp
Pretty much just align field assignments
2017-04-24 22:40:22 +02:00
Michał Janiszewski a83dd095d6 Fix mismatched allocator/deallocater for S6 2017-04-24 22:40:21 +02:00
duncanspumpkin ffeb1fa527 Initial refactor of entrance 2017-03-13 17:33:46 +00:00
Ted John bcc0bfa485 Rename climate.h to Climate.h 2017-03-11 22:59:33 +00:00
Ted John fb2c835d52 Include new config header 2017-02-18 15:45:10 +00:00
Ted John 5e812d5315 Merge pull request #5209 from IntelOrca/refactor/remove-c-rwops
Refactor and remove RWops from C code
2017-02-12 10:48:51 +00:00
Ted John 5e483b3288 Merge pull request #5153 from wolfreak99/refactor_peep_spawns_park_entrances
Refactor park entrance to a struct
2017-02-11 21:14:59 +00:00
wolfreak99 e9726a8121 Include compatibility comment 2017-02-11 15:33:22 -05:00
wolfreak99 e41f8108b7 Remove tabs 2017-02-11 14:07:05 -05:00
Ted John fb7f0a21d2 Remove game_load_sv6 that uses RWops 2017-02-11 12:03:03 +00:00
Ted John 1867ac2148 Make scenario_save just take a path 2017-02-11 12:03:03 +00:00
wolfreak99 f85dc8ced0 Code fixups 2017-02-08 21:46:54 -05:00