diff options
36 files changed, 111 insertions, 474 deletions
diff --git a/.ci/templates/merge-private.yml b/.ci/templates/merge-private.yml index f15a74355..c74561c46 100644 --- a/.ci/templates/merge-private.yml +++ b/.ci/templates/merge-private.yml | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | jobs: | 1 | jobs: |
| 2 | - job: merge | 2 | - job: merge |
| 3 | displayName: 'pull requests' | 3 | displayName: 'pull requests' |
| 4 | pool: | ||
| 5 | vmImage: 'ubuntu-latest' | ||
| 4 | steps: | 6 | steps: |
| 5 | - checkout: self | 7 | - checkout: self |
| 6 | submodules: recursive | 8 | submodules: recursive |
| @@ -24,6 +26,8 @@ jobs: | |||
| 24 | - job: upload_source | 26 | - job: upload_source |
| 25 | displayName: 'upload' | 27 | displayName: 'upload' |
| 26 | dependsOn: merge | 28 | dependsOn: merge |
| 29 | pool: | ||
| 30 | vmImage: 'ubuntu-latest' | ||
| 27 | steps: | 31 | steps: |
| 28 | - template: ./sync-source.yml | 32 | - template: ./sync-source.yml |
| 29 | parameters: | 33 | parameters: |
diff --git a/.ci/templates/merge.yml b/.ci/templates/merge.yml index 460dfa1c1..27c36e162 100644 --- a/.ci/templates/merge.yml +++ b/.ci/templates/merge.yml | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | jobs: | 1 | jobs: |
| 2 | - job: merge | 2 | - job: merge |
| 3 | displayName: 'pull requests' | 3 | displayName: 'pull requests' |
| 4 | pool: | ||
| 5 | vmImage: 'ubuntu-latest' | ||
| 4 | steps: | 6 | steps: |
| 5 | - checkout: self | 7 | - checkout: self |
| 6 | submodules: recursive | 8 | submodules: recursive |
| @@ -23,6 +25,8 @@ jobs: | |||
| 23 | - job: upload_source | 25 | - job: upload_source |
| 24 | displayName: 'upload' | 26 | displayName: 'upload' |
| 25 | dependsOn: merge | 27 | dependsOn: merge |
| 28 | pool: | ||
| 29 | vmImage: 'ubuntu-latest' | ||
| 26 | steps: | 30 | steps: |
| 27 | - template: ./sync-source.yml | 31 | - template: ./sync-source.yml |
| 28 | parameters: | 32 | parameters: |
diff --git a/.ci/yuzu-mainline-step2.yml b/.ci/yuzu-mainline-step2.yml index 3159ce3ed..91e21a126 100644 --- a/.ci/yuzu-mainline-step2.yml +++ b/.ci/yuzu-mainline-step2.yml | |||
| @@ -66,5 +66,7 @@ stages: | |||
| 66 | jobs: | 66 | jobs: |
| 67 | - job: github | 67 | - job: github |
| 68 | displayName: 'github' | 68 | displayName: 'github' |
| 69 | pool: | ||
| 70 | vmImage: ubuntu-latest | ||
| 69 | steps: | 71 | steps: |
| 70 | - template: ./templates/release-github.yml | 72 | - template: ./templates/release-github.yml |
diff --git a/.ci/yuzu-patreon-step2.yml b/.ci/yuzu-patreon-step2.yml index 3f338e2a0..ad61ac74e 100644 --- a/.ci/yuzu-patreon-step2.yml +++ b/.ci/yuzu-patreon-step2.yml | |||
| @@ -29,5 +29,7 @@ stages: | |||
| 29 | jobs: | 29 | jobs: |
| 30 | - job: release | 30 | - job: release |
| 31 | displayName: 'source' | 31 | displayName: 'source' |
| 32 | pool: | ||
| 33 | vmImage: 'ubuntu-latest' | ||
| 32 | steps: | 34 | steps: |
| 33 | - template: ./templates/release-private-tag.yml | 35 | - template: ./templates/release-private-tag.yml |
diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 93fda1dfa..000000000 --- a/.travis.yml +++ /dev/null | |||
| @@ -1,59 +0,0 @@ | |||
| 1 | language: cpp | ||
| 2 | matrix: | ||
| 3 | include: | ||
| 4 | - os: linux | ||
| 5 | env: NAME="clang-format" | ||
| 6 | sudo: required | ||
| 7 | dist: trusty | ||
| 8 | services: docker | ||
| 9 | install: "./.travis/clang-format/deps.sh" | ||
| 10 | script: "./.travis/clang-format/build.sh" | ||
| 11 | - os: linux | ||
| 12 | env: NAME="linux build" | ||
| 13 | sudo: required | ||
| 14 | dist: trusty | ||
| 15 | services: docker | ||
| 16 | addons: | ||
| 17 | apt: | ||
| 18 | packages: | ||
| 19 | - p7zip-full | ||
| 20 | install: "./.travis/linux/deps.sh" | ||
| 21 | script: "./.travis/linux/build.sh" | ||
| 22 | after_success: "./.travis/linux/upload.sh" | ||
| 23 | cache: ccache | ||
| 24 | - os: osx | ||
| 25 | env: NAME="macos build" | ||
| 26 | sudo: false | ||
| 27 | osx_image: xcode10.2 | ||
| 28 | install: "./.travis/macos/deps.sh" | ||
| 29 | script: "./.travis/macos/build.sh" | ||
| 30 | after_success: "./.travis/macos/upload.sh" | ||
| 31 | cache: ccache | ||
| 32 | - os: linux | ||
| 33 | env: NAME="MinGW build" | ||
| 34 | sudo: required | ||
| 35 | dist: trusty | ||
| 36 | services: docker | ||
| 37 | addons: | ||
| 38 | apt: | ||
| 39 | packages: | ||
| 40 | - p7zip-full | ||
| 41 | install: "./.travis/linux-mingw/deps.sh" | ||
| 42 | script: "./.travis/linux-mingw/build.sh" | ||
| 43 | after_success: "./.travis/linux-mingw/upload.sh" | ||
| 44 | cache: ccache | ||
| 45 | |||
| 46 | deploy: | ||
| 47 | provider: releases | ||
| 48 | api_key: | ||
| 49 | secure: ElsIAlbvVXBNKsP31nVPysh+mf0GQA4DiL/y5iJeQxKQYR6iRoNo+RfzOBmdswdo0bE/PGeBAlfzCkp15gjhWf6Je0N6dRpczmcmLq6SSQFn1Mpq00xMJB2AgQIlaHs6KFgoUA173EBKbPwgU/NubTFpJFm/Wa+NcSWAHQXKL9KT2M3qKpxNkPl3mKEVsbch4REP+T/46vsa+ikw0VE0kIs6V93LqUQZpI2F0Dhihx8Cxr5iedkE1QsNK+QSX9iItMHbfek9OH980gP7L3lkZltyAA1Pk0c37OAgz2PwczwNKwCT8jg9PMzdcKmWouvLyAkZFuA806ElzwHY3oEd91Zm6+Bk5n24yBKZ9027AZzw38NK2Z2m9Akb8+ar8PdsKU6N5pDutX9qSLayr0oMgJ0s7/xnGBGdL3gfkPCFc50xO/2DxlsOR+zAhPNM9Y76hhGy6A7/40+9uzrJvd4nAuDvIXRzi2Yl2L7mKBE4suMKbFLtk2LlgM0qY5JMVTQ8NliaEtqopfPur2KWFVJUpWDNLtNX8xGqhfwg7cLjIiGmnxSaJBTDuZI6dpEjkWkU0n1xYhGqEqit8DbehYzazozMJ+Vsr8hku7jGlUtlw+U6HG1e19O2y4aGeSwYPROcCNz+BLwmVM8oZE3Roy3qoaa2yiFf+sy6rUHznrhsfEM= | ||
| 50 | file_glob: true | ||
| 51 | file: "artifacts/*" | ||
| 52 | skip_cleanup: true | ||
| 53 | on: | ||
| 54 | tags: true | ||
| 55 | |||
| 56 | notifications: | ||
| 57 | webhooks: | ||
| 58 | urls: | ||
| 59 | - https://api.yuzu-emu.org/code/travis/notify | ||
diff --git a/.travis/clang-format/build.sh b/.travis/clang-format/build.sh deleted file mode 100755 index 36c276c43..000000000 --- a/.travis/clang-format/build.sh +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | docker run --env-file .travis/common/travis-ci.env -v $(pwd):/yuzu -v "$HOME/.ccache":/root/.ccache citraemu/build-environments:linux-clang-format /bin/bash -ex /yuzu/.travis/clang-format/docker.sh | ||
diff --git a/.travis/clang-format/deps.sh b/.travis/clang-format/deps.sh deleted file mode 100755 index a15d164c7..000000000 --- a/.travis/clang-format/deps.sh +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | #!/bin/sh -ex | ||
| 2 | |||
| 3 | docker pull citraemu/build-environments:linux-clang-format | ||
diff --git a/.travis/clang-format/docker.sh b/.travis/clang-format/docker.sh deleted file mode 100755 index b519ab40e..000000000 --- a/.travis/clang-format/docker.sh +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | # Run clang-format | ||
| 4 | cd /yuzu | ||
| 5 | ./.travis/clang-format/script.sh | ||
diff --git a/.travis/clang-format/script.sh b/.travis/clang-format/script.sh deleted file mode 100755 index 56a785fe0..000000000 --- a/.travis/clang-format/script.sh +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .travis* dist/*.desktop \ | ||
| 4 | dist/*.svg dist/*.xml; then | ||
| 5 | echo Trailing whitespace found, aborting | ||
| 6 | exit 1 | ||
| 7 | fi | ||
| 8 | |||
| 9 | # Default clang-format points to default 3.5 version one | ||
| 10 | CLANG_FORMAT=clang-format-10.0 | ||
| 11 | $CLANG_FORMAT --version | ||
| 12 | |||
| 13 | if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then | ||
| 14 | # Get list of every file modified in this pull request | ||
| 15 | files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' || true)" | ||
| 16 | else | ||
| 17 | # Check everything for branch pushes | ||
| 18 | files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" | ||
| 19 | fi | ||
| 20 | |||
| 21 | # Turn off tracing for this because it's too verbose | ||
| 22 | set +x | ||
| 23 | |||
| 24 | for f in $files_to_lint; do | ||
| 25 | d=$(diff -u "$f" <($CLANG_FORMAT "$f") || true) | ||
| 26 | if ! [ -z "$d" ]; then | ||
| 27 | echo "!!! $f not compliant to coding style, here is the fix:" | ||
| 28 | echo "$d" | ||
| 29 | fail=1 | ||
| 30 | fi | ||
| 31 | done | ||
| 32 | |||
| 33 | set -x | ||
| 34 | |||
| 35 | if [ "$fail" = 1 ]; then | ||
| 36 | exit 1 | ||
| 37 | fi | ||
diff --git a/.travis/common/post-upload.sh b/.travis/common/post-upload.sh deleted file mode 100755 index 28735a9cf..000000000 --- a/.travis/common/post-upload.sh +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | # Copy documentation | ||
| 4 | cp license.txt "$REV_NAME" | ||
| 5 | cp README.md "$REV_NAME" | ||
| 6 | |||
| 7 | tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$REV_NAME" | ||
| 8 | |||
| 9 | # Find out what release we are building | ||
| 10 | if [ -z $TRAVIS_TAG ]; then | ||
| 11 | RELEASE_NAME=head | ||
| 12 | else | ||
| 13 | RELEASE_NAME=$(echo $TRAVIS_TAG | cut -d- -f1) | ||
| 14 | if [ "$NAME" = "MinGW build" ]; then | ||
| 15 | RELEASE_NAME="${RELEASE_NAME}-mingw" | ||
| 16 | fi | ||
| 17 | fi | ||
| 18 | |||
| 19 | mv "$REV_NAME" $RELEASE_NAME | ||
| 20 | |||
| 21 | 7z a "$REV_NAME.7z" $RELEASE_NAME | ||
| 22 | |||
| 23 | # move the compiled archive into the artifacts directory to be uploaded by travis releases | ||
| 24 | mv "$ARCHIVE_NAME" artifacts/ | ||
| 25 | mv "$REV_NAME.7z" artifacts/ | ||
diff --git a/.travis/common/pre-upload.sh b/.travis/common/pre-upload.sh deleted file mode 100755 index 3c2fc79a2..000000000 --- a/.travis/common/pre-upload.sh +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | GITDATE="`git show -s --date=short --format='%ad' | sed 's/-//g'`" | ||
| 4 | GITREV="`git show -s --format='%h'`" | ||
| 5 | |||
| 6 | mkdir -p artifacts | ||
diff --git a/.travis/common/travis-ci.env b/.travis/common/travis-ci.env deleted file mode 100644 index cffeb2e2b..000000000 --- a/.travis/common/travis-ci.env +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | # List of environment variables to be shared with Docker containers | ||
| 2 | CI | ||
| 3 | TRAVIS | ||
| 4 | CONTINUOUS_INTEGRATION | ||
| 5 | TRAVIS_BRANCH | ||
| 6 | TRAVIS_BUILD_ID | ||
| 7 | TRAVIS_BUILD_NUMBER | ||
| 8 | TRAVIS_COMMIT | ||
| 9 | TRAVIS_COMMIT_RANGE | ||
| 10 | TRAVIS_EVENT_TYPE | ||
| 11 | TRAVIS_JOB_ID | ||
| 12 | TRAVIS_JOB_NUMBER | ||
| 13 | TRAVIS_REPO_SLUG | ||
| 14 | TRAVIS_TAG | ||
| 15 | |||
| 16 | # yuzu specific flags | ||
| 17 | ENABLE_COMPATIBILITY_REPORTING | ||
| 18 | USE_DISCORD_PRESENCE | ||
diff --git a/.travis/linux-mingw/build.sh b/.travis/linux-mingw/build.sh deleted file mode 100755 index b12d70b12..000000000 --- a/.travis/linux-mingw/build.sh +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | mkdir "$HOME/.ccache" || true | ||
| 3 | docker run --env-file .travis/common/travis-ci.env -v $(pwd):/yuzu -v "$HOME/.ccache":/root/.ccache yuzuemu/build-environments:linux-mingw /bin/bash -ex /yuzu/.travis/linux-mingw/docker.sh | ||
diff --git a/.travis/linux-mingw/deps.sh b/.travis/linux-mingw/deps.sh deleted file mode 100755 index 55b5d6006..000000000 --- a/.travis/linux-mingw/deps.sh +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | #!/bin/sh -ex | ||
| 2 | |||
| 3 | docker pull yuzuemu/build-environments:linux-mingw | ||
diff --git a/.travis/linux-mingw/docker.sh b/.travis/linux-mingw/docker.sh deleted file mode 100755 index 80d7dfe9b..000000000 --- a/.travis/linux-mingw/docker.sh +++ /dev/null | |||
| @@ -1,42 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | cd /yuzu | ||
| 4 | # override Travis CI unreasonable ccache size | ||
| 5 | echo 'max_size = 3.0G' > "$HOME/.ccache/ccache.conf" | ||
| 6 | |||
| 7 | mkdir build && cd build | ||
| 8 | cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MinGWCross.cmake" -DUSE_CCACHE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DCMAKE_BUILD_TYPE=Release | ||
| 9 | ninja | ||
| 10 | |||
| 11 | # Clean up the dirty hacks | ||
| 12 | rm /bin/uname && mv /bin/uname1 /bin/uname | ||
| 13 | rm /bin/cmd | ||
| 14 | |||
| 15 | ccache -s | ||
| 16 | |||
| 17 | echo "Tests skipped" | ||
| 18 | #ctest -VV -C Release | ||
| 19 | |||
| 20 | echo 'Prepare binaries...' | ||
| 21 | cd .. | ||
| 22 | mkdir package | ||
| 23 | |||
| 24 | QT_PLATFORM_DLL_PATH='/usr/x86_64-w64-mingw32/lib/qt5/plugins/platforms/' | ||
| 25 | find build/ -name "yuzu*.exe" -exec cp {} 'package' \; | ||
| 26 | |||
| 27 | # copy Qt plugins | ||
| 28 | mkdir package/platforms | ||
| 29 | cp "${QT_PLATFORM_DLL_PATH}/qwindows.dll" package/platforms/ | ||
| 30 | cp -rv "${QT_PLATFORM_DLL_PATH}/../mediaservice/" package/ | ||
| 31 | cp -rv "${QT_PLATFORM_DLL_PATH}/../imageformats/" package/ | ||
| 32 | rm -f package/mediaservice/*d.dll | ||
| 33 | |||
| 34 | for i in package/*.exe; do | ||
| 35 | # we need to process pdb here, however, cv2pdb | ||
| 36 | # does not work here, so we just simply strip all the debug symbols | ||
| 37 | x86_64-w64-mingw32-strip "${i}" | ||
| 38 | done | ||
| 39 | |||
| 40 | pip3 install pefile | ||
| 41 | python3 .travis/linux-mingw/scan_dll.py package/*.exe "package/" | ||
| 42 | python3 .travis/linux-mingw/scan_dll.py package/imageformats/*.dll "package/" | ||
diff --git a/.travis/linux-mingw/scan_dll.py b/.travis/linux-mingw/scan_dll.py deleted file mode 100644 index 163183f2e..000000000 --- a/.travis/linux-mingw/scan_dll.py +++ /dev/null | |||
| @@ -1,106 +0,0 @@ | |||
| 1 | import pefile | ||
| 2 | import sys | ||
| 3 | import re | ||
| 4 | import os | ||
| 5 | import queue | ||
| 6 | import shutil | ||
| 7 | |||
| 8 | # constant definitions | ||
| 9 | KNOWN_SYS_DLLS = ['WINMM.DLL', 'MSVCRT.DLL', 'VERSION.DLL', 'MPR.DLL', | ||
| 10 | 'DWMAPI.DLL', 'UXTHEME.DLL', 'DNSAPI.DLL', 'IPHLPAPI.DLL'] | ||
| 11 | # below is for Ubuntu 18.04 with specified PPA enabled, if you are using | ||
| 12 | # other distro or different repositories, change the following accordingly | ||
| 13 | DLL_PATH = [ | ||
| 14 | '/usr/x86_64-w64-mingw32/bin/', | ||
| 15 | '/usr/x86_64-w64-mingw32/lib/', | ||
| 16 | '/usr/lib/gcc/x86_64-w64-mingw32/7.3-posix/' | ||
| 17 | ] | ||
| 18 | |||
| 19 | missing = [] | ||
| 20 | |||
| 21 | |||
| 22 | def parse_imports(file_name): | ||
| 23 | results = [] | ||
| 24 | pe = pefile.PE(file_name, fast_load=True) | ||
| 25 | pe.parse_data_directories() | ||
| 26 | |||
| 27 | for entry in pe.DIRECTORY_ENTRY_IMPORT: | ||
| 28 | current = entry.dll.decode() | ||
| 29 | current_u = current.upper() # b/c Windows is often case insensitive | ||
| 30 | # here we filter out system dlls | ||
| 31 | # dll w/ names like *32.dll are likely to be system dlls | ||
| 32 | if current_u.upper() not in KNOWN_SYS_DLLS and not re.match(string=current_u, pattern=r'.*32\.DLL'): | ||
| 33 | results.append(current) | ||
| 34 | |||
| 35 | return results | ||
| 36 | |||
| 37 | |||
| 38 | def parse_imports_recursive(file_name, path_list=[]): | ||
| 39 | q = queue.Queue() # create a FIFO queue | ||
| 40 | # file_name can be a string or a list for the convience | ||
| 41 | if isinstance(file_name, str): | ||
| 42 | q.put(file_name) | ||
| 43 | elif isinstance(file_name, list): | ||
| 44 | for i in file_name: | ||
| 45 | q.put(i) | ||
| 46 | full_list = [] | ||
| 47 | while q.qsize(): | ||
| 48 | current = q.get_nowait() | ||
| 49 | print('> %s' % current) | ||
| 50 | deps = parse_imports(current) | ||
| 51 | # if this dll does not have any import, ignore it | ||
| 52 | if not deps: | ||
| 53 | continue | ||
| 54 | for dep in deps: | ||
| 55 | # the dependency already included in the list, skip | ||
| 56 | if dep in full_list: | ||
| 57 | continue | ||
| 58 | # find the requested dll in the provided paths | ||
| 59 | full_path = find_dll(dep) | ||
| 60 | if not full_path: | ||
| 61 | missing.append(dep) | ||
| 62 | continue | ||
| 63 | full_list.append(dep) | ||
| 64 | q.put(full_path) | ||
| 65 | path_list.append(full_path) | ||
| 66 | return full_list | ||
| 67 | |||
| 68 | |||
| 69 | def find_dll(name): | ||
| 70 | for path in DLL_PATH: | ||
| 71 | for root, _, files in os.walk(path): | ||
| 72 | for f in files: | ||
| 73 | if name.lower() == f.lower(): | ||
| 74 | return os.path.join(root, f) | ||
| 75 | |||
| 76 | |||
| 77 | def deploy(name, dst, dry_run=False): | ||
| 78 | dlls_path = [] | ||
| 79 | parse_imports_recursive(name, dlls_path) | ||
| 80 | for dll_entry in dlls_path: | ||
| 81 | if not dry_run: | ||
| 82 | shutil.copy(dll_entry, dst) | ||
| 83 | else: | ||
| 84 | print('[Dry-Run] Copy %s to %s' % (dll_entry, dst)) | ||
| 85 | print('Deploy completed.') | ||
| 86 | return dlls_path | ||
| 87 | |||
| 88 | |||
| 89 | def main(): | ||
| 90 | if len(sys.argv) < 3: | ||
| 91 | print('Usage: %s [files to examine ...] [target deploy directory]') | ||
| 92 | return 1 | ||
| 93 | to_deploy = sys.argv[1:-1] | ||
| 94 | tgt_dir = sys.argv[-1] | ||
| 95 | if not os.path.isdir(tgt_dir): | ||
| 96 | print('%s is not a directory.' % tgt_dir) | ||
| 97 | return 1 | ||
| 98 | print('Scanning dependencies...') | ||
| 99 | deploy(to_deploy, tgt_dir) | ||
| 100 | if missing: | ||
| 101 | print('Following DLLs are not found: %s' % ('\n'.join(missing))) | ||
| 102 | return 0 | ||
| 103 | |||
| 104 | |||
| 105 | if __name__ == '__main__': | ||
| 106 | main() | ||
diff --git a/.travis/linux-mingw/upload.sh b/.travis/linux-mingw/upload.sh deleted file mode 100755 index 66e896bc4..000000000 --- a/.travis/linux-mingw/upload.sh +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | . .travis/common/pre-upload.sh | ||
| 4 | |||
| 5 | REV_NAME="yuzu-windows-mingw-${GITDATE}-${GITREV}" | ||
| 6 | ARCHIVE_NAME="${REV_NAME}.tar.gz" | ||
| 7 | COMPRESSION_FLAGS="-czvf" | ||
| 8 | |||
| 9 | mkdir "$REV_NAME" | ||
| 10 | # get around the permission issues | ||
| 11 | cp -r package/* "$REV_NAME" | ||
| 12 | |||
| 13 | . .travis/common/post-upload.sh | ||
diff --git a/.travis/linux/build.sh b/.travis/linux/build.sh deleted file mode 100755 index 0c7fb8c9d..000000000 --- a/.travis/linux/build.sh +++ /dev/null | |||
| @@ -1,4 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | mkdir -p "$HOME/.ccache" | ||
| 4 | docker run -e ENABLE_COMPATIBILITY_REPORTING --env-file .travis/common/travis-ci.env -v $(pwd):/yuzu -v "$HOME/.ccache":/home/yuzu/.ccache yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.travis/linux/docker.sh | ||
diff --git a/.travis/linux/deps.sh b/.travis/linux/deps.sh deleted file mode 100755 index 8d23c517d..000000000 --- a/.travis/linux/deps.sh +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | #!/bin/sh -ex | ||
| 2 | |||
| 3 | docker pull yuzuemu/build-environments:linux-fresh | ||
diff --git a/.travis/linux/docker.sh b/.travis/linux/docker.sh deleted file mode 100755 index 166fb6d4c..000000000 --- a/.travis/linux/docker.sh +++ /dev/null | |||
| @@ -1,11 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | cd /yuzu | ||
| 4 | |||
| 5 | mkdir build && cd build | ||
| 6 | cmake .. -G Ninja -DYUZU_USE_QT_WEB_ENGINE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON | ||
| 7 | ninja | ||
| 8 | |||
| 9 | ccache -s | ||
| 10 | |||
| 11 | ctest -VV -C Release | ||
diff --git a/.travis/linux/upload.sh b/.travis/linux/upload.sh deleted file mode 100755 index 61842be12..000000000 --- a/.travis/linux/upload.sh +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | . .travis/common/pre-upload.sh | ||
| 4 | |||
| 5 | REV_NAME="yuzu-linux-${GITDATE}-${GITREV}" | ||
| 6 | ARCHIVE_NAME="${REV_NAME}.tar.xz" | ||
| 7 | COMPRESSION_FLAGS="-cJvf" | ||
| 8 | |||
| 9 | mkdir "$REV_NAME" | ||
| 10 | |||
| 11 | cp build/bin/yuzu-cmd "$REV_NAME" | ||
| 12 | cp build/bin/yuzu "$REV_NAME" | ||
| 13 | |||
| 14 | . .travis/common/post-upload.sh | ||
diff --git a/.travis/macos/build.sh b/.travis/macos/build.sh deleted file mode 100755 index db1c7cae7..000000000 --- a/.travis/macos/build.sh +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | set -o pipefail | ||
| 4 | |||
| 5 | export MACOSX_DEPLOYMENT_TARGET=10.14 | ||
| 6 | export Qt5_DIR=$(brew --prefix)/opt/qt5 | ||
| 7 | export PATH="/usr/local/opt/ccache/libexec:$PATH" | ||
| 8 | |||
| 9 | # TODO: Build using ninja instead of make | ||
| 10 | mkdir build && cd build | ||
| 11 | cmake --version | ||
| 12 | cmake .. -DYUZU_USE_QT_WEB_ENGINE=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DUSE_DISCORD_PRESENCE=ON | ||
| 13 | make -j4 | ||
| 14 | |||
| 15 | ccache -s | ||
| 16 | |||
| 17 | ctest -VV -C Release | ||
diff --git a/.travis/macos/deps.sh b/.travis/macos/deps.sh deleted file mode 100755 index faeafa216..000000000 --- a/.travis/macos/deps.sh +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #!/bin/sh -ex | ||
| 2 | |||
| 3 | brew update | ||
| 4 | brew install p7zip qt5 sdl2 ccache | ||
| 5 | brew outdated cmake || brew upgrade cmake | ||
| 6 | pip3 install macpack | ||
diff --git a/.travis/macos/upload.sh b/.travis/macos/upload.sh deleted file mode 100755 index c2f43a906..000000000 --- a/.travis/macos/upload.sh +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | #!/bin/bash -ex | ||
| 2 | |||
| 3 | . .travis/common/pre-upload.sh | ||
| 4 | |||
| 5 | REV_NAME="yuzu-osx-${GITDATE}-${GITREV}" | ||
| 6 | ARCHIVE_NAME="${REV_NAME}.tar.gz" | ||
| 7 | COMPRESSION_FLAGS="-czvf" | ||
| 8 | |||
| 9 | mkdir "$REV_NAME" | ||
| 10 | |||
| 11 | cp build/bin/yuzu-cmd "$REV_NAME" | ||
| 12 | cp -r build/bin/yuzu.app "$REV_NAME" | ||
| 13 | |||
| 14 | # move libs into folder for deployment | ||
| 15 | macpack "${REV_NAME}/yuzu.app/Contents/MacOS/yuzu" -d "../Frameworks" | ||
| 16 | # move qt frameworks into app bundle for deployment | ||
| 17 | $(brew --prefix)/opt/qt5/bin/macdeployqt "${REV_NAME}/yuzu.app" -executable="${REV_NAME}/yuzu.app/Contents/MacOS/yuzu" | ||
| 18 | |||
| 19 | # move libs into folder for deployment | ||
| 20 | macpack "${REV_NAME}/yuzu-cmd" -d "libs" | ||
| 21 | |||
| 22 | # Make the launching script executable | ||
| 23 | chmod +x ${REV_NAME}/yuzu.app/Contents/MacOS/yuzu | ||
| 24 | |||
| 25 | # Verify loader instructions | ||
| 26 | find "$REV_NAME" -exec otool -L {} \; | ||
| 27 | |||
| 28 | . .travis/common/post-upload.sh | ||
diff --git a/externals/dynarmic b/externals/dynarmic | |||
| Subproject 517e35f845e010788b6febe42fd6ddb187b8c23 | Subproject cce7e4ee5d7b07a4609c73c053fbf57dc8c7845 | ||
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp index 43b79bd6d..1bcb897b5 100644 --- a/src/common/fs/path_util.cpp +++ b/src/common/fs/path_util.cpp | |||
| @@ -82,32 +82,35 @@ public: | |||
| 82 | 82 | ||
| 83 | private: | 83 | private: |
| 84 | PathManagerImpl() { | 84 | PathManagerImpl() { |
| 85 | fs::path yuzu_path; | ||
| 86 | fs::path yuzu_path_cache; | ||
| 87 | fs::path yuzu_path_config; | ||
| 88 | |||
| 85 | #ifdef _WIN32 | 89 | #ifdef _WIN32 |
| 86 | auto yuzu_path = GetExeDirectory() / PORTABLE_DIR; | 90 | yuzu_path = GetExeDirectory() / PORTABLE_DIR; |
| 87 | 91 | ||
| 88 | if (!IsDir(yuzu_path)) { | 92 | if (!IsDir(yuzu_path)) { |
| 89 | yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR; | 93 | yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR; |
| 90 | } | 94 | } |
| 91 | 95 | ||
| 92 | GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); | 96 | yuzu_path_cache = yuzu_path / CACHE_DIR; |
| 93 | GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path / CACHE_DIR); | 97 | yuzu_path_config = yuzu_path / CONFIG_DIR; |
| 94 | GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path / CONFIG_DIR); | ||
| 95 | #else | 98 | #else |
| 96 | auto yuzu_path = GetCurrentDir() / PORTABLE_DIR; | 99 | yuzu_path = GetCurrentDir() / PORTABLE_DIR; |
| 97 | 100 | ||
| 98 | if (Exists(yuzu_path) && IsDir(yuzu_path)) { | 101 | if (Exists(yuzu_path) && IsDir(yuzu_path)) { |
| 99 | GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); | 102 | yuzu_path_cache = yuzu_path / CACHE_DIR; |
| 100 | GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path / CACHE_DIR); | 103 | yuzu_path_config = yuzu_path / CONFIG_DIR; |
| 101 | GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path / CONFIG_DIR); | ||
| 102 | } else { | 104 | } else { |
| 103 | yuzu_path = GetDataDirectory("XDG_DATA_HOME") / YUZU_DIR; | 105 | yuzu_path = GetDataDirectory("XDG_DATA_HOME") / YUZU_DIR; |
| 104 | 106 | yuzu_path_cache = GetDataDirectory("XDG_CACHE_HOME") / YUZU_DIR; | |
| 105 | GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); | 107 | yuzu_path_config = GetDataDirectory("XDG_CONFIG_HOME") / YUZU_DIR; |
| 106 | GenerateYuzuPath(YuzuPath::CacheDir, GetDataDirectory("XDG_CACHE_HOME") / YUZU_DIR); | ||
| 107 | GenerateYuzuPath(YuzuPath::ConfigDir, GetDataDirectory("XDG_CONFIG_HOME") / YUZU_DIR); | ||
| 108 | } | 108 | } |
| 109 | #endif | 109 | #endif |
| 110 | 110 | ||
| 111 | GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); | ||
| 112 | GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path_cache); | ||
| 113 | GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path_config); | ||
| 111 | GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR); | 114 | GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR); |
| 112 | GenerateYuzuPath(YuzuPath::KeysDir, yuzu_path / KEYS_DIR); | 115 | GenerateYuzuPath(YuzuPath::KeysDir, yuzu_path / KEYS_DIR); |
| 113 | GenerateYuzuPath(YuzuPath::LoadDir, yuzu_path / LOAD_DIR); | 116 | GenerateYuzuPath(YuzuPath::LoadDir, yuzu_path / LOAD_DIR); |
diff --git a/src/core/hle/service/am/applets/applet_web_browser.cpp b/src/core/hle/service/am/applets/applet_web_browser.cpp index 35f194961..927eeefff 100644 --- a/src/core/hle/service/am/applets/applet_web_browser.cpp +++ b/src/core/hle/service/am/applets/applet_web_browser.cpp | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include "core/hle/service/am/applets/applet_web_browser.h" | 24 | #include "core/hle/service/am/applets/applet_web_browser.h" |
| 25 | #include "core/hle/service/filesystem/filesystem.h" | 25 | #include "core/hle/service/filesystem/filesystem.h" |
| 26 | #include "core/hle/service/ns/pl_u.h" | 26 | #include "core/hle/service/ns/pl_u.h" |
| 27 | #include "core/loader/loader.h" | ||
| 27 | 28 | ||
| 28 | namespace Service::AM::Applets { | 29 | namespace Service::AM::Applets { |
| 29 | 30 | ||
| @@ -122,6 +123,15 @@ FileSys::VirtualFile GetOfflineRomFS(Core::System& system, u64 title_id, | |||
| 122 | const auto nca = system.GetContentProvider().GetEntry(title_id, nca_type); | 123 | const auto nca = system.GetContentProvider().GetEntry(title_id, nca_type); |
| 123 | 124 | ||
| 124 | if (nca == nullptr) { | 125 | if (nca == nullptr) { |
| 126 | if (nca_type == FileSys::ContentRecordType::HtmlDocument) { | ||
| 127 | LOG_WARNING(Service_AM, "Falling back to AppLoader to get the RomFS."); | ||
| 128 | FileSys::VirtualFile romfs; | ||
| 129 | system.GetAppLoader().ReadManualRomFS(romfs); | ||
| 130 | if (romfs != nullptr) { | ||
| 131 | return romfs; | ||
| 132 | } | ||
| 133 | } | ||
| 134 | |||
| 125 | LOG_ERROR(Service_AM, | 135 | LOG_ERROR(Service_AM, |
| 126 | "NCA of type={} with title_id={:016X} is not found in the ContentProvider!", | 136 | "NCA of type={} with title_id={:016X} is not found in the ContentProvider!", |
| 127 | nca_type, title_id); | 137 | nca_type, title_id); |
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index ab6211b29..ecb00d428 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp | |||
| @@ -170,7 +170,8 @@ public: | |||
| 170 | float GetAxis(int axis, float range, float offset) const { | 170 | float GetAxis(int axis, float range, float offset) const { |
| 171 | std::lock_guard lock{mutex}; | 171 | std::lock_guard lock{mutex}; |
| 172 | const float value = static_cast<float>(state.axes.at(axis)) / 32767.0f; | 172 | const float value = static_cast<float>(state.axes.at(axis)) / 32767.0f; |
| 173 | return (value + offset) / range; | 173 | const float offset_scale = (value + offset) > 0.0f ? 1.0f + offset : 1.0f - offset; |
| 174 | return (value + offset) / range / offset_scale; | ||
| 174 | } | 175 | } |
| 175 | 176 | ||
| 176 | bool RumblePlay(u16 amp_low, u16 amp_high) { | 177 | bool RumblePlay(u16 amp_low, u16 amp_high) { |
| @@ -789,8 +790,8 @@ public: | |||
| 789 | const std::string invert_y_value = params.Get("invert_y", "+"); | 790 | const std::string invert_y_value = params.Get("invert_y", "+"); |
| 790 | const bool invert_x = invert_x_value == "-"; | 791 | const bool invert_x = invert_x_value == "-"; |
| 791 | const bool invert_y = invert_y_value == "-"; | 792 | const bool invert_y = invert_y_value == "-"; |
| 792 | const float offset_x = params.Get("offset_x", 0.0f); | 793 | const float offset_x = std::clamp(params.Get("offset_x", 0.0f), -0.99f, 0.99f); |
| 793 | const float offset_y = params.Get("offset_y", 0.0f); | 794 | const float offset_y = std::clamp(params.Get("offset_y", 0.0f), -0.99f, 0.99f); |
| 794 | auto joystick = state.GetSDLJoystickByGUID(guid, port); | 795 | auto joystick = state.GetSDLJoystickByGUID(guid, port); |
| 795 | 796 | ||
| 796 | // This is necessary so accessing GetAxis with axis_x and axis_y won't crash | 797 | // This is necessary so accessing GetAxis with axis_x and axis_y won't crash |
diff --git a/src/video_core/command_classes/codecs/h264.cpp b/src/video_core/command_classes/codecs/h264.cpp index 51ee14c13..5519c4705 100644 --- a/src/video_core/command_classes/codecs/h264.cpp +++ b/src/video_core/command_classes/codecs/h264.cpp | |||
| @@ -20,6 +20,8 @@ | |||
| 20 | 20 | ||
| 21 | #include <array> | 21 | #include <array> |
| 22 | #include <bit> | 22 | #include <bit> |
| 23 | |||
| 24 | #include "common/settings.h" | ||
| 23 | #include "video_core/command_classes/codecs/h264.h" | 25 | #include "video_core/command_classes/codecs/h264.h" |
| 24 | #include "video_core/gpu.h" | 26 | #include "video_core/gpu.h" |
| 25 | #include "video_core/memory_manager.h" | 27 | #include "video_core/memory_manager.h" |
| @@ -96,7 +98,10 @@ const std::vector<u8>& H264::ComposeFrameHeader(const NvdecCommon::NvdecRegister | |||
| 96 | (context.h264_parameter_set.frame_mbs_only_flag ? 1 : 2); | 98 | (context.h264_parameter_set.frame_mbs_only_flag ? 1 : 2); |
| 97 | 99 | ||
| 98 | // TODO (ameerj): Where do we get this number, it seems to be particular for each stream | 100 | // TODO (ameerj): Where do we get this number, it seems to be particular for each stream |
| 99 | writer.WriteUe(6); // Max number of reference frames | 101 | const auto nvdec_decoding = Settings::values.nvdec_emulation.GetValue(); |
| 102 | const bool uses_gpu_decoding = nvdec_decoding == Settings::NvdecEmulation::GPU; | ||
| 103 | const u32 max_num_ref_frames = uses_gpu_decoding ? 6u : 16u; | ||
| 104 | writer.WriteUe(max_num_ref_frames); | ||
| 100 | writer.WriteBit(false); | 105 | writer.WriteBit(false); |
| 101 | writer.WriteUe(context.h264_parameter_set.pic_width_in_mbs - 1); | 106 | writer.WriteUe(context.h264_parameter_set.pic_width_in_mbs - 1); |
| 102 | writer.WriteUe(pic_height - 1); | 107 | writer.WriteUe(pic_height - 1); |
diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp index da328d904..f31f86339 100644 --- a/src/yuzu/configuration/configure_input_player_widget.cpp +++ b/src/yuzu/configuration/configure_input_player_widget.cpp | |||
| @@ -1837,7 +1837,7 @@ void PlayerControlPreview::DrawLeftBody(QPainter& p, const QPointF center) { | |||
| 1837 | const float led_size = 5.0f; | 1837 | const float led_size = 5.0f; |
| 1838 | const QPointF led_position = sideview_center + QPointF(0, -36); | 1838 | const QPointF led_position = sideview_center + QPointF(0, -36); |
| 1839 | int led_count = 0; | 1839 | int led_count = 0; |
| 1840 | for (const auto color : led_color) { | 1840 | for (const auto& color : led_color) { |
| 1841 | p.setBrush(color); | 1841 | p.setBrush(color); |
| 1842 | DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); | 1842 | DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); |
| 1843 | } | 1843 | } |
| @@ -1933,7 +1933,7 @@ void PlayerControlPreview::DrawRightBody(QPainter& p, const QPointF center) { | |||
| 1933 | const float led_size = 5.0f; | 1933 | const float led_size = 5.0f; |
| 1934 | const QPointF led_position = sideview_center + QPointF(0, -36); | 1934 | const QPointF led_position = sideview_center + QPointF(0, -36); |
| 1935 | int led_count = 0; | 1935 | int led_count = 0; |
| 1936 | for (const auto color : led_color) { | 1936 | for (const auto& color : led_color) { |
| 1937 | p.setBrush(color); | 1937 | p.setBrush(color); |
| 1938 | DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); | 1938 | DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); |
| 1939 | } | 1939 | } |
diff --git a/src/yuzu/configuration/configure_tas.ui b/src/yuzu/configuration/configure_tas.ui index 3972f9083..6caa19031 100644 --- a/src/yuzu/configuration/configure_tas.ui +++ b/src/yuzu/configuration/configure_tas.ui | |||
| @@ -2,14 +2,6 @@ | |||
| 2 | <ui version="4.0"> | 2 | <ui version="4.0"> |
| 3 | <class>ConfigureTas</class> | 3 | <class>ConfigureTas</class> |
| 4 | <widget class="QDialog" name="ConfigureTas"> | 4 | <widget class="QDialog" name="ConfigureTas"> |
| 5 | <property name="geometry"> | ||
| 6 | <rect> | ||
| 7 | <x>0</x> | ||
| 8 | <y>0</y> | ||
| 9 | <width>337</width> | ||
| 10 | <height>316</height> | ||
| 11 | </rect> | ||
| 12 | </property> | ||
| 13 | <layout class="QVBoxLayout" name="verticalLayout_1"> | 5 | <layout class="QVBoxLayout" name="verticalLayout_1"> |
| 14 | <item> | 6 | <item> |
| 15 | <layout class="QHBoxLayout" name="horizontalLayout_1"> | 7 | <layout class="QHBoxLayout" name="horizontalLayout_1"> |
diff --git a/src/yuzu/debugger/profiler.cpp b/src/yuzu/debugger/profiler.cpp index 7a6f84d96..33110685a 100644 --- a/src/yuzu/debugger/profiler.cpp +++ b/src/yuzu/debugger/profiler.cpp | |||
| @@ -143,24 +143,28 @@ void MicroProfileWidget::hideEvent(QHideEvent* ev) { | |||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) { | 145 | void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) { |
| 146 | MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); | 146 | const auto mouse_position = ev->pos(); |
| 147 | MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0); | ||
| 147 | ev->accept(); | 148 | ev->accept(); |
| 148 | } | 149 | } |
| 149 | 150 | ||
| 150 | void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) { | 151 | void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) { |
| 151 | MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); | 152 | const auto mouse_position = ev->pos(); |
| 153 | MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0); | ||
| 152 | MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); | 154 | MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); |
| 153 | ev->accept(); | 155 | ev->accept(); |
| 154 | } | 156 | } |
| 155 | 157 | ||
| 156 | void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) { | 158 | void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) { |
| 157 | MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); | 159 | const auto mouse_position = ev->pos(); |
| 160 | MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0); | ||
| 158 | MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); | 161 | MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); |
| 159 | ev->accept(); | 162 | ev->accept(); |
| 160 | } | 163 | } |
| 161 | 164 | ||
| 162 | void MicroProfileWidget::wheelEvent(QWheelEvent* ev) { | 165 | void MicroProfileWidget::wheelEvent(QWheelEvent* ev) { |
| 163 | MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, | 166 | const auto wheel_position = ev->position().toPoint(); |
| 167 | MicroProfileMousePosition(wheel_position.x() / x_scale, wheel_position.y() / y_scale, | ||
| 164 | ev->angleDelta().y() / 120); | 168 | ev->angleDelta().y() / 120); |
| 165 | ev->accept(); | 169 | ev->accept(); |
| 166 | } | 170 | } |
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index f9d949e75..ba54423ff 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp | |||
| @@ -159,8 +159,7 @@ GameListSearchField::GameListSearchField(GameList* parent) : QWidget{parent} { | |||
| 159 | * @return true if the haystack contains all words of userinput | 159 | * @return true if the haystack contains all words of userinput |
| 160 | */ | 160 | */ |
| 161 | static bool ContainsAllWords(const QString& haystack, const QString& userinput) { | 161 | static bool ContainsAllWords(const QString& haystack, const QString& userinput) { |
| 162 | const QStringList userinput_split = | 162 | const QStringList userinput_split = userinput.split(QLatin1Char{' '}, Qt::SkipEmptyParts); |
| 163 | userinput.split(QLatin1Char{' '}, QString::SplitBehavior::SkipEmptyParts); | ||
| 164 | 163 | ||
| 165 | return std::all_of(userinput_split.begin(), userinput_split.end(), | 164 | return std::all_of(userinput_split.begin(), userinput_split.end(), |
| 166 | [&haystack](const QString& s) { return haystack.contains(s); }); | 165 | [&haystack](const QString& s) { return haystack.contains(s); }); |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 552c2cc63..3eea61354 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1172,10 +1172,16 @@ void GMainWindow::ConnectMenuEvents() { | |||
| 1172 | &GMainWindow::OnDisplayTitleBars); | 1172 | &GMainWindow::OnDisplayTitleBars); |
| 1173 | connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); | 1173 | connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); |
| 1174 | connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); | 1174 | connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); |
| 1175 | |||
| 1175 | connect(ui.action_Reset_Window_Size_720, &QAction::triggered, this, | 1176 | connect(ui.action_Reset_Window_Size_720, &QAction::triggered, this, |
| 1176 | &GMainWindow::ResetWindowSize720); | 1177 | &GMainWindow::ResetWindowSize720); |
| 1178 | connect(ui.action_Reset_Window_Size_900, &QAction::triggered, this, | ||
| 1179 | &GMainWindow::ResetWindowSize900); | ||
| 1177 | connect(ui.action_Reset_Window_Size_1080, &QAction::triggered, this, | 1180 | connect(ui.action_Reset_Window_Size_1080, &QAction::triggered, this, |
| 1178 | &GMainWindow::ResetWindowSize1080); | 1181 | &GMainWindow::ResetWindowSize1080); |
| 1182 | ui.menu_Reset_Window_Size->addAction(ui.action_Reset_Window_Size_720); | ||
| 1183 | ui.menu_Reset_Window_Size->addAction(ui.action_Reset_Window_Size_900); | ||
| 1184 | ui.menu_Reset_Window_Size->addAction(ui.action_Reset_Window_Size_1080); | ||
| 1179 | 1185 | ||
| 1180 | // Fullscreen | 1186 | // Fullscreen |
| 1181 | connect(ui.action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen); | 1187 | connect(ui.action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen); |
| @@ -2621,32 +2627,29 @@ void GMainWindow::ToggleWindowMode() { | |||
| 2621 | } | 2627 | } |
| 2622 | } | 2628 | } |
| 2623 | 2629 | ||
| 2624 | void GMainWindow::ResetWindowSize720() { | 2630 | void GMainWindow::ResetWindowSize(u32 width, u32 height) { |
| 2625 | const auto aspect_ratio = Layout::EmulationAspectRatio( | 2631 | const auto aspect_ratio = Layout::EmulationAspectRatio( |
| 2626 | static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()), | 2632 | static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()), |
| 2627 | static_cast<float>(Layout::ScreenUndocked::Height) / Layout::ScreenUndocked::Width); | 2633 | static_cast<float>(height) / width); |
| 2628 | if (!ui.action_Single_Window_Mode->isChecked()) { | 2634 | if (!ui.action_Single_Window_Mode->isChecked()) { |
| 2629 | render_window->resize(Layout::ScreenUndocked::Height / aspect_ratio, | 2635 | render_window->resize(height / aspect_ratio, height); |
| 2630 | Layout::ScreenUndocked::Height); | ||
| 2631 | } else { | 2636 | } else { |
| 2632 | resize(Layout::ScreenUndocked::Height / aspect_ratio, | 2637 | const bool show_status_bar = ui.action_Show_Status_Bar->isChecked(); |
| 2633 | Layout::ScreenUndocked::Height + menuBar()->height() + | 2638 | const auto status_bar_height = show_status_bar ? statusBar()->height() : 0; |
| 2634 | (ui.action_Show_Status_Bar->isChecked() ? statusBar()->height() : 0)); | 2639 | resize(height / aspect_ratio, height + menuBar()->height() + status_bar_height); |
| 2635 | } | 2640 | } |
| 2636 | } | 2641 | } |
| 2637 | 2642 | ||
| 2643 | void GMainWindow::ResetWindowSize720() { | ||
| 2644 | ResetWindowSize(Layout::ScreenUndocked::Width, Layout::ScreenUndocked::Height); | ||
| 2645 | } | ||
| 2646 | |||
| 2647 | void GMainWindow::ResetWindowSize900() { | ||
| 2648 | ResetWindowSize(1600U, 900U); | ||
| 2649 | } | ||
| 2650 | |||
| 2638 | void GMainWindow::ResetWindowSize1080() { | 2651 | void GMainWindow::ResetWindowSize1080() { |
| 2639 | const auto aspect_ratio = Layout::EmulationAspectRatio( | 2652 | ResetWindowSize(Layout::ScreenDocked::Width, Layout::ScreenDocked::Height); |
| 2640 | static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()), | ||
| 2641 | static_cast<float>(Layout::ScreenDocked::Height) / Layout::ScreenDocked::Width); | ||
| 2642 | if (!ui.action_Single_Window_Mode->isChecked()) { | ||
| 2643 | render_window->resize(Layout::ScreenDocked::Height / aspect_ratio, | ||
| 2644 | Layout::ScreenDocked::Height); | ||
| 2645 | } else { | ||
| 2646 | resize(Layout::ScreenDocked::Height / aspect_ratio, | ||
| 2647 | Layout::ScreenDocked::Height + menuBar()->height() + | ||
| 2648 | (ui.action_Show_Status_Bar->isChecked() ? statusBar()->height() : 0)); | ||
| 2649 | } | ||
| 2650 | } | 2653 | } |
| 2651 | 2654 | ||
| 2652 | void GMainWindow::OnConfigure() { | 2655 | void GMainWindow::OnConfigure() { |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 60ce01471..5df2c9422 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -272,7 +272,9 @@ private slots: | |||
| 272 | void ShowFullscreen(); | 272 | void ShowFullscreen(); |
| 273 | void HideFullscreen(); | 273 | void HideFullscreen(); |
| 274 | void ToggleWindowMode(); | 274 | void ToggleWindowMode(); |
| 275 | void ResetWindowSize(u32 width, u32 height); | ||
| 275 | void ResetWindowSize720(); | 276 | void ResetWindowSize720(); |
| 277 | void ResetWindowSize900(); | ||
| 276 | void ResetWindowSize1080(); | 278 | void ResetWindowSize1080(); |
| 277 | void OnCaptureScreenshot(); | 279 | void OnCaptureScreenshot(); |
| 278 | void OnCoreError(Core::System::ResultStatus, std::string); | 280 | void OnCoreError(Core::System::ResultStatus, std::string); |
diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index 653c010d8..a62e39a06 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui | |||
| @@ -78,6 +78,35 @@ | |||
| 78 | <property name="title"> | 78 | <property name="title"> |
| 79 | <string>&View</string> | 79 | <string>&View</string> |
| 80 | </property> | 80 | </property> |
| 81 | <widget class="QMenu" name="menu_Reset_Window_Size"> | ||
| 82 | <property name="title"> | ||
| 83 | <string>&Reset Window Size</string> | ||
| 84 | </property> | ||
| 85 | </widget> | ||
| 86 | <action name="action_Reset_Window_Size_720"> | ||
| 87 | <property name="text"> | ||
| 88 | <string>Reset Window Size to &720p</string> | ||
| 89 | </property> | ||
| 90 | <property name="iconText"> | ||
| 91 | <string>Reset Window Size to 720p</string> | ||
| 92 | </property> | ||
| 93 | </action> | ||
| 94 | <action name="action_Reset_Window_Size_900"> | ||
| 95 | <property name="text"> | ||
| 96 | <string>Reset Window Size to &900p</string> | ||
| 97 | </property> | ||
| 98 | <property name="iconText"> | ||
| 99 | <string>Reset Window Size to 900p</string> | ||
| 100 | </property> | ||
| 101 | </action> | ||
| 102 | <action name="action_Reset_Window_Size_1080"> | ||
| 103 | <property name="text"> | ||
| 104 | <string>Reset Window Size to &1080p</string> | ||
| 105 | </property> | ||
| 106 | <property name="iconText"> | ||
| 107 | <string>Reset Window Size to 1080p</string> | ||
| 108 | </property> | ||
| 109 | </action> | ||
| 81 | <widget class="QMenu" name="menu_View_Debugging"> | 110 | <widget class="QMenu" name="menu_View_Debugging"> |
| 82 | <property name="title"> | 111 | <property name="title"> |
| 83 | <string>&Debugging</string> | 112 | <string>&Debugging</string> |
| @@ -88,9 +117,8 @@ | |||
| 88 | <addaction name="action_Display_Dock_Widget_Headers"/> | 117 | <addaction name="action_Display_Dock_Widget_Headers"/> |
| 89 | <addaction name="action_Show_Filter_Bar"/> | 118 | <addaction name="action_Show_Filter_Bar"/> |
| 90 | <addaction name="action_Show_Status_Bar"/> | 119 | <addaction name="action_Show_Status_Bar"/> |
| 91 | <addaction name="action_Reset_Window_Size_720"/> | ||
| 92 | <addaction name="action_Reset_Window_Size_1080"/> | ||
| 93 | <addaction name="separator"/> | 120 | <addaction name="separator"/> |
| 121 | <addaction name="menu_Reset_Window_Size"/> | ||
| 94 | <addaction name="menu_View_Debugging"/> | 122 | <addaction name="menu_View_Debugging"/> |
| 95 | </widget> | 123 | </widget> |
| 96 | <widget class="QMenu" name="menu_Tools"> | 124 | <widget class="QMenu" name="menu_Tools"> |
| @@ -216,22 +244,6 @@ | |||
| 216 | <string>Show Status Bar</string> | 244 | <string>Show Status Bar</string> |
| 217 | </property> | 245 | </property> |
| 218 | </action> | 246 | </action> |
| 219 | <action name="action_Reset_Window_Size_720"> | ||
| 220 | <property name="text"> | ||
| 221 | <string>Reset Window Size to &720p</string> | ||
| 222 | </property> | ||
| 223 | <property name="iconText"> | ||
| 224 | <string>Reset Window Size to 720p</string> | ||
| 225 | </property> | ||
| 226 | </action> | ||
| 227 | <action name="action_Reset_Window_Size_1080"> | ||
| 228 | <property name="text"> | ||
| 229 | <string>Reset Window Size to &1080p</string> | ||
| 230 | </property> | ||
| 231 | <property name="iconText"> | ||
| 232 | <string>Reset Window Size to 1080p</string> | ||
| 233 | </property> | ||
| 234 | </action> | ||
| 235 | <action name="action_Fullscreen"> | 247 | <action name="action_Fullscreen"> |
| 236 | <property name="checkable"> | 248 | <property name="checkable"> |
| 237 | <bool>true</bool> | 249 | <bool>true</bool> |