Sync aspect ratio setting with master

This commit is contained in:
Sergeanur 2021-02-12 18:00:20 +02:00
parent b1698948e6
commit e98164ec41
13 changed files with 72 additions and 17 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1138,18 +1138,34 @@ CMenuManager::DrawStandardMenus(bool activeScreen)
#else #else
switch (m_PrefsUseWideScreen) { switch (m_PrefsUseWideScreen) {
case AR_AUTO: case AR_AUTO:
sprintf(asciiTemp, "AUTO"); rightText = TheText.Get("FEM_AUT");
break; break;
case AR_4_3: case AR_4_3:
sprintf(asciiTemp, "4:3"); sprintf(asciiTemp, "4:3");
AsciiToUnicode(asciiTemp, unicodeTemp);
rightText = unicodeTemp;
break;
case AR_5_4:
sprintf(asciiTemp, "5:4");
AsciiToUnicode(asciiTemp, unicodeTemp);
rightText = unicodeTemp;
break;
case AR_16_10:
sprintf(asciiTemp, "16:10");
AsciiToUnicode(asciiTemp, unicodeTemp);
rightText = unicodeTemp;
break; break;
case AR_16_9: case AR_16_9:
sprintf(asciiTemp, "16:9"); sprintf(asciiTemp, "16:9");
AsciiToUnicode(asciiTemp, unicodeTemp);
rightText = unicodeTemp;
break;
case AR_21_9:
sprintf(asciiTemp, "21:9");
AsciiToUnicode(asciiTemp, unicodeTemp);
rightText = unicodeTemp;
break; break;
} }
AsciiToUnicode(asciiTemp, unicodeTemp);
rightText = unicodeTemp;
#endif #endif
break; break;
@ -4951,12 +4967,12 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u
case MENUACTION_WIDESCREEN: case MENUACTION_WIDESCREEN:
if (changeAmount > 0) { if (changeAmount > 0) {
m_PrefsUseWideScreen++; m_PrefsUseWideScreen++;
if (m_PrefsUseWideScreen > 2) if (m_PrefsUseWideScreen > AR_MAX - 1)
m_PrefsUseWideScreen = 0; m_PrefsUseWideScreen = 0;
} else { } else {
m_PrefsUseWideScreen--; m_PrefsUseWideScreen--;
if (m_PrefsUseWideScreen < 0) if (m_PrefsUseWideScreen < 0)
m_PrefsUseWideScreen = 2; m_PrefsUseWideScreen = AR_MAX - 1;
} }
SaveSettings(); SaveSettings();
break; break;

View File

@ -30,28 +30,48 @@ bool CDraw::ms_bFixRadar = true;
bool CDraw::ms_bFixSprites = true; bool CDraw::ms_bFixSprites = true;
#endif #endif
#ifdef ASPECT_RATIO_SCALE
float
FindAspectRatio(void)
{
switch (FrontEndMenuManager.m_PrefsUseWideScreen) {
case AR_AUTO:
return SCREEN_WIDTH / SCREEN_HEIGHT;
default:
case AR_4_3:
return 4.0f / 3.0f;
case AR_5_4:
return 5.0f / 4.0f;
case AR_16_10:
return 16.0f / 10.0f;
case AR_16_9:
return 16.0f / 9.0f;
case AR_21_9:
return 21.0f / 9.0f;
};
}
#endif
float float
CDraw::CalculateAspectRatio(void) CDraw::CalculateAspectRatio(void)
{ {
if (FrontEndMenuManager.m_PrefsUseWideScreen) {
#ifdef ASPECT_RATIO_SCALE #ifdef ASPECT_RATIO_SCALE
if (TheCamera.m_WideScreenOn) if (TheCamera.m_WideScreenOn)
CDraw::ms_fAspectRatio = FrontEndMenuManager.m_PrefsUseWideScreen == AR_AUTO ? CDraw::ms_fAspectRatio = (5.f / 3.f) * FindAspectRatio() / (16.f / 9.f); // It's used on theatrical showings according to Wiki
(5.f / 3.f) * (SCREEN_WIDTH / SCREEN_HEIGHT) / (16.f / 9.f) : else
5.f / 3.f; // It's used on theatrical showings according to Wiki CDraw::ms_fAspectRatio = FindAspectRatio();
else
CDraw::ms_fAspectRatio = FrontEndMenuManager.m_PrefsUseWideScreen == AR_AUTO ? SCREEN_WIDTH / SCREEN_HEIGHT : 16.f / 9.f;
#else #else
if(FrontEndMenuManager.m_PrefsUseWideScreen) {
if (TheCamera.m_WideScreenOn) if (TheCamera.m_WideScreenOn)
CDraw::ms_fAspectRatio = 5.f / 3.f; // It's used on theatrical showings according to Wiki CDraw::ms_fAspectRatio = 5.f / 3.f; // It's used on theatrical showings according to Wiki
else else
CDraw::ms_fAspectRatio = 16.f / 9.f; CDraw::ms_fAspectRatio = 16.f / 9.f;
#endif
} else if (TheCamera.m_WideScreenOn) { } else if (TheCamera.m_WideScreenOn) {
CDraw::ms_fAspectRatio = 5.f/4.f; CDraw::ms_fAspectRatio = 5.f/4.f;
} else { } else {
CDraw::ms_fAspectRatio = 4.f/3.f; CDraw::ms_fAspectRatio = 4.f/3.f;
} }
#endif
return CDraw::ms_fAspectRatio; return CDraw::ms_fAspectRatio;
} }

