forked from etc/pineapple-src
early-access version 3633
This commit is contained in:
parent
ab25285161
commit
373dcf8231
3 changed files with 7 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
yuzu emulator early access
|
yuzu emulator early access
|
||||||
=============
|
=============
|
||||||
|
|
||||||
This is the source code for early-access 3631.
|
This is the source code for early-access 3633.
|
||||||
|
|
||||||
## Legal Notice
|
## Legal Notice
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import android.provider.DocumentsContract
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.activity.result.ActivityResultLauncher
|
import androidx.activity.result.ActivityResultLauncher
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.documentfile.provider.DocumentFile
|
import androidx.documentfile.provider.DocumentFile
|
||||||
import androidx.fragment.app.DialogFragment
|
import androidx.fragment.app.DialogFragment
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||||
|
@ -49,6 +50,7 @@ class ImportExportSavesFragment : DialogFragment() {
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
val activity = requireActivity() as AppCompatActivity
|
||||||
|
|
||||||
val activityResultRegistry = requireActivity().activityResultRegistry
|
val activityResultRegistry = requireActivity().activityResultRegistry
|
||||||
startForResultExportSave = activityResultRegistry.register(
|
startForResultExportSave = activityResultRegistry.register(
|
||||||
|
@ -61,7 +63,7 @@ class ImportExportSavesFragment : DialogFragment() {
|
||||||
"documentPickerKey",
|
"documentPickerKey",
|
||||||
ActivityResultContracts.OpenDocument()
|
ActivityResultContracts.OpenDocument()
|
||||||
) {
|
) {
|
||||||
it?.let { uri -> importSave(uri) }
|
it?.let { uri -> importSave(uri, activity) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,7 +185,7 @@ class ImportExportSavesFragment : DialogFragment() {
|
||||||
* Imports the save files contained in the zip file, and replaces any existing ones with the new save file.
|
* Imports the save files contained in the zip file, and replaces any existing ones with the new save file.
|
||||||
* @param zipUri The Uri of the zip file containing the save file(s) to import.
|
* @param zipUri The Uri of the zip file containing the save file(s) to import.
|
||||||
*/
|
*/
|
||||||
private fun importSave(zipUri: Uri) {
|
private fun importSave(zipUri: Uri, activity: AppCompatActivity) {
|
||||||
val inputZip = context.contentResolver.openInputStream(zipUri)
|
val inputZip = context.contentResolver.openInputStream(zipUri)
|
||||||
// A zip needs to have at least one subfolder named after a TitleId in order to be considered valid.
|
// A zip needs to have at least one subfolder named after a TitleId in order to be considered valid.
|
||||||
var validZip = false
|
var validZip = false
|
||||||
|
@ -214,7 +216,7 @@ class ImportExportSavesFragment : DialogFragment() {
|
||||||
MessageDialogFragment.newInstance(
|
MessageDialogFragment.newInstance(
|
||||||
R.string.save_file_invalid_zip_structure,
|
R.string.save_file_invalid_zip_structure,
|
||||||
R.string.save_file_invalid_zip_structure_description
|
R.string.save_file_invalid_zip_structure_description
|
||||||
).show(childFragmentManager, MessageDialogFragment.TAG)
|
).show(activity.supportFragmentManager, MessageDialogFragment.TAG)
|
||||||
return@withContext
|
return@withContext
|
||||||
}
|
}
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
|
|
|
@ -79,6 +79,7 @@ void TextureCache<P>::RunGarbageCollector() {
|
||||||
if (num_iterations == 0) {
|
if (num_iterations == 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
--num_iterations;
|
||||||
auto& image = slot_images[image_id];
|
auto& image = slot_images[image_id];
|
||||||
if (True(image.flags & ImageFlagBits::IsDecoding)) {
|
if (True(image.flags & ImageFlagBits::IsDecoding)) {
|
||||||
// This image is still being decoded, deleting it will invalidate the slot
|
// This image is still being decoded, deleting it will invalidate the slot
|
||||||
|
@ -88,7 +89,6 @@ void TextureCache<P>::RunGarbageCollector() {
|
||||||
if (!aggressive_mode && True(image.flags & ImageFlagBits::CostlyLoad)) {
|
if (!aggressive_mode && True(image.flags & ImageFlagBits::CostlyLoad)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
--num_iterations;
|
|
||||||
const bool must_download =
|
const bool must_download =
|
||||||
image.IsSafeDownload() && False(image.flags & ImageFlagBits::BadOverlap);
|
image.IsSafeDownload() && False(image.flags & ImageFlagBits::BadOverlap);
|
||||||
if (!high_priority_mode && must_download) {
|
if (!high_priority_mode && must_download) {
|
||||||
|
|
Loading…
Reference in a new issue