mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-25 07:10:00 -06:00
Larger unemphasized screen, when possible
This commit is contained in:
@ -1398,6 +1398,7 @@ void SetupScreenRects(int width, int height)
|
|||||||
// side-by-side
|
// side-by-side
|
||||||
|
|
||||||
int heightreq;
|
int heightreq;
|
||||||
|
int emph_smaller_width;
|
||||||
int startX = 0;
|
int startX = 0;
|
||||||
|
|
||||||
width -= gap;
|
width -= gap;
|
||||||
@ -1416,23 +1417,26 @@ void SetupScreenRects(int width, int height)
|
|||||||
else // emph. top/bottom
|
else // emph. top/bottom
|
||||||
{
|
{
|
||||||
heightreq = ((width - screenW) * screenH) / screenW;
|
heightreq = ((width - screenW) * screenH) / screenW;
|
||||||
|
emph_smaller_width = screenW;
|
||||||
if (heightreq > height)
|
if (heightreq > height)
|
||||||
{
|
{
|
||||||
int newwidth = ((height * (width - screenW)) / heightreq) + screenW;
|
int maximal_width = 2 * (height * screenW / screenH);
|
||||||
startX = (width - newwidth) / 2;
|
maximal_width = maximal_width > width ? width : maximal_width;
|
||||||
|
emph_smaller_width = maximal_width - (height * screenW / screenH);
|
||||||
|
startX = (width - maximal_width) / 2;
|
||||||
heightreq = height;
|
heightreq = height;
|
||||||
width = newwidth;
|
width = maximal_width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sizemode == 2)
|
if (sizemode == 2)
|
||||||
{
|
{
|
||||||
topscreen->Width = screenW;
|
topscreen->Width = emph_smaller_width;
|
||||||
topscreen->Height = screenH;
|
topscreen->Height = emph_smaller_width * screenH / screenW;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
topscreen->Width = (sizemode==0) ? (width / 2) : (width - screenW);
|
topscreen->Width = (sizemode==0) ? (width / 2) : (width - emph_smaller_width);
|
||||||
topscreen->Height = heightreq;
|
topscreen->Height = heightreq;
|
||||||
}
|
}
|
||||||
topscreen->X = startX;
|
topscreen->X = startX;
|
||||||
@ -1442,8 +1446,8 @@ void SetupScreenRects(int width, int height)
|
|||||||
|
|
||||||
if (sizemode == 1)
|
if (sizemode == 1)
|
||||||
{
|
{
|
||||||
bottomscreen->Width = screenW;
|
bottomscreen->Width = emph_smaller_width;
|
||||||
bottomscreen->Height = screenH;
|
bottomscreen->Height = emph_smaller_width * screenH / screenW;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1457,6 +1461,7 @@ void SetupScreenRects(int width, int height)
|
|||||||
// top then bottom
|
// top then bottom
|
||||||
|
|
||||||
int widthreq;
|
int widthreq;
|
||||||
|
int emph_smaller_height;
|
||||||
int startY = 0;
|
int startY = 0;
|
||||||
|
|
||||||
height -= gap;
|
height -= gap;
|
||||||
@ -1475,24 +1480,27 @@ void SetupScreenRects(int width, int height)
|
|||||||
else // emph. top/bottom
|
else // emph. top/bottom
|
||||||
{
|
{
|
||||||
widthreq = ((height - screenH) * screenW) / screenH;
|
widthreq = ((height - screenH) * screenW) / screenH;
|
||||||
|
emph_smaller_height = screenH;
|
||||||
if (widthreq > width)
|
if (widthreq > width)
|
||||||
{
|
{
|
||||||
int newheight = ((width * (height - screenH)) / widthreq) + screenH;
|
int maximal_height = 2 * (width * screenH / screenW);
|
||||||
startY = (height - newheight) / 2;
|
maximal_height = maximal_height > height ? height : maximal_height;
|
||||||
|
emph_smaller_height = maximal_height - (width * screenH / screenW);
|
||||||
|
startY = (height - maximal_height) / 2;
|
||||||
widthreq = width;
|
widthreq = width;
|
||||||
height = newheight;
|
height = maximal_height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sizemode == 2)
|
if (sizemode == 2)
|
||||||
{
|
{
|
||||||
topscreen->Width = screenW;
|
topscreen->Width = emph_smaller_height * screenW / screenH;
|
||||||
topscreen->Height = screenH;
|
topscreen->Height = emph_smaller_height;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
topscreen->Width = widthreq;
|
topscreen->Width = widthreq;
|
||||||
topscreen->Height = (sizemode==0) ? (height / 2) : (height - screenH);
|
topscreen->Height = (sizemode==0) ? (height / 2) : (height - emph_smaller_height);
|
||||||
}
|
}
|
||||||
topscreen->Y = startY;
|
topscreen->Y = startY;
|
||||||
topscreen->X = (width - topscreen->Width) / 2;
|
topscreen->X = (width - topscreen->Width) / 2;
|
||||||
@ -1501,8 +1509,8 @@ void SetupScreenRects(int width, int height)
|
|||||||
|
|
||||||
if (sizemode == 1)
|
if (sizemode == 1)
|
||||||
{
|
{
|
||||||
bottomscreen->Width = screenW;
|
bottomscreen->Width = emph_smaller_height * screenW / screenH;
|
||||||
bottomscreen->Height = screenH;
|
bottomscreen->Height = emph_smaller_height;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user