Commit Graph

438 Commits

Author SHA1 Message Date
Hielke Morsink c2d3ca5f85
Automatically deduce std::array types
This also improves formatting of some arrays with weird or no indention.
2021-10-14 23:27:28 +02:00
Silent 5fcbc3a53d
Fix #15299: Breakpad crash dumps are created in game directory 2021-10-05 18:23:06 +02:00
Hielke Morsink 4b4b3333d6
Remove unnecessary else blocks 2021-09-16 18:31:12 +02:00
Gymnasiast bdab3219cb
Modify object loading for JSON-only objects 2021-09-15 11:28:39 +02:00
ζeh Matt 59a6c34db4
Make use of std::optional strict 2021-09-13 20:02:32 +03:00
Hielke Morsink 15d3a4a9da
Update more include guards (#15254) 2021-08-21 12:55:28 +02:00
Hielke Morsink dd2467d805
Update include guards
- Update from C-style to pragma once
- Add missing include guard to ui.h
2021-08-21 09:43:26 +02:00
ZehMatt 47287e7fb1
Save crash dumps into a separate directory 2021-07-27 18:39:13 +03:00
ZehMatt dab33b3347
Add version to the crash dump info 2021-07-26 00:39:39 +03:00
duncanspumpkin e8e7bdb776 Update Backtrace.io token for v0.3.4.1 2021-07-25 20:04:58 +01:00
Gymnasiast 5584c96d33
Update Backtrace.io token for v0.3.4 2021-07-19 12:50:08 +02:00
Silent 95388cfbb1
Add File::GetSize to get object size in a simpler way
Drastically reduces startup speed because of the
optimization applied to ObjectAsset::GetSize - now the file
size is obtained without reading the entire file into memory.
2021-05-21 19:55:42 +02:00
Tulio Leao e23eaa164b Extract RequireNewWindow to Platform 2021-03-26 23:17:01 -03:00
Tulio Leao 62fc4c8034 Extract ResolveCasing to Platform 2021-03-26 23:17:01 -03:00
Tulio Leao c7ae064a4c Extract ShouldIgnoreCase to Platform 2021-03-26 23:17:01 -03:00
Tulio Leao 9a071aef76 Extract GetAbsolutePath to Platform 2021-03-26 23:17:01 -03:00
Tulio Leao f15bbd220a Extract IsPathSeparator to Platform 2021-03-25 23:45:01 -03:00
Tulio Leao f372117939 Extract GetLastModified to Platform 2021-03-14 09:36:44 -03:00
Ted John 7793f4c548
Update backtrace token for 0.3.4 2021-03-13 14:11:58 +01:00
Michael Steenbeek e40c0af9fd
Merge pull request #13682 from adam-bloom/macos_cmake_dylib
macOS CMake with vcpkg dependencies
2021-03-01 14:53:37 +01:00
adam-bloom 7bea24708e Fix GetBundlePath, add install paths to match cmake install 2021-02-28 15:48:29 -07:00
Michał Janiszewski 6249635fb8 Guard potentially unused const with proper defines 2021-02-28 23:10:25 +01:00
Michał Janiszewski 24f0407740 Add missing include in Windows. cpp 2021-02-25 10:56:27 +01:00
Michael Steenbeek 7274c6a7e7
Remove some unused symbols 2021-02-18 21:15:50 +01: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
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 c093a50f3f Refactor to use string_view more properly 2021-01-07 01:52:10 +09:00
Gymnasiast 09c6339bd4
Stub Execute() for Win32 2021-01-03 17:53:15 +01:00
Gymnasiast 72cc8df395
Stub FindApp on Windows 2021-01-03 17:53:14 +01:00
Aaron van Geffen 89cc45908f Replace Backtrace token for v0.3.2 2020-11-01 10:18:49 +01:00
Bryan DiLaura 894be65b6d
Closes #12415: Refactor CURRENCY_TYPE to strong enum (#13276)
* closes #12415 CURRENCY_TYPE enum refactor

* reverses unintended change in Linux.cpp

* closes #12415 CurrencyType strong enum
2020-10-25 01:33:06 -03:00
Keith Stellyes 171132fb6d
Add Execute and FindApp to Platform class 2020-10-22 21:17:28 +02:00
ζeh Matt 0c099be01c
Export loaded objects alongside inside the save for Backtrace reports (#13213) 2020-10-21 23:15:29 -03:00
Tulio Leao f56039abfd
Close #5520: Use std::filesystem over fts.h for recursive deletion 2020-10-11 17:15:05 +02:00
Aaron van Geffen 8726b37951
Remove remaining old style casts from macos.mm (#13153) 2020-10-10 23:45:50 +02:00
Mike Jones 4c26fb09b3
Close #12435: Refactor FILEDIALOG_TYPE to use strong enum (#13072)
* Close #12435: Refactor FILEDIALOG_TYPE to use strong enum
2020-10-02 22:43:06 -03:00
Gymnasiast 5f0aed0929
Add .sea support to New Scenario list and extension handling 2020-09-28 21:17:28 +02:00
Tulio Leao afff2c10f2 Add new backtrace token for v0.3.1 2020-09-27 17:35:46 -03:00
Tulio Leao 720c17eea6
Cleanup c-style casts from Platform.Win32.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao e032ba091d
Cleanup c-style casts from Shared.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao 2a85374c6a
Cleanup c-style casts from Windows.cpp 2020-09-10 21:36:21 +02:00
Michał Janiszewski c6b10bb051
Make GetCurrentExecutableDirectory public (#12791) 2020-08-27 21:03:41 +02:00
Michał Janiszewski 3d12dfec3e
Part of #11437: Refactor Win32 RemoveFileAssociations to Platform2 (#12773)
Additionally fixes missing changes from previous refactor in #12036 that
borked WinNT 5.1 support
2020-08-25 23:20:24 +02:00
Michał Janiszewski c8fbffa0e2
Update backtrace token for upcoming release 2020-08-13 23:28:31 +02:00
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
Matt 30376085cf Include missing headers 2020-08-05 16:29:29 +02:00
TELK bf08943929
Fix #12352: Wrong date format for file names (#12543)
Issue likely caused by 5ae592ec79

Also see: https://en.cppreference.com/w/cpp/chrono/c/tm
2020-08-01 18:43:19 +02:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Duncan b1f80efbe3
Use u8path on file path (#12205) 2020-07-12 21:56:02 +01:00
frutiemax 508344a088
Close #12174: Remove Formatter additions with uintptr_t 2020-07-11 18:56:12 +02:00
frutiemax 26ae2dbf04
Part of #11437: Move PlatformFileExists to Platform2.h (#12077) 2020-07-02 12:03:31 -03:00
frutiemax 5ae592ec79
Part of #11437: Move GetDateLocal and GetTimeLocal in Platform2.h 2020-06-28 21:46:14 +02:00
frutiemax d2542194fa
Part of #11437: move window_setup_file_association(s) in Platform2.hpp 2020-06-23 22:58:40 +02:00
Michael Steenbeek e83b86df4d
Replace occurrences of OpenRCT with OpenRCT2 (#11898) 2020-06-08 15:11:07 +02:00
Ted John 46bb30f8a1 Refactor rct_palette to GamePalette 2020-05-27 20:52:51 +01:00
Michael Steenbeek d7637cd70f
Replace many C-style casts (#11720) 2020-05-11 14:32:56 +02: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 295a98028e
Disable warnings around incompatible function pointer cast (#9543)
This addresses a compilation issue with newer (8+) mingw.

Co-authored-by: Gymnasiast <m.o.steenbeek@gmail.com>
2020-04-24 16:03:03 +02:00
ifimfree aaaae16d15
Close #11209: Show a warning when the user is running OpenRCT2 in Wine (#11395) 2020-04-23 19:12:54 +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
Hielke Morsink c0486e250e
Fix: config and park files not selected on crash (#11251) 2020-04-08 20:00:02 +02:00
Michał Janiszewski 89ae2b51d6
Update error message for unsuccessful crash uploads (#11217)
The upload will be rejected to a disabled submission token, which we sometimes do.
2020-04-03 22:48:27 +02:00
Michał Janiszewski 15a532725a
Change backtrace.io submission token (#11216)
This is to cut off v0.2.5 traces of which we have plenty and collect
ones that have #11190 in them.
2020-04-03 19:44:11 +02:00
Michał Janiszewski e19eaa6a98 Upload park recording in case of crash 2020-04-02 23:44:59 +02:00
Michael Steenbeek ba8a4e6183
Fix date display for non-American locales on *nix (#10949) 2020-03-20 00:10:15 +01:00
Aaron van Geffen a56a3fb804
Fix #6766: Changelog window won't open (#10954) 2020-03-17 21:38:15 +01:00
Michał Janiszewski 92e5958ab6
Improve WinNT 5.1/MinGW support (#10869) 2020-03-05 19:35:23 +01:00
Ted John 0689829980
Update Windows dependencies to v20 (#10642) 2020-02-01 21:38:07 +00:00
Michael Steenbeek 77d18a664b
Implement #10358: Clean up leftover references to openrct2.website 2020-01-13 20:20:49 +01:00
ζeh Matt 2242a72b29 Add assertion failure reason to the Backtrace service integration (#10562) 2020-01-13 19:22:45 +01:00
X123M3-256 5063cd2283 Fix line that causes build to fail on Mac (#10518) 2020-01-05 14:34:39 +01:00
Tulio Leao c4a865384e Move Mac-only str handling functions to Platform (#10264) 2020-01-04 12:44:40 +01:00
nia addd27d4dc Support NetBSD and simplify platform ifdefs. (#10271)
For files intended to support unixy freedesktopy systems,
reduce the ifdef down to __unix__ && !__APPLE__ && !__ANDROID__,
rather than naming linux and all the BSDs and so on by hand.

Should simplify adding support for systems like illumos in the
future.

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2019-12-22 17:07:39 +01:00
Ted John f7a8f5a0c7 Fix #10228: Can't import RCT1 Deluxe from Steam (#10260)
Use size of buffer rather than the size of a pointer which would always return 4 or 8 for the buffer size.
2019-11-18 10:05:16 +01:00
Michał Janiszewski afc92ee15a
ifdef-out WinNT 6.0+ APIs (#10198)
Occasionally I need to build a binary compatible with WinNT 5.1, e.g.
when testing out Wine or ReactOS. There are just a few minor changes
required to have a working build, but as they are not part of the
repository, I always end up doing them from scratch. I would like to
upstream them instead so I don't have to recreate them each time, even
if this is not the most common use case.
2019-11-08 23:16:15 +01:00
Ted John 401ec9e19f Update backtrace token 2019-08-13 18:35:37 +01:00
Michael Steenbeek e5ed5568a8
Remove conversion from UTF-8 to widechar and back again (#9637) 2019-07-24 21:56:49 +02:00
Ted John a1d9e52046 Rename ToUtf16 to ToWideChar
This is more correct as wchar_t size can differ, for example Linux typically uses 32 bits for wchar_t where as Windows uses 16 bits.
2019-07-22 23:44:03 +01:00
Ted John 6f61c94dbd Remove old widechar <-> utf-8 conversion function 2019-07-22 23:44:03 +01:00
muemart 7703774437 Correctly determine size of wchar arrays (#9490) 2019-06-27 19:46:03 +02:00
Ted John 15cb3e1889 Remove unnecessary new line characters from log calls (#9237) 2019-05-12 13:48:56 +02:00
Ted John 7074d6f3ae Apply review suggestions 2019-05-11 13:57:18 +01:00
Tom Lankhorst ed353faccf Implement replace_if condition lambda
Fix include typo and CS
2019-05-11 13:54:16 +01:00
Tom Lankhorst 744f2225ed Write platform tests 2019-05-11 13:54:16 +01:00
Tom Lankhorst bbd69496b4 Sanitize screenshot path 2019-05-11 13:54:16 +01:00
Filip Gawin 6833da77e3 Simplify boolean expresions 2019-05-10 22:00:38 +02:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Michał Janiszewski 57897d4cb5 Attach screenshot to backtrace.io report 2019-01-31 23:36:41 +01:00
Michał Janiszewski b27428835c Change http://backtrace.io token
Someone seems to be trying to use up all our backtrace.io quota by
submitting the same bug over and over again which was fixed in
https://github.com/OpenRCT2/OpenRCT2/pull/8533, 17 days ago now.

To prevent such behaviour, I've disabled the old token and replaced it
with a new one, causing dumps from old builds to be rejected now and not
counting towards our quota.
2019-01-14 21:18:33 +01:00
Michał Janiszewski 7e769ed662 Fix #7536: Android build fails to start (#8554)
This was a regression from #7435 which introduced threads and caused JNI
to misbehave and fail to load our expected classes. Provide a workaround
based on the description in https://stackoverflow.com/a/16302771 which
stores a main thread's class loader and uses that in neighbouring
threads.
2019-01-04 19:48: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 0a9527fd7d
Include config.ini in the dump (#8316) 2018-11-30 12:42:53 +01:00
Michał Janiszewski fe2ab7a653 Add compressed sv6 to backtrace.io uploads 2018-11-29 21:40:59 +01:00
Hielke Morsink 354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
Michał Janiszewski e521ade293
Replace gmtime with safer gmtime_r (#8174) 2018-10-27 15:04:15 -07:00
Michał Janiszewski 11005c9f77
Enable gzip-compression of minidumps, update information (#8159)
Enable gzip, but only for local save, as GitHub will accept
gzip-compressed files even if they don't advertise it explicitly. Update
changelog and GitHub issue template to reflect that.
2018-10-26 04:39:25 -07:00
Michał Janiszewski 80b75759b3
Merge pull request #8073 from janisozaur/breakpad-upload
Auto-upload crashes to backtrace.io
2018-10-26 09:43:14 +02:00
Michał Janiszewski 76b6bd82a0 Fix messagebox buttons 2018-10-25 23:18:19 +02:00
Michał Janiszewski 7238ced946 Disable gzip compression of dumps until this gets enabled on backtrace 2018-10-25 22:25:37 +02:00
Ted John f224f7181d
Search for Discord release of RCT2 (#8149) 2018-10-25 10:57:19 +01:00
Michał Janiszewski 5780914a58 Provide error messages after the dump has finished uploading 2018-10-25 00:00:00 +02:00
Ted John 3a839043ea Use native path separators 2018-10-24 23:36:14 +02:00
Michał Janiszewski 2d95052477 Compress minidumps with gzip 2018-10-24 23:36:14 +02:00
Michał Janiszewski 98aded2bff Update minidump upload token 2018-10-24 23:36:14 +02:00
Michał Janiszewski 23f930043b Auto-upload crashes to backtrace.io 2018-10-24 23:36:14 +02:00
Michał Janiszewski 7660dc8042
Automatically detect fts.h presence when compiling (#8071)
This should support libc-s that don't ship with glibc-like fts.h, e.g.
musl
2018-10-10 00:06:50 +02:00
Bart Ribbers 8e6eb08275 Fix compilation on musl (#8067) 2018-10-09 20:42:02 +02:00
Michał Janiszewski 1334b745dc
Refactor search for OpenRCT2 data on Linux (#8054)
It should now cover all use cases supported previously, with added
benefit of automatically checking and prioritising installed directories
(including DESTDIR=.) as well as path relative to $PWD.
2018-10-08 22:45:01 +02:00
Ted John 82107e5666
Merge pull request #7957 from TheAssassin/appimage
Add build scripts to create an AppImage.
2018-10-04 07:50:06 +01:00
Ted John 9da9a9968a Add /../share/openrct2 as possible install location
This allows AppImage to work correctly.
2018-09-29 13:58:38 +01:00
Ted John 2da2aa5622 Fix platform_get_username for unicode on Windows 2018-09-18 12:37:42 +01:00
pkubaj 03cd16220e Change ordering of includes (#7941)
It fixes build with LLVM 6.0.1 and GCC 7.3.0 on FreeBSD 11.2-RELEASE
2018-08-30 21:19:46 +02:00
Michał Janiszewski 72a9729928 Add missing separator to dump file path 2018-08-25 23:13:36 +02:00
Michał Janiszewski 75a3e638ea Update MSVC libraries to v18 to re-enable breakpad 2018-08-25 22:00:21 +02:00
Michael Steenbeek 9f891bfdcc
Allow opening SV7 files 2018-08-16 16:16:56 +02:00
Aaron van Geffen 7cc5bc87e9 Check result of FileTimeToLocalFileTime; add to changelog. 2018-08-15 00:15:06 +02:00
Hielke Morsink 4a442d0d6d Convert filetime to local time on Windows 2018-08-15 00:14:47 +02:00
Aaron van Geffen 786806e116 Use localtime instead of gmtime in file browser. 2018-08-15 00:14:47 +02:00
Michael Steenbeek 0a1b53e1c2
Auto-detect RCT1 files location (#7882) 2018-08-13 15:50:45 +02:00
Sijmen Schoon 56b174432d Implement platform_get_locale_date_format for Linux
Note that this currently, this isn't implemented in the C++ standard
library. This means that date_order() will always return no_order,
causing this function to always return the default
DATE_FORMAT_DAY_MONTH_YEAR, as is the case before this commit too.

Once date_order() will be properly implemented in the standard library
someday, it will however start returning the right order for the current
locale, causing this function to start working as intended.
2018-08-12 23:03:32 +02:00
Hielke Morsink 0b03464186
Replace 0 and NULL with nullptr (#7827) 2018-07-25 22:49:20 +02:00
clang-format d787872cbe Indent preprocessor directives 2018-07-23 16:00:23 +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
clang-format 0b3edc70f2 clang-format platform 2018-07-23 16:00:07 +02:00
Hielke Morsink 4d38475f12 Undefine keywords to fix macOS build 2018-07-23 15:58:01 +02:00
Hielke Morsink ce59ed0ba2 Fix include order and defines for Windows builds 2018-07-23 15:57:59 +02:00
Michael Steenbeek 8530d56a66
Add Danish translation (#7771) 2018-07-19 21:15:54 +02:00
Michał Janiszewski ab20dcde9f
Use "secure version" of swcanf (#7774)
This makes mingw builds usable again
2018-07-16 07:38:57 +01: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 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 aad1e69d7e
Add parentheses to macro arguments (#7686)
This adds parentheses around macro arguments that are either negative or used for calculations inside the macro itself. Doing this avoids getting errors in code that may look right.
2018-06-15 10:54:05 +02:00
Hielke Morsink 184c46992c Fix remaining non-empty list initializers 2018-06-05 16:07:54 +02:00
Michał Janiszewski f0525d23ae Remove unused function
Last call was removed in 66a6aa95f6
2018-06-03 19:56:11 +02:00
Ted John ea22c672d0 Only reuse CNG object if Windows 8+ 2018-06-01 21:27:33 +01:00
Michał Janiszewski bda9ae13be Remove obsolete defines
Replaced already by constexprs
2018-05-31 00:22:37 +02:00
Hielke Morsink 8d10bfb5a1 Add namespace closing comments 2018-05-04 22:54:43 +02:00
Hielke Morsink 5327c9feb4
Remove unused windows_get_registry_install_info (#7442) 2018-04-23 20:20:03 +02:00
Hielke Morsink 30063984e6
Delete unused function arguments or mark them so (#7426)
This aims to make future refactoring easier. The arguments are removed where possible, but kept and marked with C++17's [[maybe_unused]] where they could not be removed (e.g. when they are used as a callback, rather than called directly).

I've skipped the rides/<category>/* and peep/* source files, because the rides source files are mostly generated and have a ton of unused variables, and the peep source files are being refactored.
I've also skipped most of window/* source files, because most of the functions are used as callbacks and will be bulk-renamed at some point.
2018-04-20 13:56:37 +02:00
Ted John e3eff999a7 Fix building for mingw 2018-03-22 20:16:58 +00:00
Ted John 2c627b43ba Optionally use terminal colour codes 2018-03-22 20:16:58 +00:00
Michał Janiszewski 7d67291910 Synchronise definition guards with declarations for str utils 2018-03-21 22:39:19 +01:00
pkubaj 7adde37f56 Fix build with FreeBSD 2018-03-21 14:26:38 +01:00
Michał Janiszewski d0ec97bab2
Fix missing PATH_MAX on some Linux toolchains
Some toolchains (e.g. clang 7) require explicit include of <linux/limits.h> for PATH_MAX.
2018-03-20 08:18:56 +01:00
Michał Janiszewski 28391eaf5d Move cstring out of common.h 2018-03-18 23:29:13 +01:00
Michał Janiszewski 229c793b33 Fix NO_TTF builds for Windows and macOS 2018-03-09 16:40:40 +01:00