mirror of
https://github.com/libretro/RetroArch
synced 2025-02-01 00:32:46 +00:00
Merge pull request #10493 from QuarkTheAwesome/gfx-display-wiiu-patch
WiiU: gfx_display: fix non-vertex coordinates in draws using tex shader
This commit is contained in:
commit
28bf33cd78
@ -184,7 +184,7 @@ CFLAGS := -mcpu=750 -meabi -mhard-float
|
|||||||
CFLAGS += -ffast-math -Werror=implicit-function-declaration
|
CFLAGS += -ffast-math -Werror=implicit-function-declaration
|
||||||
CFLAGS += -ffunction-sections -fdata-sections
|
CFLAGS += -ffunction-sections -fdata-sections
|
||||||
#CFLAGS += -fomit-frame-pointer -mword-relocations
|
#CFLAGS += -fomit-frame-pointer -mword-relocations
|
||||||
#CFLAGS += -Wall
|
CFLAGS += -Wall
|
||||||
|
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CFLAGS += -O0 -g
|
CFLAGS += -O0 -g
|
||||||
|
@ -89,6 +89,7 @@ static void gfx_display_wiiu_draw(gfx_display_ctx_draw_t *draw,
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/* TODO come up with a better check for "not all vertexes are the same color" */
|
||||||
else if (draw->coords->vertex || draw->coords->color[0] != draw->coords->color[12])
|
else if (draw->coords->vertex || draw->coords->color[0] != draw->coords->color[12])
|
||||||
{
|
{
|
||||||
if (wiiu->vertex_cache_tex.current + 4 > wiiu->vertex_cache_tex.size)
|
if (wiiu->vertex_cache_tex.current + 4 > wiiu->vertex_cache_tex.size)
|
||||||
@ -106,14 +107,20 @@ static void gfx_display_wiiu_draw(gfx_display_ctx_draw_t *draw,
|
|||||||
|
|
||||||
if (!draw->coords->vertex)
|
if (!draw->coords->vertex)
|
||||||
{
|
{
|
||||||
v[0].pos.x = 0.0f;
|
/* Convert the libretro bottom-up coordinate system to GX2 - low y at
|
||||||
v[0].pos.y = 1.0f;
|
the top of the screen, large y at the bottom
|
||||||
v[1].pos.x = 1.0f;
|
The compiler will optimise 90% of this out anyway */
|
||||||
v[1].pos.y = 1.0f;
|
float y = -(draw->y + draw->height - video_height);
|
||||||
v[2].pos.x = 0.0f;
|
/* Remember: this is a triangle strip, not a quad, draw in a Z shape
|
||||||
v[2].pos.y = 0.0f;
|
Bottom-left, right, top-left, right */
|
||||||
v[3].pos.x = 1.0f;
|
v[0].pos.x = (draw->x ) / video_width;
|
||||||
v[3].pos.y = 0.0f;
|
v[0].pos.y = (y + draw->height) / video_height;
|
||||||
|
v[1].pos.x = (draw->x + draw->width ) / video_width;
|
||||||
|
v[1].pos.y = (y + draw->height) / video_height;
|
||||||
|
v[2].pos.x = (draw->x ) / video_width;
|
||||||
|
v[2].pos.y = (y ) / video_height;
|
||||||
|
v[3].pos.x = (draw->x + draw->width ) / video_width;
|
||||||
|
v[3].pos.y = (y ) / video_height;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user