Commit Graph

353 Commits

Author SHA1 Message Date
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
Ted John 36cfc1bb29 Remove remaining SDL from platform code 2017-06-11 23:26:14 +01:00
Ted John ee7c97b7be Move scancode to key to openrct2ui 2017-06-11 23:22:32 +01:00
Ted John dfa1b47a4f Move keyboard shortcut code to libopenrct2ui. 2017-06-11 16:52:15 +01:00
Ted John 202cc269a7 Remove more SDL stuff from old platform code 2017-06-10 17:14:07 +01:00
Ted John abb857e51d Remove platform_get_non_window_flags 2017-06-10 16:40:08 +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
Ted John 40fc54291a Remove STUB from platform_get_locale_date_format
It is really annoying having the stub message appear on startup.
2017-06-05 19:57:51 +01:00
Ted John 94e982289e Fix openrct2-cli build
By using a dummy audio context, we can now make openrct2-cli start a headless instance without any SDL2 calls. SDL2 is still a dependency until we remove out the input code to openrct2-ui.
2017-06-04 00:18:26 +01: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
Ted John 3ebf5be3ea Fix mingw cmake 2017-05-29 22:38:46 +02:00
Richard Jenkins e8ec7ee58f Implement building of libopenrct2 and OpenRCT-UI for macOS
Initial setup of xcode for multiple targets

libopenrct2 partially working

Restore macOS mach_info init

Get macOS OpenRCT2-ui working if hackish

Implement UiContext for macOS properly

Put tabbing cancellation code back
2017-05-29 22:38:45 +02:00
Ted John 98d59ccaa3 Fix Linux build errors 2017-05-29 22:38:44 +02:00
Michał Janiszewski 423028dac9 Fix some warnings with clang and GCC 2017-05-29 22:38:44 +02:00
Ted John e2a7189663 Do not use SDL_Colour for gPalette 2017-05-29 22:38:44 +02:00
Ted John 08ae74293d Remove a few more SDL calls from core library 2017-05-29 22:38:44 +02:00
Ted John cf0dcb4753 Refactor file / directory dialogs to UiContext 2017-05-29 22:38:43 +02:00
Ted John 3fcd42fe2b Move more window code to UiContext 2017-05-29 22:38:43 +02:00
Ted John d206d181f2 Move audio code to UI project 2017-05-29 22:38:43 +02:00
Ted John 9d24e47e6f Fix build 2017-05-29 22:38:42 +02:00
Ted John f736e8ff96 Move more platform code to UiContext 2017-05-29 22:38:42 +02:00
Ted John 5885cb646f Start moving window logic to UI project 2017-05-29 22:38:42 +02:00
Ted John fedb8917c7 Create new CMake project for libopenrct2 2017-05-29 22:38:42 +02:00
Richard Jenkins 2f9f613201 Fix #3178: Precompose file name strings on macOS to prevent mojibake when displayed
* Precompose file name strings on macOS to prevent mojibake when displayed

* Ensure decomp-to-precomp string replacement is handled safely

* Add macOS non-ASCII handling to changelog; add comments to relevant block

* Fix #ifdef alignment

* Fix comment alignment
2017-05-23 09:30:13 +02:00
Richard Jenkins 493bb62457 Guard against null pointer in macos_str_decomp_to_precomp() 2017-05-22 14:28:56 +02:00
duncanspumpkin b9dc588da4 Fix return exit code for RCT2 builds 2017-05-16 20:16:10 +01:00
Richard Jenkins 86d8863496 Fix #5456: Paths with non-ASCII characters mishandled on macOS (#5463) 2017-05-11 09:43:53 +02:00
Ted John faba009f24 Merge pull request #5072 from X123M3-256/g2_offsets
Add support for x/y offsets in g2.dat
2017-05-09 22:16:50 +01:00
Craig Craig 9dd820e2e7 Spelling fixes 2017-05-08 08:30:50 +02:00
Ted John c4d2cd175d Use utf8 instead of char for platform_get_absolute_path 2017-05-07 19:17:11 +01:00
X7123M3-256 03606adbeb Fix more formatting 2017-05-07 01:01:07 +01:00
Gymnasiast 3d9e6a4e2d Fix formatting 2017-05-07 01:01:07 +01:00
Ted John 9a42edc695 Fix return of exit code 2017-05-07 01:01:07 +01:00
X123M3-256 d89fc32864 Use get_directory_path instead of dirname() 2017-05-07 01:01:06 +01:00
Ted John 7380c789e0 Implement platform_get_absolute_path for Windows 2017-05-07 01:01:06 +01:00
X7123M3-256 5e7ca2207e Fix indentation 2017-05-07 01:01:05 +01:00
X7123M3-256 3b12e4cc66 Add function to get an absolute path from a relative one 2017-05-07 01:01:05 +01:00
Michał Janiszewski 04b4ae429e Fix platform_get_ticks for POSIX
Previously it did not include seconds
2017-05-05 22:25:47 +02:00
Michał Janiszewski 03d1115425 Fix macOS version detection macros again 2017-05-05 10:37:41 +02:00
Michał Janiszewski 7fc9bf62ce Fix macros detecting macOS version 2017-05-05 08:46:03 +02:00
Richard Jenkins 28eb5fb279 Move mach_timebase_info init to core_init() 2017-05-05 00:40:07 +01:00
Richard Jenkins f8b79a4a3f Cache mach_base_info 2017-05-04 22:33:32 +01:00
Richard Jenkins 3d6f13da13 Whitespace fix 2017-05-04 22:10:00 +01:00
Richard Jenkins e1d964cb26 Implement platform_get_ticks() for macOS <10.12 2017-05-04 22:00:25 +01:00
Michał Janiszewski 8e6ea776f6 Add time.h include to shared.c for clock_gettime 2017-05-04 17:29:05 +01:00
Ted John 73fb132e41 Replace some SDL functions with our own 2017-05-04 17:27:51 +01:00
CraigCraig e0b875398b Tons of spelling fixes (#5413)
[ci skip]
2017-04-30 06:39:24 +02:00
Michał Janiszewski 92aefb477f Fix compilation with GCC7 2017-04-24 11:34:56 +02:00
Michał Janiszewski 0d4dd5849a Remove workaround for mingw bug, now fixed upstream 2017-04-16 08:44:37 +02:00
Marco Costa 6f0232431e Replace comment with STUB macro 2017-04-09 17:05:48 -04:00
Marco Costa e8136aa950 Remove unused include 2017-04-08 23:23:17 -04:00
Marco Costa 04ec93b038 Move stub implementation to posix.c 2017-04-08 23:10:16 -04:00
Marco Costa 8ed51d46ff Add import for date format 2017-04-08 22:58:45 -04:00
Marco Costa 8d2d430de0 Default implementation of date format 2017-04-08 22:50:34 -04:00
Marco Costa f1a1639c8c Auto-detect locale on first run 2017-04-08 22:39:19 -04:00
Marco Benzi Tobar 67b4d919b4 Update the window size when using maximise on macOS 2017-04-07 17:09:11 +02:00
Michał Janiszewski 07d943575d Fix invalid array size in platform_open_directory_browser 2017-04-04 22:10:23 +02:00
Michał Janiszewski 8cd704eca7 Guard array access in platform_open_directory_browser 2017-04-04 22:07:50 +02:00
Nelson Chen dc848bb8e3 macOS Sierra (10.12): Disallow Automatic Window Tabbing
Automatic Window Tabbing in macOS Sierra causes a menu item called "Show
Tab Bar" to appear under the Window menu in the menu bar. Selecting this
option causes a double-title bar effect as there is no option in OpenRCT2
to make new tabbed "documents". This double-title bar can be untoggled
by selecting "Hide Tab Bar".

I don't think OpenRCT2 is going to become a tabbed document-oriented
themepark simulator anytime soon. Thanks, but no thanks Sierra.

References:
* https://codereview.chromium.org/2325313002/
* https://hg.mozilla.org/releases/mozilla-aurora/rev/385b9ea08ff7

* Use better Obj-C styling for macos_disallow_automatic_window_tabbing()
2017-03-13 23:03:29 +01:00
Ted John bcc0bfa485 Rename climate.h to Climate.h 2017-03-11 22:59:33 +00:00
Ted John e960da95e2 Add a workaround for MINGW 2017-03-08 20:39:45 +00:00
Ted John 925d64249f Add openrct2:// uri scheme support
This sets up a URI scheme for openrct2 for Windows by adding the necessary registry keys. This is done on startup every time to keep the binary location up to date. URI handling currently supports joining a server.
2017-03-08 19:06:42 +00:00
LRFLEW f9c2d83393 Include new config header in macos.m 2017-02-21 01:51:35 -06:00
Ted John a473740efd Fix build errors 2017-02-19 21:41:36 +00:00
Ted John fb2c835d52 Include new config header 2017-02-18 15:45:10 +00:00
Christian Murphy d8cd8f1b13 Move Preprocessor to linux.c 2017-02-17 22:43:10 +00:00
Christian Murphy 29ba9586f5 Update platform.h 2017-02-16 21:47:00 +00:00
Christian Murphy b40c57934b Update platform.h 2017-02-16 12:23:32 +00:00
Christian Murphy c3ea18f490 Modified MAX_PATH usage to use more appropriate MAX_COMMAND_LENGTH 2017-02-15 23:10:04 +00:00
Christian Murphy b552231c1d more bash escapes on zenity commands for file dialog 2017-02-15 21:45:21 +00:00
Christian Murphy fb0661b55e improve file dialogs (zenity + kdialog) 2017-02-13 21:11:13 +00:00
Ted John 591e81a0af Merge pull request #5157 from IntelOrca/fix/windows-tests-assert
Allow control of assertion behaviour
2017-02-10 18:18:49 +00:00
Ted John b79e714740 Fix compilation of sprite.cpp 2017-02-09 18:50:30 +00:00
Ted John e649e7ad4a Move creation of version string to Version.cpp 2017-02-09 17:58:19 +00:00
Ted John 5787a0bf90 Use S6Exporter for crash handler 2017-02-08 22:17:01 +00:00
muemart a64dae573a Fix data path command line on windows 2017-01-31 19:41:26 +00:00
duncanspumpkin 7cddd36feb Fix RCT2 builds
Due to increased warnings unreachable code warning was causing a failure to compile.
2017-01-25 18:35:28 +00:00
Ted John efb64603eb Only create OpenGL window when necessary
Currently the game window is always created with an OpenGL context which then means that opengl32.dll and other modules are loaded. The OpenGL window flag will now only be used if the config drawing engine is set to OpenGL. This now means that a restart of the game is required when switching to the OpenGL drawing engine for Windows.

#5104
2017-01-22 21:38:08 +00:00
Ted John fc66f42c31 Add config option to enable / disable light FX 2017-01-21 12:01:01 +00:00
Broxzier 60603ae10a Use types from common.h 2017-01-14 12:37:31 +01:00
Michał Janiszewski 33dcb1a506 Rename types to avoid shadowing 2017-01-13 10:57:00 +01:00
Ted John d70cd3775e Fix silent warnings 2017-01-12 18:40:49 +00:00
Ted John 1bf7a0ffdb Fix Win32 warnings 2017-01-12 18:28:51 +00:00
Ted John b79af110c7 Fix more warnings 2017-01-12 18:02:28 +00:00
Ferdinand Thiessen afbe1dda0f Fix 'No real prototype' warnings 2017-01-12 09:52:44 +01:00
LRFLEW 47c532d020 Don't zoom to cursor for keyboard or toolbar inputs (#5028) 2017-01-11 17:43:11 -06:00
Ted John 191c4ab998 Fix mingw build 2017-01-10 17:58:04 +00:00
Ted John 21bb7b9da6 Add back main entry point for mingw 2017-01-10 17:29:55 +00:00
Ted John d535e290d3 Remove --console CLI switch 2017-01-10 17:29:52 +00:00
Ted John 73b21b5880 Convert openrct2 to static library 2017-01-10 17:29:02 +00:00
Michał Janiszewski bd140e78fb Compile fixes for MinGW (#4998)
* Fix mismatched condition in CMakeLists.txt

* Fix MinGW release builds
2017-01-06 07:04:25 +01:00
Michał Janiszewski 6684851115 Fix MinGW builds 2017-01-04 18:28:39 +00:00
Ted John 25bc798ff8 Move contents of src into project sub directory 2017-01-04 17:44:12 +00:00