mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-28 17:36: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();
|
||||
|
||||
// Add overlays by modifying texture data directly
|
||||
AddOverlaysToTexture(texture);
|
||||
AddOverlaysToTexture(texture, pt.Crop);
|
||||
|
||||
ImageCrop crop = new(
|
||||
(int)(pt.Crop.Left * texture.ScaleFactor),
|
||||
|
@ -264,7 +264,8 @@ namespace Ryujinx.Graphics.Gpu
|
|||
/// Add overlays to the texture using SkiaSharp
|
||||
/// </summary>
|
||||
/// <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
|
||||
{
|
||||
|
@ -314,9 +315,9 @@ namespace Ryujinx.Graphics.Gpu
|
|||
// Create canvas for drawing overlays
|
||||
using var canvas = new SKCanvas(bitmap);
|
||||
|
||||
// On Linux with OpenGL, we need to flip the Y-axis because OpenGL uses bottom-left origin
|
||||
// while SkiaSharp uses top-left origin
|
||||
if (OperatingSystem.IsLinux())
|
||||
// Flip Y-axis if the game/texture requires it
|
||||
// Some games have textures that are already flipped, while others need flipping
|
||||
if (crop.FlipY)
|
||||
{
|
||||
canvas.Scale(1, -1);
|
||||
canvas.Translate(0, -height);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue