mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-21 05:09:46 -06:00
Use enum for screen sizing
This commit is contained in:
@ -38,6 +38,17 @@ enum
|
|||||||
HK_MAX
|
HK_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
screenSizing_Even,
|
||||||
|
screenSizing_EmphTop,
|
||||||
|
screenSizing_EmphBop,
|
||||||
|
screenSizing_Auto,
|
||||||
|
screenSizing_TopOnly,
|
||||||
|
screenSizing_BotOnly,
|
||||||
|
screenSizing_MAX,
|
||||||
|
};
|
||||||
|
|
||||||
namespace Config
|
namespace Config
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -503,7 +503,7 @@ void EmuThread::run()
|
|||||||
micProcess();
|
micProcess();
|
||||||
|
|
||||||
// auto screen layout
|
// auto screen layout
|
||||||
if (Config::ScreenSizing == 3)
|
if (Config::ScreenSizing == screenSizing_Auto)
|
||||||
{
|
{
|
||||||
mainScreenPos[2] = mainScreenPos[1];
|
mainScreenPos[2] = mainScreenPos[1];
|
||||||
mainScreenPos[1] = mainScreenPos[0];
|
mainScreenPos[1] = mainScreenPos[0];
|
||||||
@ -515,14 +515,14 @@ void EmuThread::run()
|
|||||||
{
|
{
|
||||||
// constant flickering, likely displaying 3D on both screens
|
// constant flickering, likely displaying 3D on both screens
|
||||||
// TODO: when both screens are used for 2D only...???
|
// TODO: when both screens are used for 2D only...???
|
||||||
guess = 0;
|
guess = screenSizing_Even;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (mainScreenPos[0] == 1)
|
if (mainScreenPos[0] == 1)
|
||||||
guess = 1;
|
guess = screenSizing_EmphTop;
|
||||||
else
|
else
|
||||||
guess = 2;
|
guess = screenSizing_EmphBop;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guess != autoScreenSizing)
|
if (guess != autoScreenSizing)
|
||||||
@ -1557,7 +1557,7 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
|
|||||||
|
|
||||||
const char* screensizing[] = {"Even", "Emphasize top", "Emphasize bottom", "Auto", "Top only", "Bottom only"};
|
const char* screensizing[] = {"Even", "Emphasize top", "Emphasize bottom", "Auto", "Top only", "Bottom only"};
|
||||||
|
|
||||||
for (int i = 0; i < 6; i++)
|
for (int i = 0; i < screenSizing_MAX; i++)
|
||||||
{
|
{
|
||||||
actScreenSizing[i] = submenu->addAction(QString(screensizing[i]));
|
actScreenSizing[i] = submenu->addAction(QString(screensizing[i]));
|
||||||
actScreenSizing[i]->setActionGroup(grpScreenSizing);
|
actScreenSizing[i]->setActionGroup(grpScreenSizing);
|
||||||
@ -2778,18 +2778,18 @@ void MainWindow::onChangeScreenSwap(bool checked)
|
|||||||
Config::ScreenSwap = checked?1:0;
|
Config::ScreenSwap = checked?1:0;
|
||||||
|
|
||||||
// Swap between top and bottom screen when displaying one screen.
|
// Swap between top and bottom screen when displaying one screen.
|
||||||
if (Config::ScreenSizing == 4)
|
if (Config::ScreenSizing == screenSizing_TopOnly)
|
||||||
{
|
{
|
||||||
// Bottom Screen.
|
// Bottom Screen.
|
||||||
Config::ScreenSizing = 5;
|
Config::ScreenSizing = screenSizing_BotOnly;
|
||||||
actScreenSizing[4]->setChecked(false);
|
actScreenSizing[screenSizing_TopOnly]->setChecked(false);
|
||||||
actScreenSizing[Config::ScreenSizing]->setChecked(true);
|
actScreenSizing[Config::ScreenSizing]->setChecked(true);
|
||||||
}
|
}
|
||||||
else if (Config::ScreenSizing == 5)
|
else if (Config::ScreenSizing == screenSizing_BotOnly)
|
||||||
{
|
{
|
||||||
// Top Screen.
|
// Top Screen.
|
||||||
Config::ScreenSizing = 4;
|
Config::ScreenSizing = screenSizing_TopOnly;
|
||||||
actScreenSizing[5]->setChecked(false);
|
actScreenSizing[screenSizing_BotOnly]->setChecked(false);
|
||||||
actScreenSizing[Config::ScreenSizing]->setChecked(true);
|
actScreenSizing[Config::ScreenSizing]->setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3016,7 +3016,7 @@ int main(int argc, char** argv)
|
|||||||
SANITIZE(Config::ScreenRotation, 0, 3);
|
SANITIZE(Config::ScreenRotation, 0, 3);
|
||||||
SANITIZE(Config::ScreenGap, 0, 500);
|
SANITIZE(Config::ScreenGap, 0, 500);
|
||||||
SANITIZE(Config::ScreenLayout, 0, 3);
|
SANITIZE(Config::ScreenLayout, 0, 3);
|
||||||
SANITIZE(Config::ScreenSizing, 0, 5);
|
SANITIZE(Config::ScreenSizing, 0, (int)screenSizing_MAX);
|
||||||
SANITIZE(Config::ScreenAspectTop, 0, 4);
|
SANITIZE(Config::ScreenAspectTop, 0, 4);
|
||||||
SANITIZE(Config::ScreenAspectBot, 0, 4);
|
SANITIZE(Config::ScreenAspectBot, 0, 4);
|
||||||
#undef SANITIZE
|
#undef SANITIZE
|
||||||
|
Reference in New Issue
Block a user