1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 19:43:06 +01:00
Commit Graph

200 Commits

Author SHA1 Message Date
IntelOrca
3b4928c041 fix windows file enumerate pattern matching 2016-01-04 18:29:18 +00:00
Ted John
015c76084e Merge pull request #2616 from atmaxinger/autosave-timestamp
Append timestamp to autosave
2016-01-04 17:54:11 +00:00
Maximilian Irlinger
a0bb568889 Append timestamp to autosave 2016-01-04 16:22:15 +01:00
Michał Janiszewski
b45ca38d52 UTC epoch time for POSIX 2016-01-03 21:41:21 +01:00
IntelOrca
99e0d999b2 add timestamp to highscores.dat 2016-01-03 01:48:52 +00:00
Michał Janiszewski
8a5d066efe Fix strict aliasing violations
Compiler only guarantees proper accesses to variables when using
variable's native type or `char` (i.e. single byte type) [1].

This commit fixes violations of this rule. In most cases changing code
to a simple cast was enough, some required a bit deeper modifications.

This fixes #2596.

[1] http://blog.qt.io/blog/2011/06/10/type-punning-and-strict-aliasing/
2015-12-31 13:27:26 +01:00
Michał Janiszewski
36de7a9027 Fix warnings
Some off-by-one errors, truncation warning fix, main() in posix.c no
longer a stub.
2015-12-29 16:09:36 +01:00
Michał Janiszewski
6a5fc90cd4 Fix CMakeLists for MinGW cross-compilation
This makes sure that shared library built with MinGW toolchain is linked
statically to *all* its dependencies, including libc, libstdc++, libsdl2
and all the others. This allows producing of working `openrct2.dll` by
cross-compiling.

I hit a bug with libcrypto, a dependency of libssl, which in turn is a
dependency of curl, which creates a `DllMain` entrypoint for static lib
too, but since we don't do anything in ours, this should be safe.

I have only had chance to try it out when cross-compiling, ideally it
should be tested under Cygwin/MSYS too, but it is too bothersome to
setup for me.
2015-12-28 01:17:28 +01:00
Michał Janiszewski
184b375dcb Fix XP compatibility after #2546
8bdec9f68 (#2546) introduced call to SHGetKnownFolderPath which is only
available on Vista and later operating systems, but eda733165 restored
previous hard-coded functionality for MinGW. Use the same for XP
support.

According to
https://tedwvc.wordpress.com/2014/01/01/how-to-target-xp-with-vc2012-or-vc2013-and-continue-to-use-the-windows-8-x-sdk/
it should work.
2015-12-27 20:34:04 +01:00
Tomáš Pazdiora
6ac38a6382 fixed bug in "Fix #2158"
which caused (if fullscreen was set) starting game in desktop resolution instead of selected fullscreen resolution.
2015-12-26 23:48:05 +01:00
Michał Janiszewski
c0830ae02e Fix memory leaks in font selection for Linux
Add some logging too, in particular warning when no font was found.
2015-12-25 20:32:54 +01:00
Aaron van Geffen
eda733165e Added a hack for MINGW compatibility. 2015-12-26 01:00:34 +09:00
Aaron van Geffen
474af5c204 Use Cocoa APIs for font detection on OS X. Moving FontConfig to Linux platform only. 2015-12-25 02:52:33 +09:00
Aaron van Geffen
8bdec9f68e Experimental: use SHGetKnownFolderPath to get font path on Windows. 2015-12-25 02:17:45 +09: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
Michał Janiszewski
3ba9ec8c81 CMake updates for packaging on Linux
This enables install and package targets for make.

You can specify installation prefix with -DCMAKE_INSTALL_PREFIX=path,
when doing `make install`, OpenRCT shall be found there.

You can also use `make package` for creating packaged release files.
2015-12-22 22:47:44 +01:00
LRFLEW
46e773736c Fixed trackpad-as-touchscreen on OS X 2015-12-20 21:12:14 -06:00
IntelOrca
eab3e15182 improve touch positioning 2015-12-21 00:39:38 +00: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
LRFLEW
d91a82f6ea Added searching for OpenRCT2 data in OS X app bundle resources folder 2015-12-19 00:07:01 +01: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
Ted John
859c35574a Merge pull request #2510 from LinusU/trap-mouse
Trap mouse
2015-12-18 21:06:57 +00:00
Linus Unnebäck
e1938bb17a trap-mouse: cleanup 2015-12-18 09:13:26 +01:00
Rune Laenen
1a4ebcc0f7 Add option to trap mouse cursor 2015-12-18 09:13:26 +01:00
LRFLEW
8b63080aeb Some Objective-C Code Cleanup 2015-12-17 22:06:07 -06:00
Ted John
aed5117384 Merge pull request #2489 from LinusU/locale-clang-fix
osx: fix locale issues
2015-12-15 08:04:47 +00:00
Linus Unnebäck
7ea7625db5 osx: correct modifier key 2015-12-15 08:34:33 +01:00
Linus Unnebäck
5d03fc3fb6 osx: fix locale issues 2015-12-15 08:22:08 +01:00
Michał Janiszewski
98e204552a countof with type safety
For reference see http://www.g-truc.net/post-0708.html and
http://lxr.free-electrons.com/source/include/linux/kernel.h#L54

This will provide a type-safe mechanism for counting elements of array.
If you try passing something which cannot be counted, compiler will
frown at you right away.
2015-12-15 00:28:58 +01:00
Ted John
df3bf363ca Merge pull request #2338 from Smeat/linux_get_locale
[Linux] Implement platform_get_locale_language.
2015-12-14 14:48:21 +00:00
Ted John
4fb73e4acb Merge pull request #2435 from samdroid-apps/ctrl-backspace-clear-inputs-try2
Implement CTRL-Backspace shortcut for clearing inputs, fixes #2355
2015-12-14 14:46:56 +00:00
Michał Janiszewski
3bf659a9ea Include safe_strncpy declaration in linux.c
Fixes at least one of #2483
2015-12-13 23:09:59 +01:00
Kyle Kirbatski
2a8ed04eda Add platform dialog functions for OS X 2015-12-12 17:22:14 -06:00
Kyle Kirbatski
17766c4772 Rename osx.c to osx.m 2015-12-12 17:21:21 -06:00
Kyle Kirbatski
39ae4e2154 Extract dialog functions out of posix.c and into linux.c 2015-12-12 17:20:02 -06:00
Duncan
e953eed95b Merge pull request #2467 from kkirby/code-cleanup
Code cleanup
2015-12-12 20:13:29 +00:00
LRFLEW
c2202f6260 Moved the configuration on OS X to ~/Library/Application Support/OpenRCT2 2015-12-11 18:02:58 -06:00
Kyle Kirby
caf07c2064 Clean up the comments a litte
• Make comment heads be /**
• Make rct2 addresses be double spaced indented
• Make there be a space afte rct2: and the address
• Make single-line rct2 addresses be full block comments
• Move description of method to top of comment
2015-12-11 16:19:46 -06:00
Linus Unnebäck
894d2cd130 osx: define MAP_ANONYMOUS 2015-12-10 09:35:31 +01:00
Gymnasiast
e9737ebb61 Don't log warnings on finding files, only log to verbose instead 2015-12-09 15:54:49 +01:00
Linus Unnebäck
fc849eb097 small fixes for platform/osx.c 2015-12-06 18:34:34 +01:00
Ted John
1d3cefe73d Merge pull request #2427 from xperia64/develop
Add symbolic link support
2015-12-05 21:34:44 +00:00
Kevin
a18089145b [Linux] Check for null pointer in locale specific functions 2015-12-05 22:25:25 +01:00
Ted John
e77537b27f Merge pull request #2396 from janisozaur/osx-path
Set path properly for OS X
2015-12-05 14:21:41 +00:00
Ted John
4ed7a3496e Merge pull request #2347 from Gymnasiast/default-measurement-system
Change fallback measurement system to metric.
2015-12-05 13:32:07 +00:00
Sam Parkinson
b9ba20a399 Implement CTRL-Backspace shortcut for clearing inputs, fixes #2355 2015-12-05 06:56:39 +11:00
IntelOrca
737baf8b78 fix #2158: Video Freeze when window is maximised, minimised and then restored 2015-12-04 18:59:59 +00:00
xperia64
562d7fdb61 Add symbolic link support 2015-12-03 00:20:04 +00:00
Michał Janiszewski
d1b6d175c7 Make each platform set its own exe path 2015-12-01 21:38:35 +01:00
Kevin
c0f7b0b1f3 [Linux] Fix platform_get_locale_currency with new ascii fallback 2015-11-30 13:33:50 +01:00