Commit Graph

342 Commits

Author SHA1 Message Date
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
Richard Jenkins 172b5907fa Fix platform functions for macOS 2018-02-02 12:41:26 +00:00
Ted John 87cd9f88b3 Rewrite Platform::GetInstallPath 2018-02-02 12:41:26 +00:00
Gymnasiast 5cc21fd21b Replace NULL with nullptr in C++ files 2018-01-29 21:33:21 +00:00
Ted John cb44dc5c21 Fix changelog 2018-01-21 11:17:41 +00:00
Michał Janiszewski a634b7e2cb Add comment explaining reasoning behind our own getumask() 2018-01-18 22:47:10 +01:00
Michał Janiszewski c6e2f1a6ea Fix Android.cpp 2018-01-18 22:42:54 +01:00
Ted John 61450353cb Fix build for Linux 2018-01-18 21:25:54 +00:00
Michael Steenbeek f551a150fe Fix Xcode project 2018-01-18 21:13:38 +00:00
Ted John 974ef800cb Rename remaining platform c files to cpp 2018-01-18 21:12:41 +00:00
Ted John d9d2b2373d Rename crash.h to Crash.h 2018-01-18 21:12:41 +00:00
Ted John 34d41aeadd Convert shared.c to C++ 2018-01-18 21:12:41 +00:00
Richard Jenkins af76cef94b
Fix bracket placement 2018-01-18 14:08:06 +00:00
Ted John 8630498213
Convert platform/windows.c to C++ (#7044) 2018-01-18 12:50:34 +00:00
Ted John bea500638b Remove old file enumerator functions from platform 2018-01-18 11:38:52 +01:00
Grant Barker 52ad1e1795 fix make error on macOS 2018-01-17 23:54:57 +00:00
Aaron van Geffen 6a404eb5dc Make MINGW happy, too. 2018-01-11 20:27:40 +01:00
Richard Jenkins 4a4aa80f31 Fix Windows implementation 2018-01-11 20:27:40 +01:00
Aaron van Geffen aa82df2647 Experimental: use system date/time settings on Windows. 2018-01-11 20:27:40 +01:00
Michael Steenbeek 6a88d6e04d Move and rename RCT{1,2,12}.h 2018-01-09 13:36:41 +01:00
Michael Steenbeek 755add6c9a
Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
Ted John 3dcbebcf68 Refactor drawing.c to C++ 2018-01-05 22:57:57 +01:00
Ted John 0c3c998177 Refactor lightfx.c to C++ 2018-01-05 22:57:55 +01:00
Ted John 02c58a6c5a Remove custom base Exception class 2018-01-05 18:11:47 +00:00
Michał Janiszewski 33a94fe1bb Use C++ headers in C++ code 2018-01-04 07:36:54 +01:00
Ted John 0cbc8bea10 Fix compile of Scenario.cpp 2018-01-03 15:07:17 +01:00
Ted John 49f5611bd1 Rename scenario.c|h to cpp 2018-01-03 15:07:17 +01:00
Michał Janiszewski 645b36169d Move SSE4.1 code to its own file, detect SSE4.1 in runtime 2018-01-01 23:49:09 +01:00
Michał Janiszewski 8089cadc40 Reduce code duplication 2017-12-26 18:08:56 +01:00
Michael Steenbeek 1a9975d683 Compile util and cheats as C++ 2017-12-14 10:03:21 +01:00
Michał Janiszewski e5da0f4ffc Fix Android builds 2017-12-05 22:48:14 +01:00
Michael Steenbeek 60d8865efb Compile game.c and game.h as C++ 2017-12-05 09:10:27 +01:00
Ted John 107461bbe8 Reintroduce XDG_CONFIG_HOME
Accidentally removed resolving the user data path by XDG_CONFIG_HOME environment variable
2017-12-03 19:22:35 +00:00
Ted John 11fac1bbf5 Change back to current directory structure 2017-12-01 21:09:52 +00:00
Michael Steenbeek 8a62229a5b Fix build on Xcode 2017-12-01 21:09:52 +00:00
Ted John 205fdaefa7 Split up Platform2 by OS 2017-12-01 21:09:52 +00:00
Ted John bbc389d18e Fix remaining code issues 2017-12-01 21:09:52 +00:00
Ted John ea356cd2b9 Fix mingw 2017-12-01 21:09:52 +00:00
Ted John 679aae801d Fix GetFolderPath for Windows 2017-12-01 21:09:52 +00: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
Ted John dcb92a466d Add new base path for user data and config
Refactor more path resolution to Platform2.cpp
2017-12-01 21:09:45 +00:00
Aaron van Geffen 1747253c42 Do not accept implicit font substitutions from FontConfig.
FontConfig implicitly falls back to any default font it is configured to handle.
In our implementation, this cannot account for supported character sets, leading
to unrendered characters (tofu) when trying to render e.g. CJK characters using a
Western (sans-)serif font. We therefore ignore substitutions FontConfig provides,
and instead rely on exact matches on the fonts predefined for each font family.
2017-11-30 23:35:02 +01:00
Ted John d649a3e8b4
Merge pull request #6631 from sajattack/develop
replace flock with fcntl for better os compatibility
2017-11-16 20:28:24 +00:00
Michał Janiszewski 49dbdefe0f Format shared.c 2017-11-08 08:45:05 +01:00
Michał Janiszewski b69b0be610 Move strndup implementation to shared.c 2017-11-08 08:45:05 +01:00
Paul bf87489da8
make changes suggested in review 2017-11-07 00:15:22 -08:00
Paul 9325fffd9c
Update posix.c 2017-11-06 20:19:43 -08:00
Paul f202f19897
Update posix.c 2017-11-06 19:49:02 -08:00
Paul 62383f7cb5
fix indentation 2017-11-06 14:58:06 -08:00
Paul 8093b6369b
replace flock with fnctl for better compatibility 2017-11-06 14:53:59 -08:00
Michael Steenbeek 5035492f8c Fix #6535: Donut shop renders black spots that should be white
Issue caused by a regression that also broke #1749 (rainbow path) and the pause button.
Reinstated the fix from 599c259603.
2017-10-27 12:07:52 +02:00
Robert Jordan 98043c284b Fix: Steam path locator Android build error
Added `platform_get_steam_path` to android.c
2017-10-25 18:37:26 +02: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
Michał Janiszewski c4538496c5 Make sure variables are either static or declared externally 2017-10-09 22:59:40 +02:00
Michał Janiszewski 5ab9f938a7 Update files missed in the great extern "C" cleanup of 2017 2017-09-28 23:29:16 +02:00
ZehMatt 5187946bc9 Fix #6309: Lightfx being enabled with incompatible drawing engine. 2017-09-28 08:01:25 +02:00
Michał Janiszewski 00fd18809c Move extern "C" {} blocks to headers (#6282) 2017-09-18 17:05:28 +02:00
Michał Janiszewski 23ec1d29e7 Don't report elevated process on Emscripten 2017-09-08 11:57:24 +02:00
Michał Janiszewski 7a0a344014 Don't use unavailable fts.h for Emscripten 2017-09-08 11:57:24 +02:00
Michał Janiszewski a13c30795d Add fcntl.h include to POSIX platform
Required for `open()`, etc.
2017-09-03 14:48:50 +02:00
Michał Janiszewski 90ea8eee88 Include time.h for time_t 2017-08-24 17:10:08 +02:00
Michał Janiszewski 99d6bcf811 Only include fontconfig when TTF is enabled 2017-08-24 08:49:25 +02:00
Michał Janiszewski d698ad1100 Convert NULL -> nullptr in C++ 2017-08-15 11:51:56 +02:00
Marijn van der Werf dc7f4bcf89 Convert most dialogs to C++ 2017-08-10 13:42:27 +02:00
Richard Jenkins 727d3270b4 Fix android build post 6110 2017-08-08 23:50:41 +01:00
rwjuk 18791fa85b Fix doc path resolution 2017-08-08 00:10:42 +02:00
rwjuk b70c748ff6 Fix changelog resolution on linux 2017-08-08 00:10:42 +02:00
rwjuk 4132b85c02 Implement platform-specific changelog path funcs 2017-08-08 00:10:42 +02:00
duncanspumpkin 18d082053e Rename cpp files to use TitleCase 2017-08-04 18:12:54 +02:00
Brian Callahan 9ef629a47d Reduce strength of an OpenBSD-specific comment
[ci skip]
Change "must" to "may have to," pointed out by a user.
2017-07-31 22:43:41 +02:00
Richard Jenkins 06d1f49d61 Display a warning dialog if user runs program elevated (#6063) 2017-07-29 15:21:33 +01:00
Ted John 5614e55f84 Remove more redundant platform functions 2017-07-16 23:25:11 +01:00
William Wallace ae110a9159 Allow switching between OpenGL and other renderers without restarting 2017-07-13 19:04:37 +01:00
ζeh Matt ec236f0bf5 Fix platform_get_ticks resolution to match other platforms. (#5843) 2017-07-10 21:46:11 +02: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
David CARLIER 04ed2d78d2 Fix building on FreeBSD 2017-06-27 08:56:03 +02:00
Brian Callahan 46ae0578e4 Add a note for OpenBSD and getting path names of running executables. 2017-06-25 23:26:26 +02:00
Brian Callahan fe8f949b3f Add OpenBSD support. 2017-06-25 23:25:46 +02: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
Michael Steenbeek 9c3a16b6e0 Merge pull request #5611 from OpenRCT2/android
Android
2017-06-19 10:25:18 +02:00
Marijn van der Werf ddff36c9ee tabs to spaces 2017-06-19 02:54:21 +02:00
Richard Jenkins 306d2623ef Fix #5617, PLATFORM_MODIFIER defined twice for macOS correctly (#5633)
* Fix #5617, PLATFORM_MODIFIER defined twice for macOS correctly

And revert incorrect 'fix'

* Remove all keyboard defines from platform.h
2017-06-18 21:47:51 +02:00
Marijn van der Werf 0341841cf7 Remove commented function 2017-06-16 22:55:08 +02:00
Marijn van der Werf 8766ec37a1 Add Android project 2017-06-15 14:22:15 +02:00
rwjuk 5f5f12a63c Fix #5617: PLATFORM_MODIFIER defined twice for macOS 2017-06-15 07:47:31 +02:00
duncanspumpkin e70a96c04f Remove Win32 debug special builds
Win32 debug previously built a special .dll build to allow calling into RCT2. This has been broken for a while and has little use anymore. It has therefore been removed.
2017-06-13 12:23:26 +01:00
Ted John 29f0372da8 Reduce SDL2 in headers 2017-06-12 19:56:32 +01:00
Ted John 7e9f7df7d1 Use standard platform defines 2017-06-12 18:01:51 +01:00
Ted John 407e99bbc2 Fix mingw builds 2017-06-12 17:13:18 +01:00
Ted John 902bba6906 Fix compiler errors, add ctype.h in required source files 2017-06-11 23:43:28 +01:00