Handle odd screen resolution (POCOPHONE fix)
This commit is contained in:
parent
a65436cc6c
commit
8893f97435
|
@ -1175,8 +1175,17 @@ void fullscreenQuadPrepareFramebuffer(float xScale, float yScale) {
|
||||||
|
|
||||||
// Reduce width to keep 4:3 aspect ratio (640x480)
|
// Reduce width to keep 4:3 aspect ratio (640x480)
|
||||||
u32 reducedWidth = 4 * screen_height / 3;
|
u32 reducedWidth = 4 * screen_height / 3;
|
||||||
|
|
||||||
|
// handle odd/even screen width
|
||||||
|
if (screen_width % 2 == 0) {
|
||||||
u32 reducedWidthOffset = (screen_width - reducedWidth) / 2;
|
u32 reducedWidthOffset = (screen_width - reducedWidth) / 2;
|
||||||
glScissor(reducedWidthOffset, 0, reducedWidth, screen_height);
|
glScissor(reducedWidthOffset, 0, reducedWidth, screen_height);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
u32 reducedWidthOffset = (screen_width + 1 - reducedWidth) / 2;
|
||||||
|
glScissor(reducedWidthOffset, 0, reducedWidth - 1, screen_height);
|
||||||
|
}
|
||||||
|
|
||||||
if (settings.rend.WideScreen &&
|
if (settings.rend.WideScreen &&
|
||||||
(pvrrc.fb_X_CLIP.min==0) && ((pvrrc.fb_X_CLIP.max+1)/xScale==640) &&
|
(pvrrc.fb_X_CLIP.min==0) && ((pvrrc.fb_X_CLIP.max+1)/xScale==640) &&
|
||||||
(pvrrc.fb_Y_CLIP.min==0) && ((pvrrc.fb_Y_CLIP.max+1)/yScale==480 ))
|
(pvrrc.fb_Y_CLIP.min==0) && ((pvrrc.fb_Y_CLIP.max+1)/yScale==480 ))
|
||||||
|
|
|
@ -1902,6 +1902,10 @@ bool RenderFrame()
|
||||||
*/
|
*/
|
||||||
float dc2s_scale_h = screen_height / 480.0;
|
float dc2s_scale_h = screen_height / 480.0;
|
||||||
float ds2s_offs_x = (screen_width - dc2s_scale_h * 640.0) / 2;
|
float ds2s_offs_x = (screen_width - dc2s_scale_h * 640.0) / 2;
|
||||||
|
// handle odd screen width
|
||||||
|
if (screen_width % 2) {
|
||||||
|
ds2s_offs_x = (screen_width + 1 - dc2s_scale_h * 640.0) / 2;
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_rtt) {
|
if (!is_rtt) {
|
||||||
ShaderUniforms.scale_coefs[0] = 2.0f / (screen_width / dc2s_scale_h * scale_x);
|
ShaderUniforms.scale_coefs[0] = 2.0f / (screen_width / dc2s_scale_h * scale_x);
|
||||||
|
@ -2118,7 +2122,13 @@ bool RenderFrame()
|
||||||
width *= dc2s_scale_h;
|
width *= dc2s_scale_h;
|
||||||
height *= dc2s_scale_h;
|
height *= dc2s_scale_h;
|
||||||
}
|
}
|
||||||
|
// handle odd/even screen width
|
||||||
|
if (screen_width % 2 == 0) {
|
||||||
glScissor(min_x + 0.5f, min_y + 0.5f, width + 0.5f, height + 0.5f);
|
glScissor(min_x + 0.5f, min_y + 0.5f, width + 0.5f, height + 0.5f);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
glScissor(min_x + 0.5f, min_y + 0.5f, width + 0.5f - 1, height + 0.5f);
|
||||||
|
}
|
||||||
glEnable(GL_SCISSOR_TEST);
|
glEnable(GL_SCISSOR_TEST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue