- wide Robert's patch

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6793 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: bd26402026d3399608d25a9c30345ca7a112aecd
Former-commit-id: aa82c598411865fe4f3e55d69e5c60a41ba1a0a4
This commit is contained in:
torcs-ng 2019-12-10 10:44:35 +00:00
parent 74a4b45f9a
commit e5f9ae1d9f
7 changed files with 14 additions and 6 deletions

View file

@ -124,6 +124,7 @@
#define GR_SCT_MONITOR "Monitor"
#define GR_ATT_MONITOR "monitor type"
#define GR_VAL_MONITOR_21BY9 "21:9"
#define GR_VAL_MONITOR_16BY9 "16:9"
#define GR_VAL_MONITOR_4BY3 "4:3"
#define GR_VAL_MONITOR_NONE "none"

View file

@ -108,6 +108,8 @@ static tScreenSize ADefScreenSizes[] =
{ 1800, 1440 },
{ 1920, 1080 },
{ 1920, 1200 },
{ 2560, 1080 },
{ 2560, 1440 },
{ 3840, 2160 }
};
static const int NDefScreenSizes =

View file

@ -2462,6 +2462,8 @@ void SDCameras::loadSpanValues()
const char *pszMonitorType =
GfParmGetStr(grHandle, GR_SCT_GRAPHIC, GR_ATT_MONITOR, GR_VAL_MONITOR_16BY9);
if (strcmp(pszMonitorType, GR_VAL_MONITOR_21BY9) == 0)
spanaspect = 2.3704f;
if (strcmp(pszMonitorType, GR_VAL_MONITOR_16BY9) == 0)
spanaspect = 1.7777f;
if (strcmp(pszMonitorType, GR_VAL_MONITOR_4BY3) == 0)

View file

@ -1949,6 +1949,8 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams,
const char *pszMonitorType =
GfParmGetStr(grHandle, GR_SCT_GRAPHIC, GR_ATT_MONITOR, GR_VAL_MONITOR_16BY9);
if (strcmp(pszMonitorType, GR_VAL_MONITOR_21BY9) == 0)
spanaspect = 2.3704;
if (strcmp(pszMonitorType, GR_VAL_MONITOR_16BY9) == 0)
spanaspect = 1.7777;
if (strcmp(pszMonitorType, GR_VAL_MONITOR_4BY3) == 0)

View file

@ -47,7 +47,7 @@ static const char* ShadersValues[] = { GR_ATT_AGR_NULL, GR_ATT_AGR_LITTLE, GR_AT
static const int NbShadersValues = sizeof(ShadersValues) / sizeof(ShadersValues[0]);
static const char* SpansplitValues[] = { GR_VAL_NO, GR_VAL_YES };
static const int NbSpansplitValues = sizeof(SpansplitValues) / sizeof(SpansplitValues[0]);
static const char* MonitorValues[] = { GR_VAL_MONITOR_16BY9, GR_VAL_MONITOR_4BY3, GR_VAL_MONITOR_NONE };
static const char* MonitorValues[] = { GR_VAL_MONITOR_16BY9, GR_VAL_MONITOR_4BY3, GR_VAL_MONITOR_21BY9, GR_VAL_MONITOR_NONE };
static const int NbMonitorValues = sizeof(MonitorValues) / sizeof(MonitorValues[0]);
static void *ScrHandle = NULL;

View file

@ -29,7 +29,7 @@
// Some consts.
static const char* AMonitorTypes[MonitorMenu::nMonitorTypes] = { "4:3", "16:9" };
static const char* AMonitorTypes[MonitorMenu::nMonitorTypes] = { "4:3", "16:9", "21:9" };
static const char* ASpanSplits[MonitorMenu::nSpanSplits] = { "Disabled", "Enabled" };
static float _nBezelComp;
@ -132,10 +132,11 @@ void MonitorMenu::loadSettings()
void* grHandle =
GfParmReadFile(ossConfFile.str().c_str(), GFPARM_RMODE_STD | GFPARM_RMODE_CREAT);
// Monitor Type : 4:3 or 16:9
// Monitor Type : 4:3, 16:9 or 21:9
const char *pszMonitorType =
GfParmGetStr(grHandle, GR_SCT_MONITOR, GR_ATT_MONITOR, GR_VAL_MONITOR_16BY9);
_eMonitorType = strcmp(pszMonitorType, GR_VAL_MONITOR_16BY9) ? e4by3: e16by9;
_eMonitorType = strcmp(pszMonitorType, GR_VAL_MONITOR_4BY3) == 0 ? e4by3 :
strcmp(pszMonitorType, GR_VAL_MONITOR_21BY9) == 0 ? e21by9 : e16by9;
// Span Split Screens
const char *pszSpanSplit =
@ -167,7 +168,7 @@ void MonitorMenu::storeSettings() const
GfParmReadFile(ossConfFile.str().c_str(), GFPARM_RMODE_STD | GFPARM_RMODE_CREAT);
const char* pszMonitorType =
(_eMonitorType == e16by9) ? GR_VAL_MONITOR_16BY9 : GR_VAL_MONITOR_4BY3;
(_eMonitorType == e4by3) ? GR_VAL_MONITOR_4BY3 : (_eMonitorType == e21by9) ? GR_VAL_MONITOR_21BY9 : GR_VAL_MONITOR_16BY9;
GfParmSetStr(grHandle, GR_SCT_MONITOR, GR_ATT_MONITOR, pszMonitorType);
const char* pszSpanSplit =

View file

@ -31,7 +31,7 @@ public:
MonitorMenu();
bool initialize(void* pPreviousMenu);
enum EMonitorType { e4by3 = 0, e16by9 = 1, nMonitorTypes };
enum EMonitorType { e4by3 = 0, e16by9 = 1, e21by9 = 2, nMonitorTypes };
enum ESpanSplit { eDisabled = 0, eEnabled = 1, nSpanSplits };
void setMonitorType(EMonitorType eMode);