Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Jul 9, 2018
1 parent 7cdc94d commit 02beb05
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 16 deletions.
25 changes: 17 additions & 8 deletions core/rend/gl4/gles.cpp
Expand Up @@ -821,8 +821,8 @@ static bool RenderFrame(void)
u32 pvr_stride=(FB_W_LINESTRIDE.stride)*8;
*/

dc_width = FB_X_CLIP.max-FB_X_CLIP.min+1;
dc_height = FB_Y_CLIP.max-FB_Y_CLIP.min+1;
dc_width = pvrrc.fb_X_CLIP.max - pvrrc.fb_X_CLIP.min + 1;
dc_height = pvrrc.fb_Y_CLIP.max - pvrrc.fb_Y_CLIP.min + 1;
}

scale_x = 1;
Expand Down Expand Up @@ -1042,12 +1042,21 @@ static bool RenderFrame(void)

if (!wide_screen_on)
{
glScissor(
offs_x + pvrrc.fb_X_CLIP.min / scale_x,
(pvrrc.fb_Y_CLIP.min / scale_y) * dc2s_scale_h,
(pvrrc.fb_X_CLIP.max-pvrrc.fb_X_CLIP.min+1)/scale_x*dc2s_scale_h,
(pvrrc.fb_Y_CLIP.max-pvrrc.fb_Y_CLIP.min+1)/scale_y*dc2s_scale_h
);
float width = (pvrrc.fb_X_CLIP.max - pvrrc.fb_X_CLIP.min + 1) / scale_x;
float height = (pvrrc.fb_Y_CLIP.max - pvrrc.fb_Y_CLIP.min + 1) / scale_y;
int min_x = pvrrc.fb_X_CLIP.min / scale_x;
int min_y = pvrrc.fb_Y_CLIP.min / scale_y;
if (!is_rtt)
{
// Add x offset for aspect ratio > 4/3
min_x = min_x * dc2s_scale_h + offs_x;
// Invert y coordinates when rendering to screen
min_y = screen_height - height * dc2s_scale_h;
width *= dc2s_scale_h;
height *= dc2s_scale_h;
}

glScissor(offs_x + min_x, min_y, width, height);
glcache.Enable(GL_SCISSOR_TEST);
}

Expand Down
25 changes: 17 additions & 8 deletions core/rend/gles/gles.cpp
Expand Up @@ -743,8 +743,8 @@ static bool RenderFrame(void)
u32 pvr_stride=(FB_W_LINESTRIDE.stride)*8;
*/

dc_width = FB_X_CLIP.max-FB_X_CLIP.min+1;
dc_height = FB_Y_CLIP.max-FB_Y_CLIP.min+1;
dc_width = pvrrc.fb_X_CLIP.max - pvrrc.fb_X_CLIP.min + 1;
dc_height = pvrrc.fb_Y_CLIP.max - pvrrc.fb_Y_CLIP.min + 1;
}

scale_x = 1;
Expand Down Expand Up @@ -970,12 +970,21 @@ static bool RenderFrame(void)

if (!wide_screen_on)
{
glScissor(
offs_x + pvrrc.fb_X_CLIP.min / scale_x,
(pvrrc.fb_Y_CLIP.min / scale_y) * dc2s_scale_h,
(pvrrc.fb_X_CLIP.max-pvrrc.fb_X_CLIP.min+1)/scale_x*dc2s_scale_h,
(pvrrc.fb_Y_CLIP.max-pvrrc.fb_Y_CLIP.min+1)/scale_y*dc2s_scale_h
);
float width = (pvrrc.fb_X_CLIP.max - pvrrc.fb_X_CLIP.min + 1) / scale_x;
float height = (pvrrc.fb_Y_CLIP.max - pvrrc.fb_Y_CLIP.min + 1) / scale_y;
int min_x = pvrrc.fb_X_CLIP.min / scale_x;
int min_y = pvrrc.fb_Y_CLIP.min / scale_y;
if (!is_rtt)
{
// Add x offset for aspect ratio > 4/3
min_x = min_x * dc2s_scale_h + offs_x;
// Invert y coordinates when rendering to screen
min_y = screen_height - height * dc2s_scale_h;
width *= dc2s_scale_h;
height *= dc2s_scale_h;
}

glScissor(offs_x + min_x, min_y, width, height);
glcache.Enable(GL_SCISSOR_TEST);
}

Expand Down

0 comments on commit 02beb05

Please sign in to comment.