Commit Graph

81 Commits

Author SHA1 Message Date
Ted John 7ac0fa1316 Demonstrate using Windows 10 WRL API and GameBar API 2016-10-28 23:33:52 +01:00
Ted John aef32c0fba Merge pull request #4696 from IntelOrca/render/night-lights
The light effects mod branch #3798 by @JeroenDStout has become quite out of date. I plan to properly implement it, but first I want to merge in what we have already, so that I can branch off develop again and rebase (currently rebasing this branch is too difficult, far too many commits).

Most code that this is merging is protected by the __ENABLE_LIGHTFX__ directive, so it should not make any difference until its time to enable it via a new pull request.

I have isolated it as much as possible to lightfx.c.
2016-10-25 12:12:48 +01:00
Ted John adb2ae616c Windows: Call FreeConsole if one was attached. 2016-10-23 23:10:30 +01:00
Ted John 7611b04ad1 Add --console switch for Windows
Windows subsystem does not work like console subsystem which makes it almost impossible to obtain `stdout` until the application has finished. This adds a `--console` switch to make the game either attach to an existing console or show a new one and redirect the C streams to it.
2016-10-23 16:16:20 +01:00
Ted John b64f8861f4 Merge branch 'stout-expanded-rendering-2' into render/night-lights 2016-10-16 23:40:59 +01:00
Alexander Overvoorde 55d3ab8cc8 Fix #3062: Backtick ` opens console when inputting text into chat or other things
For some reason SDL_IsTextInputActive() returns SDL_TRUE before any call to SDL_StartTextInput(). This may be an SDL bug, but I've worked around it for this feature by also checking if there is a valid gTextInput.buffer. I've made an exception for the console itself, where the backtick should probably continue to close it.
2016-10-12 21:52:33 +01:00
LRFLEW e5ff7412e4 Refactor/Improve String and Path Handling 2016-10-09 15:29:58 -05:00
Michał Janiszewski 8afaf33b1c Fix #4453: path separators being mishandled 2016-09-19 17:59:06 +01:00
Ted John 91eb33255b Remove Exception::GetMsg()
We can undef any macro windows.h defines and interferes with our code base. In this case GetMessage
2016-09-08 21:37:27 +01:00
Aaron van Geffen 29b0b4885e Reduce code verbosity.
This introduces the function `platform_get_cursor_position_scaled` as a common means of getting the cursor position compensated for window scaling.
2016-07-30 22:05:13 +02:00
Niels NTG 017e688fcc New file naming convention for screenshots
- With this change screenshot file names have the following pattern:
save file name +  + YYYY-MM-DD hh-mm-ss + .png

- To get the correct date and time the method platform_get_time and platform_get_date are rewritten and to a version for UTC and a version for local time. This change gave the opportunity to simplify the code generating file names for autosaves.

