1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 13:03:11 +01:00
Commit Graph

3464 Commits

Author SHA1 Message Date
IntelOrca
077f3a1995 refactor RCT2 PE setup. 2015-09-24 19:03:11 +01:00
zsilencer
266f1c1e37 make multiplayer work in linux 2015-09-24 18:39:15 +01:00
IntelOrca
c93c1c738a fix network warnings by using new functions over deprecated 2015-09-24 18:30:14 +01:00
zsilencer
9ac89c2b5e remove directsound and get sound working for linux native 2015-09-23 09:42:55 -06:00
YamaArashi
bc8bf39e1b paint setup current type constant 2015-09-22 15:43:42 -07:00
YamaArashi
7c8b0641d9 replace viewport flags numeric literals with constants 2015-09-22 15:30:19 -07: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
52e0b737be Drop initial null check from SafeFree
Both free and delete treat nullptr the same way: as a no-op [1][2].

Get rid of checking if the pointer passed is a null one before acting on
it.

See stackoverflow.com/q/154136/do-while-and-if-else-statements-in in
case you are wondering why is it done this way.

[1] http://www.cplusplus.com/reference/cstdlib/free/
[2] http://www.cplusplus.com/reference/new/operator%20delete/
2015-09-22 22:58:34 +02:00
Michał Janiszewski
a3d407079f fix windows position clamping 2015-09-22 22:58:34 +02:00
Michał Janiszewski
8ec1054477 add missing parntheses 2015-09-22 22:58:34 +02:00
Michał Janiszewski
33d5e0b79f fix loop counter 2015-09-22 22:58:34 +02:00
Michał Janiszewski
cf7c827d0d Fix possible null dereference and resource leak 2015-09-22 22:58:20 +02:00
Michał Janiszewski
5ceafd66a3 Fix memory leak in screenshot.c and guest.c 2015-09-22 22:58:20 +02:00
Michał Janiszewski
16eb4666ee Safely handle 'file not found' or wrong parameters
`platform_enumerate_files_begin` (and it directory counterpart) can
return `-1`, make sure we handle that value properly when passed on
to `platform_enumerate_files_next` and `platform_enumerate_files_end`
2015-09-22 08:33:40 +02:00
zsilencer
0af364a9b6 fix #1944 2015-09-21 10:41:09 -06: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
FlynnsPixel
5b99a587d5 Stopped infinite loop in boat_hire_return_point 2015-09-20 17:44:20 +10:00
Michał Janiszewski
e0860bc3ab Make file paths use platform-specific separators 2015-09-19 09:29:39 +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
Ted John
a762390abe Merge pull request #1936 from Gymnasiast/operating-modes
Add cheat option to show all operating modes; cleanup
2015-09-18 12:44:38 +01:00
Gymnasiast
e2ec6e0970 Move 'show all operating modes' to Cheats window 2015-09-18 11:55:52 +02:00
Gymnasiast
4909272a44 Add cheat option to show all operating modes; cleanup 2015-09-18 10:54:48 +02:00
Michał Janiszewski
ee96aaec8e reduce amount of times the pointer is freed to one
track_list_cache is being free()d as part of track_load_list, which
is a better place to do so, as it has full ownership of that pointer.
2015-09-15 00:23:46 +02:00
Michał Janiszewski
3ea534f758 make sure strings are properly terminated 2015-09-15 00:03:47 +02:00
Michał Janiszewski
02d83f860e In case any memory was allocated for lang pack, free it 2015-09-14 23:03:03 +02:00
Michał Janiszewski
34f56a262b Null-terminate buffer read from language packs 2015-09-14 22:59:44 +02:00
Michał Janiszewski
d58b4e3589 memory safeness
Just some more memory checks.

One memset appears to be wrong, is fixed now.

I think this might fix #1928, but please check.
2015-09-13 21:45:57 +02:00
IntelOrca
f988f69ae0 implement sub_6D31A6 2015-09-13 03:00:03 +01:00
Michał Janiszewski
42691726fc workaround for mingw bug
For some reason mingw or sdl has trouble providing proper HWND, which
in turn prevents opening up a window for selecting file to save when
trying to convert save game to scenario.

Fixes #1486.
2015-09-12 23:46:40 +02:00
IntelOrca
72398151a7 implement ride_create_cable_lift 2015-09-12 18:17:35 +01:00
Ted John
daf61d0ca5 Merge pull request #1920 from Gymnasiast/fix-warnings-2
Fix more warnings
2015-09-12 13:54:22 +01:00
Michał Janiszewski
788e988992 Memory access fixes 2015-09-12 00:16:05 +02:00
Michał Janiszewski
27ea266de1 Incrementation of paint_struct pointer looks bogus
Since the value incremented is a pointer, pointer arithmetics apply,
so instead of incrementing by 52, incrementation by 52^2 = 2704 takes
place, which was confirmed by inspecting generated listing.
2015-09-11 22:53:01 +02:00
Ted John
94fe643b4c Merge pull request #1921 from Gymnasiast/fix-filters-in-rc-designer-2
Fix filter buttons in RC designer and TD manager, clean up some strings
2015-09-11 17:40:34 +01:00
Gymnasiast
a6ee08de11 Fix filter buttons in RC designer and TD manager, clean up some strings 2015-09-11 16:21:27 +02:00
Gymnasiast
68fc066fc5 Fix two more warnings 2015-09-11 15:23:11 +02:00
Gymnasiast
6bd003c67f Fix more warnings 2015-09-11 15:13:54 +02:00
Gymnasiast
7e67f0381e Extend build-in-pause-mode to entrances and exits, clear up some flags, fix ghost sticking in pause mode, fixes #1918 2015-09-11 14:38:45 +02:00
IntelOrca
4dd95c650b implement RideData4 data 2015-09-10 22:16:41 +01:00
IntelOrca
bda7550e33 fix #1913 2015-09-10 20:06:13 +01:00
Michał Janiszewski
17e635b8af In C++11 use actual pointer types instead of C's defines
This is mostly `NULL` -> `nullptr` in cpp files, but I only noticed
because `LanguagePack::GetObjectOverride` and
`LanguagePack::GetScenarioOverride` were returning false instead of real
pointer.

Also fixes some whitespaces, you can `w=1` to github's URL to make it
skip these.
2015-09-10 08:22:36 +02:00
IntelOrca
72b153115b fix #1909 2015-09-09 22:56:40 +01:00
IntelOrca
b55d81e561 implement ride_set_start_finish_points 2015-09-09 22:14:43 +01:00
IntelOrca
88db4f12aa fix #1910 2015-09-09 20:25:34 +01:00
IntelOrca
289555c082 fix #1908 2015-09-09 19:22:41 +01:00
IntelOrca
fddf057d68 add scenario overrides 2015-09-08 21:37:25 +01:00
Gymnasiast
188978936b Fix Math.Clamp definition 2015-09-08 21:37:24 +01:00
IntelOrca
fc65a92275 fix object override strings for scenario editor and plugin.dat 2015-09-08 21:37:24 +01:00
IntelOrca
fe7879f0a3 add capacity overriding 2015-09-08 21:37:23 +01:00
IntelOrca
34cd6a9242 fix GCC compile issue 2015-09-08 21:37:22 +01:00