Fix rotation on 3DS and Wii U (#13353)

* Fix rotation on 3DS
* Fix rotation on Wii U
pull/13362/head
vaguerant 2021-12-14 23:43:48 +11:00 committed by GitHub
parent 98431a15c0
commit 34892555ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 12 deletions

View File

@ -138,10 +138,10 @@ static INLINE void ctr_set_screen_coords(ctr_video_t * ctr)
}
else if (ctr->rotation == 1) /* 90° */
{
ctr->frame_coords->x0 = ctr->vp.x;
ctr->frame_coords->y0 = ctr->vp.y;
ctr->frame_coords->x1 = ctr->vp.x + ctr->vp.width;
ctr->frame_coords->y1 = ctr->vp.y + ctr->vp.height;
ctr->frame_coords->x1 = ctr->vp.x;
ctr->frame_coords->y1 = ctr->vp.y;
ctr->frame_coords->x0 = ctr->vp.x + ctr->vp.width;
ctr->frame_coords->y0 = ctr->vp.y + ctr->vp.height;
}
else if (ctr->rotation == 2) /* 180° */
{
@ -152,10 +152,10 @@ static INLINE void ctr_set_screen_coords(ctr_video_t * ctr)
}
else /* 270° */
{
ctr->frame_coords->x1 = ctr->vp.x;
ctr->frame_coords->y1 = ctr->vp.y;
ctr->frame_coords->x0 = ctr->vp.x + ctr->vp.width;
ctr->frame_coords->y0 = ctr->vp.y + ctr->vp.height;
ctr->frame_coords->x0 = ctr->vp.x;
ctr->frame_coords->y0 = ctr->vp.y;
ctr->frame_coords->x1 = ctr->vp.x + ctr->vp.width;
ctr->frame_coords->y1 = ctr->vp.y + ctr->vp.height;
}
}
@ -194,9 +194,6 @@ static void ctr_update_viewport(
bool video_scale_integer = settings->bools.video_scale_integer;
unsigned aspect_ratio_idx = settings->uints.video_aspect_ratio_idx;
if (ctr->rotation & 0x1)
desired_aspect = 1.0 / desired_aspect;
if (video_scale_integer)
{
video_viewport_get_scaled_integer(&ctr->vp, ctr->vp.full_width,

View File

@ -88,7 +88,7 @@ static void wiiu_set_projection(wiiu_video_t *wiiu)
{
math_matrix_4x4 proj, rot;
matrix_4x4_ortho(proj, 0, 1, 1, 0, -1, 1);
matrix_4x4_rotate_z(rot, wiiu->rotation * -M_PI_2);
matrix_4x4_rotate_z(rot, wiiu->rotation * M_PI_2);
matrix_4x4_multiply((*wiiu->ubo_mvp), rot, proj);
GX2Invalidate(GX2_INVALIDATE_MODE_CPU_UNIFORM_BLOCK, wiiu->ubo_mvp, sizeof(*wiiu->ubo_mvp));
}