Commit Graph

3631 Commits

Author SHA1 Message Date
duncanspumpkin 0551fb7170 Fix #1914. Removed y variable as it is not part of function call 2015-10-18 12:07:45 +01:00
duncanspumpkin fedd83987e Fix Disable Network build 2015-10-18 12:02:31 +01:00
Duncan 45d3fbf10d Merge pull request #2061 from clamburger/update_peep_on_enter_ride
Cleaned up peep_on_enter_ride
2015-10-18 10:21:04 +01:00
zsilencer cf78d76bdf make disable volume on focus lost not reset title music 2015-10-17 11:48:39 -06:00
zsilencer 6449dfd6ea fix #2076 2015-10-17 11:47:04 -06:00
Sam Horn 05f6ea96a0 Fixed inconsistent use of peep->rides_been_on 2015-10-18 02:32:26 +10:00
Sam Horn 8850d1153f Split off independent logic into their own functions 2015-10-18 02:31:17 +10:00
Ted John 7e753afe52 Merge pull request #2074 from duncanspumpkin/fix_2049
Possible fix to #2049.
2015-10-17 13:38:56 +01:00
IntelOrca 93e7e219cc fix peep inverted logic from 76252a32d9 2015-10-17 13:35:09 +01:00
duncanspumpkin 4ddca816e0 Possible fix to #2049.
I need this confirmed as I can't reproduce the issue even when I change the peep logic to always being sick.
2015-10-16 23:26:55 +01:00
IntelOrca 341b658ed0 add gui option for stay_connected 2015-10-16 22:45:17 +01:00
IntelOrca 6c6fa1d444 add ability for server to kick player, closes #2071 2015-10-16 22:20:16 +01:00
IntelOrca 76252a32d9 fix peep.c warnings 2015-10-16 18:51:25 +01:00
Ted John 5d6fe6f7f0 Merge pull request #2067 from duncanspumpkin/fix_load_landscape
Fix loadlandscape breaking enabled tabs
2015-10-16 13:36:12 +01:00
zsilencer ae6c88d1ce remove unused/redundant RCT2_GLOBALS fix #2065 and cleanup 2015-10-16 02:31:31 -06:00
zsilencer 109ebe4f56 fix compiler warning 2015-10-16 01:06:46 -06:00
Duncan 700cb3976d Merge pull request #2055 from ccfreak2k/develop
Implement sub_69AF1E
2015-10-16 06:47:09 +01:00
Andrew Waters b959d13c65 Add implementation of sub_69AF1E() 2015-10-15 18:22:51 -07:00
duncanspumpkin ee1e71f287 Fix loadlandscape breaking enabled tabs
Issue was caused by not calling sub_6DFED0 when loading the landscape. I assume in vanilla this would happen as part of the loading but due to the way loadsave now works it doesn't happen. In the process I also labelled the offset for editor step.
2015-10-15 22:16:27 +01:00
duncanspumpkin 31e6942ff0 Fix #1761. Issue caused by or = instead of != 2015-10-15 21:03:29 +01:00
Ted John fdfe52fc19 Merge pull request #2057 from Gymnasiast/show-vehicles-from-other-track-types
Show vehicles from other track types
2015-10-15 12:57:57 +01:00
IntelOrca 0442f08aae remove redundant dropdown assignment 2015-10-14 21:16:10 +01:00
IntelOrca 3855d70d1a fix dropdown 64 item support and remove old RCT2 addresses 2015-10-14 21:01:04 +01:00
Gymnasiast d71ca1f376 Extend dropdowns to hold up to 64 items (with bugs) 2015-10-14 16:19:50 +02:00
Sam Horn 0a14971cdf Cleaned up peep_on_enter_ride 2015-10-14 23:31:50 +10:00
Ted John 80e973887c Merge pull request #2059 from janisozaur/types
type and const fixes for sawyercoding
2015-10-13 19:15:29 +01:00
Michał Janiszewski 9572f1b532 type and const fixes for sawyercoding 2015-10-12 23:09:49 +02:00
Duncan d2398b65bb Merge pull request #2048 from clamburger/update_sub_6960AB
Clean up sub_6960AB function (peep_should_go_on_ride)
2015-10-12 21:49:46 +01:00
Gymnasiast a1cc3e4759 Fix vehicle dropdown when 'Select-by-track-type' off and 'Show vehicles from other track types' on 2015-10-12 16:01:58 +02:00
Gymnasiast 105280a082 Introduce cheat option to show vehicles from other track types 2015-10-12 15:58:15 +02:00
Caio Alonso 63603871ea fixes the portuguese (br) language name 2015-10-11 15:26:18 -03:00
IntelOrca 6cd3b41065 fix overflows / underflows with mountain tool 2015-10-11 12:31:57 +01:00
IntelOrca d5ae4a55ff allow 1 to 64 mountain tool size 2015-10-11 12:26:33 +01:00
IntelOrca 6c38ab44fa refactor map smooth game command 2015-10-11 11:39:01 +01:00
IntelOrca 969324032e implement map smooth game command 2015-10-11 02:23:39 +01:00
IntelOrca 8ec4d61739 add callfunc wrappers for the last three remaining game commands and remove original call table 2015-10-10 20:26:17 +01:00
Sam Horn 49cf5e3774 Moved the nausea thresholds into a C array 2015-10-11 04:07:14 +10:00
Sam Horn 55d6666f13 Added an enum for flags used in peep_should_go_on_ride 2015-10-11 03:21:33 +10:00
Sam Horn 58b7df8fd7 Renamed ride->first_peep_in_queue to last_peep_in_queue 2015-10-11 03:03:59 +10:00
Sam Horn 3975af93f4 Renamed ride->var_114 to undercover_portion and updated comments 2015-10-11 02:51:03 +10:00
Sam Horn 75263034e5 Use GET_PEEP macro 2015-10-10 23:15:56 +10:00
Sam Horn b0437746a9 Fixed min and max intensity being swapped 2015-10-10 21:34:37 +10:00
Sam Horn 1b2a7e62a2 Identified 0x00982392 as a nausea lookup array 2015-10-10 21:31:56 +10:00
Ted John 6c84b06fbd Merge pull request #2047 from janisozaur/memory
Memory
2015-10-10 11:57:51 +01:00
Ted John 06f7740518 Merge pull request #2039 from HaasJona/peep_count
Recalculate peep count after loading a save
2015-10-10 11:55:18 +01:00
IntelOrca 955f9a02e9 fix ride rating underflows, #2031 2015-10-10 11:54:19 +01:00
Jonathan Haas 3a11bbb6d4 Recalculate peep count after loading a save 2015-10-10 12:50:29 +02:00
Sam Horn 3f84778369 Removed extra spaces 2015-10-10 19:00:37 +10:00
Sam Horn 2b66253d28 Replaced remaining gotos with function calls 2015-10-10 18:53:48 +10:00
duncanspumpkin 5a59e7fed4 Fix issue with last commit 2015-10-09 22:25:30 +01:00
duncanspumpkin 59cdff7055 Potential fix to #639.
The scenario name was missing its null to indicate the end of the string. This would cause scenarios to have odd fileNames that are compared against to compare a scenario against the scenario list
2015-10-09 22:11:28 +01:00
Michał Janiszewski 74d0b033df Name RCT2_ADDRESS_PALETTE 2015-10-09 20:20:05 +02:00
Michał Janiszewski fb9a5833d6 Fix override offsets while loading LanguagePack
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
2015-10-09 20:19:58 +02:00
Michał Janiszewski 6dd04bbb1a Don't copy more memory than we own 2015-10-09 20:19:34 +02:00
Sam Horn a5b9b356a0 Cleaned up the queue logic 2015-10-09 22:11:15 +10:00
Sam Horn ceeaa34ac8 Start work on cleaning up sub_6960AB 2015-10-09 17:12:48 +10:00
Gymnasiast 3590b1c1b9 Adjust comment 2015-10-08 10:58:17 +02:00
Gymnasiast dfd0c52b7e Name PEEP_FLAGS_5 2015-10-08 10:47:14 +02:00
zsilencer 468a6c15fa implement peep_give_real_name 2015-10-06 23:52:37 -06:00
Ted John a6a8ea7989 Merge pull request #2030 from duncanspumpkin/fix_1720
Ride train count miscalculation.
2015-10-05 00:08:12 +01:00
Ted John 5405cf7efd Merge pull request #2012 from Overv/develop
Add Steam overlay detection that pauses the game (#1903)
2015-10-05 00:07:10 +01:00
duncanspumpkin cbbc4edd20 Fix #1720. Ride train count misscalculation.
Should now correctly allow more trains when car length reduced
2015-10-04 21:39:02 +01:00
Alexander Overvoorde 609dad157a Optimise Steam overlay check 2015-10-04 22:31:28 +02:00
duncanspumpkin 36917bd75a Fix #1661. Track direction now remembered when deleteing last section 2015-10-04 20:52:27 +01:00
duncanspumpkin 9017e5ff86 Fix #1899. Prevent mountain tool from being possible for land ownership tool. 2015-10-04 20:44:17 +01:00
duncanspumpkin 7297fc86e9 Fix #2029. Issue with 1x1 land ownership tool 2015-10-04 20:22:50 +01:00
Alexander Overvoorde af6a6bb8be Rewrite platform_is_steam_overlay_attached for Unix to detect all possible situations 2015-10-04 16:43:22 +02:00
Alexander Overvoorde 84bf968b23 Fix flags in dlopen call for steam overlay check 2015-10-04 15:46:15 +02:00
Ted John c1ecf3c531 Merge pull request #2024 from duncanspumpkin/set_land_ownership
Implemented game_command_set_land_ownership.
2015-10-04 01:06:29 +01:00
duncanspumpkin 625e051d35 Fix #2025. Issue caused by failing to check if coordinates outside of map 2015-10-04 00:35:26 +01:00
duncanspumpkin 3f77a6778a Implemented game_command_set_land_ownership.
Refactored map buy land rights for tile as it was partially broken and used a very odd style.
2015-10-04 00:07:22 +01:00
Alexander Overvoorde f6b7121c23 Implement platform_is_steam_overlay_attached for unix 2015-10-03 23:10:56 +02:00
Alexander Overvoorde 51377fc960 Add setting for Steam overlay pausing and add extra check 2015-10-03 23:10:56 +02:00
Alexander Overvoorde c03cec721e Add Steam overlay detection that pauses the game (#1903)
The Steam overlay is detected by checking if the center pixel of
the framebuffer is changed between rendering and presenting to the
screen. This happens when the Steam overlay draws the gray fade on
the screen.

This does not affect other overlays like FRAPS, MSI Afterburner and
OBS overlays that don't obstruct the center of the screen.
2015-10-03 23:10:56 +02:00
Duncan 7e8ed696a0 Merge pull request #2019 from zsilencer/develop
fix #2009
2015-10-03 22:04:55 +01:00
Andrew Waters b77e8f5146 Fixed typo of peep_udpate_ride_sub_state_13 2015-10-03 13:39:15 -07:00
zsilencer 7aebdcd534 fix #2009 2015-10-03 13:22:59 -06:00
Ted John 6228c782da Merge pull request #2016 from HaasJona/debug_createrenderer
Handle SDL_CreateRenderer error
2015-10-03 19:31:13 +01:00
Ted John 68f98663c9 Merge pull request #2018 from HaasJona/addresses
Define some tick related addresses
2015-10-03 19:26:04 +01:00
Ted John bac7c7fc4a Merge pull request #1995 from janisozaur/cleanup
Remove leftover porting hack
2015-10-03 19:22:53 +01:00
Jonathan Haas 8463e58922 Define some tick related addresses 2015-10-03 20:00:29 +02:00
Jonathan Haas d6a5d78742 Handle SDL_CreateRenderer error 2015-10-03 18:22:05 +02:00
Jonathan Haas ae82ffcd96 Rename window flags 2015-10-03 17:20:53 +02:00
Alexander Overvoorde 377650d9f5 Change autosave system to use wall-clock time based frequencies
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.
2015-10-03 14:25:59 +02:00
Duncan 3cd51f6aa5 Merge pull request #2001 from nightroan/develop
Fixed #1948
2015-10-03 09:43:04 +01:00
nightroan 1963749c58 Fixed #1948 by clearing ebx when setting ride price 2015-10-02 19:14:01 -07:00
Ted John fe4b4516fd Merge pull request #2006 from zsilencer/develop
linux fixes
2015-10-02 23:20:45 +01:00
zsilencer ffee5229b5 fix directories in linux 2015-10-02 14:48:10 -06:00
Michał Janiszewski 8a5d9bf614 Platform name 2015-10-02 21:19:20 +02:00
zsilencer 5793ded423 mouse drag in linux 2015-10-02 09:51:34 -06:00
Rune Laenen 7934e2efd2 Fix issue 1942 2015-10-02 14:16:02 +02:00
Rune Laenen 7ac930c318 errorfix guest_list 2015-10-02 13:49:13 +02:00
Rune Laenen 1b5e55d346 newPeep fix 2015-10-02 13:45:17 +02:00
Rune Laenen 5d75fa4464 var_2A to outside_of_park 2015-10-02 13:41:13 +02:00
duncanspumpkin 33e04b8bd6 Implement game_command_place_park_entrance 2015-10-01 21:24:24 +01:00
Michał Janiszewski 9a1e88872f sub_6E7FF3 no longer causes problems 2015-10-01 18:57:45 +02:00
Michał Janiszewski df52bb5ca1 Add hooks for Linux 2015-10-01 18:49:13 +02:00
Michał Janiszewski ca298d5568 Remove leftover porting hack 2015-10-01 17:05:31 +02:00
duncanspumpkin f40ccc883a Name remaining peep cheat flag enums 2015-09-30 22:01:44 +01:00
duncanspumpkin b5711638bc Implement game_command_set_peep_name
Note this is how most of the existing cheats are used
2015-09-30 21:55:36 +01:00
Duncan f34902f5cf Merge pull request #1989 from duncanspumpkin/footpath_from_track
Implement game command footpath from track.
2015-09-30 20:48:07 +01:00
duncanspumpkin ecc2f74b63 Implement game command footpath from track.
Fixes #1954
2015-09-29 23:07:07 +01:00
Michał Janiszewski 89846a088a platform time functions 2015-09-29 23:35:15 +02:00
Ted John 78e43e7ca4 Merge pull request #1983 from janisozaur/docker32
Docker32
2015-09-28 23:23:09 +01:00
Michał Janiszewski 9e62198546 Partially revert c93c1c7, for mingw builds only
Conditionally restore old functionality which got broken for mingw
builds with commit c93c1c7. Allow building with old version of code, but
generate a warning when doing so.
2015-09-29 00:13:27 +02:00
Michał Janiszewski a16de307d7 Refactor project build scripts
This is mostly refactoring of cmake scripts, but also touches build.sh
and install.sh. The cmake should be much more palatable now for major
Linux distributions.

At the same time, new configuration is introduced to Linux version, one
with Twitch enabled.

Please note, however, this change requires update of orctlibs.zip for
mingw builds.
2015-09-28 21:10:21 +02:00
Michał Janiszewski 5d1beb14c0 Platform, memory fixes 2015-09-28 19:35:06 +02:00
IntelOrca c6b0d0919d fix #1982 2015-09-28 18:10:41 +01:00
duncanspumpkin eaa44ab1e1 Fix #1854. Special track elements disable correctly.
Issue was caused by a change I asked to be done a month back. Dropdowns are awkward windows the global array for dropdown content should be populated before creating them but not anything else as that will get reset. In this case the disabled items were reset. The same happens for highlighted index if that is specified before window creation
2015-09-27 21:55:48 +01:00
duncanspumpkin 9e1e0748f3 Fix #1947. Maze entrances no longer modify hedges wrong.
> Issue was caused by incorrectly translating btr and bts to C. In addition the operation was on a word and not a byte so it wouldn't change the maze correctly for all rotations. I've also refactored the code to make it a bit easier to follow.
2015-09-27 21:33:19 +01:00
duncanspumpkin a697606211 Fix #1718. Incorrect cursors on scroll widgets.
Issue was being caused by passing the incorrect x and y parameters due to missing a widget dereference. I've also moved the x/y coordinates of the hand open/close to closer match what it feels like.
2015-09-27 16:55:34 +01:00
duncanspumpkin 1a0fc46559 Fix #1723 issue caused by failing to return.
The logic would fall through to the ending code so that it would just make a beeline to the exit after walking to one corner.
2015-09-27 16:21:45 +01:00
nightroan 8d3f7600fb As a multiplayer client, don't select the next track piece if is is unaffordable. 2015-09-26 16:01:04 -07:00
IntelOrca a04663368e add two new date formats, y/m/d and y/d/m, closes #1900 2015-09-26 14:35:26 +01:00
IntelOrca 015c41f6ef fix #1744 2015-09-26 14:07:17 +01:00
IntelOrca 3835c8c109 fix inet_ntop signature issues 2015-09-26 13:48:24 +01:00
nightroan bd51c7ed80 Fixed #1939 by adding a callback to delay selection of the next piece until the server sends back the placement command. 2015-09-25 23:57:15 -07:00
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