Commit Graph

167 Commits

Author SHA1 Message Date
Yaroslav Tretyakov c3ba519a6e Integrate audio related variables (#3322) 2016-04-17 14:20:26 +01:00
IntelOrca 51a7e3f278 clean up and refactor the crash handler 2016-04-10 01:00:31 +02:00
Michał Janiszewski 17bc485fb5 Breakpad for windows
This enables breakpad Windows support **only**.

The scope of this was limited to allow for inclusion into 0.0.4 release.
Breakpad for now is a Windows-only functionality, as this platform has
largest audience and is the only one that has no system-provided stack
tracing utility.

Upon crash, breakpad will try to create a dump and save current game,
present user with some vital information, then open explorer on the
created files for user convenience, asking him/her to create a new
issue with OpenRCT2 on Github.
2016-04-09 18:57:14 +02:00
Michał Janiszewski e28de49a34 Breakpad integration
Provide your own breakpad and point cmake at it.

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
mkdir breakpad && cd breakpad
../depot_tools/fetch breakpad # edit the script to use python2
cd src
LDFLAGS="-m32" CXXFLAGS="-m32" CFLAGS="-m32" CPPFLAGS="-m32" ./configure
LDFLAGS="-m32" CXXFLAGS="-m32" CFLAGS="-m32" CPPFLAGS="-m32" make -j 8

Run cmake on openrct2:
cd openrct2
vim CMakeLists.txt # provide your path to breakpad
mkdir build && cd build
cmake ../ -DWITH_BREAKPAD=ON
make -j 8
./openrct2 # open a game, select "about openrct2", crash
2016-04-09 18:57:14 +02:00
IntelOrca a99a2f0cf4 fix command line hosting of scenario files 2016-03-05 12:20:02 +00:00
IntelOrca 38fda5debf remove old redundant RCT2 platform code 2016-02-16 20:23:32 +00:00
Michał Janiszewski 4aac5c035f Don't do uncapped FPS when running headlessly 2016-02-15 10:41:09 +01:00
IntelOrca caf9bd9939 get game working with new theme manager
Theme editor currently unavailable.
2016-02-03 18:23:44 +00:00
robin clemens 6db4536da9 1. Added --password=<str> to headless server mode to configure a password.
2. added default_password under [network] to configure a default password for headless server mode
2016-01-23 21:53:02 +00:00
LRFLEW 58d258038f Improve security on OSX and Linux 2016-01-22 16:44:08 -07:00
Michał Janiszewski 3bf1e0e06d Rename `safe_strncpy` to `safe_strcpy` 2016-01-18 20:49:52 +01:00
Michał Janiszewski 7dae861dab Unload all objects on dispose to stop memory leaks 2016-01-15 16:37:27 +01:00
Michał Janiszewski ab3d2a1ad9 Release config on closing to limit leaked memory 2016-01-15 14:55:36 +01:00
IntelOrca cdee534eb1 use SDL2's platform defines to normalise platform guards 2016-01-14 20:12:43 +00:00
Michał Janiszewski 1e5f59df29 Drop number from build ID. 2016-01-13 14:33:19 +01:00
IntelOrca 8cf53c12af add ability to set RCT2 path by command line 2016-01-12 23:10:18 +00:00
Michał Janiszewski 54f7f93ab9 Make sure config.ini gets created
This commit makes sure config.ini gets created even when RCT2 path is
not selected.

This makes for a better out-of-box experience on Linux, where no
directory selector is provided yet, as we provide default config file
and state in the error message how to fix it.
2016-01-11 22:46:29 +01:00
IntelOrca e9d222fdd3 new-argparse: finish new argparse integration and clean up 2016-01-10 22:50:31 +00:00
IntelOrca 3f0073f29c new-argparse: implement most of the root commands, fix issues 2016-01-10 22:50:30 +00:00
Michał Janiszewski 17e5a0d356 Use strndup when setting last_run_version
gConfigGeneral.last_run_version should have the string value copied to,
otherwise the SafeFree in config_set_property could try freeing value
from stack if used.
2016-01-02 00:11:34 +01:00
IntelOrca 3b5768f5bc print '(debug)' to version string when build in debug configuration 2015-12-26 17:23:27 +00: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
Michał Janiszewski 7d132d8fe1 Extract and embed sections into binary itself
Fixed some CMakeLists.txt problems, made another target for converting
section images into something palatable by ld, modified the linker
script to place these ssection at predefined VMAs and updated openrct2.c
with new checks.
2015-12-16 19:16:27 +01:00
Duncan 0a86b8c946 Merge pull request #2450 from janisozaur/mmap
POSIX: MAP_ANONYMOUS should have fd = -1
2015-12-12 08:23:50 +00:00
LRFLEW c9be2e1bc9 Resolved struct packing error and crash on OS X 2015-12-10 17:29:58 -06:00
Kyle Kirbatski af382b1884 Switched to -sectcreate instead of mmap on OS X 2015-12-10 16:32:46 -06:00
Michał Janiszewski 1bafbde113 Shift segments in Mach-O to outside of required AS
Mach-O defaults to having .text segment starting at 0x1000 RVA, which
clashes with the address space required for mmap to work properly.

This change tells linker to move the segment outside of required AS, and
then some, so that mmap can properly allocate required addresses without
evicting anything else.
2015-12-10 16:32:45 -06:00
duncanspumpkin ce56b2c7f7 Aligned hook for better OS X support 2015-12-10 16:31:41 -06:00
Michał Janiszewski 3d0fcc948d POSIX: use mincore to detect impending doom
Call to mmap (or next malloc) will likely fail if there are already
mapped pages within the region we want to map ourselves. Using mincore
we can detect if such pages exist and warn user about what's going to
happen.
2015-12-09 00:57:42 +01:00
Michał Janiszewski 8f82e5013a POSIX: MAP_ANONYMOUS should have fd = -1 2015-12-08 23:30:55 +01:00
Michał Janiszewski d1b6d175c7 Make each platform set its own exe path 2015-12-01 21:38:35 +01:00
Michał Janiszewski b4b1624e08 Set path properly for OS X 2015-11-29 15:29:35 +01:00
Michał Janiszewski 39cc16d137 Plug memory leaks, check memory accesses 2015-11-29 12:15:47 +01:00
Ted John c63eef9a21 Merge pull request #2378 from IntelOrca/support-unicode-currencies
support unicode currencies with ascii fallback
2015-11-27 17:56:44 +00:00
Linus Unnebäck 30b6718532 start of OS X support 2015-11-27 17:43:12 +01:00
IntelOrca 7ea0e2d6a3 improve language load fail behaviour
improve currencies
fix bug in supported glyph check
2015-11-26 18:28:52 +00:00
Dom Light e9b7e41635 Refactor audio_sound_play_planned 2015-11-17 23:05:24 +00:00
Dom Light b736de003e Sanitize audio.c 2015-11-17 01:05:21 +00:00
Dom Light 3a8b25a0ee Sanitize audio.h 2015-11-17 01:05:14 +00:00
Michał Janiszewski 1bd665563b Improve memory setup for Linux
DATASEG was mapped, but did not have its contents filled properly. It is
now done as the process expects it.

Extend memory checksum region to catch possible corruptions early.

Fixes #2063
2015-11-09 22:11:46 +01:00
IntelOrca e1b67eeda0 improve command line version information and add headless check 2015-11-08 12:49:19 +00:00
Ted John 7366c87e2c Merge pull request #2196 from IntelOrca/custom-user-data-path
Allow user data path to be specified by command line
2015-11-06 18:35:38 +00:00
Michał Janiszewski 2d62c356c3 Early out and report error if langauge files are missing
This is a common problem if you don't set up your paths properly on
Linux, so be nice and try to provide helpful message why we failed to
load instead of crashing on user a moment later.
2015-11-05 22:41:20 +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
duncanspumpkin eaffec651c Fix #2178. Failure to load a scenario no longer causes intro to be playable. 2015-11-02 19:45:18 +00:00
Michał Janiszewski 9284930d7e Add safe_strncpy function
safe_strncpy is similar to strncpy, but makes sure buffer is
null-terminated. Update most of project to use this updated function to
prevent illegal memory accesses.
2015-10-30 16:01:00 +01:00
Michał Janiszewski 7fcc801d01 Cleanup allocated segments on disposal 2015-10-29 20:26:47 +01:00
Michał Janiszewski 31f412d0e4 Fixes: scope & types, control flow, cmake, platform support 2015-10-29 20:26:47 +01:00
Gymnasiast 2b0d5b2470 Remove obsolete sound and config code 2015-10-25 20:54:19 +01:00
Alexander Overvoorde 8a23aa1bec Change openrct2_loop to not draw if window is minimized or otherwise hidden (fixes #2096) 2015-10-23 17:33:25 +02:00
zsilencer 7aebdcd534 fix #2009 2015-10-03 13:22:59 -06:00
zsilencer ffee5229b5 fix directories in linux 2015-10-02 14:48:10 -06:00
IntelOrca 077f3a1995 refactor RCT2 PE setup. 2015-09-24 19:03:11 +01:00
zsilencer 9ac89c2b5e remove directsound and get sound working for linux native 2015-09-23 09:42:55 -06:00
Michał Janiszewski 1bd8e11c0f Make it work on Linux
Right now the project is decompiled to the point where it is feasible to
try porting it to another platform. It doesn't work 100% correctly, but
it's nearing this state.

To port it to Linux I mmapped the openrct2.exe into expected places,
disabled two offending calls (RCT2_CALLPROC_EBPSAFE(0x0040701D) and
RCT2_CALLPROC_X(0x006E7FF3…)), replaced memory management routines
with generic ones and removed all the function-pointer calls.

A basic, non-exhaustive check is included to verify that memory is
loaded correctly in place.

That last bit is probably the most intrusive one, but had to be done, as
the calling convention on Linux differs from the one on Windows. It
could possibly be emulated (just like RCT2_CALLFUNC_X) until dependency
on exe is dropped.

It is possible to completely remove calls out to original code by
commenting out contents of RCT2_CALLFUNC_X, right now this will yield
working UI, but no rendering of peeps, rides or rest of world. This can
be used as a benchmark or test platform for correctness of
implementation. The data sections will still be required for now.

Assets are expected to be in specific places, so to launch it, following
needs to satisified:
* $build/data/ has to have contents of $RCT2/Data/
* $build/data/ (same as above) has to have contents of $repo/data/
* $build/ObjData/ has to have contents of $RCT2/ObjData/
* $build/../openrct2.exe has to be $repo/openrct2.exe (as of 976ea0d)
Keep in mind you can symlink stuff and that filesystems are case
sensitive!
You can copy more of required data to possibly improve your experience.

Pretty much all of this commit will possibly have to be reverted by the
time OpenRCT2 gains independence.

Remember to build with -DDISABLE_NETWORK=ON -DDISABLE_HTTP_TWITCH=ON
2015-09-23 00:04:40 +02:00
Michał Janiszewski 4ce0e3a8b2 Linux platform file
Add bulk of the platform file for linux, change the compilation target
from shared library to executable for linux, provide necessary changes
to make it compile & load the stub of a process.

Make sure functions are marked as stubs where needed, and implementation
is expected.
2015-09-20 23:19:08 +02:00
Michał Janiszewski 4df8761831 remove windows-only code
Step 1 on road towards Linux.

Remove windows-specific code, stub it out where needed and make sure we
can still compile it the way it is.

Take care of Travis' build matrix to include new build configuration.

Install new packages.
2015-09-18 16:01:38 +02:00
IntelOrca 1a877e637d refactor sprite_invalidate 2015-08-22 11:56:32 +01:00
Michał Janiszewski fc533c92c4 Add switch to disable network at compile-time 2015-08-19 01:47:33 +02:00
IntelOrca 4f8e289e79 finish server list and fix a couple of multiplayer issues 2015-08-16 17:29:47 +01:00
zsilencer 5dab3be1d7 fix view position when loading map over network 2015-08-14 09:13:40 -06:00
zsilencer 1d811a5692 improve chat feature 2015-08-14 09:13:39 -06:00
zsilencer 149b3d86af network refactoring 2015-08-14 09:13:30 -06:00
zsilencer f883e7a8da get game commands working a bit better 2015-08-14 09:13:30 -06:00
IntelOrca 196e6eb675 get basic network game working 2015-08-14 09:13:17 -06:00
IntelOrca 2d770093e9 fix #1630 2015-08-05 13:01:41 +01:00
IntelOrca be4ee45d66 convert more platform functions over to utf8 and close #1713 2015-08-04 21:41:45 +01:00
IntelOrca cac0f2ab52 upgrade to VS2015 compiler 2015-08-03 23:16:30 +01:00
IntelOrca 33929d3ac4 implement utf8, part 25 (bug fixes) 2015-08-03 14:42:48 +01:00
IntelOrca d228d13918 implement utf8, part 23 (bug fixes) 2015-08-01 16:40:15 +01:00
IntelOrca 6bf474bd52 implement utf8, part 16 2015-08-01 10:20:58 +01:00
IntelOrca 31eb758ba1 implement utf8, part 15 2015-08-01 10:20:57 +01:00
Gymnasiast ce7a0ac27b Remove Infogrames disclaimer from intro and fix config option 2015-07-26 16:07:58 +02:00
IntelOrca 07717abdfd fix audio initialisation bug when device is not set in config 2015-07-14 23:59:29 +01:00
zsilencer 72d16dd4d0 make all sounds play correctly through hook 2015-07-14 16:45:25 -06:00
zsilencer 689f7c9f1d #1130 save last audio device 2015-07-14 16:45:24 -06:00
Duncan Frost 1440ac185d Fix invalid hook register list.
Fixes #1607
2015-07-14 21:20:22 +01:00
zsilencer af68e9d9ea fix #1590 2015-07-12 20:23:58 -06:00
IntelOrca 6acf52ce63 implement ride_check_track_contains_inversions, ride_check_track_contains_banked, refactor track circuit iteration and fix window event bug with hook 2015-07-11 22:51:11 +01:00
zsilencer 6e3ff0e1df refactor tween reset
Conflicts:
	src/game.c
2015-07-11 12:30:39 +01:00
zsilencer 11a98d2e23 better solution to #1572 2015-07-10 20:13:19 -06:00
IntelOrca 25cad9d9f1 implement ride_crash with hook 2015-07-10 20:29:50 +01:00
IntelOrca f906391c9d remove registers from window events and changed to typed signatures 2015-07-10 01:39:16 +01:00
zsilencer c971a260b7 fix #1572 2015-07-09 11:00:46 -06:00
zsilencer 520d7840c0 fix bugs introduced in last commit 2015-07-05 09:50:03 -06:00
IntelOrca 57e059b167 fix invalidation issues with uncapped FPS 2015-07-05 12:12:55 +01:00
IntelOrca f0bba54e79 uncapped FPS: fix viewport chopiness and reset after park load 2015-07-04 23:51:23 +01:00
zsilencer 76b231c150 add option to uncap fps, and fix #1470 2015-07-04 13:14:14 -06:00
Robert Jordan a3a993dabd Title Sequence editor 2015-06-24 12:25:54 -04:00
IntelOrca 4a69ded1c7 fix get exe path issue 2015-06-16 14:55:09 +01:00
Miso Zmiric (Mike Squinter) be98d6d850 closes #1305, uses absolute paths for all file loads
edit and update the distribution readme

clean up the variables mess

improve the set_exe_path and cleanup

final fixes
2015-06-16 14:05:25 +01:00
IntelOrca b69487cbba add changelog window 2015-06-13 13:30:50 +01:00
IntelOrca 909060b964 implement language fallback to English (UK) 2015-06-08 17:16:37 +01:00
IntelOrca bb309f34c6 refactor test project and add ride ratings test 2015-06-04 12:46:17 +01:00
IntelOrca f6eec3725c Merge branch 'develop' of https://github.com/marcotc/OpenRCT2 into marcotc-develop
Conflicts:
	src/openrct2.c
2015-06-04 11:54:27 +01:00
IntelOrca 463131117c fix edit command line function 2015-06-03 17:11:52 +01:00
Marco Costa f05d851811 Create simple test framework
* Run all tests by passing "test" as a command line argument to
'openrct2'
* Using CuTest 1.5 as a test framework
2015-06-01 21:45:12 -04:00
Robert Jordan 765bf976ee Renamed Colour Schemes to Themes
Themes window now opens to settings/presets tab so it's less confusing
for others.
Can no longer change default presets, you get a warning when you try.
now stores themes in themes folder.
Now clips theme names.
2015-06-01 11:02:09 -04:00
Robert Jordan 41171aa304 Resolved Merge Conflicts 2015-05-30 16:00:13 -04:00
Robert Jordan dbc1df308f Issues with Dropdown text 2015-05-29 16:42:57 -04:00