View File

@ -4,10 +4,14 @@ enum eAspectRatio
{ {
// Make sure these work the same as FrontEndMenuManager.m_PrefsUseWideScreen // Make sure these work the same as FrontEndMenuManager.m_PrefsUseWideScreen
// without widescreen support // without widescreen support
AR_4_3,
AR_16_9,
AR_AUTO, AR_AUTO,
AR_4_3,
AR_5_4,
AR_16_10,
AR_16_9,
AR_21_9,
AR_MAX,
}; };
class CDraw class CDraw

View File

@ -14420,6 +14420,9 @@ GAMEPAD TYPE
[FET_AGS] [FET_AGS]
GAMEPAD SETTINGS GAMEPAD SETTINGS
[FEM_AUT] { aspect ratio related }
AUTO
{ end of file } { end of file }
[DUMMY] [DUMMY]
THIS LABEL NEEDS TO BE HERE !!! THIS LABEL NEEDS TO BE HERE !!!

View File

@ -14709,6 +14709,9 @@ GAMEPAD TYPE
[FET_AGS] [FET_AGS]
GAMEPAD SETTINGS GAMEPAD SETTINGS
[FEM_AUT] { aspect ratio related }
AUTO
[DUMMY] [DUMMY]
THIS LABEL NEEDS TO BE HERE !!! THIS LABEL NEEDS TO BE HERE !!!
AS THE LAST LABEL DOES NOT GET COMPILED AS THE LAST LABEL DOES NOT GET COMPILED

View File

@ -14709,6 +14709,9 @@ GAMEPAD TYPE
[FET_AGS] [FET_AGS]
GAMEPAD SETTINGS GAMEPAD SETTINGS
[FEM_AUT] { aspect ratio related }
AUTO
[DUMMY] [DUMMY]
THIS LABEL NEEDS TO BE HERE !!! THIS LABEL NEEDS TO BE HERE !!!
AS THE LAST LABEL DOES NOT GET COMPILED AS THE LAST LABEL DOES NOT GET COMPILED

View File

@ -14718,6 +14718,9 @@ GAMEPAD TYPE
[FET_AGS] [FET_AGS]
GAMEPAD SETTINGS GAMEPAD SETTINGS
[FEM_AUT] { aspect ratio related }
AUTO
[DUMMY] [DUMMY]
THIS LABEL NEEDS TO BE HERE !!! THIS LABEL NEEDS TO BE HERE !!!
AS THE LAST LABEL DOES NOT GET COMPILED AS THE LAST LABEL DOES NOT GET COMPILED

View File

@ -14404,6 +14404,9 @@ TIPO DE MANDO
[FET_AGS] [FET_AGS]
AJUSTES DE MANDO AJUSTES DE MANDO
[FEM_AUT] { aspect ratio related }
AUTO
{ end of file } { end of file }
[DUMMY] [DUMMY]
THIS LABEL NEEDS TO BE HERE !!! THIS LABEL NEEDS TO BE HERE !!!