Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99f04ac1a6 | ||
|
|
ce09450743 | ||
|
|
2cb80f37d4 |
@@ -21,6 +21,8 @@ namespace Ryujinx.Horizon.Sdk.OsTypes.Impl
|
|||||||
|
|
||||||
public long CurrentTime { get; private set; }
|
public long CurrentTime { get; private set; }
|
||||||
|
|
||||||
|
public IEnumerable<MultiWaitHolderBase> MultiWaits => _multiWaits;
|
||||||
|
|
||||||
public MultiWaitImpl()
|
public MultiWaitImpl()
|
||||||
{
|
{
|
||||||
_multiWaits = new List<MultiWaitHolderBase>();
|
_multiWaits = new List<MultiWaitHolderBase>();
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Ryujinx.Horizon.Sdk.OsTypes.Impl;
|
using Ryujinx.Horizon.Sdk.OsTypes.Impl;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Ryujinx.Horizon.Sdk.OsTypes
|
namespace Ryujinx.Horizon.Sdk.OsTypes
|
||||||
{
|
{
|
||||||
@@ -6,6 +7,8 @@ namespace Ryujinx.Horizon.Sdk.OsTypes
|
|||||||
{
|
{
|
||||||
private readonly MultiWaitImpl _impl;
|
private readonly MultiWaitImpl _impl;
|
||||||
|
|
||||||
|
public IEnumerable<MultiWaitHolderBase> MultiWaits => _impl.MultiWaits;
|
||||||
|
|
||||||
public MultiWait()
|
public MultiWait()
|
||||||
{
|
{
|
||||||
_impl = new MultiWaitImpl();
|
_impl = new MultiWaitImpl();
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using Ryujinx.Horizon.Sdk.OsTypes;
|
|||||||
using Ryujinx.Horizon.Sdk.Sf.Cmif;
|
using Ryujinx.Horizon.Sdk.Sf.Cmif;
|
||||||
using Ryujinx.Horizon.Sdk.Sm;
|
using Ryujinx.Horizon.Sdk.Sm;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
||||||
{
|
{
|
||||||
@@ -116,6 +117,18 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
|||||||
while (WaitAndProcessRequestsImpl())
|
while (WaitAndProcessRequestsImpl())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unlink pending sessions, dispose expects them to be already unlinked.
|
||||||
|
|
||||||
|
ServerSession[] serverSessions = Enumerable.OfType<ServerSession>(_multiWait.MultiWaits).ToArray();
|
||||||
|
|
||||||
|
foreach (ServerSession serverSession in serverSessions)
|
||||||
|
{
|
||||||
|
if (serverSession.IsLinked)
|
||||||
|
{
|
||||||
|
serverSession.UnlinkFromMultiWaitHolder();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void WaitAndProcessRequests()
|
public void WaitAndProcessRequests()
|
||||||
|
|||||||
@@ -367,19 +367,14 @@ namespace Ryujinx.Ava
|
|||||||
}
|
}
|
||||||
|
|
||||||
var colorType = e.IsBgra ? SKColorType.Bgra8888 : SKColorType.Rgba8888;
|
var colorType = e.IsBgra ? SKColorType.Bgra8888 : SKColorType.Rgba8888;
|
||||||
using var bitmap = new SKBitmap(new SKImageInfo(e.Width, e.Height, colorType, SKAlphaType.Premul));
|
using SKBitmap bitmap = new SKBitmap(new SKImageInfo(e.Width, e.Height, colorType, SKAlphaType.Premul));
|
||||||
|
|
||||||
Marshal.Copy(e.Data, 0, bitmap.GetPixels(), e.Data.Length);
|
Marshal.Copy(e.Data, 0, bitmap.GetPixels(), e.Data.Length);
|
||||||
|
|
||||||
SKBitmap bitmapToSave = null;
|
using SKBitmap bitmapToSave = new SKBitmap(bitmap.Width, bitmap.Height);
|
||||||
|
using SKCanvas canvas = new SKCanvas(bitmapToSave);
|
||||||
|
|
||||||
if (e.FlipX || e.FlipY)
|
canvas.Clear(SKColors.Black);
|
||||||
{
|
|
||||||
bitmapToSave = new SKBitmap(bitmap.Width, bitmap.Height);
|
|
||||||
|
|
||||||
using var canvas = new SKCanvas(bitmapToSave);
|
|
||||||
|
|
||||||
canvas.Clear(SKColors.Transparent);
|
|
||||||
|
|
||||||
float scaleX = e.FlipX ? -1 : 1;
|
float scaleX = e.FlipX ? -1 : 1;
|
||||||
float scaleY = e.FlipY ? -1 : 1;
|
float scaleY = e.FlipY ? -1 : 1;
|
||||||
@@ -387,12 +382,9 @@ namespace Ryujinx.Ava
|
|||||||
var matrix = SKMatrix.CreateScale(scaleX, scaleY, bitmap.Width / 2f, bitmap.Height / 2f);
|
var matrix = SKMatrix.CreateScale(scaleX, scaleY, bitmap.Width / 2f, bitmap.Height / 2f);
|
||||||
|
|
||||||
canvas.SetMatrix(matrix);
|
canvas.SetMatrix(matrix);
|
||||||
|
canvas.DrawBitmap(bitmap, SKPoint.Empty);
|
||||||
|
|
||||||
canvas.DrawBitmap(bitmap, new SKPoint(e.FlipX ? -bitmap.Width : 0, e.FlipY ? -bitmap.Height : 0));
|
SaveBitmapAsPng(bitmapToSave, path);
|
||||||
}
|
|
||||||
|
|
||||||
SaveBitmapAsPng(bitmapToSave ?? bitmap, path);
|
|
||||||
bitmapToSave?.Dispose();
|
|
||||||
|
|
||||||
Logger.Notice.Print(LogClass.Application, $"Screenshot saved to {path}", "Screenshot");
|
Logger.Notice.Print(LogClass.Application, $"Screenshot saved to {path}", "Screenshot");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
|
|
||||||
var content = new DownloadableContentModel(nca.Header.TitleId.ToString("X16"), path, fileEntry.FullPath, true);
|
var content = new DownloadableContentModel(nca.Header.TitleId.ToString("X16"), path, fileEntry.FullPath, true);
|
||||||
DownloadableContents.Add(content);
|
DownloadableContents.Add(content);
|
||||||
SelectedDownloadableContents.Add(content);
|
Dispatcher.UIThread.InvokeAsync(() => SelectedDownloadableContents.Add(content));
|
||||||
|
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddUpdate(string path, bool ignoreNotFound = false)
|
private void AddUpdate(string path, bool ignoreNotFound = false, bool selected = false)
|
||||||
{
|
{
|
||||||
if (!File.Exists(path) || TitleUpdates.Any(x => x.Path == path))
|
if (!File.Exists(path) || TitleUpdates.Any(x => x.Path == path))
|
||||||
{
|
{
|
||||||
@@ -204,7 +204,13 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
controlNca.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None).OpenFile(ref nacpFile.Ref, "/control.nacp".ToU8Span(), OpenMode.Read).ThrowIfFailure();
|
controlNca.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None).OpenFile(ref nacpFile.Ref, "/control.nacp".ToU8Span(), OpenMode.Read).ThrowIfFailure();
|
||||||
nacpFile.Get.Read(out _, 0, SpanHelpers.AsByteSpan(ref controlData), ReadOption.None).ThrowIfFailure();
|
nacpFile.Get.Read(out _, 0, SpanHelpers.AsByteSpan(ref controlData), ReadOption.None).ThrowIfFailure();
|
||||||
|
|
||||||
TitleUpdates.Add(new TitleUpdateModel(controlData, path));
|
var update = new TitleUpdateModel(controlData, path);
|
||||||
|
TitleUpdates.Add(update);
|
||||||
|
|
||||||
|
if (selected)
|
||||||
|
{
|
||||||
|
Dispatcher.UIThread.InvokeAsync(() => SelectedUpdate = update);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -245,7 +251,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
|
|
||||||
foreach (var file in result)
|
foreach (var file in result)
|
||||||
{
|
{
|
||||||
AddUpdate(file.Path.LocalPath);
|
AddUpdate(file.Path.LocalPath, selected: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
SortUpdates();
|
SortUpdates();
|
||||||
|
|||||||
Reference in New Issue
Block a user