mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-07-07 15:52:59 +12:00
More formatting fixes
This commit is contained in:
parent
4b90239ae7
commit
9527acebe6
1 changed files with 7 additions and 10 deletions
|
@ -19,13 +19,9 @@ void ScreenLayout::calculateCoordinates(
|
||||||
int availableBottomHeight = outputWindowHeight - availableTopHeight;
|
int availableBottomHeight = outputWindowHeight - availableTopHeight;
|
||||||
|
|
||||||
// Calculate scales for top and bottom screens, and then the actual sizes
|
// Calculate scales for top and bottom screens, and then the actual sizes
|
||||||
float scaleTopX = float(outputWindowWidth) / float(TOP_SCREEN_WIDTH);
|
float scaleTop = std::min(float(outputWindowWidth) / float(TOP_SCREEN_WIDTH), float(availableTopHeight) / float(TOP_SCREEN_HEIGHT));
|
||||||
float scaleTopY = float(availableTopHeight) / float(TOP_SCREEN_HEIGHT);
|
float scaleBottom =
|
||||||
float scaleTop = std::min(scaleTopX, scaleTopY);
|
std::min(float(outputWindowWidth) / float(BOTTOM_SCREEN_WIDTH), float(availableBottomHeight) / float(BOTTOM_SCREEN_HEIGHT));
|
||||||
|
|
||||||
float scaleBottomX = float(outputWindowWidth) / float(BOTTOM_SCREEN_WIDTH);
|
|
||||||
float scaleBottomY = float(availableBottomHeight) / float(BOTTOM_SCREEN_HEIGHT);
|
|
||||||
float scaleBottom = std::min(scaleBottomX, scaleBottomY);
|
|
||||||
|
|
||||||
int topScreenWidth = int(TOP_SCREEN_WIDTH * scaleTop + 0.5f);
|
int topScreenWidth = int(TOP_SCREEN_WIDTH * scaleTop + 0.5f);
|
||||||
int topScreenHeight = int(TOP_SCREEN_HEIGHT * scaleTop + 0.5f);
|
int topScreenHeight = int(TOP_SCREEN_HEIGHT * scaleTop + 0.5f);
|
||||||
|
@ -90,10 +86,10 @@ void ScreenLayout::calculateCoordinates(
|
||||||
|
|
||||||
// Vertically center the tallest screen
|
// Vertically center the tallest screen
|
||||||
int maxHeight = std::max(topScreenHeight, bottomScreenHeight);
|
int maxHeight = std::max(topScreenHeight, bottomScreenHeight);
|
||||||
int baseY = (outputWindowHeight - maxHeight) / 2;
|
int centerY = (outputWindowHeight - maxHeight) / 2;
|
||||||
|
|
||||||
int topScreenY = baseY + (maxHeight - topScreenHeight) / 2;
|
int topScreenY = centerY + (maxHeight - topScreenHeight) / 2;
|
||||||
int bottomScreenY = baseY + (maxHeight - bottomScreenHeight) / 2;
|
int bottomScreenY = centerY + (maxHeight - bottomScreenHeight) / 2;
|
||||||
|
|
||||||
if (layout == Layout::SideBySide) {
|
if (layout == Layout::SideBySide) {
|
||||||
coordinates.topScreenX = (outputWindowWidth - (topScreenWidth + bottomScreenWidth)) / 2;
|
coordinates.topScreenX = (outputWindowWidth - (topScreenWidth + bottomScreenWidth)) / 2;
|
||||||
|
@ -153,3 +149,4 @@ const char* ScreenLayout::layoutToString(Layout layout) {
|
||||||
default: return "invalid";
|
default: return "invalid";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue