mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-10 01:06:27 +02:00
add game stats helper
This commit is contained in:
parent
c8d6f786c5
commit
c5bcdc06f5
2 changed files with 59 additions and 0 deletions
|
@ -100,6 +100,21 @@ namespace LibRyujinx
|
|||
AudioDriver = new SDL2HardwareDeviceDriver();
|
||||
}
|
||||
|
||||
public static GameStats GetGameStats()
|
||||
{
|
||||
if (SwitchDevice?.EmulationContext == null)
|
||||
return new GameStats();
|
||||
|
||||
var context = SwitchDevice.EmulationContext;
|
||||
|
||||
return new GameStats()
|
||||
{
|
||||
Fifo = context.Statistics.GetFifoPercent(),
|
||||
GameFps = context.Statistics.GetGameFrameRate(),
|
||||
GameTime = context.Statistics.GetGameFrameTime()
|
||||
};
|
||||
}
|
||||
|
||||
public static GameInfo GetGameInfo(Stream gameStream, bool isXci)
|
||||
{
|
||||
var gameInfo = new GameInfo();
|
||||
|
@ -579,4 +594,11 @@ namespace LibRyujinx
|
|||
public string Version;
|
||||
public byte[] Icon;
|
||||
}
|
||||
|
||||
public class GameStats
|
||||
{
|
||||
public double Fifo;
|
||||
public double GameFps;
|
||||
public double GameTime;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue