1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 04:23:20 +01:00
Commit Graph

98 Commits

Author SHA1 Message Date
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