summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-09-27 03:39:25 +0200
committereray orçunus <erayorcunus@gmail.com>2020-09-27 03:39:25 +0200
commit9b7642454006f4c6b93d57297f88b2899e3f0077 (patch)
treef6d36d6be1b23ee2dfc4e0a64cbd9d54fd7c4150 /src/core
parentAdd target arm64 (diff)
downloadre3-9b7642454006f4c6b93d57297f88b2899e3f0077.tar
re3-9b7642454006f4c6b93d57297f88b2899e3f0077.tar.gz
re3-9b7642454006f4c6b93d57297f88b2899e3f0077.tar.bz2
re3-9b7642454006f4c6b93d57297f88b2899e3f0077.tar.lz
re3-9b7642454006f4c6b93d57297f88b2899e3f0077.tar.xz
re3-9b7642454006f4c6b93d57297f88b2899e3f0077.tar.zst
re3-9b7642454006f4c6b93d57297f88b2899e3f0077.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Frontend.cpp34
-rw-r--r--src/core/config.h4
-rw-r--r--src/core/re3.cpp3
3 files changed, 30 insertions, 11 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 0e358fc5..256cf0d4 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -262,6 +262,12 @@ ScaleAndCenterX(float x)
#endif
#ifdef PS2_LIKE_MENU
+#define PAGE_NAME_X MENU_X_RIGHT_ALIGNED
+#else
+#define PAGE_NAME_X SCREEN_SCALE_FROM_RIGHT
+#endif
+
+#ifdef PS2_LIKE_MENU
#define ChangeScreen(screen, option, updateDelay, withReverseAlpha) \
do { \
if (reverseAlpha) { \
@@ -272,7 +278,7 @@ ScaleAndCenterX(float x)
if (updateDelay) \
m_nScreenChangeDelayTimer = CTimer::GetTimeInMillisecondsPauseMode(); \
} \
- if (withReverseAlpha) { \
+ if (withReverseAlpha && !m_bRenderGameInMenu) { \
pendingOption = option; \
pendingScreen = screen; \
reverseAlpha = true; \
@@ -827,7 +833,7 @@ CMenuManager::Draw()
if (aScreens[m_nCurrScreen].m_ScreenName[0] != '\0') {
PREPARE_MENU_HEADER
- CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
+ CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
// Weird place to put that.
nextYToUse += 24.0f + 10.0f;
@@ -1418,10 +1424,17 @@ CMenuManager::Draw()
if (!m_bRenderGameInMenu)
#endif
if (i == m_nCurrOption && itemsAreSelectable) {
+#ifdef PS2_LIKE_MENU
// We keep stretching, because we also stretch background image and we want that bar to be aligned with borders of background
- CSprite2d::DrawRect(CRect(StretchX(10.0f), MENU_Y(bitAboveNextItemY),
- SCREEN_STRETCH_FROM_RIGHT(11.0f), MENU_Y(usableLineHeight + nextItemY)),
+ CSprite2d::DrawRect(CRect(MENU_X_LEFT_ALIGNED(29.0f), MENU_Y(bitAboveNextItemY),
+ MENU_X_RIGHT_ALIGNED(29.0f), MENU_Y(usableLineHeight + nextItemY)),
CRGBA(100, 200, 50, FadeIn(50)));
+#else
+ // We keep stretching, because we also stretch background image and we want that bar to be aligned with borders of background
+ CSprite2d::DrawRect(CRect(StretchX(10.0f), MENU_Y(bitAboveNextItemY),
+ SCREEN_STRETCH_FROM_RIGHT(11.0f), MENU_Y(usableLineHeight + nextItemY)),
+ CRGBA(100, 200, 50, FadeIn(50)));
+#endif
}
CFont::SetColor(CRGBA(0, 0, 0, FadeIn(90)));
@@ -2047,11 +2060,11 @@ CMenuManager::DrawControllerSetupScreen()
switch (m_ControlMethod) {
case CONTROL_STANDARD:
- CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y),
+ CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y),
TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
break;
case CONTROL_CLASSIC:
- CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y),
+ CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y),
TheText.Get("FET_CTI"));
break;
default:
@@ -2753,7 +2766,7 @@ CMenuManager::DrawPlayerSetupScreen()
PREPARE_MENU_HEADER
- CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get("FET_PS"));
+ CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get("FET_PS"));
// lstrcpy's changed with strcpy
@@ -3737,7 +3750,7 @@ CMenuManager::PrintStats()
// ::Draw already does that.
/*
PREPARE_MENU_HEADER
- CFont::PrintString(MENU_X_RIGHT_ALIGNED(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
+ CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
*/
CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X), MENU_Y(MENU_TEXT_SIZE_Y));
}
@@ -4513,12 +4526,17 @@ CMenuManager::ProcessButtonPresses(void)
bottomBarActive = false;
curBottomBarOption = hoveredBottomBarOption;
ChangeScreen(bbNames[curBottomBarOption].screenId, 0, true, false);
+ if (bbNames[curBottomBarOption].screenId == MENUPAGE_SOUND_SETTINGS)
+ DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
return;
} else if (bottomBarActive) {
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetCrossJustDown()) {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NAVIGATION, 0);
bottomBarActive = false;
+ if (bbNames[curBottomBarOption].screenId == MENUPAGE_SOUND_SETTINGS)
+ DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
+
// If there's a menu change with fade ongoing, finish it now
if (reverseAlpha)
m_nMenuFadeAlpha = 0;
diff --git a/src/core/config.h b/src/core/config.h
index 498be8f3..13a0c099 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -242,13 +242,13 @@ enum Config {
#ifndef PC_MENU
# define PS2_MENU
//# define PS2_MENU_USEALLPAGEICONS
-# define PS2_SAVE_DIALOG // PS2 style save dialog with transparent black box
-//# define PS2_LIKE_MENU // An effort to recreate PS2 menu, cycling through tabs, different bg etc.
#else
# define MENU_MAP // VC-like menu map. Make sure you have new menu.txd
# define SCROLLABLE_STATS_PAGE // only draggable by mouse atm
# define TRIANGLE_BACK_BUTTON
//# define CIRCLE_BACK_BUTTON
+//# define PS2_LIKE_MENU // An effort to recreate PS2 menu, cycling through tabs, different bg etc.
+//# define PS2_SAVE_DIALOG // PS2 style save dialog with transparent black box
# define CUSTOM_FRONTEND_OPTIONS
# define GRAPHICS_MENU_OPTIONS // otherwise Advanced Options menu will appear if Display is full
#endif
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index a7a0d7f1..13cb6283 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -267,6 +267,7 @@ void PS2AlphaTestChange(int8 displayedValue)
// Important: Make sure to read the warnings/informations in frontendoption.h!!
+// For texts: Either use TheText.Get, or use wcsdup(wchar version of strdup)
void
CustomFrontendOptionsPopulate(void)
{
@@ -369,7 +370,7 @@ CustomFrontendOptionsPopulate(void)
#ifdef FREE_CAM
SWITCH_TO_DISPLAY_MENU
- static const wchar* text = (wchar*)L"FREE CAM";
+ static const wchar* text = (wchar*)wcsdup(L"FREE CAM");
FrontendOptionAddSelect(text, off_on, 2, (int8*)&TheCamera.bFreeCam, false, FreeCamChange, nil, true);
#endif