mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-29 00:06:24 +02:00
Overlays: FlipY fix
This commit is contained in:
parent
d6232008d5
commit
58c2dc4ac4
1 changed files with 6 additions and 5 deletions
|
@ -213,7 +213,7 @@ namespace Ryujinx.Graphics.Gpu
|
||||||
texture.SynchronizeMemory();
|
texture.SynchronizeMemory();
|
||||||
|
|
||||||
// Add overlays by modifying texture data directly
|
// Add overlays by modifying texture data directly
|
||||||
AddOverlaysToTexture(texture);
|
AddOverlaysToTexture(texture, pt.Crop);
|
||||||
|
|
||||||
ImageCrop crop = new(
|
ImageCrop crop = new(
|
||||||
(int)(pt.Crop.Left * texture.ScaleFactor),
|
(int)(pt.Crop.Left * texture.ScaleFactor),
|
||||||
|
@ -264,7 +264,8 @@ namespace Ryujinx.Graphics.Gpu
|
||||||
/// Add overlays to the texture using SkiaSharp
|
/// Add overlays to the texture using SkiaSharp
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="texture">The texture to modify</param>
|
/// <param name="texture">The texture to modify</param>
|
||||||
private void AddOverlaysToTexture(Image.Texture texture)
|
/// <param name="crop">The crop information containing flip flags</param>
|
||||||
|
private void AddOverlaysToTexture(Image.Texture texture, ImageCrop crop)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -314,9 +315,9 @@ namespace Ryujinx.Graphics.Gpu
|
||||||
// Create canvas for drawing overlays
|
// Create canvas for drawing overlays
|
||||||
using var canvas = new SKCanvas(bitmap);
|
using var canvas = new SKCanvas(bitmap);
|
||||||
|
|
||||||
// On Linux with OpenGL, we need to flip the Y-axis because OpenGL uses bottom-left origin
|
// Flip Y-axis if the game/texture requires it
|
||||||
// while SkiaSharp uses top-left origin
|
// Some games have textures that are already flipped, while others need flipping
|
||||||
if (OperatingSystem.IsLinux())
|
if (crop.FlipY)
|
||||||
{
|
{
|
||||||
canvas.Scale(1, -1);
|
canvas.Scale(1, -1);
|
||||||
canvas.Translate(0, -height);
|
canvas.Translate(0, -height);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue