mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-03 23:38:55 +02:00
added stretch to fullscreen
This commit is contained in:
@@ -221,19 +221,29 @@ namespace LibKenjinx
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct GraphicsConfiguration
|
||||
{
|
||||
public float ResScale = 1f;
|
||||
public float MaxAnisotropy = -1;
|
||||
public bool FastGpuTime = true;
|
||||
public bool Fast2DCopy = true;
|
||||
public bool EnableMacroJit = false;
|
||||
public bool EnableMacroHLE = true;
|
||||
public bool EnableShaderCache = true;
|
||||
public bool EnableTextureRecompression = false;
|
||||
public BackendThreading BackendThreading = BackendThreading.Auto;
|
||||
public AspectRatio AspectRatio = AspectRatio.Fixed16x9;
|
||||
public float ResScale;
|
||||
public float MaxAnisotropy;
|
||||
public bool FastGpuTime;
|
||||
public bool Fast2DCopy;
|
||||
public bool EnableMacroJit;
|
||||
public bool EnableMacroHLE;
|
||||
public bool EnableShaderCache;
|
||||
public bool EnableTextureRecompression;
|
||||
public BackendThreading BackendThreading;
|
||||
public AspectRatio AspectRatio; // <- important
|
||||
|
||||
public GraphicsConfiguration()
|
||||
{
|
||||
ResScale = 1f;
|
||||
MaxAnisotropy = -1;
|
||||
FastGpuTime = true;
|
||||
Fast2DCopy = true;
|
||||
EnableMacroJit = false;
|
||||
EnableMacroHLE = true;
|
||||
EnableShaderCache = true;
|
||||
EnableTextureRecompression = false;
|
||||
BackendThreading = BackendThreading.Auto;
|
||||
AspectRatio = AspectRatio.Fixed16x9;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,6 @@ namespace LibKenjinx
|
||||
}
|
||||
|
||||
List<string> extensions = [];
|
||||
var size = Marshal.SizeOf<IntPtr>();
|
||||
var extPtr = (IntPtr*)nativeGraphicsInterop.VkRequiredExtensions;
|
||||
for (int i = 0; i < nativeGraphicsInterop.VkRequiredExtensionsCount; i++)
|
||||
{
|
||||
@@ -274,6 +273,7 @@ namespace LibKenjinx
|
||||
|
||||
return stats;
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "device_launch_mii_editor")]
|
||||
public static bool LaunchMiiEditAppletNative()
|
||||
{
|
||||
@@ -468,5 +468,34 @@ namespace LibKenjinx
|
||||
|
||||
CloseUser(userId);
|
||||
}
|
||||
|
||||
// ----------------------
|
||||
// Stretch: Helper + Exports
|
||||
// ----------------------
|
||||
|
||||
// central logic (managed)
|
||||
private static void ApplyFullscreenStretch(bool enable)
|
||||
{
|
||||
var ar = enable ? AspectRatio.Stretched : AspectRatio.Fixed16x9;
|
||||
|
||||
// Retrieve, modify, write back struct
|
||||
var cfg = GraphicsConfiguration;
|
||||
cfg.AspectRatio = ar;
|
||||
GraphicsConfiguration = cfg;
|
||||
|
||||
// Hot-Apply for running emulation
|
||||
var dev = SwitchDevice?.EmulationContext;
|
||||
if (dev != null)
|
||||
{
|
||||
try { dev.Configuration.AspectRatio = ar; } catch { }
|
||||
}
|
||||
}
|
||||
|
||||
// CamelCase Export (JNA calls it here)
|
||||
[UnmanagedCallersOnly(EntryPoint = "graphicsSetFullscreenStretch")]
|
||||
public static void GraphicsSetFullscreenStretchNativeAlias(bool enable)
|
||||
{
|
||||
ApplyFullscreenStretch(enable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user