Lanaguages were not falling back if there was a translated string further on in the langauge pack. This issue was caused by operating on an invalid string that was masked by a cast from a nullpointer to a size_t. The code now will not set the string if there is a nullptr
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.
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.
When loading language pack, a check is made not to double entries. This
check was wrong, because it tried to use offsets as pointers to strings.
These offsets are later rewritten to actual pointers in remaining part
of LanguagePack::LanguagePack
The autosave system will now use frequencies based on wall-clock
time rather than in-game time, for example every 15 minutes. This
frequency is not affected by pausing the game or changing the game
speed. The default frequency is every 5 minutes.
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
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.
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.