Commit Graph

202 Commits

Author SHA1 Message Date
Matt Thomson a8f8f06e2d
Fix #12402: Refactor MEASUREMENT_FORMAT to use strong enum (#12642)
* Fix #12402: Refactor MEASUREMENT_FORMAT to use strong enum

* Remove redundant default branches

Co-authored-by: Matt Thomson <matt-thomson@users.noreply.github.com>
2020-08-13 21:51:28 +01:00
Michael Lu 7cd6e72edd
Refactor TEMPERATURE_FORMAT to use strong enum (#12610)
* Refactor TEMPERATURE_FORMAT to use strong enum

* Rename TEMPERATURE_FORMAT to TemperatureFormat

* Rename TemperatureFormat to TempueratureUnit
2020-08-09 07:26:46 +01:00
Tulio Leao be9dca6945
Close #12416: Refactor CURRENCY_AFFIX to use strong enum (#12589)
* Close #12416: Refactor CURRENCY_AFFIX to use strong enum

* Add static assert to check config enum type

Co-authored-by: Matt Thomson <matt-thomson@users.noreply.github.com>
2020-08-05 20:26:18 -03:00
Matt Thomson 788bc1581c Add static assert to check config enum type 2020-08-05 20:48:02 +01:00
Matt 0dc43d66e4 Remove the use of INTERFACE macro and macro its self 2020-08-05 16:30:44 +02:00
Matt 83355e35cc Move IStream, MemoryStream, FileStream into OpenRCT2 namespace 2020-08-05 16:29:36 +02:00
Matt 30376085cf Include missing headers 2020-08-05 16:29:29 +02:00
Matt Thomson 150100d89f Fix #12416: Refactor CURRENCY_AFFIX to use strong enum 2020-08-04 21:35:59 +01:00
Michał Janiszewski 3b60740128
Add int64_t support to INI parser (#12374) 2020-07-25 09:37:35 +02:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02: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
Ted John 8f77125cdb
Fix #11298: Unable to advertise server (500): Retry with ipv4 only (#11824)
Add new config option to allow any address to be advertised. This then
doesn't rely on the master server retrieving the server IP address via
the HTTP request which can often be IPv6 by default.
2020-05-30 18:21:22 +02:00
Gymnasiast 9a9ab47856
Remove Twitch from the rest of the code 2020-05-28 09:28:32 +02:00
Michael Steenbeek 451af76fb6
Remove nonfunctional "guest is lost" notification (#11722) 2020-05-11 21:31:02 +02:00
Michael Steenbeek 29fcdb5392
Fix Steam RCT1 detection (#11543) 2020-04-30 14:49:04 +02:00
Ted John 0e8c627324 Add config option for hot reload and refactor 2020-04-26 14:35:01 +01:00
Michael Steenbeek 0ecc64f781
Fix #11407: Setting an RCT1 path needs better error messages (#11418) 2020-04-25 15:36:44 +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
Aaron van Geffen a81488d704
Fix #11272: Make casualty and stalled vehicle notifications optional 2020-04-16 14:41:39 +02:00
WantDiscussion 828eef7411
Introduced optional light effects for vehicles at night. (#10970) 2020-03-20 11:47:31 +01:00
Michael Berk 914c07a711 Added Random Title Sequence 2020-01-22 11:41:34 +01:00
Ted John 6f61c94dbd Remove old widechar <-> utf-8 conversion function 2019-07-22 23:44:03 +01:00
Spongeloaf 5777074a3e #9285 Add feature to remember scernario tab 2019-06-21 12:54:49 -04:00
Hielke Morsink b3ed5b0cc1 Make giant screenshots transparent by default 2019-06-09 11:03:01 +02:00
Hielke Morsink 5418eb6e34 Add transparency setting to options window 2019-06-09 11:03:01 +02:00
Ted John fec6d660c6 Remove obsolete configs:
- no crashes
- test unfinished track
2019-05-28 16:50:08 +01:00
ζeh Matt c8f822ea70
Gamestate snapshots (#8819)
* Add initial interface.

* Implement move operator in MemoryStream

* Add pod array serialisation traits.

* Add push_back with move semantics to CircularBuffer

* Initial implementation of GameStateSnapshots

* Add GameStateSnapshots to Context.

* Add mp_desync console command.

* Compare sprite data and fill change list.

* Minor changes.

* Proof of concept.

* Calculate offset instead of using offsetof

* Implement game state difference detection

* Update mp_desync console command.

* Fix identification of sprite remove/add.

* Fix crash when only one peep in park when using mp_desync

* Output state differences into user directory desync folder.

* Add desync debugging as an option.

* Add information to network status when a desync report was created.

* Cast to proper type for %llu.

* Update xcode project

* Add more information to the diffed data.

* Remove client-only relevant fields.

* Cleanup.

* Add better name output for misc sprites

* Add srand0 and tick information to the output

* Bump up network version

* Cleanup

* Set desync_debugging to false as default

* Apply suggestions
2019-05-11 21:31:34 +02:00
ζeh Matt 62f163a67d Don't enable multithreading option by default. (#9039) 2019-04-04 12:11:37 +02:00
Matt 37c3809744 Implement partial multicore rendering 2019-03-31 15:50:55 +02:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Matt a7f8c8aa36 Refactor utf8* use over std::string 2019-02-24 00:08:05 +01:00
Tom Lankhorst 521948139c Chat toggle button (#8648)
* Add chat_available()

* Add appropriate strings

* Add new Chat icon

* Implement Chat button

* CS

* Fix chat icon

* Make chat icon a bit smaller and less bright

* Update chat icon

* Update changelog
2019-02-03 23:30:34 +01:00
Lars Toenning 7de115263e Fix #8377: Change number of autosaves that are stored (#8440) 2019-01-19 14:31:12 +01:00
Michał Janiszewski ca3d9cea91 Add missing free() call in config_release() 2019-01-02 20:02:14 +01:00
Ted John f224f7181d
Search for Discord release of RCT2 (#8149) 2018-10-25 10:57:19 +01:00
Michael Steenbeek 28c5221f6d
Fix missing comma 2018-08-21 21:51:50 +02:00
Michael Steenbeek 7743d0e8e7
Prefer Steam and GOG installs to disc during autodetection
Some people apparently have both a disc version and a Steam version of RCT2 installed. The problem is that the former does not always include the expansions, while the latter does. The same applies to RCT1.

By checking for Steam/GOG versions first, these problems can be avoided.
2018-08-20 17:48:52 +02:00
Aaron van Geffen 25170fda45 Implement #7658: Add option to always use system file browsing window. 2018-08-18 13:28:27 +02:00
Sijmen Schoon 0cdd7c8cc8 Add master sound checkbox and master volume slider
Also includes some rewriting of rct_scroll code that I did while
debugging the issue with more than two rct_scrolls in one window. I
decided to leave it in.
2018-08-17 22:14:11 +02:00
Michael Steenbeek 0a1b53e1c2
Auto-detect RCT1 files location (#7882) 2018-08-13 15:50:45 +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 472320d8f3 Correct formatting up to the management folder
I went over the commits ab7f22f..8726712 (bulk format commits for game actions to management inclusive) and corrected all mistakes I found. Most of them have to do with arrays missing trailing commas, making clang-format indent the entire array or not add breaks between the values.
2018-07-23 16:00:15 +02:00
clang-format 6f2e84e593 clang-format config 2018-07-23 15:58:02 +02:00
Øystein Dale 5744509b87 Fix memory leak in config
Assigning a pointer to std::string appears to only perform a copy and
does not transfer ownership of the pointer, thus the allocated memory is
will never be freed. Use StringBuilder::GetStdString() to avoid the
memory leak.
2018-07-18 00:57:37 +02:00
Michael Steenbeek 9e559d577a
Fix Steam path for Linux and macOS
While OpenRCT2 already had code to look up the Steam path on macOS and Linux, it didn't look in the correct directory. This meant that it wouldn't detect the presence of RCT2, even if the user had downloaded it via the Steam Console.
2018-07-05 09:42:52 +02:00
Michael Steenbeek fae7c61f05 Fix config read/write 2018-06-20 17:56:57 +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
Michał Janiszewski 1d28826b79 Fix -Wdocumentation and add it to default warnings 2018-06-11 09:52:54 +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
Aaron van Geffen bf44007197 Allow fine-tuning the virtual floor style (#7577)
The virtual floor by @JeroenDStout, introduced in the v0.1.2 release, has generally been well-received. However, some players find it too intrusive in its current appearance (cf. #7221). This PR gives them the option of a toned-down version, rather than having to turn it off completely.

![screenshot_20180528_221350](https://user-images.githubusercontent.com/604665/40628292-6e71358e-62c4-11e8-9293-e166e75d0da6.png)

The clear/transparent style, introduced by this PR, looks like the virtual floor as originally introduced in #6338:
![](https://user-images.githubusercontent.com/14242454/31050274-e3f0e62e-a645-11e7-9b10-ec26b733d631.gif)

The glassy/translucent style is the virtual floor as we've come to know it since the v0.1.2 release, and remains the default setting.
2018-05-30 13:09:50 +02:00
Park Joon-Kyu 30fa405eb3 Make Twitch integration API URL configurable. (#7555) 2018-05-28 22:01:37 +02:00
Ted John 7b610fd3c0 Use shared_ptr more for UiContext in relation to DrawingEngine 2018-05-11 20:37:48 +01:00
Hielke Morsink 8d10bfb5a1 Add namespace closing comments 2018-05-04 22:54:43 +02:00
thyeggman ccb1b330a5 Option for early scenario completion (#7187) 2018-03-20 12:58:59 +01:00
Michał Janiszewski 3303246b09 Reduce header inclusions 2018-03-20 00:27:58 +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
Hielke Morsink 5115cdddd8 Remove unused screenshot_format configuration 2018-03-09 15:58:29 +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 e996c83b70 Create config directory if it doesn't exist 2018-02-11 10:39:15 +00: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
Michael Steenbeek b4018d398c
Add more object source filters 2018-01-31 13:07:20 +01:00
Michał Janiszewski 48c3225cb7 Fix types of caught exception in IniReader.cpp 2018-01-18 19:06:05 +01:00
Adakite Systems 0681ba4e04 Read and set edge scrolling speed via config
- For future reference, the default edge scrolling speed
value of 12 is retained.
2018-01-14 00:51:51 +00:00
ZehMatt 84f2917f59 Use const and constexpr whenever possible. 2018-01-11 22:29:08 +01:00
Aaron van Geffen 1d7bec8a11 Make the virtual floor optional, on by default. 2018-01-11 10:37:40 +01:00
Ted John c3eab7ead6 Refactor window.c to C++ 2018-01-07 12:39:58 +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
Michał Janiszewski 4d0c88fb94 Mark constructors explicit (#6928) 2018-01-04 01:12:34 +00:00
Ted John 49f5611bd1 Rename scenario.c|h to cpp 2018-01-03 15:07:17 +01:00
Tobias Kohlbau 7a8c5c2842 multiplayer: Adds option to pause server
OpenRCT2 does not provide a simple function to pause a server
while no client is connected. This patch adds a so called
"pause_server_if_no_clients" flag within network section of
config.ini. By default this flag is set to false to be backward
compatible with running servers. After setting this flag to
true the game is paused on launch and gets unpaused on first
connection.

Signed-off-by: Tobias Kohlbau <tobias@kohlbau.de>
2017-12-31 12:55:07 +01:00
Michał Janiszewski c4c5439943 Add missing include guards 2017-12-26 22:16:03 +01:00
LRFLEW eed00ea363 Add Vsync Toggle to Options 2017-12-14 11:18:28 +01:00
Michael Steenbeek e3c52360db Remove most usages of separate flag
This removes most usages of the separate flag, instead relying on ride groups to do its job.
Research is more complicated and will follow in another commit.
2017-12-08 10:28:29 +01:00
Aaron van Geffen c000263bbb Remove construction marker colour option. 2017-12-04 11:26:53 +01:00
Aaron van Geffen 837b177d9d Simplify UI scaling display quality options (#6764)
Simplify UI scaling display quality options.

This removes three options:
* 'Use NN scaling at integer scales', as NN is decidedly preferable at integer scales.
* Anisotropic scaling, as it produces results very similar (if not equal) to linear scaling.
* NN as a selectable option in the dropdown - NN is forced on integer scales and unavailable for non-integer scales.
2017-12-03 22:35:16 +01:00
Ted John 66a6aa95f6 Redirect platform_get_user_directory to IPlatformEnvironment
- Remove old code for getting user directory, redirect to IPlatformEnvironment.
- Fix config loading so that it uses path straight from IPlatformEnvironment.
- Add more special folder implementation in Platform2.
2017-12-01 21:09:52 +00:00
Philip Goto 4dfcb32d85 Fix spelling errors in neighbour 2017-11-06 23:05:21 +01:00
Philip Goto 6377ac7bfb Create enum for scale quality 2017-11-06 23:05:21 +01:00
Christian F. Coors 06afeeda9a Apply some refactoring 2017-11-02 12:22:28 +01:00
Robert Jordan c9c0c07eca RCT2 Steam path locator: improve OS support
Now looks for RCT2 install within OS-specific steam install directories.
Also checks the registry in Windows in case Steam has a custom install
path.
2017-10-24 18:36:40 +02:00
TELK 1043be5bd5 Fix Twitch config not being read correctly 2017-10-21 09:42:41 +02:00
Liam Parker b2a781dc1d Fix #6518: Correctly load guest left park from config
OpenRCT2 was reading a "guest_entered_left_park" value for the notification setting.

The value is saved as "guest_left_park" however. Mistake made during refactor.
2017-10-19 21:58:49 +01:00
Aaron van Geffen 551fdabc7f Make the hinting threshold configurable per font.
This addresses the issue that tofu would not show up in Arial on macOS if the
threshold was set to 60. It being the fallback font, it is important that they
do, which requires lowering to at most 43.

However, it is even more important that the threshold is left at 60 for kanji
in e.g. Japanese to render properly.

Hence, for the moment, Arial is the only font now using a hinting threshold
of 40, for now.
2017-10-15 22:31:11 +02:00
Aaron van Geffen 2dcf9c73e7 Make font hinting optional through config.ini. 2017-10-15 22:31:11 +02:00
Michał Janiszewski 00fd18809c Move extern "C" {} blocks to headers (#6282) 2017-09-18 17:05:28 +02:00
Gymnasiast dba7d6053e Clarify elevated permissions warning, insert line break in data files message, fixes #6215 2017-08-31 10:55:33 +02:00
Michał Janiszewski 6ee9bf6799 Free listen_address when releasing config 2017-08-02 23:16:00 +02:00
Ted John 354a26a9d2 Use std::string for player name
Removes memory leak.
2017-07-22 09:48:34 +01:00
Keatzee ea87e87750 Fix #4301: Remove leading/trailing space from playername 2017-07-22 09:43:24 +01:00
Ted John f08db17d94 Merge pull request #5713 from rwjuk/fix5707
Fix #5707: Usernames aren't detected for multiplayer
2017-06-27 13:27:21 +01:00
Richard Jenkins 1893326b62 Check for file existence before releasing config in config_open() (#5712) 2017-06-27 13:23:16 +01:00
rwjuk c904fa9fe2 Duplicate string literal for assignment to utf8* var 2017-06-26 20:58:36 +01:00
rwjuk 3162b9c221 Use String::IsNullOrEmpty() 2017-06-26 19:10:55 +01:00
rwjuk 3236701d51 Fix #5707: Usernames aren't detected for multiplayer 2017-06-26 18:59:01 +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
Marijn van der Werf 8766ec37a1 Add Android project 2017-06-15 14:22:15 +02:00