- SOUND_WINDOW_OPEN is now the new "shutter" sound when taking screenshot.
2016-07-24 20:32:55 +02:00
Michał Janiszewski 31a219a961 Fix declaration of Windows' `StartOpenRCT` 2016-07-14 14:11:50 +02:00
Michał Janiszewski a6d0e6916e Fix function definitions to match their declarations
This makes sure every function is properly declared, which includes
proper `extern` wrappers.
2016-07-14 14:11:49 +02:00
Ted John 3b627651aa add drawing engine config 2016-06-07 22:47:31 +01:00
JeroenDStout f5783231c0 Lightfx 2016-05-31 23:49:58 +02:00
Michał Janiszewski 451379c8a3 Handle SDL builds which already have HAVE_MATH_H defined (#3765)
ArchLinux's SDL2 build for mingw already has HAVE_MATH_H define, this
fixes warnings I was getting, as they are now upgraded to errors.
2016-05-28 12:24:52 +01:00
janisozaur 658e877955 Name all the typdef-ed structs (#3581) 2016-05-12 22:57:40 +01:00
janisozaur 68bad6505c Add and correct licence headers to all sources (#3108) 2016-05-04 18:24:41 +01:00
Patrick de Wit 13701660c9 Implement customizable toggle windowed mode shortcut (#3462)
Implement customizable toggle windowed mode shortcut
2016-05-03 20:07:33 +01:00
Ted John c51f9a8ecc register file associations on Windows 2016-04-21 21:41:53 +01:00
Ted John b499a4589f embed OpenRCT2 icon for Windows (#3372)
Embeds the OpenRCT2 icon file using Win32 native resources and sets the window icon to it.
2016-04-21 19:17:26 +01:00
IntelOrca d865e4d453 pass better data in struct to file dialog function 2016-03-31 20:41:47 +01:00
IntelOrca 1daa657657 fix #3091: Korean words corrupted if over byte limit 2016-03-10 18:48:00 +00:00
Michał Janiszewski 6b514d1e3a Fix possible issues highlighted at higher warn levels
Mostly possibly uninitialized values and signedness
2016-02-26 12:54:00 +01:00
Alexander Overvoorde 316abb1df9 Change screenshot logic to use palette that is actually used for rendering (fixes #2925) 2016-02-15 03:23:47 +01:00
Ted John 703e9c3153 Merge pull request #2839 from anyc/develop
Linux: use zenity or kdialog to show user dialogs
2016-02-13 12:15:41 +00:00
Alexander Overvoorde 75b072d266 Change default player name to use the OS username if available (resolves #2761) 2016-02-10 21:49:41 +01:00
anyc ffafd07c90 use enum to specify file dialog type 2016-01-29 19:03:09 +01:00
IntelOrca cdee534eb1 use SDL2's platform defines to normalise platform guards 2016-01-14 20:12:43 +00:00
Marijn van der Werf 0825b9bf62 Share currency detection across platforms 2016-01-13 21:38:10 +01:00
IntelOrca c7feb72a69 move compiler normalisation to rct2.h 2016-01-10 22:50:35 +00:00
IntelOrca 5796cf3053 use native line endings for config.ini and themes, closes #2678 2016-01-09 22:43:12 +00:00
IntelOrca 99e0d999b2 add timestamp to highscores.dat 2016-01-03 01:48:52 +00:00
Aaron van Geffen dd604afc89 Use FontConfig to find suitable TrueType fonts on Linux and OS X. Fixes #2537. 2015-12-25 01:53:52 +09:00
Sam Parkinson 2852c02e0a Handle touch events
Natively on Linux, using OpenRCT2 with touch is impossible because
touch events are not handled by the game. They just don't do anything.

This commit handles touch events. A single touch represents a
press of the left mouse button. If it followed by another touch
within 300ms, a right mouse button event is emitted.  This timeout
is like that of mobile web browsers [1].

[1]  https://developers.google.com/web/updates/2013/12/300ms-tap-delay-gone-away?hl=en
2015-12-20 19:33:12 +11:00
Michał Janiszewski ea6fa2c82a Let user specify the data dir as cmdline option.
This adds --openrct-data-dir=<str> option to command line letting user
select where he wants OpenRCT2-specific data to be. By default the
search locations are:
* <exePath>/data (on all platforms)
* /var/lib/openrct2 (on Linux)
* /usr/share/openrct2 (on Linux)
2015-12-19 00:06:41 +01:00
Linus Unnebäck 7ea7625db5 osx: correct modifier key 2015-12-15 08:34:33 +01:00
Linus Unnebäck 894d2cd130 osx: define MAP_ANONYMOUS 2015-12-10 09:35:31 +01:00
Michał Janiszewski d1b6d175c7 Make each platform set its own exe path 2015-12-01 21:38:35 +01:00
Linus Unnebäck 30b6718532 start of OS X support 2015-11-27 17:43:12 +01:00
Michał Janiszewski c4ad2346e3 Fixes for building optimized binary on Linux
Use `-DCMAKE_BUILD_TYPE=X`, where X:
- `RELEASE`
- `RELWITHDEBINFO`
- `MINSIZEREL`

Only works for GCC, clang binaries crash for now.
2015-11-18 21:29:08 +01:00
Michał Janiszewski 80510c91bd Add ui option to change scale in run-time
Doesn't let user go lower than 0.5f
2015-11-12 01:18:42 +01:00
IntelOrca e177be305b allow user data path to be specified by command line, closes #2182
Also changed default path under linux to be ~/.config/OpenRCT2.
2015-11-03 22:20:35 +00:00
Michał Janiszewski 45b3d8362d Provide strndup implementation for platforms missing it 2015-10-30 19:14:05 +01:00
Gymnasiast 2b0d5b2470 Remove obsolete sound and config code 2015-10-25 20:54:19 +01:00
Ted John 5e9912e880 Merge pull request #2038 from HaasJona/restart_required
Require a restart after changing hardware rendering
2015-10-24 14:44:01 +01:00
Jonathan Haas 475466dcd9 Require a restart after changing hardware rendering setting, decouple setting from active status 2015-10-24 12:50:28 +02:00
Michał Janiszewski d570163958 Fix types
Bunch of type fixes
2015-10-19 20:30:46 +02:00
Alexander Overvoorde 609dad157a Optimise Steam overlay check 2015-10-04 22:31:28 +02:00
Alexander Overvoorde 51377fc960 Add setting for Steam overlay pausing and add extra check 2015-10-03 23:10:56 +02:00