Cmd line: -fs-height: small refactor so that bestWidth/Height are only returned for logging purposes

This commit is contained in:
tomcw 2021-05-31 16:40:44 +01:00
parent cc126d7745
commit 793f2eb507
2 changed files with 4 additions and 7 deletions

View File

@ -213,20 +213,21 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
LPSTR lpTmp = lpCmdLine + sizeof(CMD_FS_HEIGHT)-1;
bool bRes = false;
UINT bestWidth=0, bestHeight=0;
if (strcmp(lpTmp, "best") == 0)
{
bRes = GetFrame().GetBestDisplayResolutionForFullScreen(g_cmdLine.bestWidth, g_cmdLine.bestHeight);
bRes = GetFrame().GetBestDisplayResolutionForFullScreen(bestWidth, bestHeight);
}
else
{
UINT userSpecifiedHeight = atoi(lpTmp);
if (userSpecifiedHeight)
bRes = GetFrame().GetBestDisplayResolutionForFullScreen(g_cmdLine.bestWidth, g_cmdLine.bestHeight, userSpecifiedHeight);
bRes = GetFrame().GetBestDisplayResolutionForFullScreen(bestWidth, bestHeight, userSpecifiedHeight);
else
LogFileOutput("Invalid cmd-line parameter for -fs-height=x switch\n");
}
if (bRes)
LogFileOutput("Best resolution for -fs-height=x switch: Width=%d, Height=%d\n", g_cmdLine.bestWidth, g_cmdLine.bestHeight);
LogFileOutput("Best resolution for -fs-height=x switch: Width=%d, Height=%d\n", bestWidth, bestHeight);
else
LogFileOutput("Failed to set parameter for -fs-height=x switch\n");
}

View File

@ -18,8 +18,6 @@ struct CmdLine
bSlot7EmptyOnExit = false;
bSwapButtons0and1 = false;
bRemoveNoSlotClock = false;
bestWidth = 0;
bestHeight = 0;
szImageName_harddisk[HARDDISK_1] = NULL;
szImageName_harddisk[HARDDISK_2] = NULL;
szSnapshotName = NULL;
@ -56,8 +54,6 @@ struct CmdLine
bool bSwapButtons0and1;
bool bRemoveNoSlotClock;
SS_CARDTYPE slotInsert[NUM_SLOTS];
UINT bestWidth;
UINT bestHeight;
LPSTR szImageName_drive[NUM_SLOTS][NUM_DRIVES];
bool driveConnected[NUM_SLOTS][NUM_DRIVES];
LPSTR szImageName_harddisk[NUM_HARDDISKS];