Small refactor for app window's title

This commit is contained in:
tomcw 2020-08-17 19:26:06 +01:00
parent 221e35edc7
commit 039ad8a547
3 changed files with 20 additions and 12 deletions

View File

@ -279,10 +279,7 @@ static void GetAppleWindowTitle()
if( IsVideoStyle(VS_HALF_SCANLINES) )
g_pAppTitle += " 50% ";
if ( g_eVideoType != VT_COLOR_MONITOR_NTSC)
g_pAppTitle += g_apVideoModeDesc[ g_eVideoType ];
else
g_pAppTitle += g_apVideoMonitorModeDesc[ GetVideoRefreshRate() == VR_60HZ ? 0 : 1 ]; // NTSC or PAL
g_pAppTitle += VideoGetAppWindowTitle();
if (g_CardMgr.GetDisk2CardMgr().IsAnyFirmware13Sector())
g_pAppTitle += " (S6-13) ";

View File

@ -124,12 +124,6 @@ static LPDIRECTDRAW g_lpDD = NULL;
, "White Monitor"
};
const char *g_apVideoMonitorModeDesc[ 2 ] =
{
"Color (NTSC Monitor)"
, "Color (PAL Monitor)"
};
// Prototypes (Private) _____________________________________________
bool g_bDisplayPrintScreenFileName = false;
@ -1442,3 +1436,20 @@ static void videoCreateDIBSection()
// CREATE THE OFFSET TABLE FOR EACH SCAN LINE IN THE FRAME BUFFER
NTSC_VideoInit( g_pFramebufferbits );
}
//===========================================================================
const char* VideoGetAppWindowTitle(void)
{
static const char *apVideoMonitorModeDesc[ 2 ] =
{
"Color (NTSC Monitor)",
"Color (PAL Monitor)"
};
const VideoType_e videoType = GetVideoType();
if ( videoType != VT_COLOR_MONITOR_NTSC)
return g_apVideoModeDesc[ videoType ];
else
return apVideoMonitorModeDesc[ GetVideoRefreshRate() == VR_60HZ ? 0 : 1 ]; // NTSC or PAL
}

View File

@ -19,8 +19,6 @@
};
extern TCHAR g_aVideoChoices[];
extern const char *g_apVideoModeDesc[ NUM_VIDEO_MODES ];
extern const char *g_apVideoMonitorModeDesc[ 2 ];
enum VideoStyle_e
{
@ -241,3 +239,5 @@ void SetVideoRefreshRate(VideoRefreshRate_e rate);
bool DDInit(void);
void DDUninit(void);
const char* VideoGetAppWindowTitle(void);