summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-02-12 17:00:20 +0100
committerSergeanur <s.anureev@yandex.ua>2021-02-12 17:00:20 +0100
commite98164ec41c3629c592bb31d8b110d85626c5e3c (patch)
treef4e345af3889cbec4d2a9239b6570ee21ee1e9f4 /src
parentUpdate TXDs (diff)
downloadre3-e98164ec41c3629c592bb31d8b110d85626c5e3c.tar
re3-e98164ec41c3629c592bb31d8b110d85626c5e3c.tar.gz
re3-e98164ec41c3629c592bb31d8b110d85626c5e3c.tar.bz2
re3-e98164ec41c3629c592bb31d8b110d85626c5e3c.tar.lz
re3-e98164ec41c3629c592bb31d8b110d85626c5e3c.tar.xz
re3-e98164ec41c3629c592bb31d8b110d85626c5e3c.tar.zst
re3-e98164ec41c3629c592bb31d8b110d85626c5e3c.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/Frontend.cpp28
-rw-r--r--src/render/Draw.cpp36
-rw-r--r--src/render/Draw.h6
3 files changed, 55 insertions, 15 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 4c847596..861e67d1 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -1138,18 +1138,34 @@ CMenuManager::DrawStandardMenus(bool activeScreen)
#else
switch (m_PrefsUseWideScreen) {
case AR_AUTO:
- sprintf(asciiTemp, "AUTO");
+ rightText = TheText.Get("FEM_AUT");
break;
case AR_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;
case AR_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;
}
-
- AsciiToUnicode(asciiTemp, unicodeTemp);
- rightText = unicodeTemp;
#endif
break;
@@ -4951,12 +4967,12 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u
case MENUACTION_WIDESCREEN:
if (changeAmount > 0) {
m_PrefsUseWideScreen++;
- if (m_PrefsUseWideScreen > 2)
+ if (m_PrefsUseWideScreen > AR_MAX - 1)
m_PrefsUseWideScreen = 0;
} else {
m_PrefsUseWideScreen--;
if (m_PrefsUseWideScreen < 0)
- m_PrefsUseWideScreen = 2;
+ m_PrefsUseWideScreen = AR_MAX - 1;
}
SaveSettings();
break;
diff --git a/src/render/Draw.cpp b/src/render/Draw.cpp
index 13cbd1b3..9c5921c3 100644
--- a/src/render/Draw.cpp
+++ b/src/render/Draw.cpp
@@ -30,28 +30,48 @@ bool CDraw::ms_bFixRadar = true;
bool CDraw::ms_bFixSprites = true;
#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
CDraw::CalculateAspectRatio(void)
{
- if (FrontEndMenuManager.m_PrefsUseWideScreen) {
#ifdef ASPECT_RATIO_SCALE
- if (TheCamera.m_WideScreenOn)
- CDraw::ms_fAspectRatio = FrontEndMenuManager.m_PrefsUseWideScreen == AR_AUTO ?
- (5.f / 3.f) * (SCREEN_WIDTH / SCREEN_HEIGHT) / (16.f / 9.f) :
- 5.f / 3.f; // It's used on theatrical showings according to Wiki
- else
- CDraw::ms_fAspectRatio = FrontEndMenuManager.m_PrefsUseWideScreen == AR_AUTO ? SCREEN_WIDTH / SCREEN_HEIGHT : 16.f / 9.f;
+ if (TheCamera.m_WideScreenOn)
+ CDraw::ms_fAspectRatio = (5.f / 3.f) * FindAspectRatio() / (16.f / 9.f); // It's used on theatrical showings according to Wiki
+ else
+ CDraw::ms_fAspectRatio = FindAspectRatio();
#else
+ if(FrontEndMenuManager.m_PrefsUseWideScreen) {
if (TheCamera.m_WideScreenOn)
CDraw::ms_fAspectRatio = 5.f / 3.f; // It's used on theatrical showings according to Wiki
else
CDraw::ms_fAspectRatio = 16.f / 9.f;
-#endif
} else if (TheCamera.m_WideScreenOn) {
CDraw::ms_fAspectRatio = 5.f/4.f;
} else {
CDraw::ms_fAspectRatio = 4.f/3.f;
}
+#endif
return CDraw::ms_fAspectRatio;
}
diff --git a/src/render/Draw.h b/src/render/Draw.h
index e67ab42b..b96fa813 100644
--- a/src/render/Draw.h
+++ b/src/render/Draw.h
@@ -4,10 +4,14 @@ enum eAspectRatio
{
// Make sure these work the same as FrontEndMenuManager.m_PrefsUseWideScreen
// without widescreen support
+ AR_AUTO,
AR_4_3,
+ AR_5_4,
+ AR_16_10,
AR_16_9,
+ AR_21_9,
- AR_AUTO,
+ AR_MAX,
};
class CDraw