Commit Graph

331 Commits

Author SHA1 Message Date
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
Michael Steenbeek d481cca2ed
Remove some redundant casts and fix rct_sprite::AsDuck() 2018-02-15 13:04:25 +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
Michał Janiszewski 35b86e3aa1 Fix Android assertion (#7148) 2018-02-08 07:47:48 +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
Marijn van der Werf 941f433aa8 Use Objective-C++ for macOS platform file 2018-02-05 15:34:45 +01:00
Brian Callahan e8484d1816 Fix build on OpenBSD and FreeBSD 2018-02-02 12:41:26 +00:00