From 793f2eb50797b4682da8f281eb27bcd4aad91ea5 Mon Sep 17 00:00:00 2001 From: tomcw Date: Mon, 31 May 2021 16:40:44 +0100 Subject: [PATCH] Cmd line: -fs-height: small refactor so that bestWidth/Height are only returned for logging purposes --- source/CmdLine.cpp | 7 ++++--- source/CmdLine.h | 4 ---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/source/CmdLine.cpp b/source/CmdLine.cpp index 9a196e98..3f183527 100644 --- a/source/CmdLine.cpp +++ b/source/CmdLine.cpp @@ -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"); } diff --git a/source/CmdLine.h b/source/CmdLine.h index d8c21a05..842ca45b 100644 --- a/source/CmdLine.h +++ b/source/CmdLine.h @@ -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];