diff --git a/build.sh b/build.sh index 965c72cbbf..b69543ebd8 100755 --- a/build.sh +++ b/build.sh @@ -11,6 +11,10 @@ pushd build make popd +if [[ ! -h openrct2.dll ]]; then + ln -s build/openrct2.dll openrct2.dll +fi + if [[ -t 1 ]]; then echo -e "\nDone! Run OpenRCT2 by typing:\n\n\033[95mwine openrct2.exe\n\033[0m" else diff --git a/readme.md b/readme.md index 403ce159c5..be64612120 100644 --- a/readme.md +++ b/readme.md @@ -53,6 +53,8 @@ The aim is to completely decompile RollerCoaster Tycoon 2 into C so that cross-p # 2 Building the source code +Alternatively, a third-party offers [downloadable precompiled builds](https://openrct2.com/download). However, building the project is always recommended. + ## 2.1 Prerequisites ### Windows: - Windows XP / Vista / 7 / 8 diff --git a/src/input.h b/src/input.h index dd1cc5b3fb..0a40da1636 100644 --- a/src/input.h +++ b/src/input.h @@ -23,6 +23,7 @@ void game_handle_input(); void game_handle_keyboard_input(); +void handle_shortcut_command(int shortcutIndex); void store_mouse_input(int state); diff --git a/src/osinterface.c b/src/osinterface.c index 4f95acd7f3..59b5a887c0 100644 --- a/src/osinterface.c +++ b/src/osinterface.c @@ -57,6 +57,9 @@ static SDL_Cursor* _cursors[NO_CURSORS]; static const int _fullscreen_modes[] = { 0, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_FULLSCREEN_DESKTOP }; +static unsigned int _lastGestureTimestamp; +static float _gestureRadius; + void osinterface_init() { osinterface_create_window(); @@ -395,6 +398,25 @@ void osinterface_process_messages() screenshot_check(); } break; + case SDL_MULTIGESTURE: + if (e.mgesture.numFingers == 2) { + if (e.mgesture.timestamp > _lastGestureTimestamp + 1000) + _gestureRadius = 0; + _lastGestureTimestamp = e.mgesture.timestamp; + _gestureRadius += e.mgesture.dDist; + + // Zoom gesture + const int tolerance = 128; + int gesturePixels = (int)(_gestureRadius * RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, sint16)); + if (gesturePixels > tolerance) { + _gestureRadius = 0; + handle_shortcut_command(SHORTCUT_ZOOM_VIEW_IN); + } else if (gesturePixels < -tolerance) { + _gestureRadius = 0; + handle_shortcut_command(SHORTCUT_ZOOM_VIEW_OUT); + } + } + break; default: break; }