From e3a7187973ecc4021ddf075ce10a6329ca253532 Mon Sep 17 00:00:00 2001 From: fincs Date: Fri, 31 Aug 2018 20:14:50 +0200 Subject: [PATCH] gfx: Remove gfxSetDrawFlip. Make 0 the default transform instead of FLIP_V. --- nx/include/switch/display/gfx.h | 9 +-------- nx/source/display/gfx.c | 11 ++--------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/nx/include/switch/display/gfx.h b/nx/include/switch/display/gfx.h index dc37947f..af6ee6c8 100644 --- a/nx/include/switch/display/gfx.h +++ b/nx/include/switch/display/gfx.h @@ -90,10 +90,7 @@ u32 gfxGetFramebufferPitch(void); /// Sets the \ref GfxMode. void gfxSetMode(GfxMode mode); -/// Controls whether a vertical-flip is done when determining the pixel-offset within the actual framebuffer. By default this is enabled. -void gfxSetDrawFlip(bool flip); - -/// Configures transform. See the NATIVE_WINDOW_TRANSFORM_* enums in buffer_producer.h. The default is NATIVE_WINDOW_TRANSFORM_FLIP_V. +/// Configures transform. See the NATIVE_WINDOW_TRANSFORM_* enums in buffer_producer.h. The default is 0. void gfxConfigureTransform(u32 transform); /// Flushes the framebuffer in the data cache. When \ref GfxMode is GfxMode_LinearDouble, this also transfers the linear-framebuffer to the actual framebuffer. @@ -106,13 +103,9 @@ static inline u32 gfxGetFramebufferDisplayOffset(u32 x, u32 y) { u32 tmp_pos; extern size_t g_gfx_framebuf_aligned_width; - extern size_t g_gfx_framebuf_display_height; - extern bool g_gfx_drawflip; //if (x >= g_gfx_framebuf_width || y >= g_gfx_framebuf_display_height) return (gfxGetFramebufferSize()-4)/4;//Return the last pixel-offset in the buffer, the data located here is not displayed due to alignment. (Disabled for perf) - if (g_gfx_drawflip) y = g_gfx_framebuf_display_height-1-y; - tmp_pos = ((y & 127) / 16) + (x/16*8) + ((y/16/8)*(g_gfx_framebuf_aligned_width/16*8)); tmp_pos *= 16*16 * 4; diff --git a/nx/source/display/gfx.c b/nx/source/display/gfx.c index b0733920..efd0894b 100644 --- a/nx/source/display/gfx.c +++ b/nx/source/display/gfx.c @@ -38,8 +38,6 @@ size_t g_gfx_framebuf_display_width=0, g_gfx_framebuf_display_height=0; size_t g_gfx_singleframebuf_size=0; size_t g_gfx_singleframebuf_linear_size=0; -bool g_gfx_drawflip = true; - static AppletHookCookie g_gfx_autoresolution_applethookcookie; static bool g_gfx_autoresolution_enabled; @@ -60,7 +58,7 @@ static BqQueueBufferInput g_gfxQueueBufferData = { .isAutoTimestamp = 0x1, .crop = {0x0, 0x0, 0x0, 0x0}, //Official apps which use multiple resolutions configure this for the currently used resolution, depending on the current appletOperationMode. .scalingMode = 0x0, - .transform = NATIVE_WINDOW_TRANSFORM_FLIP_V, + .transform = 0, .stickyTransform = 0x0, .unk = 0x0, .swapInterval = 0x1, @@ -174,8 +172,7 @@ Result gfxInitDefault(void) { g_gfxFramebufHandle = 0; g_gfxMode = GfxMode_LinearDouble; - g_gfx_drawflip = true; - g_gfxQueueBufferData.transform = NATIVE_WINDOW_TRANSFORM_FLIP_V; + g_gfxQueueBufferData.transform = 0; //memset(g_gfx_ProducerSlotsRequested, 0, sizeof(g_gfx_ProducerSlotsRequested)); g_gfx_ProducerSlotsRequested = 0; @@ -476,10 +473,6 @@ void gfxSetMode(GfxMode mode) { g_gfxMode = mode; } -void gfxSetDrawFlip(bool flip) { - g_gfx_drawflip = flip; -} - void gfxConfigureTransform(u32 transform) { g_gfxQueueBufferData.transform = transform; }