Removed workflow files and hook

This commit is contained in:
Jarrod Norwell 2024-03-11 15:15:21 +08:00
parent 82ab497ccf
commit 46cec552e5
22 changed files with 46 additions and 503 deletions

View File

@ -1,18 +0,0 @@
#!/bin/bash
export GDK_PIXBUF_MODULEDIR=$(pkg-config --variable=gdk_pixbuf_moduledir gdk-pixbuf-2.0)
export GDK_PIXBUF_MODULE_FILE=$(pkg-config --variable=gdk_pixbuf_cache_file gdk-pixbuf-2.0)
mkdir -p $HOME/.local/share/icons/hicolor/scalable/apps && cp $APPDIR/yuzu.svg $HOME/.local/share/icons/hicolor/scalable/apps
GITURL='https://api.github.com/repos/pineappleEA/pineapple-src/releases/latest'
GITVER=`( wget -qO- $GITURL 2>/dev/null || curl -sL $GITURL ) | grep "EA-" | grep -o 'EA-[[:digit:]]*'`
APPVER=`cat $APPDIR/version.txt`
if [[ -z "$GITVER" ]]; then
$APPDIR/AppRun-patched "$@"
elif [ "$GITVER" = "$APPVER" ]; then
$APPDIR/AppRun-patched "$@"
else
$APPDIR/update.sh "$@"
fi

View File

@ -1,91 +0,0 @@
#!/bin/bash -ex
BUILDBIN=/yuzu/build/bin
BINFILE=yuzu-x86_64.AppImage
LOG_FILE=$HOME/curl.log
BRANCH=`echo ${GITHUB_REF##*/}`
export CC=${GCC_BINARY}
export CXX=${GXX_BINARY}
cd /tmp
curl -sLO "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
curl -sLO "https://github.com/$GITHUB_REPOSITORY/raw/$BRANCH/.github/workflows/update.tar.gz"
curl -sL https://github.com$(curl https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous | grep "mkappimage-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2) -o mkappimage.AppImage
tar -xzf update.tar.gz
chmod a+x linuxdeployqt*.AppImage
chmod a+x mkappimage.AppImage
./linuxdeployqt-continuous-x86_64.AppImage --appimage-extract
cd $HOME
mkdir -p squashfs-root/usr/bin
cp -P "$BUILDBIN"/yuzu $HOME/squashfs-root/usr/bin/
curl -sL https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$BRANCH/dist/yuzu.svg -o ./squashfs-root/yuzu.svg
curl -sL https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$BRANCH/dist/yuzu.desktop -o ./squashfs-root/yuzu.desktop
curl -sL https://github.com/AppImage/AppImageKit/releases/download/continuous/runtime-x86_64 -o ./squashfs-root/runtime
mkdir -p squashfs-root/usr/share/applications && cp ./squashfs-root/yuzu.desktop ./squashfs-root/usr/share/applications
mkdir -p squashfs-root/usr/share/icons && cp ./squashfs-root/yuzu.svg ./squashfs-root/usr/share/icons
mkdir -p squashfs-root/usr/share/icons/hicolor/scalable/apps && cp ./squashfs-root/yuzu.svg ./squashfs-root/usr/share/icons/hicolor/scalable/apps
mkdir -p squashfs-root/usr/share/pixmaps && cp ./squashfs-root/yuzu.svg ./squashfs-root/usr/share/pixmaps
curl -sL "https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$BRANCH/.github/workflows/update.sh" -o $HOME/squashfs-root/update.sh
chmod a+x ./squashfs-root/runtime
chmod a+x ./squashfs-root/update.sh
version=$(cat /yuzu/README.md | grep -o 'early-access [[:digit:]]*' | cut -c 14-17)
echo EA-$version > $HOME/squashfs-root/version.txt
unset QT_PLUGIN_PATH
unset LD_LIBRARY_PATH
unset QTDIR
mkdir $HOME/artifacts/
mkdir -p /yuzu/artifacts/version
# Version AppImage
mkdir -p squashfs-root/usr/optional/{libstdc++,libgcc_s}
mkdir -p squashfs-root/usr/lib
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./squashfs-root/usr/optional/libstdc++/
cp /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 ./squashfs-root/usr/optional/libgcc_s/
cp /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 ./squashfs-root/usr/lib
curl -sSfL https://github.com/RPCS3/AppImageKit-checkrt/releases/download/continuous2/AppRun-patched-x86_64 -o ./squashfs-root/AppRun.wrapped
# create AppRun
cat << 'EOF' > $HOME/squashfs-root/AppRun
#! /usr/bin/env bash
set -e
this_dir="$(readlink -f "$(dirname "$0")")"
#GDK_PIXBUF
export GDK_PIXBUF_MODULEDIR=$(pkg-config --variable=gdk_pixbuf_moduledir gdk-pixbuf-2.0)
export GDK_PIXBUF_MODULE_FILE=$(pkg-config --variable=gdk_pixbuf_cache_file gdk-pixbuf-2.0)
exec "$this_dir"/AppRun.wrapped "$@"
EOF
chmod a+x ./squashfs-root/{AppRun,AppRun.wrapped}
curl -sSfL https://github.com/RPCS3/AppImageKit-checkrt/releases/download/continuous2/exec-x86_64.so -o ./squashfs-root/usr/optional/exec.so
printf "#include <sstream>\n#include <exception>\n#include <memory_resource>\nint main(){auto x = std::stringbuf();x.get_allocator();std::make_exception_ptr(0);std::pmr::get_default_resource();}" \
| $CXX -x c++ -std=c++2a -o ./squashfs-root/usr/optional/checker -
# Build AppDir
/tmp/squashfs-root/AppRun $HOME/squashfs-root/usr/bin/yuzu -unsupported-allow-new-glibc -no-copy-copyright-files -no-translations -bundle-non-qt-libs
export PATH=$(readlink -f /tmp/squashfs-root/usr/bin/):$PATH
mkdir $HOME/squashfs-root/usr/plugins/platformthemes/
cp /opt/qt515/plugins/platformthemes/libqgtk3.so $HOME/squashfs-root/usr/plugins/platformthemes/
rm $HOME/squashfs-root/usr/lib/libglib-2.0.so.0
VERSION=pineapple /tmp/mkappimage.AppImage --appimage-extract-and-run $HOME/squashfs-root
mv ./yuzu-pineapple-x86_64.AppImage /yuzu/artifacts/version/Yuzu-EA-$version.AppImage
# Continuous AppImage
mv $HOME/squashfs-root/AppRun.wrapped ./squashfs-root/AppRun-patched
rm $HOME/squashfs-root/AppRun
curl -sL "https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$BRANCH/.github/workflows/AppRun" -o $HOME/squashfs-root/AppRun
chmod a+x ./squashfs-root/AppRun
mv /tmp/update/AppImageUpdate $HOME/squashfs-root/usr/bin/
mv /tmp/update/* $HOME/squashfs-root/usr/lib/
/tmp/squashfs-root/usr/bin/appimagetool $HOME/squashfs-root -u "gh-releases-zsync|pineappleEA|pineapple-src|continuous|yuzu-x86_64.AppImage.zsync"
# mv yuzu-x86_64.AppImage old.AppImage
#VERSION=pineapple /tmp/mkappimage.AppImage --appimage-extract-and-run $HOME/squashfs-root -u "gh-releases-zsync|pineappleEA|pineapple-src|continuous|yuzu-x86_64.AppImage.zsync"
#mv yuzu-pineapple-x86_64.AppImage yuzu-x86_64.AppImage
mv yuzu-x86_64.AppImage* /yuzu/artifacts
cp -R $HOME/artifacts/ /yuzu/
#cp "$BUILDBIN"/yuzu /yuzu/artifacts/version/
chmod -R 777 /yuzu/artifacts
cd /yuzu/artifacts
ls -al /yuzu/artifacts/
ls -al /yuzu/artifacts/version

View File

@ -1,48 +0,0 @@
name: AppImage
on:
push:
branches: [ main ]
jobs:
appimage:
name: pineapple bundled as appimage
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: build-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
build-ccache-
- name: Build binary
run: |
mkdir -p "$HOME/.ccache"
docker pull quriouspixel/yuzu:latest
docker run -u root -e ENABLE_COMPATIBILITY_REPORTING --env-file .github/workflows/docker.env -v $(pwd):/yuzu -v "$HOME/.ccache":/root/.ccache quriouspixel/yuzu:latest /bin/bash /yuzu/.github/workflows/docker.sh
- name: Package AppImage
run: echo "Success!"
- name: Upload AppImage
run: |
ls -al artifacts/
wget -c https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_linux_amd64.tar.gz
tar xfv ghr_v0.13.0_linux_amd64.tar.gz
version=$(ls artifacts/version |grep Yuzu-EA | cut -d "-" -f 3 | cut -d "." -f 1)
ghr_v0.13.0_linux_amd64/ghr -recreate -n "EA-$version (auto-updater)" -b "Yuzu build with Auto-Updater builtin (linux only)" continuous artifacts/
ghr_v0.13.0_linux_amd64/ghr -replace -n "EA-$version" -b "early-access version $version" EA-$version artifacts/version/
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,9 +0,0 @@
GITHUB_REF
GITHUB_RUN_ID
GITHUB_REPOSITORY
GITHUB_SHA
GITHUB_WORKSPACE
# yuzu specific flags
ENABLE_COMPATIBILITY_REPORTING
USE_DISCORD_PRESENCE

View File

@ -1,70 +0,0 @@
#!/bin/bash -ex
BRANCH=`echo ${GITHUB_REF##*/}`
build_date=$(date +%F -r .)
ver=$(cat /yuzu/README.md | grep -o 'early-access [[:digit:]]*' | cut -c 14-17)
title="yuzu Early Access $ver"
yuzupatch=( $(ls -d patches/* ) )
for i in "${yuzupatch[@]}"; do patch -p1 < "$i"; done
find . -name "CMakeLists.txt" ! -path "*/externals/*" -exec sed -i 's/^.*-Werror$/-W/g' {} +
find . -name "CMakeLists.txt" ! -path "*/externals/*" -exec sed -i 's/^.*-Werror=.*)$/ )/g' {} +
find . -name "CMakeLists.txt" ! -path "*/externals/*" -exec sed -i 's/^.*-Werror=.*$/ /g' {} +
find . -name "CMakeLists.txt" ! -path "*/externals/*" -exec sed -i 's/-Werror/-W/g' {} +
if [ -e src/core/network/network.h ]; then mv src/core/network/network.h src/core/network/network.h_ ; fi
# Add cache if does not exist
if [[ ! -e ~/.ccache ]]; then
mkdir ~/.ccache
fi
CACHEDIR=~/.ccache
ls -al $CACHEDIR
###############################################
# Install SDL
SDL2VER=2.0.22
#SDL2
cd $CACHEDIR
if [[ ! -e SDL2-${SDL2VER} ]]; then
curl -sLO https://libsdl.org/release/SDL2-${SDL2VER}.tar.gz
tar -xzf SDL2-${SDL2VER}.tar.gz
cd SDL2-${SDL2VER}
./configure --prefix=/usr
make && cd ../
rm SDL2-${SDL2VER}.tar.gz
fi
make -C SDL2-${SDL2VER} install
sdl2-config --version
cd /yuzu
###############################################
pip3 install conan --upgrade --no-cache-dir
pip3 install wheel
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=/usr/lib/ccache/gcc \
-DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ \
-DTITLE_BAR_FORMAT_IDLE="$title" \
-DTITLE_BAR_FORMAT_RUNNING="$title | {3}" \
-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON \
-DGIT_BRANCH="HEAD" \
-DGIT_DESC="$msvc" \
-DUSE_DISCORD_PRESENCE=ON \
-DENABLE_QT_TRANSLATION=ON \
-DBUILD_DATE="$build_date" \
-DYUZU_USE_QT_WEB_ENGINE=OFF \
-DYUZU_USE_EXTERNAL_SDL2=OFF \
-G Ninja
ninja
cd /tmp
curl -sLO "https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$BRANCH/.github/workflows/appimage.sh"
chmod a+x appimage.sh
./appimage.sh

View File

@ -1,23 +0,0 @@
#!/bin/bash
directory=${APPIMAGE%${ARGV0/*\//}}
if [ -w $directory ] ; then
zenity --question --timeout=10 --title="yuzu updater" --text="New update available. Update now?" --icon-name=yuzu --window-icon=yuzu.svg --height=80 --width=400
answer=$?
if [ "$answer" -eq 0 ]; then
$APPDIR/usr/bin/AppImageUpdate $APPIMAGE && "$directory"yuzu-x86_64.AppImage "$@"
elif [ "$answer" -eq 1 ]; then
$APPDIR/AppRun-patched "$@"
elif [ "$answer" -eq 5 ]; then
$APPDIR/AppRun-patched "$@"
fi
else
zenity --error --timeout=5 --text="Cannot update in $directory" --title="Update Error" --width=500 --width=200
$APPDIR/AppRun-patched "$@"
fi
exit 0

Binary file not shown.

View File

@ -620,7 +620,7 @@ if (NOT CLANG_FORMAT)
message(STATUS "Clang format not found! Downloading...")
set(CLANG_FORMAT "${PROJECT_BINARY_DIR}/externals/clang-format${CLANG_FORMAT_POSTFIX}.exe")
file(DOWNLOAD
https://github.com/sudachi-emu/windows-binaries/raw/main/clang-format${CLANG_FORMAT_POSTFIX}.exe
https://github.com/sudachi-emu/windows-binaries/raw/master/clang-format${CLANG_FORMAT_POSTFIX}.exe
"${CLANG_FORMAT}" SHOW_PROGRESS
STATUS DOWNLOAD_SUCCESS)
if (NOT DOWNLOAD_SUCCESS EQUAL 0)

View File

@ -14,7 +14,7 @@ if (WIN32)
set(package_repo "windows-binaries/raw/main/")
set(package_extension ".7z")
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(package_repo "ext-linux-bin/raw/main/")
set(package_repo "linux-binaries/raw/main/")
set(package_extension ".tar.xz")
elseif (ANDROID)
set(package_repo "android-binaries/raw/main/")

View File

@ -115,6 +115,9 @@ if (USE_DISCORD_PRESENCE AND NOT TARGET DiscordRPC::discord-rpc)
add_library(DiscordRPC::discord-rpc ALIAS discord-rpc)
endif()
# Sirit
add_subdirectory(sirit)
# httplib
if (ENABLE_WEB_SERVICE AND NOT TARGET httplib::httplib)
set(HTTPLIB_REQUIRE_OPENSSL ON)
@ -152,9 +155,6 @@ if (YUZU_USE_EXTERNAL_VULKAN_HEADERS)
add_subdirectory(Vulkan-Headers)
endif()
# Sirit
add_subdirectory(sirit)
# Vulkan-Utility-Libraries
if (YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES)
add_subdirectory(Vulkan-Utility-Libraries)

View File

@ -1,44 +1,16 @@
# SPDX-FileCopyrightText: 2009 Michal Cihar <michal@cihar.com>
# SPDX-License-Identifier: GPL-2.0-or-later
# - Find libusb-1.0 library
# This module defines
# LIBUSB_INCLUDE_DIR, where to find bluetooth.h
# LIBUSB_LIBRARIES, the libraries needed to use libusb-1.0.
# LIBUSB_FOUND, If false, do not try to use libusb-1.0.
# SPDX-FileCopyrightText: 2022 Alexandre Bouvier <contact@amb.tf>
#
# vim: expandtab sw=4 ts=4 sts=4:
# SPDX-License-Identifier: GPL-3.0-or-later
if(ANDROID)
set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found")
message(STATUS "libusb-1.0 not found.")
elseif (NOT LIBUSB_FOUND)
pkg_check_modules (LIBUSB_PKG libusb-1.0)
find_package(PkgConfig QUIET)
pkg_search_module(LIBUSB QUIET IMPORTED_TARGET libusb-1.0)
find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h
PATHS
${LIBUSB_PKG_INCLUDE_DIRS}
/usr/include/libusb-1.0
/usr/include
/usr/local/include/libusb-1.0
/usr/local/include
)
find_library(LIBUSB_LIBRARIES NAMES usb-1.0 usb
PATHS
${LIBUSB_PKG_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
)
if(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
set(LIBUSB_FOUND TRUE CACHE INTERNAL "libusb-1.0 found")
message(STATUS "Found libusb-1.0: ${LIBUSB_INCLUDE_DIR}, ${LIBUSB_LIBRARIES}")
else(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found")
message(STATUS "libusb-1.0 not found.")
endif(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
endif ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libusb
REQUIRED_VARS LIBUSB_LINK_LIBRARIES
VERSION_VAR LIBUSB_VERSION
)
if (libusb_FOUND AND NOT TARGET libusb::usb)
add_library(libusb::usb ALIAS PkgConfig::LIBUSB)
endif()

View File

@ -1,8 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#define VMA_IMPLEMENTATION
#define VMA_STATIC_VULKAN_FUNCTIONS 0
#define VMA_DYNAMIC_VULKAN_FUNCTIONS 1
#include <vk_mem_alloc.h>

View File

@ -1,29 +0,0 @@
#!/bin/sh
# SPDX-FileCopyrightText: 2015 Citra Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
# Enforce yuzu's whitespace policy
git config --local core.whitespace tab-in-indent,trailing-space
paths_to_check="src/ CMakeLists.txt"
# If there are whitespace errors, print the offending file names and fail.
if ! git diff --cached --check -- $paths_to_check ; then
cat<<END
Error: This commit would contain trailing spaces or tabs, which is against this repo's policy.
Please correct those issues before committing. (Use 'git diff --check' for more details)
If you know what you are doing, you can try 'git commit --no-verify' to bypass the check
END
exit 1
fi
# Check for tabs, since tab-in-indent catches only those at the beginning of a line
if git diff --cached -- $paths_to_check | egrep '^\+.* '; then
cat<<END
Error: This commit would contain a tab, which is against this repo's policy.
If you know what you are doing, you can try 'git commit --no-verify' to bypass the check.
END
exit 1
fi

View File

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later
import android.annotation.SuppressLint
import com.github.triplet.gradle.androidpublisher.ReleaseStatus
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
import com.github.triplet.gradle.androidpublisher.ReleaseStatus
plugins {
id("com.android.application")
@ -25,7 +25,6 @@ val autoVersion = (((System.currentTimeMillis() / 1000) - 1451606400) / 10).toIn
@Suppress("UnstableApiUsage")
android {
namespace = "org.yuzu.yuzu_emu"
compileSdk = 34
ndkVersion = "26.2.11394342"
@ -55,7 +54,7 @@ android {
defaultConfig {
// TODO If this is ever modified, change application_id in strings.xml
applicationId = "org.yuzu.yuzu_emu"
minSdk = 30
minSdk = 29
targetSdk = 34
versionName = getGitVersion()
@ -162,6 +161,8 @@ android {
path = file("../../../CMakeLists.txt")
}
}
compileSdk = 34
buildToolsVersion = "34.0.0"
defaultConfig {

View File

@ -8,14 +8,14 @@ import android.os.Handler
import android.os.Looper
import android.view.KeyEvent
import android.view.View
import android.view.WindowInsets
import android.view.inputmethod.InputMethodManager
import androidx.annotation.Keep
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import java.io.Serializable
import org.yuzu.yuzu_emu.NativeLibrary
import org.yuzu.yuzu_emu.R
import org.yuzu.yuzu_emu.applets.keyboard.ui.KeyboardDialogFragment
import java.io.Serializable
@Keep
object SoftwareKeyboard {
@ -35,7 +35,7 @@ object SoftwareKeyboard {
val overlayView = emulationActivity!!.findViewById<View>(R.id.surface_input_overlay)
val im =
overlayView.context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
im.showSoftInput(overlayView, 0)
im.showSoftInput(overlayView, InputMethodManager.SHOW_FORCED)
// There isn't a good way to know that the IMM is dismissed, so poll every 500ms to submit inline keyboard result.
val handler = Handler(Looper.myLooper()!!)
@ -44,7 +44,7 @@ object SoftwareKeyboard {
object : Runnable {
override fun run() {
val insets = ViewCompat.getRootWindowInsets(overlayView)
val isKeyboardVisible = insets!!.isVisible(WindowInsetsCompat.Type.ime())
val isKeyboardVisible = insets!!.isVisible(WindowInsets.Type.ime())
if (isKeyboardVisible) {
handler.postDelayed(this, delayMs.toLong())
return

View File

@ -31,7 +31,7 @@ object DiskShaderCacheProgress {
}
emulationActivity.runOnUiThread {
when (LoadCallbackStage.values()[stage]) {
when (LoadCallbackStage.entries[stage]) {
LoadCallbackStage.Prepare -> prepareViewModel()
LoadCallbackStage.Build -> emulationViewModel.updateProgress(
emulationActivity.getString(R.string.building_shaders),

View File

@ -1,31 +0,0 @@
// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
package org.yuzu.yuzu_emu.disk_shader_cache
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
class ShaderProgressViewModel : ViewModel() {
private val _progress = MutableLiveData(0)
val progress: LiveData<Int> get() = _progress
private val _max = MutableLiveData(0)
val max: LiveData<Int> get() = _max
private val _message = MutableLiveData("")
val message: LiveData<String> get() = _message
fun setProgress(progress: Int) {
_progress.postValue(progress)
}
fun setMax(max: Int) {
_max.postValue(max)
}
fun setMessage(msg: String) {
_message.postValue(msg)
}
}

View File

@ -1,103 +0,0 @@
// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
package org.yuzu.yuzu_emu.disk_shader_cache.ui
import android.app.Dialog
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AlertDialog
import androidx.fragment.app.DialogFragment
import androidx.lifecycle.ViewModelProvider
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import org.yuzu.yuzu_emu.databinding.DialogProgressBarBinding
import org.yuzu.yuzu_emu.disk_shader_cache.DiskShaderCacheProgress
import org.yuzu.yuzu_emu.disk_shader_cache.ShaderProgressViewModel
class ShaderProgressDialogFragment : DialogFragment() {
private var _binding: DialogProgressBarBinding? = null
private val binding get() = _binding!!
private lateinit var alertDialog: AlertDialog
private lateinit var shaderProgressViewModel: ShaderProgressViewModel
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
_binding = DialogProgressBarBinding.inflate(layoutInflater)
shaderProgressViewModel =
ViewModelProvider(requireActivity())[ShaderProgressViewModel::class.java]
val title = requireArguments().getString(TITLE)
val message = requireArguments().getString(MESSAGE)
isCancelable = false
alertDialog = MaterialAlertDialogBuilder(requireActivity())
.setView(binding.root)
.setTitle(title)
.setMessage(message)
.create()
return alertDialog
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
return binding.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
shaderProgressViewModel.progress.observe(viewLifecycleOwner) { progress ->
binding.progressBar.progress = progress
setUpdateText()
}
shaderProgressViewModel.max.observe(viewLifecycleOwner) { max ->
binding.progressBar.max = max
setUpdateText()
}
shaderProgressViewModel.message.observe(viewLifecycleOwner) { msg ->
alertDialog.setMessage(msg)
}
synchronized(DiskShaderCacheProgress.finishLock) {
DiskShaderCacheProgress.finishLock.notifyAll()
}
}
override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
fun onUpdateProgress(msg: String, progress: Int, max: Int) {
shaderProgressViewModel.setProgress(progress)
shaderProgressViewModel.setMax(max)
shaderProgressViewModel.setMessage(msg)
}
private fun setUpdateText() {
binding.progressText.text = String.format(
"%d/%d",
shaderProgressViewModel.progress.value,
shaderProgressViewModel.max.value
)
}
companion object {
const val TAG = "ProgressDialogFragment"
const val TITLE = "title"
const val MESSAGE = "message"
fun newInstance(title: String, message: String): ShaderProgressDialogFragment {
val frag = ShaderProgressDialogFragment()
val args = Bundle()
args.putString(TITLE, title)
args.putString(MESSAGE, message)
frag.arguments = args
return frag
}
}
}

View File

@ -491,7 +491,7 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_doesUpdateMatchProgram(JNIEnv* en
return false;
}
void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeGpuDriver(JNIEnv* env, jobject clazz,
void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeGpuDriver(JNIEnv* env, jclass clazz,
jstring hook_lib_dir,
jstring custom_driver_dir,
jstring custom_driver_name,
@ -555,32 +555,32 @@ jobjectArray Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_getSystemDriverInfo(
return j_driver_info;
}
jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_reloadKeys(JNIEnv* env, jobject clazz) {
jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_reloadKeys(JNIEnv* env, jclass clazz) {
Core::Crypto::KeyManager::Instance().ReloadKeys();
return static_cast<jboolean>(Core::Crypto::KeyManager::Instance().AreKeysLoaded());
}
void Java_org_yuzu_yuzu_1emu_NativeLibrary_unpauseEmulation(JNIEnv* env, jobject clazz) {
void Java_org_yuzu_yuzu_1emu_NativeLibrary_unpauseEmulation(JNIEnv* env, jclass clazz) {
EmulationSession::GetInstance().UnPauseEmulation();
}
void Java_org_yuzu_yuzu_1emu_NativeLibrary_pauseEmulation(JNIEnv* env, jobject clazz) {
void Java_org_yuzu_yuzu_1emu_NativeLibrary_pauseEmulation(JNIEnv* env, jclass clazz) {
EmulationSession::GetInstance().PauseEmulation();
}
void Java_org_yuzu_yuzu_1emu_NativeLibrary_stopEmulation(JNIEnv* env, jobject clazz) {
void Java_org_yuzu_yuzu_1emu_NativeLibrary_stopEmulation(JNIEnv* env, jclass clazz) {
EmulationSession::GetInstance().HaltEmulation();
}
jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isRunning(JNIEnv* env, jobject clazz) {
jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isRunning(JNIEnv* env, jclass clazz) {
return static_cast<jboolean>(EmulationSession::GetInstance().IsRunning());
}
jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isPaused(JNIEnv* env, jobject clazz) {
jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isPaused(JNIEnv* env, jclass clazz) {
return static_cast<jboolean>(EmulationSession::GetInstance().IsPaused());
}
void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeSystem(JNIEnv* env, jobject clazz,
void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeSystem(JNIEnv* env, jclass clazz,
jboolean reload) {
// Initialize the emulated system.
if (!reload) {
@ -589,7 +589,7 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeSystem(JNIEnv* env, jobject
EmulationSession::GetInstance().InitializeSystem(reload);
}
jdoubleArray Java_org_yuzu_yuzu_1emu_NativeLibrary_getPerfStats(JNIEnv* env, jobject clazz) {
jdoubleArray Java_org_yuzu_yuzu_1emu_NativeLibrary_getPerfStats(JNIEnv* env, jclass clazz) {
jdoubleArray j_stats = env->NewDoubleArray(4);
if (EmulationSession::GetInstance().IsRunning()) {
@ -605,7 +605,7 @@ jdoubleArray Java_org_yuzu_yuzu_1emu_NativeLibrary_getPerfStats(JNIEnv* env, job
return j_stats;
}
jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getCpuBackend(JNIEnv* env, jobject clazz) {
jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getCpuBackend(JNIEnv* env, jclass clazz) {
if (Settings::IsNceEnabled()) {
return Common::Android::ToJString(env, "NCE");
}
@ -641,18 +641,18 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_run(JNIEnv* env, jobject jobj, jstrin
}
}
void Java_org_yuzu_yuzu_1emu_NativeLibrary_logDeviceInfo(JNIEnv* env, jobject clazz) {
void Java_org_yuzu_yuzu_1emu_NativeLibrary_logDeviceInfo(JNIEnv* env, jclass clazz) {
LOG_INFO(Frontend, "yuzu Version: {}-{}", Common::g_scm_branch, Common::g_scm_desc);
LOG_INFO(Frontend, "Host OS: Android API level {}", android_get_device_api_level());
}
void Java_org_yuzu_yuzu_1emu_NativeLibrary_submitInlineKeyboardText(JNIEnv* env, jobject clazz,
void Java_org_yuzu_yuzu_1emu_NativeLibrary_submitInlineKeyboardText(JNIEnv* env, jclass clazz,
jstring j_text) {
const std::u16string input = Common::UTF8ToUTF16(Common::Android::GetJString(env, j_text));
EmulationSession::GetInstance().SoftwareKeyboard()->SubmitInlineKeyboardText(input);
}
void Java_org_yuzu_yuzu_1emu_NativeLibrary_submitInlineKeyboardInput(JNIEnv* env, jobject clazz,
void Java_org_yuzu_yuzu_1emu_NativeLibrary_submitInlineKeyboardInput(JNIEnv* env, jclass clazz,
jint j_key_code) {
EmulationSession::GetInstance().SoftwareKeyboard()->SubmitInlineKeyboardInput(j_key_code);
}
@ -677,7 +677,7 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeEmptyUserDirectory(JNIEnv*
}
}
jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getAppletLaunchPath(JNIEnv* env, jobject clazz,
jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getAppletLaunchPath(JNIEnv* env, jclass clazz,
jlong jid) {
auto bis_system =
EmulationSession::GetInstance().System().GetFileSystemController().GetSystemNANDContents();
@ -694,18 +694,18 @@ jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getAppletLaunchPath(JNIEnv* env, j
return Common::Android::ToJString(env, applet_nca->GetFullPath());
}
void Java_org_yuzu_yuzu_1emu_NativeLibrary_setCurrentAppletId(JNIEnv* env, jobject clazz,
void Java_org_yuzu_yuzu_1emu_NativeLibrary_setCurrentAppletId(JNIEnv* env, jclass clazz,
jint jappletId) {
EmulationSession::GetInstance().SetAppletId(jappletId);
}
void Java_org_yuzu_yuzu_1emu_NativeLibrary_setCabinetMode(JNIEnv* env, jobject clazz,
void Java_org_yuzu_yuzu_1emu_NativeLibrary_setCabinetMode(JNIEnv* env, jclass clazz,
jint jcabinetMode) {
EmulationSession::GetInstance().System().GetFrontendAppletHolder().SetCabinetMode(
static_cast<Service::NFP::CabinetMode>(jcabinetMode));
}
jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isFirmwareAvailable(JNIEnv* env, jobject clazz) {
jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isFirmwareAvailable(JNIEnv* env, jclass clazz) {
auto bis_system =
EmulationSession::GetInstance().System().GetFileSystemController().GetSystemNANDContents();
if (!bis_system) {

View File

@ -9,7 +9,7 @@ plugins {
}
tasks.register("clean").configure {
delete(rootProject.layout.buildDirectory.asFile.toString())
delete(rootProject.layout.buildDirectory.asFile)
}
buildscript {

View File

@ -1,4 +1,4 @@
#Thu Mar 07 02:52:25 AWST 2024
#Sat Mar 09 18:38:36 AWST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip