Merge pull request #289 from erorcun/erorcun

Fixes
This commit is contained in:
erorcun 2020-01-11 02:02:09 +03:00 committed by GitHub
commit 6af77d8514
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 56 additions and 24 deletions

View File

@ -30,6 +30,8 @@
#define ALL_ORIGINAL_FRONTEND 1 #define ALL_ORIGINAL_FRONTEND 1
WRAPPER void CMenuManager::PrintController(void) { EAXJMP(0x483990); }
int32 &CMenuManager::OS_Language = *(int32*)0x5F2F78; // 9 int32 &CMenuManager::OS_Language = *(int32*)0x5F2F78; // 9
int8 &CMenuManager::m_PrefsUseVibration = *(int8*)0x95CD92; int8 &CMenuManager::m_PrefsUseVibration = *(int8*)0x95CD92;
int8 &CMenuManager::m_DisplayControllerOnFoot = *(int8*)0x95CD8D; int8 &CMenuManager::m_DisplayControllerOnFoot = *(int8*)0x95CD8D;
@ -518,16 +520,10 @@ void CMenuManager::Draw()
case MENUPAGE_DELETE_SLOT_CONFIRM: case MENUPAGE_DELETE_SLOT_CONFIRM:
case MENUPAGE_SAVE_OVERWRITE_CONFIRM: case MENUPAGE_SAVE_OVERWRITE_CONFIRM:
case MENUPAGE_EXIT: case MENUPAGE_EXIT:
#ifdef PS2_SAVE_DIALOG
case MENUPAGE_SAVE:
columnWidth = 280;
CFont::SetFontStyle(FONT_BANK);
#else
columnWidth = 320; columnWidth = 320;
CFont::SetFontStyle(FONT_HEADING);
#endif
headerHeight = 60; headerHeight = 60;
lineHeight = 24; lineHeight = 24;
CFont::SetFontStyle(FONT_HEADING);
CFont::SetScale(MENU_X(actionTextScaleX = 0.75f), MENU_Y(actionTextScaleY = 0.9f)); CFont::SetScale(MENU_X(actionTextScaleX = 0.75f), MENU_Y(actionTextScaleY = 0.9f));
CFont::SetCentreOn(); CFont::SetCentreOn();
break; break;
@ -547,6 +543,15 @@ void CMenuManager::Draw()
CFont::SetScale(MENU_X(actionTextScaleX = 0.75f), MENU_Y(actionTextScaleY = 0.9f)); CFont::SetScale(MENU_X(actionTextScaleX = 0.75f), MENU_Y(actionTextScaleY = 0.9f));
CFont::SetCentreOn(); CFont::SetCentreOn();
break; break;
#ifdef PS2_SAVE_DIALOG
case MENUPAGE_SAVE:
columnWidth = 180;
headerHeight = 60;
lineHeight = 24;
CFont::SetFontStyle(FONT_BANK);
CFont::SetScale(MENU_X(actionTextScaleX = 0.75f), MENU_Y(actionTextScaleY = 0.9f));
break;
#endif
default: default:
columnWidth = 320; columnWidth = 320;
headerHeight = 40; headerHeight = 40;
@ -586,7 +591,7 @@ void CMenuManager::Draw()
if (Slots[i-1] != 1) if (Slots[i-1] != 1)
textToPrint[MENUCOLUMN_RIGHT] = GetSavedGameDateAndTime(i - 1); textToPrint[MENUCOLUMN_RIGHT] = GetSavedGameDateAndTime(i - 1);
if (!textToPrint[MENUCOLUMN_LEFT]) { if (textToPrint[MENUCOLUMN_LEFT][0] == '\0') {
sprintf(gString, "FEM_SL%d", i); sprintf(gString, "FEM_SL%d", i);
textToPrint[MENUCOLUMN_LEFT] = TheText.Get(gString); textToPrint[MENUCOLUMN_LEFT] = TheText.Get(gString);
} }
@ -761,12 +766,11 @@ void CMenuManager::Draw()
if (m_nPrefsAudio3DProviderIndex == -1) if (m_nPrefsAudio3DProviderIndex == -1)
textToPrint[MENUCOLUMN_RIGHT] = TheText.Get("FEA_NAH"); textToPrint[MENUCOLUMN_RIGHT] = TheText.Get("FEA_NAH");
else { else {
char* provider = DMAudio.Get3DProviderName(m_nPrefsAudio3DProviderIndex); char *provider = DMAudio.Get3DProviderName(m_nPrefsAudio3DProviderIndex);
if (!strcmp(strupr(provider), "DIRECTSOUND3D HARDWARE SUPPORT")) { if (!strcmp(strupr(provider), "DIRECTSOUND3D HARDWARE SUPPORT")) {
strcpy(provider, "DSOUND3D HARDWARE SUPPORT"); strcpy(provider, "DSOUND3D HARDWARE SUPPORT");
} } else if (!strcmp(strupr(provider), "DIRECTSOUND3D SOFTWARE EMULATION")) {
else if (!strcmp(strupr(provider), "DIRECTSOUND3D SOFTWARE EMULATION")) {
strcpy(provider, "DSOUND3D SOFTWARE EMULATION"); strcpy(provider, "DSOUND3D SOFTWARE EMULATION");
} }
wchar temp[64]; wchar temp[64];
@ -1051,10 +1055,11 @@ void CMenuManager::Draw()
DisplayHelperText(); DisplayHelperText();
break; break;
} }
/*
if (m_nCurrScreen == MENUPAGE_CONTROLLER_SETTINGS) { if (m_nCurrScreen == MENUPAGE_CONTROLLER_SETTINGS) {
PrintController(); PrintController();
} else if (m_nCurrScreen == MENUPAGE_SKIN_SELECT_OLD) { }
/* else if (m_nCurrScreen == MENUPAGE_SKIN_SELECT_OLD) {
CSprite2d::DrawRect(CRect(StretchX(180), MENU_Y(98), StretchX(230), MENU_Y(123)), CRGBA(255, 255, 255, FadeIn(255))); CSprite2d::DrawRect(CRect(StretchX(180), MENU_Y(98), StretchX(230), MENU_Y(123)), CRGBA(255, 255, 255, FadeIn(255)));
CSprite2d::DrawRect(CRect(StretchX(181), MENU_Y(99), StretchX(229), MENU_Y(233)), CRGBA(Player color from PickNewPlayerColour, FadeIn(255))); CSprite2d::DrawRect(CRect(StretchX(181), MENU_Y(99), StretchX(229), MENU_Y(233)), CRGBA(Player color from PickNewPlayerColour, FadeIn(255)));
} }
@ -1121,7 +1126,7 @@ void CMenuManager::DrawFrontEndSaveZone()
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERNEAREST); RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERNEAREST);
// Not original dimensions, have been changed to fit PC screen & PC menu layout. // Not original dimensions, have been changed to fit PC screen & PC menu layout.
CSprite2d::DrawRect(CRect(MENU_X_LEFT_ALIGNED(25.0f), MENU_Y(40.0f), MENU_X_RIGHT_ALIGNED(25.0f), SCREEN_SCALE_FROM_BOTTOM(40.0f)), CRGBA(0, 0, 0, 175)); CSprite2d::DrawRect(CRect(MENU_X_LEFT_ALIGNED(30.0f), MENU_Y(50.0f), MENU_X_RIGHT_ALIGNED(30.0f), SCREEN_SCALE_FROM_BOTTOM(50.0f)), CRGBA(0, 0, 0, 175));
m_nMenuFadeAlpha = 255; m_nMenuFadeAlpha = 255;
RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void*)rwTEXTUREADDRESSCLAMP); RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void*)rwTEXTUREADDRESSCLAMP);

View File

@ -530,6 +530,7 @@ public:
void SwitchMenuOnAndOff(); void SwitchMenuOnAndOff();
void UnloadTextures(); void UnloadTextures();
void WaitForUserCD(); void WaitForUserCD();
void PrintController();
// New content: // New content:
uint8 GetNumberOfMenuOptions(); uint8 GetNumberOfMenuOptions();

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
// There are some missing/wrong entries in here.
const CMenuScreen aScreens[] = { const CMenuScreen aScreens[] = {
// MENUPAGE_NONE = 0 // MENUPAGE_NONE = 0
{ "", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0, }, { "", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0, },
@ -24,7 +26,10 @@ const CMenuScreen aScreens[] = {
// MENU_CONTROLLER_SETTINGS = 4 // MENU_CONTROLLER_SETTINGS = 4
{ "FET_CON", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 0, 0, { "FET_CON", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 0, 0,
MENUACTION_CTRLCONFIG, "FEC_CCF", SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS,
MENUACTION_CTRLDISPLAY, "FEC_CDP", SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS,
MENUACTION_CTRLVIBRATION, "FEC_VIB", SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS,
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS,
}, },
// MENUPAGE_SOUND_SETTINGS = 5 // MENUPAGE_SOUND_SETTINGS = 5
@ -243,31 +248,45 @@ const CMenuScreen aScreens[] = {
}, },
// MENUPAGE_CONTROLLER_PC = 35 // MENUPAGE_CONTROLLER_PC = 35
{ "FET_CTL", MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 0, 0, { "FET_CTL", MENUPAGE_DISABLED, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 0, 0,
MENUACTION_CTRLMETHOD, "FET_CME", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC, MENUACTION_CTRLMETHOD, "FET_CME", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
MENUACTION_CHANGEMENU, "FET_RDK", SAVESLOT_NONE, MENUPAGE_KEYBOARD_CONTROLS, MENUACTION_CHANGEMENU, "FET_RDK", SAVESLOT_NONE, MENUPAGE_KEYBOARD_CONTROLS,
MENUACTION_CHANGEMENU, "FET_AMS", SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS, MENUACTION_CHANGEMENU, "FET_AMS", SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS,
MENUACTION_RESTOREDEF, "FET_DEF", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC, MENUACTION_RESTOREDEF, "FET_DEF", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE, MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
}, },
// MENUPAGE_CONTROLLER_PC_OLD1 = 36 // MENUPAGE_CONTROLLER_PC_OLD1 = 36
{ "FET_CTL", MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 0, 0, { "FET_CTL", MENUPAGE_DISABLED, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 0, 0,
MENUACTION_GETKEY, "FEC_PLB", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD1,
MENUACTION_GETKEY, "FEC_CWL", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD1,
MENUACTION_GETKEY, "FEC_CWR", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD1,
MENUACTION_GETKEY, "FEC_LKT", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD1,
MENUACTION_GETKEY, "FEC_PJP", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD1,
MENUACTION_GETKEY, "FEC_PSP", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD1,
MENUACTION_GETKEY, "FEC_TLF", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD1,
MENUACTION_GETKEY, "FEC_TRG", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD1,
MENUACTION_GETKEY, "FEC_CCM", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD1,
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
}, },
// MENUPAGE_CONTROLLER_PC_OLD2 = 37 // MENUPAGE_CONTROLLER_PC_OLD2 = 37
{ "FET_CTL", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0, { "FET_CTL", MENUPAGE_DISABLED, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 1, 1,
}, },
// MENUPAGE_CONTROLLER_PC_OLD3 = 38 // MENUPAGE_CONTROLLER_PC_OLD3 = 38
{ "FET_CTL", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0, { "FET_CTL", MENUPAGE_DISABLED, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 2, 2,
MENUACTION_GETKEY, "FEC_LUP", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD3,
MENUACTION_GETKEY, "FEC_LDN", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD3,
MENUACTION_GETKEY, "FEC_SMS", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD3,
MENUACTION_SHOWHEADBOB, "FEC_GSL", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC_OLD3,
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
}, },
// MENUPAGE_CONTROLLER_PC_OLD4 = 39 // MENUPAGE_CONTROLLER_PC_OLD4 = 39
{ "FET_CTL", MENUPAGE_DISABLED, MENUPAGE_DISABLED, MENUPAGE_DISABLED, 0, 0, { "FET_CTL", MENUPAGE_DISABLED, MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, 3, 3,
}, },

View File

@ -61,12 +61,21 @@ public:
T *New(void){ T *New(void){
bool wrapped = false; bool wrapped = false;
do do
#ifdef FIX_BUGS
if (++m_allocPtr >= m_size) {
m_allocPtr = 0;
if (wrapped)
return nil;
wrapped = true;
}
#else
if(++m_allocPtr == m_size){ if(++m_allocPtr == m_size){
if(wrapped) if(wrapped)
return nil; return nil;
wrapped = true; wrapped = true;
m_allocPtr = 0; m_allocPtr = 0;
} }
#endif
while(!m_flags[m_allocPtr].free); while(!m_flags[m_allocPtr].free);
m_flags[m_allocPtr].free = 0; m_flags[m_allocPtr].free = 0;
m_flags[m_allocPtr].id++; m_flags[m_allocPtr].id++;

View File

@ -1474,8 +1474,6 @@ void CHud::SetZoneName(wchar *name)
void CHud::Shutdown() void CHud::Shutdown()
{ {
debug("Shutdown CHud");
for (int i = 0; i < ARRAY_SIZE(WeaponFilenames); ++i) { for (int i = 0; i < ARRAY_SIZE(WeaponFilenames); ++i) {
Sprites[i].Delete(); Sprites[i].Delete();
} }