summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorXinerki <simasadves@gmail.com>2020-05-21 16:36:12 +0200
committerXinerki <simasadves@gmail.com>2020-05-21 16:36:12 +0200
commit0db3d03c3c9c40ba09391f2dab492d9a49acb9bd (patch)
treec1abe365258dc75faec250e3cfee1c9d7ee0bda4 /src/core
parentvehicle cheats and debug cheat string display (diff)
downloadre3-0db3d03c3c9c40ba09391f2dab492d9a49acb9bd.tar
re3-0db3d03c3c9c40ba09391f2dab492d9a49acb9bd.tar.gz
re3-0db3d03c3c9c40ba09391f2dab492d9a49acb9bd.tar.bz2
re3-0db3d03c3c9c40ba09391f2dab492d9a49acb9bd.tar.lz
re3-0db3d03c3c9c40ba09391f2dab492d9a49acb9bd.tar.xz
re3-0db3d03c3c9c40ba09391f2dab492d9a49acb9bd.tar.zst
re3-0db3d03c3c9c40ba09391f2dab492d9a49acb9bd.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Frontend.cpp3122
-rw-r--r--src/core/Pad.cpp1939
2 files changed, 2464 insertions, 2597 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 663c9323..228168b2 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -150,8 +150,8 @@ uint8 CMenuManager::m_PrefsPlayerBlue; // why??
CMenuManager FrontEndMenuManager;
uint32 TimeToStopPadShaking;
-char* pEditString;
-int32* pControlEdit;
+char *pEditString;
+int32 *pControlEdit;
bool DisplayComboButtonErrMsg;
int32 MouseButtonJustClicked;
int32 JoyButtonJustClicked;
@@ -232,8 +232,7 @@ ScaleAndCenterX(float x)
else {
if (x > DEFAULT_SCREEN_WIDTH / 2) {
return SCREEN_WIDTH / 2 + SCREEN_SCALE_X(x - DEFAULT_SCREEN_WIDTH / 2);
- }
- else {
+ } else {
return SCREEN_WIDTH / 2 - SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH / 2 - x);
}
}
@@ -316,7 +315,7 @@ ScaleAndCenterX(float x)
// --- Functions not in the game/inlined starts
inline void
-CMenuManager::ScrollUpListByOne()
+CMenuManager::ScrollUpListByOne()
{
if (m_nSelectedListRow == m_nFirstVisibleRowOnList) {
if (m_nFirstVisibleRowOnList > 0) {
@@ -324,8 +323,7 @@ CMenuManager::ScrollUpListByOne()
m_nFirstVisibleRowOnList--;
m_nScrollbarTopMargin -= SCROLLBAR_MAX_HEIGHT / m_nTotalListRow;
}
- }
- else {
+ } else {
m_nSelectedListRow--;
}
}
@@ -339,8 +337,7 @@ CMenuManager::ScrollDownListByOne()
m_nFirstVisibleRowOnList++;
m_nScrollbarTopMargin += SCROLLBAR_MAX_HEIGHT / m_nTotalListRow;
}
- }
- else {
+ } else {
if (m_nSelectedListRow < m_nTotalListRow - 1) {
m_nSelectedListRow++;
}
@@ -352,13 +349,12 @@ CMenuManager::PageUpList(bool playSoundOnSuccess)
{
if (m_nTotalListRow > MAX_VISIBLE_LIST_ROW) {
if (m_nFirstVisibleRowOnList > 0) {
- if (playSoundOnSuccess)
+ if(playSoundOnSuccess)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
m_nFirstVisibleRowOnList = Max(0, m_nFirstVisibleRowOnList - MAX_VISIBLE_LIST_ROW);
m_nSelectedListRow = Min(m_nSelectedListRow, m_nFirstVisibleRowOnList + MAX_VISIBLE_LIST_ROW - 1);
- }
- else {
+ } else {
m_nFirstVisibleRowOnList = 0;
m_nSelectedListRow = 0;
}
@@ -371,13 +367,12 @@ CMenuManager::PageDownList(bool playSoundOnSuccess)
{
if (m_nTotalListRow > MAX_VISIBLE_LIST_ROW) {
if (m_nFirstVisibleRowOnList < m_nTotalListRow - MAX_VISIBLE_LIST_ROW) {
- if (playSoundOnSuccess)
+ if(playSoundOnSuccess)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
m_nFirstVisibleRowOnList = Min(m_nFirstVisibleRowOnList + MAX_VISIBLE_LIST_ROW, m_nTotalListRow - MAX_VISIBLE_LIST_ROW);
m_nSelectedListRow = Max(m_nSelectedListRow, m_nFirstVisibleRowOnList);
- }
- else {
+ } else {
m_nFirstVisibleRowOnList = m_nTotalListRow - MAX_VISIBLE_LIST_ROW;
m_nSelectedListRow = m_nTotalListRow - 1;
}
@@ -390,16 +385,14 @@ CMenuManager::ThingsToDoBeforeLeavingPage()
{
if ((m_nCurrScreen == MENUPAGE_SKIN_SELECT) && strcmp(m_aSkinName, m_PrefsSkinFile) != 0) {
CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile);
- }
- else if (m_nCurrScreen == MENUPAGE_SOUND_SETTINGS) {
+ } else if (m_nCurrScreen == MENUPAGE_SOUND_SETTINGS) {
if (m_nPrefsAudio3DProviderIndex != -1)
m_nPrefsAudio3DProviderIndex = DMAudio.GetCurrent3DProviderIndex();
#ifdef TIDY_UP_PBP
DMAudio.StopFrontEndTrack();
OutputDebugString("FRONTEND AUDIO TRACK STOPPED");
#endif
- }
- else if (m_nCurrScreen == MENUPAGE_GRAPHICS_SETTINGS) {
+ } else if (m_nCurrScreen == MENUPAGE_GRAPHICS_SETTINGS) {
m_nDisplayVideoMode = m_nPrefsVideoMode;
#ifdef IMPROVED_VIDEOMODE
m_nSelectedScreenMode = m_nPrefsWindowed;
@@ -418,7 +411,7 @@ CMenuManager::ThingsToDoBeforeLeavingPage()
// ------ Functions not in the game/inlined ends
void
-CMenuManager::BuildStatLine(Const char* text, void* stat, bool itsFloat, void* stat2)
+CMenuManager::BuildStatLine(Const char *text, void *stat, bool itsFloat, void *stat2)
{
if (!text)
return;
@@ -431,20 +424,18 @@ CMenuManager::BuildStatLine(Const char* text, void* stat, bool itsFloat, void* s
sprintf(gString2, " %d/%d", *(int*)stat, *(int*)stat2);
else
#endif
- if (stat2) {
- if (itsFloat)
- sprintf(gString2, " %.2f %s %.2f", *(float*)stat, UnicodeToAscii(TheText.Get("FEST_OO")), *(float*)stat2);
- else
- sprintf(gString2, " %d %s %d", *(int*)stat, UnicodeToAscii(TheText.Get("FEST_OO")), *(int*)stat2);
- }
- else if (stat) {
- if (itsFloat)
- sprintf(gString2, " %.2f", *(float*)stat);
- else
- sprintf(gString2, " %d", *(int*)stat);
- }
+ if (stat2) {
+ if (itsFloat)
+ sprintf(gString2, " %.2f %s %.2f", *(float*)stat, UnicodeToAscii(TheText.Get("FEST_OO")), *(float*)stat2);
+ else
+ sprintf(gString2, " %d %s %d", *(int*)stat, UnicodeToAscii(TheText.Get("FEST_OO")), *(int*)stat2);
+ } else if (stat) {
+ if (itsFloat)
+ sprintf(gString2, " %.2f", *(float*)stat);
else
- gString2[0] = '\0';
+ sprintf(gString2, " %d", *(int*)stat);
+ } else
+ gString2[0] = '\0';
UnicodeStrcpy(gUString, TheText.Get(text));
AsciiToUnicode(gString2, gUString2);
@@ -477,58 +468,50 @@ CMenuManager::CheckCodesForControls(int typeOfControl)
bool escPressed = false;
eControllerType typeToSave;
// GetStartOptionsCntrlConfigScreens();
- e_ControllerAction action = (e_ControllerAction)m_CurrCntrlAction;
+ e_ControllerAction action = (e_ControllerAction) m_CurrCntrlAction;
if (typeOfControl == KEYBOARD) {
if (*pControlEdit == rsESC) {
escPressed = true;
- }
- else if (*pControlEdit != rsF1 && *pControlEdit != rsF2 && *pControlEdit != rsF3 && *pControlEdit != rsF9 &&
+ } else if (*pControlEdit != rsF1 && *pControlEdit != rsF2 && *pControlEdit != rsF3 && *pControlEdit != rsF9 &&
*pControlEdit != rsLWIN && *pControlEdit != rsRWIN && *pControlEdit != rsRALT) {
typeToSave = KEYBOARD;
if (ControlsManager.GetControllerKeyAssociatedWithAction(action, KEYBOARD) != rsNULL &&
*pControlEdit != ControlsManager.GetControllerKeyAssociatedWithAction(action, KEYBOARD)) {
typeToSave = OPTIONAL_EXTRA;
}
- }
- else {
+ } else {
invalidKey = true;
}
- }
- else if (typeOfControl == MOUSE) {
+ } else if (typeOfControl == MOUSE) {
typeToSave = MOUSE;
- }
- else if (typeOfControl == JOYSTICK) {
+ } else if (typeOfControl == JOYSTICK) {
typeToSave = JOYSTICK;
if (ControlsManager.GetIsActionAButtonCombo(action))
DisplayComboButtonErrMsg = true;
}
#ifdef FIX_BUGS
- if (!escPressed && !invalidKey)
+ if(!escPressed && !invalidKey)
#endif
ControlsManager.ClearSettingsAssociatedWithAction(action, typeToSave);
if (!DisplayComboButtonErrMsg && !escPressed && !invalidKey) {
if (typeOfControl == KEYBOARD) {
ControlsManager.DeleteMatchingActionInitiators(action, *pControlEdit, KEYBOARD);
ControlsManager.DeleteMatchingActionInitiators(action, *pControlEdit, OPTIONAL_EXTRA);
- }
- else {
+ } else {
if (typeOfControl == MOUSE) {
ControlsManager.DeleteMatchingActionInitiators(action, MouseButtonJustClicked, MOUSE);
- }
- else if (typeOfControl == JOYSTICK) {
+ } else if (typeOfControl == JOYSTICK) {
ControlsManager.DeleteMatchingActionInitiators(action, JoyButtonJustClicked, JOYSTICK);
}
}
if (typeOfControl == KEYBOARD) {
ControlsManager.SetControllerKeyAssociatedWithAction(action, *pControlEdit, typeToSave);
- }
- else if (typeOfControl == MOUSE) {
+ } else if (typeOfControl == MOUSE) {
ControlsManager.SetControllerKeyAssociatedWithAction(action, MouseButtonJustClicked, typeToSave);
- }
- else {
+ } else {
if (typeOfControl == JOYSTICK) {
ControlsManager.SetControllerKeyAssociatedWithAction(action, JoyButtonJustClicked, typeToSave);
}
@@ -552,8 +535,8 @@ CMenuManager::CheckCodesForControls(int typeOfControl)
bool
CMenuManager::CheckHover(int x1, int x2, int y1, int y2)
{
- return m_nMousePosX > x1 && m_nMousePosX < x2&&
- m_nMousePosY > y1 && m_nMousePosY < y2;
+ return m_nMousePosX > x1 && m_nMousePosX < x2 &&
+ m_nMousePosY > y1 && m_nMousePosY < y2;
}
void
@@ -561,11 +544,11 @@ CMenuManager::CheckSliderMovement(int value)
{
switch (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action) {
case MENUACTION_BRIGHTNESS:
- m_PrefsBrightness += value * (512 / 16);
+ m_PrefsBrightness += value * (512/16);
m_PrefsBrightness = clamp(m_PrefsBrightness, 0, 511);
break;
case MENUACTION_DRAWDIST:
- if (value > 0)
+ if(value > 0)
m_PrefsLOD += ((1.8f - 0.8f) / 16.0f);
else
m_PrefsLOD -= ((1.8f - 0.8f) / 16.0f);
@@ -573,18 +556,18 @@ CMenuManager::CheckSliderMovement(int value)
CRenderer::ms_lodDistScale = m_PrefsLOD;
break;
case MENUACTION_MUSICVOLUME:
- m_PrefsMusicVolume += value * (128 / 16);
+ m_PrefsMusicVolume += value * (128/16);
m_PrefsMusicVolume = clamp(m_PrefsMusicVolume, 0, 127);
DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume);
break;
case MENUACTION_SFXVOLUME:
- m_PrefsSfxVolume += value * (128 / 16);
+ m_PrefsSfxVolume += value * (128/16);
m_PrefsSfxVolume = clamp(m_PrefsSfxVolume, 0, 127);
DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
break;
case MENUACTION_MOUSESENS:
- TheCamera.m_fMouseAccelHorzntl += value * 1.0f / 200.0f / 15.0f; // ???
- TheCamera.m_fMouseAccelHorzntl = clamp(TheCamera.m_fMouseAccelHorzntl, 1.0f / 3200.0f, 1.0f / 200.0f);
+ TheCamera.m_fMouseAccelHorzntl += value * 1.0f/200.0f/15.0f; // ???
+ TheCamera.m_fMouseAccelHorzntl = clamp(TheCamera.m_fMouseAccelHorzntl, 1.0f/3200.0f, 1.0f/200.0f);
TheCamera.m_fMouseAccelVertical = TheCamera.m_fMouseAccelHorzntl;
break;
default:
@@ -628,39 +611,39 @@ CMenuManager::DisplayHelperText()
// TODO: name this cases?
switch (m_nHelperTextMsgId) {
- case 0:
- {
- int action = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action;
- if (action != MENUACTION_CHANGEMENU && action != MENUACTION_REDEFCTRL && action != MENUACTION_RESTOREDEF) {
- CFont::SetColor(CRGBA(255, 255, 255, 255));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(320.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), TheText.Get("FET_MIG"));
+ case 0:
+ {
+ int action = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action;
+ if (action != MENUACTION_CHANGEMENU && action != MENUACTION_REDEFCTRL && action != MENUACTION_RESTOREDEF) {
+ CFont::SetColor(CRGBA(255, 255, 255, 255));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(320.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), TheText.Get("FET_MIG"));
+ }
+ break;
}
- break;
- }
- case 1:
- CFont::SetColor(CRGBA(255, 255, 255, 255));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(320.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), TheText.Get("FET_APP"));
- break;
- case 2:
- CFont::SetColor(CRGBA(255, 255, 255, alpha));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(320.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), TheText.Get("FET_HRD"));
- break;
- case 3:
- CFont::SetColor(CRGBA(255, 255, 255, alpha));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(320.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), TheText.Get("FET_RSO"));
- break;
- case 4:
- CFont::SetColor(CRGBA(255, 255, 255, alpha));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(320.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), TheText.Get("FET_RSC"));
- break;
- default:
- break;
+ case 1:
+ CFont::SetColor(CRGBA(255, 255, 255, 255));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(320.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), TheText.Get("FET_APP"));
+ break;
+ case 2:
+ CFont::SetColor(CRGBA(255, 255, 255, alpha));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(320.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), TheText.Get("FET_HRD"));
+ break;
+ case 3:
+ CFont::SetColor(CRGBA(255, 255, 255, alpha));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(320.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), TheText.Get("FET_RSO"));
+ break;
+ case 4:
+ CFont::SetColor(CRGBA(255, 255, 255, alpha));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(320.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), TheText.Get("FET_RSC"));
+ break;
+ default:
+ break;
}
CFont::SetRightJustifyOff();
}
int
-CMenuManager::DisplaySlider(float x, float y, float mostLeftBarSize, float mostRightBarSize, float rectSize, float progress)
+CMenuManager::DisplaySlider(float x, float y, float mostLeftBarSize, float mostRightBarSize, float rectSize, float progress)
{
CRGBA color;
float maxBarHeight;
@@ -669,13 +652,12 @@ CMenuManager::DisplaySlider(float x, float y, float mostLeftBarSize, float mostR
float curBarX = 0.0f;
float spacing = SCREEN_SCALE_X(4.0f); // TODO: find actual numbers used in the game
for (int i = 0; i < 16; i++) {
- curBarX = i * rectSize / 32.0f + x;
+ curBarX = i * rectSize/32.0f + x;
if (i / 16.0f + 1 / 32.0f < progress) {
color = CRGBA(SLIDERON_COLOR.r, SLIDERON_COLOR.g, SLIDERON_COLOR.b, FadeIn(255));
lastActiveBarX = curBarX;
- }
- else
+ } else
color = CRGBA(SLIDEROFF_COLOR.r, SLIDEROFF_COLOR.g, SLIDEROFF_COLOR.b, FadeIn(255));
maxBarHeight = Max(mostLeftBarSize, mostRightBarSize);
@@ -735,16 +717,16 @@ CMenuManager::Draw()
CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENUACTION_WIDTH));
switch (m_nCurrScreen) {
- case MENUPAGE_STATS:
- PrintStats();
- break;
- case MENUPAGE_BRIEFS:
- PrintBriefs();
- break;
+ case MENUPAGE_STATS:
+ PrintStats();
+ break;
+ case MENUPAGE_BRIEFS:
+ PrintBriefs();
+ break;
#ifdef MENU_MAP
- case MENUPAGE_MAP:
- PrintMap();
- break;
+ case MENUPAGE_MAP:
+ PrintMap();
+ break;
#endif
}
@@ -753,20 +735,20 @@ CMenuManager::Draw()
// Page name
#ifdef PS2_SAVE_DIALOG
- if (!m_bRenderGameInMenu)
+ if(!m_bRenderGameInMenu)
#endif
- if (aScreens[m_nCurrScreen].m_ScreenName[0] != '\0') {
+ if (aScreens[m_nCurrScreen].m_ScreenName[0] != '\0') {
- PREPARE_MENU_HEADER
- CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255)));
- CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X + 7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
+ PREPARE_MENU_HEADER
+ CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255)));
+ CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X + 7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
- PREPARE_MENU_HEADER
- CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
+ PREPARE_MENU_HEADER
+ CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
- // Weird place to put that.
- nextYToUse += 24.0f + 10.0f;
- }
+ // Weird place to put that.
+ nextYToUse += 24.0f + 10.0f;
+ }
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
CFont::SetScale(MENU_X(MENUACTION_SCALE_MULT * MENU_TEXT_SIZE_X), MENU_Y(MENUACTION_SCALE_MULT * MENU_TEXT_SIZE_Y));
@@ -774,7 +756,7 @@ CMenuManager::Draw()
CFont::SetColor(CRGBA(LABEL_COLOR.r, LABEL_COLOR.g, LABEL_COLOR.b, FadeIn(255)));
// Label
- wchar* str;
+ wchar *str;
if (aScreens[m_nCurrScreen].m_aEntries[0].m_Action == MENUACTION_LABEL) {
switch (m_nCurrScreen) {
case MENUPAGE_LOAD_SLOT_CONFIRM:
@@ -819,87 +801,87 @@ CMenuManager::Draw()
int headerHeight;
int columnWidth;
switch (m_nCurrScreen) {
- case MENUPAGE_STATS:
- case MENUPAGE_BRIEFS:
- columnWidth = 320;
- headerHeight = 240;
- lineHeight = 24;
- CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
- CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE));
- CFont::SetCentreOn();
- break;
- case MENUPAGE_SOUND_SETTINGS:
- case MENUPAGE_GRAPHICS_SETTINGS:
- case MENUPAGE_MULTIPLAYER_CREATE:
- case MENUPAGE_SKIN_SELECT_OLD:
- case MENUPAGE_CONTROLLER_PC_OLD1:
- case MENUPAGE_CONTROLLER_PC_OLD2:
- case MENUPAGE_CONTROLLER_PC_OLD3:
- case MENUPAGE_CONTROLLER_PC_OLD4:
- case MENUPAGE_CONTROLLER_DEBUG:
- case MENUPAGE_MOUSE_CONTROLS:
- columnWidth = 50;
- headerHeight = 0;
- lineHeight = 20;
- CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
- CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = MEDIUMTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = MEDIUMTEXT_Y_SCALE));
- CFont::SetRightJustifyOff();
- break;
- case MENUPAGE_CHOOSE_LOAD_SLOT:
- case MENUPAGE_CHOOSE_DELETE_SLOT:
- case MENUPAGE_CHOOSE_SAVE_SLOT:
- columnWidth = 120;
- headerHeight = 38;
- lineHeight = 20;
- CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
- CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = SMALLTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = SMALLTEXT_Y_SCALE));
- CFont::SetRightJustifyOff();
- break;
- case MENUPAGE_NEW_GAME_RELOAD:
- case MENUPAGE_LOAD_SLOT_CONFIRM:
- case MENUPAGE_DELETE_SLOT_CONFIRM:
- case MENUPAGE_SAVE_OVERWRITE_CONFIRM:
- case MENUPAGE_EXIT:
- columnWidth = 320;
- headerHeight = 60;
- lineHeight = 24;
- CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
- CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE));
- CFont::SetCentreOn();
- break;
- case MENUPAGE_START_MENU:
- columnWidth = 320;
- headerHeight = 110;
- lineHeight = 24;
- CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
- CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE));
- CFont::SetCentreOn();
- break;
- case MENUPAGE_PAUSE_MENU:
- columnWidth = 320;
- headerHeight = 117;
- lineHeight = 24;
- CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
- CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE));
- CFont::SetCentreOn();
- break;
+ case MENUPAGE_STATS:
+ case MENUPAGE_BRIEFS:
+ columnWidth = 320;
+ headerHeight = 240;
+ lineHeight = 24;
+ CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
+ CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE));
+ CFont::SetCentreOn();
+ break;
+ case MENUPAGE_SOUND_SETTINGS:
+ case MENUPAGE_GRAPHICS_SETTINGS:
+ case MENUPAGE_MULTIPLAYER_CREATE:
+ case MENUPAGE_SKIN_SELECT_OLD:
+ case MENUPAGE_CONTROLLER_PC_OLD1:
+ case MENUPAGE_CONTROLLER_PC_OLD2:
+ case MENUPAGE_CONTROLLER_PC_OLD3:
+ case MENUPAGE_CONTROLLER_PC_OLD4:
+ case MENUPAGE_CONTROLLER_DEBUG:
+ case MENUPAGE_MOUSE_CONTROLS:
+ columnWidth = 50;
+ headerHeight = 0;
+ lineHeight = 20;
+ CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
+ CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = MEDIUMTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = MEDIUMTEXT_Y_SCALE));
+ CFont::SetRightJustifyOff();
+ break;
+ case MENUPAGE_CHOOSE_LOAD_SLOT:
+ case MENUPAGE_CHOOSE_DELETE_SLOT:
+ case MENUPAGE_CHOOSE_SAVE_SLOT:
+ columnWidth = 120;
+ headerHeight = 38;
+ lineHeight = 20;
+ CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
+ CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = SMALLTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = SMALLTEXT_Y_SCALE));
+ CFont::SetRightJustifyOff();
+ break;
+ case MENUPAGE_NEW_GAME_RELOAD:
+ case MENUPAGE_LOAD_SLOT_CONFIRM:
+ case MENUPAGE_DELETE_SLOT_CONFIRM:
+ case MENUPAGE_SAVE_OVERWRITE_CONFIRM:
+ case MENUPAGE_EXIT:
+ columnWidth = 320;
+ headerHeight = 60;
+ lineHeight = 24;
+ CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
+ CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE));
+ CFont::SetCentreOn();
+ break;
+ case MENUPAGE_START_MENU:
+ columnWidth = 320;
+ headerHeight = 110;
+ lineHeight = 24;
+ CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
+ CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE));
+ CFont::SetCentreOn();
+ break;
+ case MENUPAGE_PAUSE_MENU:
+ columnWidth = 320;
+ headerHeight = 117;
+ lineHeight = 24;
+ CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
+ CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE));
+ CFont::SetCentreOn();
+ break;
#ifdef PS2_SAVE_DIALOG
- case MENUPAGE_SAVE:
- columnWidth = 180;
- headerHeight = 60;
- lineHeight = 24;
- CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
- CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE));
- break;
+ case MENUPAGE_SAVE:
+ columnWidth = 180;
+ headerHeight = 60;
+ lineHeight = 24;
+ CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
+ CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE));
+ break;
#endif
- default:
- columnWidth = 320;
- headerHeight = 40;
- lineHeight = 24;
- CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
- CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE));
- CFont::SetCentreOn();
- break;
+ default:
+ columnWidth = 320;
+ headerHeight = 40;
+ lineHeight = 24;
+ CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
+ CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X = BIGTEXT_X_SCALE), MENU_Y(MENU_TEXT_SIZE_Y = BIGTEXT_Y_SCALE));
+ CFont::SetCentreOn();
+ break;
}
#ifdef PS2_LIKE_MENU
@@ -907,18 +889,18 @@ CMenuManager::Draw()
#endif
switch (m_nCurrScreen) {
- case MENUPAGE_CONTROLLER_PC_OLD1:
- case MENUPAGE_CONTROLLER_PC_OLD2:
- case MENUPAGE_CONTROLLER_PC_OLD3:
- case MENUPAGE_CONTROLLER_PC_OLD4:
- case MENUPAGE_CONTROLLER_DEBUG:
- if (m_bWaitingForNewKeyBind)
- itemsAreSelectable = false;
-
- DrawControllerScreenExtraText(nextYToUse - 8.0f, MENU_X_LEFT_ALIGNED(350), lineHeight);
- break;
- default:
- break;
+ case MENUPAGE_CONTROLLER_PC_OLD1:
+ case MENUPAGE_CONTROLLER_PC_OLD2:
+ case MENUPAGE_CONTROLLER_PC_OLD3:
+ case MENUPAGE_CONTROLLER_PC_OLD4:
+ case MENUPAGE_CONTROLLER_DEBUG:
+ if (m_bWaitingForNewKeyBind)
+ itemsAreSelectable = false;
+
+ DrawControllerScreenExtraText(nextYToUse - 8.0f, MENU_X_LEFT_ALIGNED(350), lineHeight);
+ break;
+ default:
+ break;
}
float usableLineHeight = lineHeight * 0.9f; // also height of biggest bar in slider
@@ -930,7 +912,7 @@ CMenuManager::Draw()
#ifdef MENU_MAP
if (m_nCurrScreen == MENUPAGE_MAP) {
// Back button
- wchar* backTx = TheText.Get("FEDS_TB");
+ wchar *backTx = TheText.Get("FEDS_TB");
CFont::SetDropShadowPosition(1);
CFont::SetDropColor(CRGBA(0, 0, 0, 255));
CFont::PrintString(MENU_X(60.0f), SCREEN_SCALE_FROM_BOTTOM(120.0f), backTx);
@@ -938,8 +920,7 @@ CMenuManager::Draw()
if (!CheckHover(MENU_X(30.0f), MENU_X(30.0f) + CFont::GetStringWidth(backTx), SCREEN_SCALE_FROM_BOTTOM(125.0f), SCREEN_SCALE_FROM_BOTTOM(105.0f))) {
m_nHoverOption = HOVEROPTION_NOT_HOVERING;
m_nCurrOption = m_nPrevOption = 0;
- }
- else {
+ } else {
m_nHoverOption = HOVEROPTION_RANDOM_ITEM;
m_nCurrOption = m_nPrevOption = 1;
}
@@ -949,8 +930,8 @@ CMenuManager::Draw()
for (int i = 0; i < NUM_MENUROWS; ++i) {
if (aScreens[m_nCurrScreen].m_aEntries[i].m_Action != MENUACTION_LABEL && aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName[0] != '\0') {
- wchar* rightText = nil;
- wchar* leftText;
+ wchar *rightText = nil;
+ wchar *leftText;
if (aScreens[m_nCurrScreen].m_aEntries[i].m_SaveSlot >= SAVESLOT_1 && aScreens[m_nCurrScreen].m_aEntries[i].m_SaveSlot <= SAVESLOT_8) {
CFont::SetRightJustifyOff();
@@ -963,76 +944,75 @@ CMenuManager::Draw()
sprintf(gString, "FEM_SL%d", i);
leftText = TheText.Get(gString);
}
- }
- else {
+ } else {
leftText = TheText.Get(aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName);
}
switch (aScreens[m_nCurrScreen].m_aEntries[i].m_Action) {
case MENUACTION_CHANGEMENU: {
switch (aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu) {
- case MENUPAGE_MULTIPLAYER_MAP:
- switch (m_SelectedMap) {
- case 0:
- rightText = TheText.Get("FEM_MA0");
- break;
- case 1:
- rightText = TheText.Get("FEM_MA1");
- break;
- case 2:
- rightText = TheText.Get("FEM_MA2");
- break;
- case 3:
- rightText = TheText.Get("FEM_MA3");
- break;
- case 4:
- rightText = TheText.Get("FEM_MA4");
- break;
- case 5:
- rightText = TheText.Get("FEM_MA5");
- break;
- case 6:
- rightText = TheText.Get("FEM_MA6");
- break;
- case 7:
- rightText = TheText.Get("FEM_MA7");
- break;
- default:
- break;
- }
- break;
- case MENUPAGE_MULTIPLAYER_MODE:
- switch (m_SelectedGameType) {
- case 0:
- rightText = TheText.Get("FEN_TY0");
- break;
- case 1:
- rightText = TheText.Get("FEN_TY1");
- break;
- case 2:
- rightText = TheText.Get("FEN_TY2");
- break;
- case 3:
- rightText = TheText.Get("FEN_TY3");
- break;
- case 4:
- rightText = TheText.Get("FEN_TY4");
- break;
- case 5:
- rightText = TheText.Get("FEN_TY5");
- break;
- case 6:
- rightText = TheText.Get("FEN_TY6");
+ case MENUPAGE_MULTIPLAYER_MAP:
+ switch (m_SelectedMap) {
+ case 0:
+ rightText = TheText.Get("FEM_MA0");
+ break;
+ case 1:
+ rightText = TheText.Get("FEM_MA1");
+ break;
+ case 2:
+ rightText = TheText.Get("FEM_MA2");
+ break;
+ case 3:
+ rightText = TheText.Get("FEM_MA3");
+ break;
+ case 4:
+ rightText = TheText.Get("FEM_MA4");
+ break;
+ case 5:
+ rightText = TheText.Get("FEM_MA5");
+ break;
+ case 6:
+ rightText = TheText.Get("FEM_MA6");
+ break;
+ case 7:
+ rightText = TheText.Get("FEM_MA7");
+ break;
+ default:
+ break;
+ }
break;
- case 7:
- rightText = TheText.Get("FEN_TY7");
+ case MENUPAGE_MULTIPLAYER_MODE:
+ switch (m_SelectedGameType) {
+ case 0:
+ rightText = TheText.Get("FEN_TY0");
+ break;
+ case 1:
+ rightText = TheText.Get("FEN_TY1");
+ break;
+ case 2:
+ rightText = TheText.Get("FEN_TY2");
+ break;
+ case 3:
+ rightText = TheText.Get("FEN_TY3");
+ break;
+ case 4:
+ rightText = TheText.Get("FEN_TY4");
+ break;
+ case 5:
+ rightText = TheText.Get("FEN_TY5");
+ break;
+ case 6:
+ rightText = TheText.Get("FEN_TY6");
+ break;
+ case 7:
+ rightText = TheText.Get("FEN_TY7");
+ break;
+ default:
+ break;
+ }
break;
default:
break;
- }
- break;
- default:
- break;
}
break;
}
@@ -1146,12 +1126,11 @@ CMenuManager::Draw()
if (m_nPrefsAudio3DProviderIndex == -1)
rightText = TheText.Get("FEA_NAH");
else {
- char* provider = DMAudio.Get3DProviderName(m_nPrefsAudio3DProviderIndex);
+ char *provider = DMAudio.Get3DProviderName(m_nPrefsAudio3DProviderIndex);
if (!strcmp(strupr(provider), "DIRECTSOUND3D 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");
}
AsciiToUnicode(provider, unicodeTemp);
@@ -1198,10 +1177,10 @@ CMenuManager::Draw()
float nextItemY = headerHeight + nextYToUse;
float bitAboveNextItemY = nextItemY - 2.0f;
int nextYToCheck = bitAboveNextItemY;
-
+
if (!foundTheHoveringItem) {
for (int rowToCheck = aScreens[m_nCurrScreen].m_aEntries[0].m_Action == MENUACTION_LABEL; rowToCheck < NUM_MENUROWS; ++rowToCheck) {
- if (aScreens[m_nCurrScreen].m_aEntries[rowToCheck].m_Action == MENUACTION_NOTHING)
+ if(aScreens[m_nCurrScreen].m_aEntries[rowToCheck].m_Action == MENUACTION_NOTHING)
break;
int extraOffset = 0;
@@ -1219,13 +1198,13 @@ CMenuManager::Draw()
m_nMousePosY < MENU_Y((nextYToCheck + 2) + usableLineHeight)) {
static int oldOption = -99;
- static int oldScreen = m_nCurrScreen;
+ static int oldScreen = m_nCurrScreen;
- m_nPrevOption = rowToCheck;
- if (m_nMouseOldPosX != m_nMousePosX || m_nMouseOldPosY != m_nMousePosY) {
- m_nCurrOption = rowToCheck;
- m_bShowMouse = true;
- }
+ m_nPrevOption = rowToCheck;
+ if (m_nMouseOldPosX != m_nMousePosX || m_nMouseOldPosY != m_nMousePosY) {
+ m_nCurrOption = rowToCheck;
+ m_bShowMouse = true;
+ }
if (oldOption != m_nCurrOption) {
if (oldScreen == m_nCurrScreen && m_bShowMouse)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
@@ -1249,17 +1228,17 @@ CMenuManager::Draw()
#ifdef PS2_SAVE_DIALOG
if (!m_bRenderGameInMenu)
#endif
- if (i == m_nCurrOption && itemsAreSelectable) {
- // 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(SELECTIONBORDER_COLOR.r, SELECTIONBORDER_COLOR.g, SELECTIONBORDER_COLOR.b, FadeIn(255)));
- }
+ if (i == m_nCurrOption && itemsAreSelectable) {
+ // 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(SELECTIONBORDER_COLOR.r, SELECTIONBORDER_COLOR.g, SELECTIONBORDER_COLOR.b, FadeIn(255)));
+ }
CFont::SetColor(CRGBA(0, 0, 0, FadeIn(90)));
// Button and it's shadow
- for (int textLayer = 0; textLayer < 2; textLayer++) {
+ for(int textLayer = 0; textLayer < 2; textLayer++) {
if (!CFont::Details.centre)
CFont::SetRightJustifyOff();
@@ -1269,23 +1248,22 @@ CMenuManager::Draw()
if (rightText) {
if (!CFont::Details.centre)
CFont::SetRightJustifyOn();
-
- if (!strcmp(aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName, "FED_RES")
+
+ if(!strcmp(aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName, "FED_RES")
&& !m_bGameNotLoaded && textLayer == 1) {
CFont::SetColor(CRGBA(DARKMENUOPTION_COLOR.r, DARKMENUOPTION_COLOR.g, DARKMENUOPTION_COLOR.b, FadeIn(255)));
}
CFont::PrintString(MENU_X_RIGHT_ALIGNED(columnWidth - textLayer), itemY, rightText);
}
- if (i == m_nCurrOption && itemsAreSelectable) {
+ if (i == m_nCurrOption && itemsAreSelectable){
CFont::SetColor(CRGBA(MENUOPTION_COLOR.r, MENUOPTION_COLOR.g, MENUOPTION_COLOR.b, FadeIn(255)));
- }
- else {
+ } else {
CFont::SetColor(CRGBA(SELECTEDMENUOPTION_COLOR.r, SELECTEDMENUOPTION_COLOR.g, SELECTEDMENUOPTION_COLOR.b, FadeIn(255)));
}
}
if (m_nPrefsAudio3DProviderIndex == DMAudio.GetCurrent3DProviderIndex()) {
- if (!strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEA_3DH") && m_nHelperTextMsgId == 1)
+ if(!strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEA_3DH") && m_nHelperTextMsgId == 1)
ResetHelperText();
}
if (m_nDisplayVideoMode == m_nPrefsVideoMode) {
@@ -1327,21 +1305,21 @@ CMenuManager::Draw()
// Sliders
int lastActiveBarX;
switch (aScreens[m_nCurrScreen].m_aEntries[i].m_Action) {
- case MENUACTION_BRIGHTNESS:
- ProcessSlider(m_PrefsBrightness / 512.0f, HOVEROPTION_INCREASE_BRIGHTNESS, HOVEROPTION_DECREASE_BRIGHTNESS, MENU_X_LEFT_ALIGNED(170.0f), SCREEN_WIDTH);
- break;
- case MENUACTION_DRAWDIST:
- ProcessSlider((m_PrefsLOD - 0.8f) * 1.0f, HOVEROPTION_INCREASE_DRAWDIST, HOVEROPTION_DECREASE_DRAWDIST, MENU_X_LEFT_ALIGNED(170.0f), SCREEN_WIDTH);
- break;
- case MENUACTION_MUSICVOLUME:
- ProcessSlider(m_PrefsMusicVolume / 128.0f, HOVEROPTION_INCREASE_MUSICVOLUME, HOVEROPTION_DECREASE_MUSICVOLUME, MENU_X_LEFT_ALIGNED(170.0f), SCREEN_WIDTH);
- break;
- case MENUACTION_SFXVOLUME:
- ProcessSlider(m_PrefsSfxVolume / 128.0f, HOVEROPTION_INCREASE_SFXVOLUME, HOVEROPTION_DECREASE_SFXVOLUME, MENU_X_LEFT_ALIGNED(170.0f), SCREEN_WIDTH);
- break;
- case MENUACTION_MOUSESENS:
- ProcessSlider(TheCamera.m_fMouseAccelHorzntl * 200.0f, HOVEROPTION_INCREASE_MOUSESENS, HOVEROPTION_DECREASE_MOUSESENS, MENU_X_LEFT_ALIGNED(200.0f), SCREEN_WIDTH);
- break;
+ case MENUACTION_BRIGHTNESS:
+ ProcessSlider(m_PrefsBrightness / 512.0f, HOVEROPTION_INCREASE_BRIGHTNESS, HOVEROPTION_DECREASE_BRIGHTNESS, MENU_X_LEFT_ALIGNED(170.0f), SCREEN_WIDTH);
+ break;
+ case MENUACTION_DRAWDIST:
+ ProcessSlider((m_PrefsLOD - 0.8f) * 1.0f, HOVEROPTION_INCREASE_DRAWDIST, HOVEROPTION_DECREASE_DRAWDIST, MENU_X_LEFT_ALIGNED(170.0f), SCREEN_WIDTH);
+ break;
+ case MENUACTION_MUSICVOLUME:
+ ProcessSlider(m_PrefsMusicVolume / 128.0f, HOVEROPTION_INCREASE_MUSICVOLUME, HOVEROPTION_DECREASE_MUSICVOLUME, MENU_X_LEFT_ALIGNED(170.0f), SCREEN_WIDTH);
+ break;
+ case MENUACTION_SFXVOLUME:
+ ProcessSlider(m_PrefsSfxVolume / 128.0f, HOVEROPTION_INCREASE_SFXVOLUME, HOVEROPTION_DECREASE_SFXVOLUME, MENU_X_LEFT_ALIGNED(170.0f), SCREEN_WIDTH);
+ break;
+ case MENUACTION_MOUSESENS:
+ ProcessSlider(TheCamera.m_fMouseAccelHorzntl * 200.0f, HOVEROPTION_INCREASE_MOUSESENS, HOVEROPTION_DECREASE_MOUSESENS, MENU_X_LEFT_ALIGNED(200.0f), SCREEN_WIDTH);
+ break;
}
// 60.0 is silly
@@ -1392,22 +1370,22 @@ CMenuManager::GetNumOptionsCntrlConfigScreens(void)
{
int number = 0;
switch (m_nCurrScreen) {
- case MENUPAGE_CONTROLLER_PC_OLD3:
- number = 2;
- break;
- case MENUPAGE_CONTROLLER_DEBUG:
- number = 4;
- break;
- case MENUPAGE_KEYBOARD_CONTROLS:
- switch (m_ControlMethod) {
- case CONTROL_STANDARD:
- number = 25;
+ case MENUPAGE_CONTROLLER_PC_OLD3:
+ number = 2;
break;
- case CONTROL_CLASSIC:
- number = 30;
+ case MENUPAGE_CONTROLLER_DEBUG:
+ number = 4;
+ break;
+ case MENUPAGE_KEYBOARD_CONTROLS:
+ switch (m_ControlMethod) {
+ case CONTROL_STANDARD:
+ number = 25;
+ break;
+ case CONTROL_CLASSIC:
+ number = 30;
+ break;
+ }
break;
- }
- break;
}
return number;
}
@@ -1421,14 +1399,14 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
int bindingMargin = MENU_X(3.0f);
float rowHeight;
switch (m_ControlMethod) {
- case CONTROL_STANDARD:
- rowHeight = CONTSETUP_STANDARD_ROW_HEIGHT;
- break;
- case CONTROL_CLASSIC:
- rowHeight = CONTSETUP_CLASSIC_ROW_HEIGHT;
- break;
- default:
- break;
+ case CONTROL_STANDARD:
+ rowHeight = CONTSETUP_STANDARD_ROW_HEIGHT;
+ break;
+ case CONTROL_CLASSIC:
+ rowHeight = CONTSETUP_CLASSIC_ROW_HEIGHT;
+ break;
+ default:
+ break;
}
// MENU_Y(rowHeight * 0.0f + yStart);
@@ -1439,164 +1417,163 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
if (column == CONTSETUP_PED_COLUMN) {
switch (optionIdx) {
- case 0:
- controllerAction = PED_FIREWEAPON;
- break;
- case 1:
- controllerAction = PED_CYCLE_WEAPON_RIGHT;
- break;
- case 2:
- controllerAction = PED_CYCLE_WEAPON_LEFT;
- break;
- case 3:
- controllerAction = GO_FORWARD;
- break;
- case 4:
- controllerAction = GO_BACK;
- break;
- case 5:
- controllerAction = GO_LEFT;
- break;
- case 6:
- controllerAction = GO_RIGHT;
- break;
- case 7:
- controllerAction = PED_SNIPER_ZOOM_IN;
- break;
- case 8:
- controllerAction = PED_SNIPER_ZOOM_OUT;
- break;
- case 9:
- controllerAction = VEHICLE_ENTER_EXIT;
- break;
- case 10:
- case 11:
- case 12:
- case 16:
- case 18:
- case 19:
- case 20:
- case 21:
- controllerAction = -1;
- break;
- case 13:
- controllerAction = CAMERA_CHANGE_VIEW_ALL_SITUATIONS;
- break;
- case 14:
- controllerAction = PED_JUMPING;
- break;
- case 15:
- controllerAction = PED_SPRINT;
- break;
- case 17:
- controllerAction = PED_LOCK_TARGET;
- break;
- case 22:
- controllerAction = PED_LOOKBEHIND;
- break;
- case 23:
- if (m_ControlMethod == CONTROL_STANDARD)
- controllerAction = -1;
- else
- controllerAction = PED_1RST_PERSON_LOOK_LEFT;
- break;
- case 24:
- if (m_ControlMethod == CONTROL_STANDARD)
+ case 0:
+ controllerAction = PED_FIREWEAPON;
+ break;
+ case 1:
+ controllerAction = PED_CYCLE_WEAPON_RIGHT;
+ break;
+ case 2:
+ controllerAction = PED_CYCLE_WEAPON_LEFT;
+ break;
+ case 3:
+ controllerAction = GO_FORWARD;
+ break;
+ case 4:
+ controllerAction = GO_BACK;
+ break;
+ case 5:
+ controllerAction = GO_LEFT;
+ break;
+ case 6:
+ controllerAction = GO_RIGHT;
+ break;
+ case 7:
+ controllerAction = PED_SNIPER_ZOOM_IN;
+ break;
+ case 8:
+ controllerAction = PED_SNIPER_ZOOM_OUT;
+ break;
+ case 9:
+ controllerAction = VEHICLE_ENTER_EXIT;
+ break;
+ case 10:
+ case 11:
+ case 12:
+ case 16:
+ case 18:
+ case 19:
+ case 20:
+ case 21:
controllerAction = -1;
- else
- controllerAction = PED_1RST_PERSON_LOOK_RIGHT;
- break;
- case 25:
- controllerAction = PED_1RST_PERSON_LOOK_UP;
- break;
- case 26:
- controllerAction = PED_1RST_PERSON_LOOK_DOWN;
- break;
- case 27:
- controllerAction = PED_CYCLE_TARGET_LEFT;
- break;
- case 28:
- controllerAction = PED_CYCLE_TARGET_RIGHT;
- break;
- case 29:
- controllerAction = PED_CENTER_CAMERA_BEHIND_PLAYER;
- break;
- default:
- break;
+ break;
+ case 13:
+ controllerAction = CAMERA_CHANGE_VIEW_ALL_SITUATIONS;
+ break;
+ case 14:
+ controllerAction = PED_JUMPING;
+ break;
+ case 15:
+ controllerAction = PED_SPRINT;
+ break;
+ case 17:
+ controllerAction = PED_LOCK_TARGET;
+ break;
+ case 22:
+ controllerAction = PED_LOOKBEHIND;
+ break;
+ case 23:
+ if (m_ControlMethod == CONTROL_STANDARD)
+ controllerAction = -1;
+ else
+ controllerAction = PED_1RST_PERSON_LOOK_LEFT;
+ break;
+ case 24:
+ if (m_ControlMethod == CONTROL_STANDARD)
+ controllerAction = -1;
+ else
+ controllerAction = PED_1RST_PERSON_LOOK_RIGHT;
+ break;
+ case 25:
+ controllerAction = PED_1RST_PERSON_LOOK_UP;
+ break;
+ case 26:
+ controllerAction = PED_1RST_PERSON_LOOK_DOWN;
+ break;
+ case 27:
+ controllerAction = PED_CYCLE_TARGET_LEFT;
+ break;
+ case 28:
+ controllerAction = PED_CYCLE_TARGET_RIGHT;
+ break;
+ case 29:
+ controllerAction = PED_CENTER_CAMERA_BEHIND_PLAYER;
+ break;
+ default:
+ break;
}
- }
- else if (column == CONTSETUP_VEHICLE_COLUMN) {
+ } else if (column == CONTSETUP_VEHICLE_COLUMN) {
switch (optionIdx) {
- case 0:
- controllerAction = PED_FIREWEAPON;
- break;
- case 1:
- case 2:
- case 7:
- case 8:
- case 14:
- case 15:
- case 17:
- case 25:
- case 26:
- case 27:
- case 28:
- case 29:
- controllerAction = -1;
- break;
- case 3:
- controllerAction = VEHICLE_ACCELERATE;
- break;
- case 4:
- controllerAction = VEHICLE_BRAKE;
- break;
- case 5:
- controllerAction = GO_LEFT;
- break;
- case 6:
- controllerAction = GO_RIGHT;
- break;
- case 9:
- controllerAction = VEHICLE_ENTER_EXIT;
- break;
- case 10:
- controllerAction = VEHICLE_CHANGE_RADIO_STATION;
- break;
- case 11:
- controllerAction = VEHICLE_HORN;
- break;
- case 12:
- controllerAction = TOGGLE_SUBMISSIONS;
- break;
- case 13:
- controllerAction = CAMERA_CHANGE_VIEW_ALL_SITUATIONS;
- break;
- case 16:
- controllerAction = VEHICLE_HANDBRAKE;
- break;
- case 18:
- controllerAction = VEHICLE_TURRETLEFT;
- break;
- case 19:
- controllerAction = VEHICLE_TURRETRIGHT;
- break;
- case 20:
- controllerAction = VEHICLE_TURRETUP;
- break;
- case 21:
- controllerAction = VEHICLE_TURRETDOWN;
- break;
- case 22:
- controllerAction = -2;
- break;
- case 23:
- controllerAction = VEHICLE_LOOKLEFT;
- break;
- case 24:
- controllerAction = VEHICLE_LOOKRIGHT;
- break;
- default:
- break;
+ case 0:
+ controllerAction = PED_FIREWEAPON;
+ break;
+ case 1:
+ case 2:
+ case 7:
+ case 8:
+ case 14:
+ case 15:
+ case 17:
+ case 25:
+ case 26:
+ case 27:
+ case 28:
+ case 29:
+ controllerAction = -1;
+ break;
+ case 3:
+ controllerAction = VEHICLE_ACCELERATE;
+ break;
+ case 4:
+ controllerAction = VEHICLE_BRAKE;
+ break;
+ case 5:
+ controllerAction = GO_LEFT;
+ break;
+ case 6:
+ controllerAction = GO_RIGHT;
+ break;
+ case 9:
+ controllerAction = VEHICLE_ENTER_EXIT;
+ break;
+ case 10:
+ controllerAction = VEHICLE_CHANGE_RADIO_STATION;
+ break;
+ case 11:
+ controllerAction = VEHICLE_HORN;
+ break;
+ case 12:
+ controllerAction = TOGGLE_SUBMISSIONS;
+ break;
+ case 13:
+ controllerAction = CAMERA_CHANGE_VIEW_ALL_SITUATIONS;
+ break;
+ case 16:
+ controllerAction = VEHICLE_HANDBRAKE;
+ break;
+ case 18:
+ controllerAction = VEHICLE_TURRETLEFT;
+ break;
+ case 19:
+ controllerAction = VEHICLE_TURRETRIGHT;
+ break;
+ case 20:
+ controllerAction = VEHICLE_TURRETUP;
+ break;
+ case 21:
+ controllerAction = VEHICLE_TURRETDOWN;
+ break;
+ case 22:
+ controllerAction = -2;
+ break;
+ case 23:
+ controllerAction = VEHICLE_LOOKLEFT;
+ break;
+ case 24:
+ controllerAction = VEHICLE_LOOKRIGHT;
+ break;
+ default:
+ break;
}
}
int bindingWhite = 155;
@@ -1611,8 +1588,7 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
if (controllerAction == -1) {
CSprite2d::DrawRect(CRect(nextX, MENU_Y(bgY), nextX + MENU_X(CONTSETUP_BOUND_COLUMN_WIDTH),
MENU_Y(bgY + CONTSETUP_BOUND_HIGHLIGHT_HEIGHT)), CRGBA(235, 170, 50, FadeIn(150)));
- }
- else {
+ } else {
CSprite2d::DrawRect(CRect(nextX, MENU_Y(bgY), nextX + MENU_X(CONTSETUP_BOUND_COLUMN_WIDTH),
MENU_Y(bgY + CONTSETUP_BOUND_HIGHLIGHT_HEIGHT)), CRGBA(255, 217, 106, FadeIn(210)));
}
@@ -1620,8 +1596,7 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
if (controllerAction == -1) {
CSprite2d::DrawRect(CRect(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(bgY),
MENU_X_LEFT_ALIGNED(400.0f), MENU_Y(bgY + CONTSETUP_BOUND_HIGHLIGHT_HEIGHT)), CRGBA(235, 170, 50, FadeIn(150)));
- }
- else {
+ } else {
CSprite2d::DrawRect(CRect(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(bgY),
MENU_X_LEFT_ALIGNED(400.0f), MENU_Y(bgY + CONTSETUP_BOUND_HIGHLIGHT_HEIGHT)), CRGBA(255, 217, 106, FadeIn(210)));
}
@@ -1629,22 +1604,19 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
CFont::SetColor(CRGBA(0, 0, 0, FadeIn(255)));
bindingWhite = 0;
- }
- else if (column == CONTSETUP_VEHICLE_COLUMN && m_nSelectedContSetupColumn == CONTSETUP_VEHICLE_COLUMN) {
+ } else if (column == CONTSETUP_VEHICLE_COLUMN && m_nSelectedContSetupColumn == CONTSETUP_VEHICLE_COLUMN) {
#ifdef FIX_BUGS
if (controllerAction == -1) {
CSprite2d::DrawRect(CRect(nextX, MENU_Y(bgY), nextX + MENU_X(CONTSETUP_BOUND_COLUMN_WIDTH),
MENU_Y(bgY + CONTSETUP_BOUND_HIGHLIGHT_HEIGHT)), CRGBA(235, 170, 50, FadeIn(150)));
- }
- else {
+ } else {
CSprite2d::DrawRect(CRect(nextX, MENU_Y(bgY), nextX + MENU_X(CONTSETUP_BOUND_COLUMN_WIDTH),
MENU_Y(bgY + CONTSETUP_BOUND_HIGHLIGHT_HEIGHT)), CRGBA(255, 217, 106, FadeIn(210)));
}
#else
if (controllerAction == -1) {
CSprite2d::DrawRect(CRect(MENU_X_LEFT_ALIGNED(410.0f), MENU_Y(bgY), MENU_X_LEFT_ALIGNED(600.0f), MENU_Y(bgY + 10)), CRGBA(235, 170, 50, FadeIn(150)));
- }
- else {
+ } else {
CSprite2d::DrawRect(CRect(MENU_X_LEFT_ALIGNED(410.0f), MENU_Y(bgY), MENU_X_LEFT_ALIGNED(600.0f), MENU_Y(bgY + 10)), CRGBA(255, 217, 106, FadeIn(210)));
}
#endif
@@ -1657,11 +1629,11 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
// Print bindings, including seperator (-) between them
CFont::SetScale(MENU_X(0.25f), MENU_Y(0.6f));
for (int contSetOrder = SETORDER_1; contSetOrder < MAX_SETORDERS && controllerAction != -1; contSetOrder++) {
- wchar* settingText = ControlsManager.GetControllerSettingTextWithOrderNumber((e_ControllerAction)controllerAction, (eContSetOrder)contSetOrder);
+ wchar *settingText = ControlsManager.GetControllerSettingTextWithOrderNumber((e_ControllerAction)controllerAction, (eContSetOrder)contSetOrder);
if (settingText) {
++bindingsForThisOpt;
if (bindingsForThisOpt > 1) {
- wchar* seperator = TheText.Get("FEC_IBT");
+ wchar *seperator = TheText.Get("FEC_IBT");
CFont::SetColor(CRGBA(20, 20, 20, FadeIn(80)));
CFont::PrintString(nextX, nextY, seperator);
CFont::SetColor(CRGBA(bindingWhite, bindingWhite, bindingWhite, FadeIn(255)));
@@ -1679,23 +1651,19 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
if (controllerAction == -1) {
CFont::SetColor(CRGBA(20, 20, 20, FadeIn(80)));
CFont::PrintString(nextX, nextY, TheText.Get("FEC_NUS")); // not used
- }
- else if (controllerAction == -2) {
+ } else if (controllerAction == -2) {
CFont::SetColor(CRGBA(20, 20, 20, FadeIn(80)));
CFont::PrintString(nextX, nextY, TheText.Get("FEC_CMP")); // combo: l+r
- }
- else if (bindingsForThisOpt == 0) {
+ } else if (bindingsForThisOpt == 0) {
if (m_nSelectedListRow != optionIdx) {
CFont::SetColor(CRGBA(255, 255, 255, FadeIn(255)));
CFont::PrintString(nextX, nextY, TheText.Get("FEC_UNB")); // unbound
- }
- else if (m_bWaitingForNewKeyBind) {
+ } else if (m_bWaitingForNewKeyBind) {
if (column != m_nSelectedContSetupColumn) {
CFont::SetColor(CRGBA(255, 255, 255, FadeIn(255)));
CFont::PrintString(nextX, nextY, TheText.Get("FEC_UNB")); // unbound
}
- }
- else {
+ } else {
if (column != m_nSelectedContSetupColumn) {
CFont::SetColor(CRGBA(255, 255, 255, FadeIn(255)));
}
@@ -1707,11 +1675,11 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
column == CONTSETUP_VEHICLE_COLUMN && m_nSelectedContSetupColumn == CONTSETUP_VEHICLE_COLUMN) {
if (optionIdx == m_nSelectedListRow && controllerAction != -1 && controllerAction != -2) {
- m_CurrCntrlAction = controllerAction;
+ m_CurrCntrlAction = controllerAction;
if (m_bWaitingForNewKeyBind) {
static bool showWaitingText = false;
if (bindingsForThisOpt > 0) {
- wchar* seperator = TheText.Get("FEC_IBT");
+ wchar *seperator = TheText.Get("FEC_IBT");
CFont::PrintString(nextX, nextY, seperator);
nextX += CFont::GetStringWidth(seperator, true) + bindingMargin;
}
@@ -1730,11 +1698,10 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
CFont::SetColor(CRGBA(255, 255, 255, FadeIn(255)));
if (m_bKeyChangeNotProcessed) {
CFont::PrintString(MENU_X_LEFT_ALIGNED(275.0f), SCREEN_SCALE_FROM_BOTTOM(114.0f), TheText.Get("FET_CIG")); // BACKSPACE TO CLEAR - LMB,RETURN TO CHANGE
- }
- else {
+ } else {
CFont::PrintString(MENU_X_LEFT_ALIGNED(275.0f), SCREEN_SCALE_FROM_BOTTOM(114.0f), TheText.Get("FET_RIG")); // SELECT A NEW CONTROL FOR THIS ACTION OR ESC TO CANCEL
}
-
+
CFont::SetRightJustifyOff();
CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE), MENU_Y(SMALLESTTEXT_Y_SCALE));
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
@@ -1742,8 +1709,7 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
m_bKeyIsOK = true;
- }
- else {
+ } else {
CFont::SetCentreOn();
CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE), MENU_Y(SMALLESTTEXT_Y_SCALE));
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
@@ -1755,8 +1721,7 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
m_bKeyIsOK = false;
m_bKeyChangeNotProcessed = false;
}
- }
- else if (optionIdx == m_nSelectedListRow) {
+ } else if (optionIdx == m_nSelectedListRow) {
CFont::SetCentreOn();
CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE), MENU_Y(SMALLESTTEXT_Y_SCALE));
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
@@ -1780,7 +1745,7 @@ CMenuManager::DrawControllerScreenExtraText(int yStart, int xStart, int lineHeig
int numTextsPrinted = 0;
int nextX = xStart;
for (int j = 1; j < 5; j++) {
- wchar* text = ControlsManager.GetControllerSettingTextWithOrderNumber((e_ControllerAction)i, (eContSetOrder)j);
+ wchar *text = ControlsManager.GetControllerSettingTextWithOrderNumber((e_ControllerAction)i, (eContSetOrder)j);
if (text)
++numTextsPrinted;
@@ -1816,7 +1781,7 @@ CMenuManager::DrawControllerScreenExtraText(int yStart, int xStart, int lineHeig
}
yStart += lineHeight;
}
- wchar* error = nil;
+ wchar *error = nil;
if (DisplayComboButtonErrMsg)
error = ControlsManager.GetButtonComboText((e_ControllerAction)(m_nCurrOption + extraTextStart));
@@ -1831,14 +1796,14 @@ CMenuManager::DrawControllerSetupScreen()
{
float rowHeight;
switch (m_ControlMethod) {
- case CONTROL_STANDARD:
- rowHeight = CONTSETUP_STANDARD_ROW_HEIGHT;
- break;
- case CONTROL_CLASSIC:
- rowHeight = CONTSETUP_CLASSIC_ROW_HEIGHT;
- break;
- default:
- break;
+ case CONTROL_STANDARD:
+ rowHeight = CONTSETUP_STANDARD_ROW_HEIGHT;
+ break;
+ case CONTROL_CLASSIC:
+ rowHeight = CONTSETUP_CLASSIC_ROW_HEIGHT;
+ break;
+ default:
+ break;
}
CFont::SetBackgroundOff();
CFont::SetScale(MENU_X(MENUACTION_SCALE_MULT), MENU_Y(MENUACTION_SCALE_MULT));
@@ -1852,15 +1817,15 @@ CMenuManager::DrawControllerSetupScreen()
PREPARE_MENU_HEADER
- switch (m_ControlMethod) {
+ switch (m_ControlMethod) {
case CONTROL_STANDARD:
CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255)));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X + 7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f),
TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
PREPARE_MENU_HEADER
- CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y),
- TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
+ CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y),
+ TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
break;
case CONTROL_CLASSIC:
CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255)));
@@ -1868,13 +1833,13 @@ CMenuManager::DrawControllerSetupScreen()
TheText.Get("FET_CTI"));
PREPARE_MENU_HEADER
- CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y),
- TheText.Get("FET_CTI"));
+ CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y),
+ TheText.Get("FET_CTI"));
break;
default:
break;
- }
- wchar* actionTexts[31];
+ }
+ wchar *actionTexts[31];
actionTexts[0] = TheText.Get("FEC_FIR");
actionTexts[1] = TheText.Get("FEC_NWE");
actionTexts[2] = TheText.Get("FEC_PWE");
@@ -1907,8 +1872,7 @@ CMenuManager::DrawControllerSetupScreen()
actionTexts[28] = TheText.Get("FEC_PTT");
actionTexts[29] = TheText.Get("FEC_CEN");
actionTexts[30] = nil;
- }
- else {
+ } else {
actionTexts[18] = TheText.Get("FEC_TFL");
actionTexts[19] = TheText.Get("FEC_TFR");
actionTexts[20] = TheText.Get("FEC_TFU");
@@ -1946,7 +1910,7 @@ CMenuManager::DrawControllerSetupScreen()
yStart = CONTSETUP_LIST_HEADER_HEIGHT + 34;
for (int i = 0; i < ARRAY_SIZE(actionTexts); ++i) {
- wchar* actionText = actionTexts[i];
+ wchar *actionText = actionTexts[i];
if (!actionText)
break;
@@ -1955,50 +1919,47 @@ CMenuManager::DrawControllerSetupScreen()
float curOptY = i * rowHeight + yStart;
if (m_nMousePosY > MENU_Y(curOptY) && m_nMousePosY < MENU_Y(rowHeight + curOptY)) {
- if (m_nPrevOption != i && m_nCurrExLayer == HOVEROPTION_LIST)
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
+ if (m_nPrevOption != i && m_nCurrExLayer == HOVEROPTION_LIST)
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
- m_nPrevOption = i;
- if (m_nMouseOldPosX != m_nMousePosX || m_nMouseOldPosY != m_nMousePosY) {
- m_nCurrExLayer = HOVEROPTION_LIST;
- m_nSelectedListRow = i;
+ m_nPrevOption = i;
+ if (m_nMouseOldPosX != m_nMousePosX || m_nMouseOldPosY != m_nMousePosY) {
+ m_nCurrExLayer = HOVEROPTION_LIST;
+ m_nSelectedListRow = i;
- // why different number for 3rd column hovering X?? this function is a mess
+ // why different number for 3rd column hovering X?? this function is a mess
#ifdef FIX_BUGS
- if (m_nMousePosX > MENU_X_LEFT_ALIGNED(0.0f) && m_nMousePosX < MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_2_X + CONTSETUP_BOUND_COLUMN_WIDTH)) {
+ if (m_nMousePosX > MENU_X_LEFT_ALIGNED(0.0f) && m_nMousePosX < MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_2_X + CONTSETUP_BOUND_COLUMN_WIDTH)) {
#else
- if (m_nMousePosX > MENU_X_LEFT_ALIGNED(0.0f) && m_nMousePosX < MENU_X_LEFT_ALIGNED(370.0f)) {
+ if (m_nMousePosX > MENU_X_LEFT_ALIGNED(0.0f) && m_nMousePosX < MENU_X_LEFT_ALIGNED(370.0f)) {
#endif
- if (m_nSelectedContSetupColumn != CONTSETUP_PED_COLUMN && m_nCurrExLayer == HOVEROPTION_LIST)
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
+ if (m_nSelectedContSetupColumn != CONTSETUP_PED_COLUMN && m_nCurrExLayer == HOVEROPTION_LIST)
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
- m_nSelectedContSetupColumn = CONTSETUP_PED_COLUMN;
+ m_nSelectedContSetupColumn = CONTSETUP_PED_COLUMN;
#ifdef FIX_BUGS
- }
- else if (m_nMousePosX > MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_2_X + CONTSETUP_BOUND_COLUMN_WIDTH) && m_nMousePosX < SCREEN_WIDTH) {
+ } else if (m_nMousePosX > MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_2_X + CONTSETUP_BOUND_COLUMN_WIDTH) && m_nMousePosX < SCREEN_WIDTH) {
#else
- }
- else if (m_nMousePosX > MENU_X_LEFT_ALIGNED(370.0f) && m_nMousePosX < SCREEN_WIDTH) {
+ } else if (m_nMousePosX > MENU_X_LEFT_ALIGNED(370.0f) && m_nMousePosX < SCREEN_WIDTH) {
#endif
- if (m_nSelectedContSetupColumn != CONTSETUP_VEHICLE_COLUMN && m_nCurrExLayer == HOVEROPTION_LIST)
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
+ if (m_nSelectedContSetupColumn != CONTSETUP_VEHICLE_COLUMN && m_nCurrExLayer == HOVEROPTION_LIST)
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
- m_nSelectedContSetupColumn = CONTSETUP_VEHICLE_COLUMN;
- }
+ m_nSelectedContSetupColumn = CONTSETUP_VEHICLE_COLUMN;
+ }
}
- // what??
- if (m_nHoverOption == HOVEROPTION_SKIN) {
- if (i == m_nSelectedListRow) {
+ // what??
+ if (m_nHoverOption == HOVEROPTION_SKIN) {
+ if (i == m_nSelectedListRow) {
+ m_nHoverOption = HOVEROPTION_NOT_HOVERING;
+ m_bWaitingForNewKeyBind = true;
+ m_bStartWaitingForKeyBind = true;
+ pControlEdit = &m_KeyPressedCode;
+ }
+ } else
m_nHoverOption = HOVEROPTION_NOT_HOVERING;
- m_bWaitingForNewKeyBind = true;
- m_bStartWaitingForKeyBind = true;
- pControlEdit = &m_KeyPressedCode;
- }
- }
- else
- m_nHoverOption = HOVEROPTION_NOT_HOVERING;
- }
}
+ }
if (m_nSelectedListRow != 35)
CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255)));
else if (m_nCurrExLayer == HOVEROPTION_LIST)
@@ -2011,7 +1972,7 @@ CMenuManager::DrawControllerSetupScreen()
CFont::SetScale(MENU_X(0.32f), MENU_Y(SMALLESTTEXT_Y_SCALE));
CFont::PrintString(MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_1_X), MENU_Y(i * rowHeight + yStart), actionText);
- }
+ }
DrawControllerBound(yStart, MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_2_X), rowHeight, CONTSETUP_PED_COLUMN);
DrawControllerBound(yStart, MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_3_X), rowHeight, CONTSETUP_VEHICLE_COLUMN);
CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X), MENU_Y(MENU_TEXT_SIZE_Y));
@@ -2021,13 +1982,11 @@ CMenuManager::DrawControllerSetupScreen()
&& m_nMousePosY < SCREEN_SCALE_FROM_BOTTOM(CONTSETUP_BACK_BOTTOM - CONTSETUP_BACK_HEIGHT)) || m_nCurrExLayer == HOVEROPTION_BACK) {
m_nHoverOption = HOVEROPTION_BACK;
- }
- else if (m_nMousePosX > MENU_X_LEFT_ALIGNED(CONTSETUP_LIST_LEFT + 2.0f) && m_nMousePosX < MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_3_X + CONTSETUP_BOUND_COLUMN_WIDTH)
+ } else if (m_nMousePosX > MENU_X_LEFT_ALIGNED(CONTSETUP_LIST_LEFT + 2.0f) && m_nMousePosX < MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_3_X + CONTSETUP_BOUND_COLUMN_WIDTH)
&& m_nMousePosY > MENU_Y(CONTSETUP_LIST_TOP + CONTSETUP_LIST_HEADER_HEIGHT) && m_nMousePosY < SCREEN_SCALE_FROM_BOTTOM(CONTSETUP_LIST_BOTTOM + 5.0f)) {
m_nHoverOption = HOVEROPTION_LIST;
- }
- else {
+ } else {
m_nHoverOption = HOVEROPTION_NOT_HOVERING;
}
@@ -2045,7 +2004,7 @@ CMenuManager::DrawControllerSetupScreen()
else
CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255)));
}
- }
+}
void
CMenuManager::DrawFrontEnd()
@@ -2064,8 +2023,7 @@ CMenuManager::DrawFrontEnd()
bbNames[5] = { "FESZ_QU",MENUPAGE_EXIT };
bbTabCount = 6;
}
- }
- else {
+ } else {
if (bbTabCount != 8) {
bbNames[0] = { "FEB_STA",MENUPAGE_STATS };
bbNames[1] = { "FEB_SAV",MENUPAGE_NEW_GAME };
@@ -2086,8 +2044,7 @@ CMenuManager::DrawFrontEnd()
if (m_nCurrScreen == MENUPAGE_NONE) {
if (m_bGameNotLoaded) {
m_nCurrScreen = MENUPAGE_START_MENU;
- }
- else {
+ } else {
m_nCurrScreen = MENUPAGE_PAUSE_MENU;
}
}
@@ -2097,7 +2054,7 @@ CMenuManager::DrawFrontEnd()
m_nCurrOption = 1;
#ifdef PS2_SAVE_DIALOG
- if (m_bRenderGameInMenu)
+ if(m_bRenderGameInMenu)
DrawFrontEndSaveZone();
else
#endif
@@ -2137,12 +2094,11 @@ CMenuManager::DrawFrontEndSaveZone()
mouse.Translate(m_nMousePosX, m_nMousePosY);
shad.Translate(m_nMousePosX, m_nMousePosY);
- if (field_518 == 4) {
+ if(field_518 == 4){
m_aFrontEndSprites[MENUSPRITE_MOUSE].Draw(shad, CRGBA(100, 100, 100, 50));
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
m_aFrontEndSprites[MENUSPRITE_MOUSE].Draw(mouse, CRGBA(255, 255, 255, 255));
- }
- else {
+ }else{
m_aFrontEndSprites[MENUSPRITE_MOUSE].Draw(shad, CRGBA(100, 100, 100, 50));
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
m_aFrontEndSprites[MENUSPRITE_MOUSE].Draw(mouse, CRGBA(255, 255, 255, 255));
@@ -2160,10 +2116,9 @@ CMenuManager::DrawFrontEndNormal()
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR);
if (!m_bGameNotLoaded) {
- CSprite2d* bg = LoadSplash(nil);
+ CSprite2d *bg = LoadSplash(nil);
bg->Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, 255));
- }
- else {
+ } else {
CSprite2d::DrawRect(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(0, 0, 0, 255));
}
@@ -2176,44 +2131,44 @@ CMenuManager::DrawFrontEndNormal()
m_aFrontEndSprites[FE2_MAINPANEL_UR].Draw(CRect(SCREEN_WIDTH / 2, 0.0f, MENU_X_RIGHT_ALIGNED(0.0f), SCREEN_HEIGHT / 2), CRGBA(255, 255, 255, 255));
m_aFrontEndSprites[FE2_MAINPANEL_DL].Draw(CRect(MENU_X_LEFT_ALIGNED(0.0f), SCREEN_HEIGHT / 2, SCREEN_WIDTH / 2, SCREEN_HEIGHT), CRGBA(255, 255, 255, 255));
m_aFrontEndSprites[FE2_MAINPANEL_DR].Draw(CRect(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, MENU_X_RIGHT_ALIGNED(0.0f), SCREEN_HEIGHT), CRGBA(255, 255, 255, 255));
-
+
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR);
eFrontendSprites currentSprite;
switch (m_nCurrScreen) {
- case MENUPAGE_STATS:
- case MENUPAGE_START_MENU:
- case MENUPAGE_PAUSE_MENU:
- case MENUPAGE_EXIT:
- currentSprite = FE_ICONSTATS;
- break;
- case MENUPAGE_LANGUAGE_SETTINGS:
- currentSprite = FE_ICONLANGUAGE;
- break;
- case MENUPAGE_CHOOSE_LOAD_SLOT:
- case MENUPAGE_CHOOSE_DELETE_SLOT:
- case MENUPAGE_NEW_GAME_RELOAD:
- case MENUPAGE_LOAD_SLOT_CONFIRM:
- case MENUPAGE_DELETE_SLOT_CONFIRM:
- currentSprite = FE_ICONSAVE;
- break;
- case MENUPAGE_GRAPHICS_SETTINGS:
- currentSprite = FE_ICONDISPLAY;
- break;
- case MENUPAGE_SOUND_SETTINGS:
- currentSprite = FE_ICONAUDIO;
- break;
- case MENUPAGE_CONTROLLER_PC:
- case MENUPAGE_OPTIONS:
- case MENUPAGE_CONTROLLER_SETTINGS:
- case MENUPAGE_KEYBOARD_CONTROLS:
- case MENUPAGE_MOUSE_CONTROLS:
- currentSprite = FE_ICONCONTROLS;
- break;
- default:
- /*case MENUPAGE_NEW_GAME: */
- /*case MENUPAGE_BRIEFS: */
- currentSprite = FE_ICONBRIEF;
- break;
+ case MENUPAGE_STATS:
+ case MENUPAGE_START_MENU:
+ case MENUPAGE_PAUSE_MENU:
+ case MENUPAGE_EXIT:
+ currentSprite = FE_ICONSTATS;
+ break;
+ case MENUPAGE_LANGUAGE_SETTINGS:
+ currentSprite = FE_ICONLANGUAGE;
+ break;
+ case MENUPAGE_CHOOSE_LOAD_SLOT:
+ case MENUPAGE_CHOOSE_DELETE_SLOT:
+ case MENUPAGE_NEW_GAME_RELOAD:
+ case MENUPAGE_LOAD_SLOT_CONFIRM:
+ case MENUPAGE_DELETE_SLOT_CONFIRM:
+ currentSprite = FE_ICONSAVE;
+ break;
+ case MENUPAGE_GRAPHICS_SETTINGS:
+ currentSprite = FE_ICONDISPLAY;
+ break;
+ case MENUPAGE_SOUND_SETTINGS:
+ currentSprite = FE_ICONAUDIO;
+ break;
+ case MENUPAGE_CONTROLLER_PC:
+ case MENUPAGE_OPTIONS:
+ case MENUPAGE_CONTROLLER_SETTINGS:
+ case MENUPAGE_KEYBOARD_CONTROLS:
+ case MENUPAGE_MOUSE_CONTROLS:
+ currentSprite = FE_ICONCONTROLS;
+ break;
+ default:
+ /*case MENUPAGE_NEW_GAME: */
+ /*case MENUPAGE_BRIEFS: */
+ currentSprite = FE_ICONBRIEF;
+ break;
}
m_aFrontEndSprites[currentSprite].Draw(CRect(MENU_X_LEFT_ALIGNED(50.0f), MENU_Y(50.0f), MENU_X_RIGHT_ALIGNED(50.0f), SCREEN_SCALE_FROM_BOTTOM(95.0f)), CRGBA(255, 255, 255, m_nMenuFadeAlpha > 255 ? 255 : m_nMenuFadeAlpha));
@@ -2229,8 +2184,7 @@ CMenuManager::DrawFrontEndNormal()
if (m_nMenuFadeAlpha <= 0 && reverseAlpha) {
reverseAlpha = false;
ChangeScreen(pendingScreen, pendingOption, true, false);
- }
- else {
+ } else {
// +20 per every 33 ms (1000.f/30.f - original frame limiter fps)
if (!reverseAlpha)
fadeAlpha += (frameTime) * 20.f / 33.f;
@@ -2238,10 +2192,9 @@ CMenuManager::DrawFrontEndNormal()
fadeAlpha = max(0.0f, fadeAlpha - (frameTime) * 30.f / 33.f);
m_nMenuFadeAlpha = fadeAlpha;
- }
+ }
lastState = 0;
- }
- else {
+ } else {
if (lastState == 0) fadeAlpha = 255.f;
if (reverseAlpha) {
@@ -2252,8 +2205,8 @@ CMenuManager::DrawFrontEndNormal()
lastState = 1;
// TODO: what is this? waiting mouse?
- if (field_518 == 4) {
- if (m_nHoverOption == HOVEROPTION_3 || m_nHoverOption == HOVEROPTION_4 ||
+ if(field_518 == 4){
+ if(m_nHoverOption == HOVEROPTION_3 || m_nHoverOption == HOVEROPTION_4 ||
m_nHoverOption == HOVEROPTION_5 || m_nHoverOption == HOVEROPTION_6 || m_nHoverOption == HOVEROPTION_7)
field_518 = 2;
@@ -2266,28 +2219,28 @@ CMenuManager::DrawFrontEndNormal()
RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void*)rwTEXTUREADDRESSCLAMP);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
switch (m_nCurrScreen) {
- case MENUPAGE_SKIN_SELECT:
- DrawPlayerSetupScreen();
- break;
- case MENUPAGE_KEYBOARD_CONTROLS:
- DrawControllerSetupScreen();
- break;
- default:
- Draw();
- break;
+ case MENUPAGE_SKIN_SELECT:
+ DrawPlayerSetupScreen();
+ break;
+ case MENUPAGE_KEYBOARD_CONTROLS:
+ DrawControllerSetupScreen();
+ break;
+ default:
+ Draw();
+ break;
}
-#define optionWidth MENU_X(66.0f)
-#define rawOptionHeight 22.0f
-#define optionBottom SCREEN_SCALE_FROM_BOTTOM(20.0f)
-#define optionTop SCREEN_SCALE_FROM_BOTTOM(20.0f + rawOptionHeight)
-#define leftPadding MENU_X_LEFT_ALIGNED(90.0f)
- wchar* str;
+ #define optionWidth MENU_X(66.0f)
+ #define rawOptionHeight 22.0f
+ #define optionBottom SCREEN_SCALE_FROM_BOTTOM(20.0f)
+ #define optionTop SCREEN_SCALE_FROM_BOTTOM(20.0f + rawOptionHeight)
+ #define leftPadding MENU_X_LEFT_ALIGNED(90.0f)
+ wchar *str;
hoveredBottomBarOption = -1;
if (curBottomBarOption != -1) {
// This active tab sprite is needlessly big
- m_aFrontEndSprites[FE2_TABACTIVE].Draw(CRect(leftPadding - MENU_X(2.0f) + (optionWidth)*curBottomBarOption, optionTop,
+ m_aFrontEndSprites[FE2_TABACTIVE].Draw(CRect(leftPadding - MENU_X(2.0f) + (optionWidth) * curBottomBarOption, optionTop,
leftPadding - MENU_X(5.0f) + optionWidth * (curBottomBarOption + 2), optionBottom + MENU_Y(rawOptionHeight - 9.0f)),
CRGBA(CRGBA(255, 255, 255, 255)));
@@ -2302,23 +2255,23 @@ CMenuManager::DrawFrontEndNormal()
if (hoveredBottomBarOption == i && hoveredBottomBarOption != curBottomBarOption)
CFont::SetColor(CRGBA(235, 170, 50, 255));
else {
- if (bottomBarActive || curBottomBarOption == i)
+ if(bottomBarActive || curBottomBarOption == i)
CFont::SetColor(CRGBA(0, 0, 0, 255));
else
CFont::SetColor(CRGBA(0, 0, 0, 110));
}
str = TheText.Get(bbNames[i].name);
-
+
CFont::PrintString(xStart + MENU_X(4.0f), SCREEN_SCALE_FROM_BOTTOM(39.0f), str);
-
+
}
}
-#undef optionBottom
-#undef optionTop
-#undef leftPadding
-#undef optionWidth
-#undef rawOptionHeight
+ #undef optionBottom
+ #undef optionTop
+ #undef leftPadding
+ #undef optionWidth
+ #undef rawOptionHeight
CFont::DrawFonts();
@@ -2335,12 +2288,11 @@ CMenuManager::DrawFrontEndNormal()
mouse.Translate(m_nMousePosX, m_nMousePosY);
shad.Translate(m_nMousePosX, m_nMousePosY);
- if (field_518 == 4) {
+ if(field_518 == 4){
m_aFrontEndSprites[MENUSPRITE_MOUSET].Draw(shad, CRGBA(100, 100, 100, 50));
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
m_aFrontEndSprites[MENUSPRITE_MOUSET].Draw(mouse, CRGBA(255, 255, 255, 255));
- }
- else {
+ }else{
m_aFrontEndSprites[MENUSPRITE_MOUSE].Draw(shad, CRGBA(100, 100, 100, 50));
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
m_aFrontEndSprites[MENUSPRITE_MOUSE].Draw(mouse, CRGBA(255, 255, 255, 255));
@@ -2356,7 +2308,7 @@ CMenuManager::DrawFrontEndNormal()
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR);
LoadSplash(nil);
-
+
eMenuSprites previousSprite = MENUSPRITE_BACKGROUND;
if (m_nMenuFadeAlpha < 255) {
@@ -2372,29 +2324,29 @@ CMenuManager::DrawFrontEndNormal()
eMenuSprites currentSprite = MENUSPRITE_BACKGROUND; // actually uninitialized
switch (m_nCurrScreen) {
- case MENUPAGE_STATS:
- case MENUPAGE_START_MENU:
- case MENUPAGE_PAUSE_MENU:
- case MENUPAGE_NEW_GAME:
- case MENUPAGE_CHOOSE_LOAD_SLOT:
- case MENUPAGE_CHOOSE_DELETE_SLOT:
- case MENUPAGE_NEW_GAME_RELOAD:
- case MENUPAGE_LOAD_SLOT_CONFIRM:
- case MENUPAGE_DELETE_SLOT_CONFIRM:
- case MENUPAGE_EXIT:
- case MENUPAGE_MULTIPLAYER_MAIN:
- case MENUPAGE_MULTIPLAYER_MAP:
- case MENUPAGE_MULTIPLAYER_FIND_GAME:
- case MENUPAGE_SKIN_SELECT:
- case MENUPAGE_KEYBOARD_CONTROLS:
- case MENUPAGE_MOUSE_CONTROLS:
- case MENUPAGE_MULTIPLAYER_CONNECTION:
- case MENUPAGE_MULTIPLAYER_MODE:
- case MENUPAGE_MULTIPLAYER_CREATE:
- case MENUPAGE_SKIN_SELECT_OLD:
- case MENUPAGE_OPTIONS:
- currentSprite = MENUSPRITE_BACKGROUND;
- break;
+ case MENUPAGE_STATS:
+ case MENUPAGE_START_MENU:
+ case MENUPAGE_PAUSE_MENU:
+ case MENUPAGE_NEW_GAME:
+ case MENUPAGE_CHOOSE_LOAD_SLOT:
+ case MENUPAGE_CHOOSE_DELETE_SLOT:
+ case MENUPAGE_NEW_GAME_RELOAD:
+ case MENUPAGE_LOAD_SLOT_CONFIRM:
+ case MENUPAGE_DELETE_SLOT_CONFIRM:
+ case MENUPAGE_EXIT:
+ case MENUPAGE_MULTIPLAYER_MAIN:
+ case MENUPAGE_MULTIPLAYER_MAP:
+ case MENUPAGE_MULTIPLAYER_FIND_GAME:
+ case MENUPAGE_SKIN_SELECT:
+ case MENUPAGE_KEYBOARD_CONTROLS:
+ case MENUPAGE_MOUSE_CONTROLS:
+ case MENUPAGE_MULTIPLAYER_CONNECTION:
+ case MENUPAGE_MULTIPLAYER_MODE:
+ case MENUPAGE_MULTIPLAYER_CREATE:
+ case MENUPAGE_SKIN_SELECT_OLD:
+ case MENUPAGE_OPTIONS:
+ currentSprite = MENUSPRITE_BACKGROUND;
+ break;
}
if (m_nMenuFadeAlpha < 255) {
@@ -2410,25 +2362,23 @@ CMenuManager::DrawFrontEndNormal()
#else
static uint32 LastFade = 0;
- if (CTimer::GetTimeInMillisecondsPauseMode() - LastFade > 10) {
+ if(CTimer::GetTimeInMillisecondsPauseMode() - LastFade > 10){
m_nMenuFadeAlpha += 20;
LastFade = CTimer::GetTimeInMillisecondsPauseMode();
}
#endif
-
- if (m_nMenuFadeAlpha > 255) {
+
+ if (m_nMenuFadeAlpha > 255){
m_aFrontEndSprites[currentSprite].Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, 255));
- }
- else {
+ } else {
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
m_aFrontEndSprites[currentSprite].Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, m_nMenuFadeAlpha));
}
- }
- else {
+ } else {
m_aFrontEndSprites[currentSprite].Draw(CRect(0.0f, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT), CRGBA(255, 255, 255, 255));
// TODO: what is this? waiting mouse?
- if (field_518 == 4) {
- if (m_nHoverOption == HOVEROPTION_3 || m_nHoverOption == HOVEROPTION_4 ||
+ if(field_518 == 4){
+ if(m_nHoverOption == HOVEROPTION_3 || m_nHoverOption == HOVEROPTION_4 ||
m_nHoverOption == HOVEROPTION_5 || m_nHoverOption == HOVEROPTION_6 || m_nHoverOption == HOVEROPTION_7)
field_518 = 2;
@@ -2456,15 +2406,15 @@ CMenuManager::DrawFrontEndNormal()
RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void*)rwTEXTUREADDRESSCLAMP);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
switch (m_nCurrScreen) {
- case MENUPAGE_SKIN_SELECT:
- DrawPlayerSetupScreen();
- break;
- case MENUPAGE_KEYBOARD_CONTROLS:
- DrawControllerSetupScreen();
- break;
- default:
- Draw();
- break;
+ case MENUPAGE_SKIN_SELECT:
+ DrawPlayerSetupScreen();
+ break;
+ case MENUPAGE_KEYBOARD_CONTROLS:
+ DrawControllerSetupScreen();
+ break;
+ default:
+ Draw();
+ break;
}
CFont::DrawFonts();
@@ -2482,12 +2432,11 @@ CMenuManager::DrawFrontEndNormal()
mouse.Translate(m_nMousePosX, m_nMousePosY);
shad.Translate(m_nMousePosX, m_nMousePosY);
- if (field_518 == 4) {
+ if(field_518 == 4){
m_aFrontEndSprites[MENUSPRITE_MOUSE].Draw(shad, CRGBA(100, 100, 100, 50));
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
m_aFrontEndSprites[MENUSPRITE_MOUSE].Draw(mouse, CRGBA(255, 255, 255, 255));
- }
- else {
+ }else{
m_aFrontEndSprites[MENUSPRITE_MOUSE].Draw(shad, CRGBA(100, 100, 100, 50));
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
m_aFrontEndSprites[MENUSPRITE_MOUSE].Draw(mouse, CRGBA(255, 255, 255, 255));
@@ -2511,7 +2460,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(SCREEN_SCALE_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get("FET_PS"));
// lstrcpy's changed with strcpy
@@ -2592,18 +2541,17 @@ CMenuManager::DrawPlayerSetupScreen()
}
}
}
- }
+ }
OutputDebugString("Finished enumerating skin files.");
m_bSkinsEnumerated = true;
- }
+ }
CSprite2d::DrawRect(CRect(MENU_X_LEFT_ALIGNED(PLAYERSETUP_LIST_LEFT), MENU_Y(PLAYERSETUP_LIST_TOP),
MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM)), CRGBA(200, 200, 50, FadeIn(50)));
// Header (Skin - Date)
if (m_nCurrExLayer == HOVEROPTION_LIST) {
CFont::SetColor(CRGBA(255, 217, 106, FadeIn(255)));
- }
- else {
+ } else {
CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255)));
}
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
@@ -2611,13 +2559,13 @@ CMenuManager::DrawPlayerSetupScreen()
CFont::SetRightJustifyOn();
CFont::PrintString(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_DATE_COLUMN_RIGHT), MENU_Y(PLAYERSETUP_LIST_TOP), TheText.Get("FES_DAT"));
switch (m_PrefsLanguage) {
- case LANGUAGE_FRENCH:
- case LANGUAGE_SPANISH:
- CFont::SetScale(MENU_X(0.6f), MENU_Y(MENUACTION_SCALE_MULT));
- break;
- default:
- CFont::SetScale(MENU_X(MENUACTION_SCALE_MULT), MENU_Y(MENUACTION_SCALE_MULT));
- break;
+ case LANGUAGE_FRENCH:
+ case LANGUAGE_SPANISH:
+ CFont::SetScale(MENU_X(0.6f), MENU_Y(MENUACTION_SCALE_MULT));
+ break;
+ default:
+ CFont::SetScale(MENU_X(MENUACTION_SCALE_MULT), MENU_Y(MENUACTION_SCALE_MULT));
+ break;
}
CFont::SetRightJustifyOff();
CFont::PrintString(MENU_X_LEFT_ALIGNED(PLAYERSETUP_SKIN_COLUMN_LEFT), MENU_Y(PLAYERSETUP_LIST_TOP), TheText.Get("FES_SKN"));
@@ -2634,7 +2582,7 @@ CMenuManager::DrawPlayerSetupScreen()
int orderInVisibles = 0;
int rowEndY = PLAYERSETUP_LIST_BODY_TOP + PLAYERSETUP_ROW_HEIGHT + 1;
int rowStartY = PLAYERSETUP_LIST_BODY_TOP;
- for (int rowIdx = m_nFirstVisibleRowOnList;
+ for (int rowIdx = m_nFirstVisibleRowOnList;
rowIdx < m_nFirstVisibleRowOnList + MAX_VISIBLE_LIST_ROW && m_pSelectedSkin; ) {
if (m_nMousePosX > MENU_X_LEFT_ALIGNED(PLAYERSETUP_LIST_LEFT) && m_nMousePosX < MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT)) {
@@ -2652,8 +2600,7 @@ CMenuManager::DrawPlayerSetupScreen()
CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile);
SaveSettings();
}
- }
- else {
+ } else {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
m_nCurrExLayer = HOVEROPTION_LIST;
m_nSelectedListRow = rowIdx;
@@ -2672,11 +2619,9 @@ CMenuManager::DrawPlayerSetupScreen()
CWorld::Players[0].SetPlayerSkin(m_aSkinName);
}
lastSelectedSkin = m_nSelectedListRow;
- }
- else if (!strcmp(m_PrefsSkinFile, m_pSelectedSkin->skinNameOriginal)) {
+ } else if (!strcmp(m_PrefsSkinFile, m_pSelectedSkin->skinNameOriginal)) {
CFont::SetColor(CRGBA(255, 255, 155, FadeIn(255)));
- }
- else {
+ } else {
CFont::SetColor(CRGBA(155, 155, 155, FadeIn(255)));
}
wchar unicodeTemp[80];
@@ -2702,9 +2647,9 @@ CMenuManager::DrawPlayerSetupScreen()
// Scrollbar background
CSprite2d::DrawRect(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2), MENU_Y(PLAYERSETUP_LIST_TOP),
MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2 - PLAYERSETUP_SCROLLBAR_WIDTH), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM)), CRGBA(100, 100, 66, FadeIn(205)));
-
+
// Scrollbar
- float scrollbarHeight = SCROLLBAR_MAX_HEIGHT / m_nSkinsTotal * (float)MAX_VISIBLE_LIST_ROW;
+ float scrollbarHeight = SCROLLBAR_MAX_HEIGHT / m_nSkinsTotal * (float) MAX_VISIBLE_LIST_ROW;
float scrollbarBottom, scrollbarTop;
if (m_nSkinsTotal <= MAX_VISIBLE_LIST_ROW) {
scrollbarBottom = SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM + PLAYERSETUP_SCROLLBUTTON_HEIGHT + 4.0f);
@@ -2713,8 +2658,7 @@ CMenuManager::DrawPlayerSetupScreen()
// Shadow
CSprite2d::DrawRect(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 4), scrollbarTop,
MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 1 - PLAYERSETUP_SCROLLBAR_WIDTH), scrollbarBottom + MENU_Y(1.0f)), CRGBA(50, 50, 50, FadeIn(255)));
- }
- else {
+ } else {
#ifdef FIX_BUGS
scrollbarBottom = MENU_Y(PLAYERSETUP_LIST_BODY_TOP - 8 + m_nScrollbarTopMargin + scrollbarHeight);
scrollbarTop = MENU_Y(PLAYERSETUP_LIST_BODY_TOP + m_nScrollbarTopMargin);
@@ -2745,8 +2689,7 @@ CMenuManager::DrawPlayerSetupScreen()
MENU_X_RIGHT_ALIGNED(-20.0f), MENU_Y(PLAYERSETUP_LIST_TOP + 58)),
CRGBA(255, 255, 255, FadeIn(255)));
#endif
- }
- else {
+ } else {
#ifdef FIX_BUGS
m_aFrontEndSprites[MENUSPRITE_UPOFF].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3), MENU_Y(PLAYERSETUP_LIST_TOP),
MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3 - PLAYERSETUP_SCROLLBUTTON_TXD_DIMENSION), MENU_Y(PLAYERSETUP_LIST_TOP + PLAYERSETUP_SCROLLBUTTON_TXD_DIMENSION)),
@@ -2765,11 +2708,10 @@ CMenuManager::DrawPlayerSetupScreen()
CRGBA(255, 255, 255, FadeIn(255)));
#else
m_aFrontEndSprites[MENUSPRITE_DOWNON].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2), SCREEN_SCALE_FROM_BOTTOM(141.0f),
- MENU_X_RIGHT_ALIGNED(-20.0f), SCREEN_SCALE_FROM_BOTTOM(83.0f)),
+ MENU_X_RIGHT_ALIGNED(-20.0f), SCREEN_SCALE_FROM_BOTTOM(83.0f)),
CRGBA(255, 255, 255, FadeIn(255)));
#endif
- }
- else {
+ } else {
#ifdef FIX_BUGS
m_aFrontEndSprites[MENUSPRITE_DOWNOFF].Draw(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM + PLAYERSETUP_SCROLLBUTTON_HEIGHT + 1),
MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3 - PLAYERSETUP_SCROLLBUTTON_TXD_DIMENSION), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM + PLAYERSETUP_SCROLLBUTTON_HEIGHT + 1 - PLAYERSETUP_SCROLLBUTTON_TXD_DIMENSION)),
@@ -2787,19 +2729,19 @@ CMenuManager::DrawPlayerSetupScreen()
if (strcmp(m_aSkinName, m_PrefsSkinFile) != 0) {
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
switch (m_PrefsLanguage) {
- case LANGUAGE_FRENCH:
- CFont::SetScale(MENU_X(1.1f), MENU_Y(1.9f));
- break;
- case LANGUAGE_GERMAN:
- CFont::SetScale(MENU_X(0.85f), MENU_Y(1.9f));
- break;
- case LANGUAGE_ITALIAN:
- case LANGUAGE_SPANISH:
- CFont::SetScale(MENU_X(1.4f), MENU_Y(1.9f));
- break;
- default:
- CFont::SetScale(MENU_X(1.9f), MENU_Y(1.9f));
- break;
+ case LANGUAGE_FRENCH:
+ CFont::SetScale(MENU_X(1.1f), MENU_Y(1.9f));
+ break;
+ case LANGUAGE_GERMAN:
+ CFont::SetScale(MENU_X(0.85f), MENU_Y(1.9f));
+ break;
+ case LANGUAGE_ITALIAN:
+ case LANGUAGE_SPANISH:
+ CFont::SetScale(MENU_X(1.4f), MENU_Y(1.9f));
+ break;
+ default:
+ CFont::SetScale(MENU_X(1.9f), MENU_Y(1.9f));
+ break;
}
CFont::SetColor(CRGBA(255, 217, 106, FadeIn(120)));
CFont::SetRightJustifyOff();
@@ -2819,8 +2761,7 @@ CMenuManager::DrawPlayerSetupScreen()
m_nHoverOption = HOVEROPTION_BACK;
- }
- else if ((strcmp(m_aSkinName, m_PrefsSkinFile) != 0
+ } else if ((strcmp(m_aSkinName, m_PrefsSkinFile) != 0
&& m_nMousePosX > MENU_X_LEFT_ALIGNED(PLAYERSETUP_LIST_LEFT)
&& m_nMousePosX < MENU_X_LEFT_ALIGNED(PLAYERSETUP_LIST_LEFT) + CFont::GetStringWidth(TheText.Get("FES_SET"), true)
&& m_nMousePosY > SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM - 3)
@@ -2831,35 +2772,31 @@ CMenuManager::DrawPlayerSetupScreen()
m_nHoverOption = HOVEROPTION_USESKIN;
- }
- else if (m_nMousePosX > MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2)
+ } else if (m_nMousePosX > MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2)
&& m_nMousePosX < MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - PLAYERSETUP_SCROLLBAR_WIDTH - 2)
&& m_nMousePosY > MENU_Y(PLAYERSETUP_LIST_TOP)
&& m_nMousePosY < MENU_Y(PLAYERSETUP_LIST_BODY_TOP - 3)) {
if (m_nHoverOption != HOVEROPTION_CLICKED_SCROLL_UP && m_nHoverOption != HOVEROPTION_CLICKED_SCROLL_DOWN)
m_nHoverOption = HOVEROPTION_OVER_SCROLL_UP;
- }
- else if (m_nMousePosX > MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2)
+ } else if (m_nMousePosX > MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2)
&& m_nMousePosX < MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - PLAYERSETUP_SCROLLBAR_WIDTH - 2)
&& m_nMousePosY > SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM + PLAYERSETUP_SCROLLBUTTON_HEIGHT + 1)
&& m_nMousePosY < SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM)) {
if (m_nHoverOption != HOVEROPTION_CLICKED_SCROLL_UP && m_nHoverOption != HOVEROPTION_CLICKED_SCROLL_DOWN)
m_nHoverOption = HOVEROPTION_OVER_SCROLL_DOWN;
- }
- else if (m_nMousePosX > MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2)
+ } else if (m_nMousePosX > MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2)
&& m_nMousePosX < MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - PLAYERSETUP_SCROLLBAR_WIDTH - 2)
- && m_nMousePosY > MENU_Y(PLAYERSETUP_LIST_BODY_TOP - 3)
+ && m_nMousePosY > MENU_Y(PLAYERSETUP_LIST_BODY_TOP - 3)
#ifdef FIX_BUGS
- && m_nMousePosY < MENU_Y(PLAYERSETUP_LIST_BODY_TOP + m_nScrollbarTopMargin)) {
+ && m_nMousePosY < MENU_Y(PLAYERSETUP_LIST_BODY_TOP + m_nScrollbarTopMargin)) {
#else
- && m_nMousePosY < MENU_Y(SCROLLBAR_MAX_HEIGHT / m_nTotalListRow + PLAYERSETUP_LIST_BODY_TOP - 3 + m_nScrollbarTopMargin)) {
+ && m_nMousePosY < MENU_Y(SCROLLBAR_MAX_HEIGHT / m_nTotalListRow + PLAYERSETUP_LIST_BODY_TOP - 3 + m_nScrollbarTopMargin)) {
#endif
m_nHoverOption = HOVEROPTION_PAGEUP;
- }
- else if (m_nMousePosX > MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2)
+ } else if (m_nMousePosX > MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 2)
&& m_nMousePosX < MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - PLAYERSETUP_SCROLLBAR_WIDTH - 2)
#ifdef FIX_BUGS
&& m_nMousePosY > MENU_Y(PLAYERSETUP_LIST_BODY_TOP - 8 + m_nScrollbarTopMargin + scrollbarHeight)
@@ -2869,8 +2806,7 @@ CMenuManager::DrawPlayerSetupScreen()
&& m_nMousePosY < SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM + PLAYERSETUP_SCROLLBUTTON_HEIGHT + 1)) {
m_nHoverOption = HOVEROPTION_PAGEDOWN;
- }
- else if (m_nMousePosX > MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 4)
+ } else if (m_nMousePosX > MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 4)
&& m_nMousePosX < MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - PLAYERSETUP_SCROLLBAR_WIDTH)
#ifdef FIX_BUGS
&& m_nMousePosY > MENU_Y(PLAYERSETUP_LIST_BODY_TOP + m_nScrollbarTopMargin)
@@ -2881,16 +2817,14 @@ CMenuManager::DrawPlayerSetupScreen()
#endif
m_nHoverOption = HOVEROPTION_HOLDING_SCROLLBAR;
- }
- else if (m_nMousePosX > MENU_X_LEFT_ALIGNED(PLAYERSETUP_LIST_LEFT) && m_nMousePosX < MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT)
+ } else if (m_nMousePosX > MENU_X_LEFT_ALIGNED(PLAYERSETUP_LIST_LEFT) && m_nMousePosX < MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT)
&& m_nMousePosY > MENU_Y(PLAYERSETUP_LIST_BODY_TOP + 1) && m_nMousePosY < SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM)) {
m_nHoverOption = HOVEROPTION_LIST;
- }
- else {
+ } else {
m_nHoverOption = HOVEROPTION_NOT_HOVERING;
}
- }
+ }
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
CFont::SetScale(MENU_X(SMALLTEXT_X_SCALE), MENU_Y(SMALLTEXT_Y_SCALE));
CFont::SetRightJustifyOn();
@@ -2901,8 +2835,7 @@ CMenuManager::DrawPlayerSetupScreen()
CFont::PrintString(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3 - i), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM - 5 - i), TheText.Get("FEDS_TB"));
if (m_nHoverOption == HOVEROPTION_BACK) {
CFont::SetColor(CRGBA(255, 217, 106, FadeIn(255)));
- }
- else {
+ } else {
CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255)));
}
}
@@ -2914,16 +2847,14 @@ CMenuManager::DrawPlayerSetupScreen()
CFont::PrintString(MENU_X_LEFT_ALIGNED(i + PLAYERSETUP_LIST_LEFT), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM - 5 - i), TheText.Get("FES_SET"));
if (!strcmp(m_aSkinName, m_PrefsSkinFile)) {
CFont::SetColor(CRGBA(155, 117, 6, FadeIn(255)));
- }
- else if (m_nHoverOption == HOVEROPTION_USESKIN) {
+ } else if (m_nHoverOption == HOVEROPTION_USESKIN) {
CFont::SetColor(CRGBA(255, 217, 106, FadeIn(255)));
- }
- else {
+ } else {
CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255)));
}
}
- }
+}
int
CMenuManager::FadeIn(int alpha)
@@ -2937,28 +2868,27 @@ CMenuManager::FadeIn(int alpha)
}
void
-CMenuManager::FilterOutColorMarkersFromString(wchar * str, CRGBA & newColor)
+CMenuManager::FilterOutColorMarkersFromString(wchar *str, CRGBA &newColor)
{
int newIdx = 0;
- wchar copy[256], * c;
+ wchar copy[256], *c;
UnicodeStrcpy(copy, str);
for (c = copy; *c != '\0'; c++) {
if (*c == '~') {
c++;
switch (*c) {
- case 'b': newColor = CRGBA(40, 40, 255, 255); break;
- case 'g': newColor = CRGBA(40, 235, 40, 255); break;
+ case 'b': newColor = CRGBA(40, 40, 255, 255); break;
+ case 'g': newColor = CRGBA(40, 235, 40, 255); break;
// There is no case for "h", is that a mistake?
- case 'l': newColor = CRGBA(0, 0, 0, 255); break;
- case 'p': newColor = CRGBA(255, 0, 255, 255); break;
- case 'r': newColor = CRGBA(255, 0, 0, 255); break;
- case 'w': newColor = CRGBA(255, 255, 255, 255); break;
- case 'y': newColor = CRGBA(255, 255, 0, 255); break;
+ case 'l': newColor = CRGBA(0, 0, 0, 255); break;
+ case 'p': newColor = CRGBA(255, 0, 255, 255); break;
+ case 'r': newColor = CRGBA(255, 0, 0, 255); break;
+ case 'w': newColor = CRGBA(255, 255, 255, 255); break;
+ case 'y': newColor = CRGBA(255, 255, 0, 255); break;
}
while (*c != '~') c++;
- }
- else {
+ } else {
str[newIdx++] = *c;
}
}
@@ -2970,17 +2900,17 @@ CMenuManager::GetStartOptionsCntrlConfigScreens()
{
int number = 0;
switch (m_nCurrScreen) {
- case MENUPAGE_CONTROLLER_PC_OLD3:
- number = 34;
- break;
- case MENUPAGE_CONTROLLER_DEBUG:
- number = 35;
- break;
- case MENUPAGE_KEYBOARD_CONTROLS:
- number = 0;
- break;
- default:
- break;
+ case MENUPAGE_CONTROLLER_PC_OLD3:
+ number = 34;
+ break;
+ case MENUPAGE_CONTROLLER_DEBUG:
+ number = 35;
+ break;
+ case MENUPAGE_KEYBOARD_CONTROLS:
+ number = 0;
+ break;
+ default:
+ break;
}
return number;
}
@@ -3051,10 +2981,9 @@ CMenuManager::LoadAllTextures()
if (DMAudio.IsMP3RadioChannelAvailable()) {
if (m_PrefsRadioStation > USERTRACK)
m_PrefsRadioStation = CGeneral::GetRandomNumber() % 10;
- }
- else if (m_PrefsRadioStation > CHATTERBOX)
+ } else if (m_PrefsRadioStation > CHATTERBOX)
m_PrefsRadioStation = CGeneral::GetRandomNumber() % 9;
-
+
CFileMgr::SetDir("");
//CFileMgr::SetDir("");
CTimer::Stop();
@@ -3064,7 +2993,7 @@ CMenuManager::LoadAllTextures()
CTxdStore::PushCurrentTxd();
int frontendTxdSlot1 = CTxdStore::FindTxdSlot("frontend1");
- if (frontendTxdSlot1 == -1)
+ if(frontendTxdSlot1 == -1)
frontendTxdSlot1 = CTxdStore::AddTxdSlot("frontend1");
printf("LOAD frontend1\n");
@@ -3146,7 +3075,7 @@ CMenuManager::LoadSettings()
CFileMgr::Read(fileHandle, (char*)&m_nPrefsDepth, sizeof(m_nPrefsDepth));
CFileMgr::Read(fileHandle, (char*)&m_nPrefsWindowed, sizeof(m_nPrefsWindowed));
CFileMgr::Read(fileHandle, (char*)&m_nPrefsSubsystem, sizeof(m_nPrefsSubsystem));
- if (m_nPrefsWindowed != 0 && m_nPrefsWindowed != 1) {
+ if(m_nPrefsWindowed != 0 && m_nPrefsWindowed != 1){
// garbage data from vanilla settings file
// let skeleton find something
m_nPrefsWidth = 0;
@@ -3215,7 +3144,7 @@ CMenuManager::LoadSettings()
}
WIN32_FIND_DATA FindFileData;
- char skinfile[256 + 16]; // Stack analysis shows 16 bits gap, but I don't trust it. It may very well be MAX_PATH(260).
+ char skinfile[256+16]; // Stack analysis shows 16 bits gap, but I don't trust it. It may very well be MAX_PATH(260).
bool SkinFound = false;
HANDLE handle = FindFirstFile("skins\\*.bmp", &FindFileData);
for (int i = 1; handle != INVALID_HANDLE_VALUE && i; i = FindNextFile(handle, &FindFileData)) {
@@ -3293,9 +3222,9 @@ bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 Bo
void DoRWStuffEndOfFrame(void);
void
-CMenuManager::MessageScreen(const char* text)
+CMenuManager::MessageScreen(const char *text)
{
- CSprite2d* splash = LoadSplash(nil);
+ CSprite2d *splash = LoadSplash(nil);
if (!DoRWStuffStartOfFrame(0, 0, 0, 0, 0, 0, 255))
return;
@@ -3351,7 +3280,7 @@ CMenuManager::PrintBriefs()
float nextY = BRIEFS_TOP_MARGIN;
CRGBA newColor;
for (int i = 4; i >= 0; i--) {
- tPreviousBrief& brief = CMessages::PreviousBriefs[i];
+ tPreviousBrief &brief = CMessages::PreviousBriefs[i];
if (brief.m_pText) {
CMessages::InsertNumberInString(brief.m_pText,
brief.m_nNumber[0], brief.m_nNumber[1],
@@ -3432,8 +3361,7 @@ CMenuManager::PrintStats()
if (CPad::GetPad(0)->GetLeftMouse()) {
scrollY += (m_nMouseOldPosY - m_nMousePosY);
lastChange = CTimer::GetTimeInMillisecondsPauseMode();
- }
- else {
+ } else {
scrollY += MENU_Y(STATS_SLIDE_Y_PER_SECOND) / 1000.0f * (CTimer::GetTimeInMillisecondsPauseMode() - lastChange);
lastChange = CTimer::GetTimeInMillisecondsPauseMode();
}
@@ -3459,15 +3387,13 @@ CMenuManager::PrintStats()
else
alphaMult = (y - MENU_Y(STATS_BOTTOM_MARGIN)) / MENU_Y(STATS_TOP_DIMMING_AREA_LENGTH);
- // About to dim from bottom
- }
- else if (y > SCREEN_SCALE_FROM_BOTTOM(STATS_TOP_DIMMING_AREA_LENGTH) - MENU_Y(STATS_BOTTOM_DIMMING_AREA_LENGTH)) {
+ // About to dim from bottom
+ } else if (y > SCREEN_SCALE_FROM_BOTTOM(STATS_TOP_DIMMING_AREA_LENGTH) - MENU_Y(STATS_BOTTOM_DIMMING_AREA_LENGTH)) {
if ((SCREEN_SCALE_FROM_BOTTOM(STATS_BOTTOM_DIMMING_AREA_LENGTH) - y) / MENU_Y(STATS_TOP_DIMMING_AREA_LENGTH) < 0.0f)
alphaMult = 0.0f;
else
alphaMult = (SCREEN_SCALE_FROM_BOTTOM(STATS_BOTTOM_DIMMING_AREA_LENGTH) - y) / MENU_Y(STATS_TOP_DIMMING_AREA_LENGTH);
- }
- else
+ } else
alphaMult = 1.0f;
CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255.0f * alphaMult)));
@@ -3541,7 +3467,7 @@ CMenuManager::Process(void)
SlotPopulated = true;
}
- if (SlotPopulated)
+ if (SlotPopulated)
ChangeScreen(MENUPAGE_DELETE_SUCCESS, 0, true, false);
else
SaveLoadFileError_SetUpErrorScreen();
@@ -3567,8 +3493,7 @@ CMenuManager::Process(void)
DMAudio.SetEffectsFadeVol(0);
DMAudio.SetMusicFadeVol(0);
DMAudio.ResetTimers(CTimer::GetTimeInMilliseconds());
- }
- else
+ } else
SaveLoadFileError_SetUpErrorScreen();
}
@@ -3618,14 +3543,12 @@ CMenuManager::Process(void)
m_bWaitingForNewKeyBind = false;
m_KeyPressedCode = -1;
m_bStartWaitingForKeyBind = false;
- }
- else if (!m_bKeyChangeNotProcessed) {
+ } else if (!m_bKeyChangeNotProcessed) {
if (*pControlEdit != rsNULL || MouseButtonJustClicked || JoyButtonJustClicked)
CheckCodesForControls(TypeOfControl);
field_535 = true;
- }
- else {
+ } else {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
for (int i = 0; i < 4; i++)
ControlsManager.ClearSettingsAssociatedWithAction((e_ControllerAction)m_CurrCntrlAction, (eControllerType)i);
@@ -3650,8 +3573,7 @@ CMenuManager::Process(void)
TimeToStopPadShaking = 0;
}
- }
- else {
+ } else {
UnloadTextures();
m_bRenderGameInMenu = false;
// byte_5F33E4 = 1; // unused
@@ -3720,8 +3642,7 @@ CMenuManager::ProcessButtonPresses(void)
m_bKeyChangeNotProcessed = true;
pControlEdit = &m_KeyPressedCode;
}
- }
- else {
+ } else {
field_535 = false;
}
@@ -3740,15 +3661,15 @@ CMenuManager::ProcessButtonPresses(void)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
m_bShowMouse = false;
switch (m_nCurrExLayer) {
- case HOVEROPTION_BACK:
- default:
- m_nCurrExLayer = HOVEROPTION_LIST;
- break;
- case HOVEROPTION_LIST:
- m_nCurrExLayer = HOVEROPTION_USESKIN;
- break;
- case HOVEROPTION_USESKIN:
- m_nCurrExLayer = HOVEROPTION_BACK;
+ case HOVEROPTION_BACK:
+ default:
+ m_nCurrExLayer = HOVEROPTION_LIST;
+ break;
+ case HOVEROPTION_LIST:
+ m_nCurrExLayer = HOVEROPTION_USESKIN;
+ break;
+ case HOVEROPTION_USESKIN:
+ m_nCurrExLayer = HOVEROPTION_BACK;
}
if (((m_nCurrScreen == MENUPAGE_SKIN_SELECT) && (m_nCurrExLayer == HOVEROPTION_USESKIN)) && strcmp(m_aSkinName, m_PrefsSkinFile) == 0) {
m_nCurrExLayer = HOVEROPTION_BACK;
@@ -3762,8 +3683,7 @@ CMenuManager::ProcessButtonPresses(void)
if (CPad::GetPad(0)->GetUp() || CPad::GetPad(0)->GetAnaloguePadUp() || CPad::GetPad(0)->GetDPadUpJustDown()) {
m_bShowMouse = false;
pressed = true;
- }
- else if (CPad::GetPad(0)->GetMouseWheelUpJustUp()) {
+ } else if (CPad::GetPad(0)->GetMouseWheelUpJustUp()) {
m_bShowMouse = true;
pressed = true;
}
@@ -3777,8 +3697,7 @@ CMenuManager::ProcessButtonPresses(void)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
ScrollUpListByOne();
}
- }
- else {
+ } else {
m_bPressedUpOnList = false;
}
@@ -3786,8 +3705,7 @@ CMenuManager::ProcessButtonPresses(void)
if (CPad::GetPad(0)->GetDown() || CPad::GetPad(0)->GetAnaloguePadDown() || CPad::GetPad(0)->GetDPadDownJustDown()) {
m_bShowMouse = false;
pressed = true;
- }
- else if (CPad::GetPad(0)->GetMouseWheelDownJustDown()) {
+ } else if (CPad::GetPad(0)->GetMouseWheelDownJustDown()) {
m_bShowMouse = true;
pressed = true;
}
@@ -3801,16 +3719,14 @@ CMenuManager::ProcessButtonPresses(void)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
ScrollDownListByOne();
}
- }
- else {
+ } else {
m_bPressedDownOnList = false;
}
if (m_nCurrScreen != MENUPAGE_KEYBOARD_CONTROLS) {
if (!CPad::GetPad(0)->GetPageUp()) {
m_bPressedPgUpOnList = false;
- }
- else {
+ } else {
m_nCurrExLayer = HOVEROPTION_LIST;
if (!m_bPressedPgUpOnList) {
m_bPressedPgUpOnList = true;
@@ -3822,8 +3738,7 @@ CMenuManager::ProcessButtonPresses(void)
}
if (!CPad::GetPad(0)->GetPageDown()) {
m_bPressedPgDnOnList = false;
- }
- else {
+ } else {
m_nCurrExLayer = HOVEROPTION_LIST;
if (!m_bPressedPgDnOnList) {
m_bPressedPgDnOnList = true;
@@ -3864,53 +3779,50 @@ CMenuManager::ProcessButtonPresses(void)
if (CPad::GetPad(0)->GetLeftMouseJustDown()) {
switch (m_nHoverOption) {
- case HOVEROPTION_BACK:
- goBack = true;
- break;
- case HOVEROPTION_PAGEUP:
- PageUpList(true);
- break;
- case HOVEROPTION_PAGEDOWN:
- PageDownList(true);
- break;
- case HOVEROPTION_USESKIN:
- if (m_nSkinsTotal > 0) {
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
- m_pSelectedSkin = m_pSkinListHead.nextSkin;
- strcpy(m_PrefsSkinFile, m_aSkinName);
- CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile);
- SaveSettings();
- }
+ case HOVEROPTION_BACK:
+ goBack = true;
+ break;
+ case HOVEROPTION_PAGEUP:
+ PageUpList(true);
+ break;
+ case HOVEROPTION_PAGEDOWN:
+ PageDownList(true);
+ break;
+ case HOVEROPTION_USESKIN:
+ if (m_nSkinsTotal > 0) {
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
+ m_pSelectedSkin = m_pSkinListHead.nextSkin;
+ strcpy(m_PrefsSkinFile, m_aSkinName);
+ CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile);
+ SaveSettings();
+ }
}
}
if (CPad::GetPad(0)->GetLeftMouseJustDown()) {
switch (m_nHoverOption) {
- case HOVEROPTION_OVER_SCROLL_UP:
- m_nHoverOption = HOVEROPTION_CLICKED_SCROLL_UP;
- break;
- case HOVEROPTION_OVER_SCROLL_DOWN:
- m_nHoverOption = HOVEROPTION_CLICKED_SCROLL_DOWN;
- break;
- case HOVEROPTION_LIST:
- m_nHoverOption = HOVEROPTION_SKIN;
+ case HOVEROPTION_OVER_SCROLL_UP:
+ m_nHoverOption = HOVEROPTION_CLICKED_SCROLL_UP;
+ break;
+ case HOVEROPTION_OVER_SCROLL_DOWN:
+ m_nHoverOption = HOVEROPTION_CLICKED_SCROLL_DOWN;
+ break;
+ case HOVEROPTION_LIST:
+ m_nHoverOption = HOVEROPTION_SKIN;
}
- }
- else if ((CPad::GetPad(0)->GetLeftMouseJustUp())
+ } else if ((CPad::GetPad(0)->GetLeftMouseJustUp())
&& ((m_nHoverOption == HOVEROPTION_CLICKED_SCROLL_UP || (m_nHoverOption == HOVEROPTION_CLICKED_SCROLL_DOWN)))) {
m_nHoverOption = HOVEROPTION_NOT_HOVERING;
}
if (!CPad::GetPad(0)->GetLeftMouse()) {
holdingScrollBar = false;
- }
- else {
+ } else {
if ((m_nHoverOption == HOVEROPTION_HOLDING_SCROLLBAR) || holdingScrollBar) {
holdingScrollBar = true;
// TODO: This part is a bit hard to reverse. Not much code tho
assert(0 && "Holding scrollbar isn't done yet");
- }
- else {
+ } else {
switch (m_nHoverOption) {
case HOVEROPTION_OVER_SCROLL_UP:
case HOVEROPTION_CLICKED_SCROLL_UP:
@@ -3933,8 +3845,7 @@ CMenuManager::ProcessButtonPresses(void)
}
}
}
- }
- else if (isPlainTextScreen(m_nCurrScreen)) {
+ } else if (isPlainTextScreen(m_nCurrScreen)) {
#ifndef TIDY_UP_PBP
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetCrossJustDown() || CPad::GetPad(0)->GetLeftMouseJustDown()) {
optionSelected = true;
@@ -3945,14 +3856,12 @@ CMenuManager::ProcessButtonPresses(void)
}
}
#endif
- }
- else {
+ } else {
if (CPad::GetPad(0)->GetDownJustDown() || CPad::GetPad(0)->GetAnaloguePadDown() || CPad::GetPad(0)->GetDPadDownJustDown()) {
m_bShowMouse = false;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
goDown = true;
- }
- else if (CPad::GetPad(0)->GetUpJustDown() || CPad::GetPad(0)->GetAnaloguePadUp() || CPad::GetPad(0)->GetDPadUpJustDown()) {
+ } else if (CPad::GetPad(0)->GetUpJustDown() || CPad::GetPad(0)->GetAnaloguePadUp() || CPad::GetPad(0)->GetDPadUpJustDown()) {
m_bShowMouse = false;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
goUp = true;
@@ -3964,8 +3873,7 @@ CMenuManager::ProcessButtonPresses(void)
m_bShowMouse = false;
optionSelected = true;
}
- }
- else {
+ } else {
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetCrossJustDown()) {
m_bShowMouse = false;
optionSelected = true;
@@ -3981,10 +3889,9 @@ CMenuManager::ProcessButtonPresses(void)
#endif
(m_nHoverOption == HOVEROPTION_RANDOM_ITEM)) {
m_nCurrOption = m_nPrevOption;
- optionSelected = true;
+ optionSelected = true;
}
- }
- else if (CPad::GetPad(0)->GetLeftMouseJustDown()) {
+ } else if (CPad::GetPad(0)->GetLeftMouseJustDown()) {
#ifdef TIDY_UP_PBP
if (m_nHoverOption >= HOVEROPTION_RADIO_0 && m_nHoverOption <= HOVEROPTION_RADIO_9) {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
@@ -3993,8 +3900,7 @@ CMenuManager::ProcessButtonPresses(void)
DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
OutputDebugString("FRONTEND RADIO STATION CHANGED");
- }
- else if (m_nHoverOption == HOVEROPTION_RANDOM_ITEM
+ } else if (m_nHoverOption == HOVEROPTION_RANDOM_ITEM
&& aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action != MENUACTION_RESUME) {
m_nCurrOption = m_nPrevOption;
optionSelected = true;
@@ -4177,26 +4083,26 @@ CMenuManager::ProcessButtonPresses(void)
TheCamera.m_fMouseAccelVertical = TheCamera.m_fMouseAccelHorzntl;
SaveSettings();
break;
- }
+ }
#else
switch (m_nHoverOption) {
- case HOVEROPTION_INCREASE_BRIGHTNESS:
- case HOVEROPTION_INCREASE_DRAWDIST:
- case HOVEROPTION_INCREASE_MUSICVOLUME:
- case HOVEROPTION_INCREASE_SFXVOLUME:
- case HOVEROPTION_INCREASE_MOUSESENS:
- CheckSliderMovement(1);
- break;
- case HOVEROPTION_DECREASE_BRIGHTNESS:
- case HOVEROPTION_DECREASE_DRAWDIST:
- case HOVEROPTION_DECREASE_MUSICVOLUME:
- case HOVEROPTION_DECREASE_SFXVOLUME:
- case HOVEROPTION_DECREASE_MOUSESENS:
- CheckSliderMovement(-1);
- break;
+ case HOVEROPTION_INCREASE_BRIGHTNESS:
+ case HOVEROPTION_INCREASE_DRAWDIST:
+ case HOVEROPTION_INCREASE_MUSICVOLUME:
+ case HOVEROPTION_INCREASE_SFXVOLUME:
+ case HOVEROPTION_INCREASE_MOUSESENS:
+ CheckSliderMovement(1);
+ break;
+ case HOVEROPTION_DECREASE_BRIGHTNESS:
+ case HOVEROPTION_DECREASE_DRAWDIST:
+ case HOVEROPTION_DECREASE_MUSICVOLUME:
+ case HOVEROPTION_DECREASE_SFXVOLUME:
+ case HOVEROPTION_DECREASE_MOUSESENS:
+ CheckSliderMovement(-1);
+ break;
}
#endif
- }
+ }
if (CPad::GetPad(0)->GetLeftMouseJustUp() || CPad::GetPad(0)->GetLeftJustUp() || CPad::GetPad(0)->GetRightJustUp()
|| CPad::GetPad(0)->GetDPadLeftJustUp() || CPad::GetPad(0)->GetDPadRightJustUp()
@@ -4230,7 +4136,7 @@ CMenuManager::ProcessButtonPresses(void)
goBack = false;
}
#endif
- }
+ }
// Centralized enter/back (except some conditions)
#ifdef TIDY_UP_PBP
@@ -4243,8 +4149,7 @@ CMenuManager::ProcessButtonPresses(void)
optionSelected = true;
}
- }
- else {
+ } else {
if (CPad::GetPad(0)->GetEnterJustUp() || CPad::GetPad(0)->GetCrossJustUp()) {
m_bShowMouse = false;
optionSelected = true;
@@ -4257,8 +4162,7 @@ CMenuManager::ProcessButtonPresses(void)
if (CPad::GetPad(0)->GetEscapeJustDown() || CPad::GetPad(0)->GetBackJustUp()) {
goBack = true;
}
- }
- else {
+ } else {
if (CPad::GetPad(0)->GetEscapeJustDown() || (m_nCurrScreen != MENUPAGE_PAUSE_MENU && CPad::GetPad(0)->GetBackJustDown())) {
m_bShowMouse = false;
goBack = true;
@@ -4275,8 +4179,7 @@ CMenuManager::ProcessButtonPresses(void)
curBottomBarOption = hoveredBottomBarOption;
ChangeScreen(bbNames[curBottomBarOption].screenId, 0, true, false);
return;
- }
- else if (bottomBarActive) {
+ } else if (bottomBarActive) {
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetCrossJustDown()) {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
bottomBarActive = false;
@@ -4285,8 +4188,7 @@ CMenuManager::ProcessButtonPresses(void)
if (reverseAlpha)
m_nMenuFadeAlpha = 0;
return;
- }
- else if (CPad::GetPad(0)->GetLeftJustDown() || CPad::GetPad(0)->GetAnaloguePadLeft() || CPad::GetPad(0)->GetDPadLeftJustDown()
+ } else if (CPad::GetPad(0)->GetLeftJustDown() || CPad::GetPad(0)->GetAnaloguePadLeft() || CPad::GetPad(0)->GetDPadLeftJustDown()
|| CPad::GetPad(0)->GetUpJustDown() || CPad::GetPad(0)->GetAnaloguePadUp() || CPad::GetPad(0)->GetDPadUpJustDown()) {
m_bShowMouse = false;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
@@ -4294,12 +4196,11 @@ CMenuManager::ProcessButtonPresses(void)
curBottomBarOption--;
ChangeScreen(bbNames[curBottomBarOption].screenId, 0, true, true);
return;
- }
- else if (CPad::GetPad(0)->GetRightJustDown() || CPad::GetPad(0)->GetAnaloguePadRight() || CPad::GetPad(0)->GetDPadRightJustDown()
+ } else if (CPad::GetPad(0)->GetRightJustDown() || CPad::GetPad(0)->GetAnaloguePadRight() || CPad::GetPad(0)->GetDPadRightJustDown()
|| CPad::GetPad(0)->GetDownJustDown() || CPad::GetPad(0)->GetAnaloguePadDown() || CPad::GetPad(0)->GetDPadDownJustDown()) {
m_bShowMouse = false;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
- if (curBottomBarOption < bbTabCount - 1)
+ if (curBottomBarOption < bbTabCount-1)
curBottomBarOption++;
ChangeScreen(bbNames[curBottomBarOption].screenId, 0, true, true);
return;
@@ -4322,8 +4223,7 @@ CMenuManager::ProcessButtonPresses(void)
&& aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption + 1].m_Action != MENUACTION_NOTHING) {
m_nCurrOption++;
}
- }
- else {
+ } else {
m_nCurrOption--;
}
}
@@ -4339,11 +4239,9 @@ CMenuManager::ProcessButtonPresses(void)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_FAIL, 0);
else
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
- }
- else
+ } else
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
- }
- else {
+ } else {
// This is duplicate, back button already processed below
#ifndef TIDY_UP_PBP
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_EXIT, 0);
@@ -4353,18 +4251,15 @@ CMenuManager::ProcessButtonPresses(void)
}
#endif
}
- }
- else if (option == MENUACTION_CHECKSAVE) {
+ } else if (option == MENUACTION_CHECKSAVE) {
if (Slots[aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_SaveSlot - 1] == SLOT_EMPTY) {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_FAIL, 0);
- }
- else {
+ } else {
if (m_nCurrScreen != MENUPAGE_NEW_GAME_RELOAD) {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
}
}
- }
- else if (option != MENUACTION_CHANGEMENU && option != MENUACTION_BRIGHTNESS && option != MENUACTION_DRAWDIST
+ } else if (option != MENUACTION_CHANGEMENU && option != MENUACTION_BRIGHTNESS && option != MENUACTION_DRAWDIST
&& option != MENUACTION_MUSICVOLUME && option != MENUACTION_SFXVOLUME
&& option != MENUACTION_CHECKSAVE && option != MENUACTION_UNK24
&& option != MENUACTION_MOUSESENS && option != MENUACTION_SCREENRES) {
@@ -4374,392 +4269,382 @@ CMenuManager::ProcessButtonPresses(void)
if ((m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS) || (m_nCurrScreen == MENUPAGE_SKIN_SELECT)) {
switch (m_nCurrExLayer) {
- default:
- goBack = true;
- break;
- case HOVEROPTION_LIST:
- if (m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS) {
- m_bWaitingForNewKeyBind = true;
- m_bStartWaitingForKeyBind = true;
- pControlEdit = &m_KeyPressedCode;
- }
- if (m_nCurrScreen == MENUPAGE_SKIN_SELECT) {
+ default:
+ goBack = true;
+ break;
+ case HOVEROPTION_LIST:
+ if (m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS) {
+ m_bWaitingForNewKeyBind = true;
+ m_bStartWaitingForKeyBind = true;
+ pControlEdit = &m_KeyPressedCode;
+ }
+ if (m_nCurrScreen == MENUPAGE_SKIN_SELECT) {
+ strcpy(m_PrefsSkinFile, m_aSkinName);
+ CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile);
+ m_nCurrExLayer = HOVEROPTION_BACK;
+ SaveSettings();
+ }
+ m_nHoverOption = HOVEROPTION_NOT_HOVERING;
+ break;
+ case HOVEROPTION_USESKIN:
+ m_nHoverOption = HOVEROPTION_NOT_HOVERING;
strcpy(m_PrefsSkinFile, m_aSkinName);
CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile);
m_nCurrExLayer = HOVEROPTION_BACK;
SaveSettings();
- }
- m_nHoverOption = HOVEROPTION_NOT_HOVERING;
- break;
- case HOVEROPTION_USESKIN:
- m_nHoverOption = HOVEROPTION_NOT_HOVERING;
- strcpy(m_PrefsSkinFile, m_aSkinName);
- CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile);
- m_nCurrExLayer = HOVEROPTION_BACK;
- SaveSettings();
- break;
+ break;
}
- }
- else if (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu == MENUPAGE_NEW_GAME_RELOAD && m_bGameNotLoaded) {
+ } else if (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu == MENUPAGE_NEW_GAME_RELOAD && m_bGameNotLoaded) {
DoSettingsBeforeStartingAGame();
- /* } else if (m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS) {
- // .. either empty or there was some outer if. :shrug: pointless anyway, keyboard_controls is handled in first if.
- */
- }
- else if (m_nCurrScreen == MENUPAGE_SKIN_SELECT) {
+/* } else if (m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS) {
+ // .. either empty or there was some outer if. :shrug: pointless anyway, keyboard_controls is handled in first if.
+*/
+ } else if (m_nCurrScreen == MENUPAGE_SKIN_SELECT) {
if (m_nSkinsTotal > 0) {
m_pSelectedSkin = m_pSkinListHead.nextSkin;
strcpy(m_PrefsSkinFile, m_aSkinName);
CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile);
SaveSettings();
- }
- else {
+ } else {
if (!m_bGameNotLoaded)
ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[1], aScreens[m_nCurrScreen].m_ParentEntry[1], true, true);
else
ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[0], aScreens[m_nCurrScreen].m_ParentEntry[0], true, true);
}
- }
- else if (m_nCurrScreen != MENUPAGE_MULTIPLAYER_FIND_GAME) {
+ } else if (m_nCurrScreen != MENUPAGE_MULTIPLAYER_FIND_GAME) {
option = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action;
switch (option) {
- case MENUACTION_RADIO:
+ case MENUACTION_RADIO:
#ifdef TIDY_UP_PBP
- assumeIncrease = true;
+ assumeIncrease = true;
#else
- ++m_PrefsRadioStation;
- if (DMAudio.IsMP3RadioChannelAvailable()) {
- if (m_PrefsRadioStation > USERTRACK)
- m_PrefsRadioStation = HEAD_RADIO;
- }
- else if (m_PrefsRadioStation > CHATTERBOX) {
- m_PrefsRadioStation = USERTRACK;
- }
- SaveSettings();
- DMAudio.SetRadioInCar(m_PrefsRadioStation);
- DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
- OutputDebugString("FRONTEND RADIO STATION CHANGED");
+ ++m_PrefsRadioStation;
+ if (DMAudio.IsMP3RadioChannelAvailable()) {
+ if (m_PrefsRadioStation > USERTRACK)
+ m_PrefsRadioStation = HEAD_RADIO;
+ } else if (m_PrefsRadioStation > CHATTERBOX) {
+ m_PrefsRadioStation = USERTRACK;
+ }
+ SaveSettings();
+ DMAudio.SetRadioInCar(m_PrefsRadioStation);
+ DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
+ OutputDebugString("FRONTEND RADIO STATION CHANGED");
#endif
- break;
- case MENUACTION_LANG_ENG:
- m_PrefsLanguage = LANGUAGE_AMERICAN;
- m_bFrontEnd_ReloadObrTxtGxt = true;
- InitialiseChangedLanguageSettings();
- SaveSettings();
- break;
- case MENUACTION_LANG_FRE:
- m_PrefsLanguage = LANGUAGE_FRENCH;
- m_bFrontEnd_ReloadObrTxtGxt = true;
- InitialiseChangedLanguageSettings();
- SaveSettings();
- break;
- case MENUACTION_LANG_GER:
- m_PrefsLanguage = LANGUAGE_GERMAN;
- m_bFrontEnd_ReloadObrTxtGxt = true;
- InitialiseChangedLanguageSettings();
- SaveSettings();
- break;
- case MENUACTION_LANG_ITA:
- m_PrefsLanguage = LANGUAGE_ITALIAN;
- m_bFrontEnd_ReloadObrTxtGxt = true;
- InitialiseChangedLanguageSettings();
- SaveSettings();
- break;
- case MENUACTION_LANG_SPA:
- m_PrefsLanguage = LANGUAGE_SPANISH;
- m_bFrontEnd_ReloadObrTxtGxt = true;
- InitialiseChangedLanguageSettings();
- SaveSettings();
- break;
+ break;
+ case MENUACTION_LANG_ENG:
+ m_PrefsLanguage = LANGUAGE_AMERICAN;
+ m_bFrontEnd_ReloadObrTxtGxt = true;
+ InitialiseChangedLanguageSettings();
+ SaveSettings();
+ break;
+ case MENUACTION_LANG_FRE:
+ m_PrefsLanguage = LANGUAGE_FRENCH;
+ m_bFrontEnd_ReloadObrTxtGxt = true;
+ InitialiseChangedLanguageSettings();
+ SaveSettings();
+ break;
+ case MENUACTION_LANG_GER:
+ m_PrefsLanguage = LANGUAGE_GERMAN;
+ m_bFrontEnd_ReloadObrTxtGxt = true;
+ InitialiseChangedLanguageSettings();
+ SaveSettings();
+ break;
+ case MENUACTION_LANG_ITA:
+ m_PrefsLanguage = LANGUAGE_ITALIAN;
+ m_bFrontEnd_ReloadObrTxtGxt = true;
+ InitialiseChangedLanguageSettings();
+ SaveSettings();
+ break;
+ case MENUACTION_LANG_SPA:
+ m_PrefsLanguage = LANGUAGE_SPANISH;
+ m_bFrontEnd_ReloadObrTxtGxt = true;
+ InitialiseChangedLanguageSettings();
+ SaveSettings();
+ break;
#ifdef MORE_LANGUAGES
- case MENUACTION_LANG_PL:
- m_PrefsLanguage = LANGUAGE_POLISH;
- m_bFrontEnd_ReloadObrTxtGxt = true;
- InitialiseChangedLanguageSettings();
- SaveSettings();
- break;
- case MENUACTION_LANG_RUS:
- m_PrefsLanguage = LANGUAGE_RUSSIAN;
- m_bFrontEnd_ReloadObrTxtGxt = true;
- CMenuManager::InitialiseChangedLanguageSettings();
- SaveSettings();
- break;
- case MENUACTION_LANG_JAP:
- m_PrefsLanguage = LANGUAGE_JAPANESE;
- m_bFrontEnd_ReloadObrTxtGxt = true;
- InitialiseChangedLanguageSettings();
- SaveSettings();
- break;
+ case MENUACTION_LANG_PL:
+ m_PrefsLanguage = LANGUAGE_POLISH;
+ m_bFrontEnd_ReloadObrTxtGxt = true;
+ InitialiseChangedLanguageSettings();
+ SaveSettings();
+ break;
+ case MENUACTION_LANG_RUS:
+ m_PrefsLanguage = LANGUAGE_RUSSIAN;
+ m_bFrontEnd_ReloadObrTxtGxt = true;
+ CMenuManager::InitialiseChangedLanguageSettings();
+ SaveSettings();
+ break;
+ case MENUACTION_LANG_JAP:
+ m_PrefsLanguage = LANGUAGE_JAPANESE;
+ m_bFrontEnd_ReloadObrTxtGxt = true;
+ InitialiseChangedLanguageSettings();
+ SaveSettings();
+ break;
#endif
- case MENUACTION_POPULATESLOTS_CHANGEMENU:
- PcSaveHelper.PopulateSlotInfo();
-
- // fall through
- case MENUACTION_CHANGEMENU:
- {
- bool changeMenu = true;
- int saveSlot = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_SaveSlot;
-
- // This should be unused.
- if (saveSlot >= 2 && saveSlot <= 9) {
- m_nCurrSaveSlot = saveSlot - 2;
- switch (m_nCurrScreen) {
- case MENUPAGE_CHOOSE_LOAD_SLOT:
- if (Slots[m_nCurrSaveSlot + 1] != SLOT_EMPTY)
- changeMenu = false;
-
- break;
- case MENUPAGE_CHOOSE_DELETE_SLOT:
- if (Slots[m_nCurrSaveSlot + 1] == SLOT_EMPTY)
- changeMenu = false;
-
- break;
+ case MENUACTION_POPULATESLOTS_CHANGEMENU:
+ PcSaveHelper.PopulateSlotInfo();
+
+ // fall through
+ case MENUACTION_CHANGEMENU:
+ {
+ bool changeMenu = true;
+ int saveSlot = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_SaveSlot;
+
+ // This should be unused.
+ if (saveSlot >= 2 && saveSlot <= 9) {
+ m_nCurrSaveSlot = saveSlot - 2;
+ switch (m_nCurrScreen) {
+ case MENUPAGE_CHOOSE_LOAD_SLOT:
+ if (Slots[m_nCurrSaveSlot + 1] != SLOT_EMPTY)
+ changeMenu = false;
+
+ break;
+ case MENUPAGE_CHOOSE_DELETE_SLOT:
+ if (Slots[m_nCurrSaveSlot + 1] == SLOT_EMPTY)
+ changeMenu = false;
+
+ break;
+ }
}
- }
- if (changeMenu) {
- if (strncmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEDS_TB", 8) == 0) {
+ if (changeMenu) {
+ if (strncmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FEDS_TB", 8) == 0) {
#ifndef TIDY_UP_PBP
- ResetHelperText();
- if (!m_bGameNotLoaded)
- ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[1], aScreens[m_nCurrScreen].m_ParentEntry[1], true, true);
- else
- ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[0], aScreens[m_nCurrScreen].m_ParentEntry[0], true, true);
+ ResetHelperText();
+ if (!m_bGameNotLoaded)
+ ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[1], aScreens[m_nCurrScreen].m_ParentEntry[1], true, true);
+ else
+ ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[0], aScreens[m_nCurrScreen].m_ParentEntry[0], true, true);
#else
- goBack = true;
- break;
+ goBack = true;
+ break;
#endif
- }
- else {
+ } else {
#ifdef MENU_MAP
- if (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu == MENUPAGE_MAP) {
- bMapLoaded = false;
- }
+ if (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu == MENUPAGE_MAP) {
+ bMapLoaded = false;
+ }
#endif
- ChangeScreen(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, 0, true, true);
+ ChangeScreen(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, 0, true, true);
+ }
}
+ break;
}
- break;
- }
- case MENUACTION_CHECKSAVE:
- {
- int saveSlot = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_SaveSlot;
-
- if (saveSlot >= 2 && saveSlot <= 9) {
- m_nCurrSaveSlot = saveSlot - 2;
- if (Slots[m_nCurrSaveSlot + 1] != SLOT_EMPTY && Slots[m_nCurrSaveSlot + 1] != SLOT_CORRUPTED) {
- ChangeScreen(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, 0, true, true);
+ case MENUACTION_CHECKSAVE:
+ {
+ int saveSlot = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_SaveSlot;
+
+ if (saveSlot >= 2 && saveSlot <= 9) {
+ m_nCurrSaveSlot = saveSlot - 2;
+ if (Slots[m_nCurrSaveSlot + 1] != SLOT_EMPTY && Slots[m_nCurrSaveSlot + 1] != SLOT_CORRUPTED) {
+ ChangeScreen(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, 0, true, true);
+ }
}
+ break;
}
- break;
- }
- case MENUACTION_NEWGAME:
- DoSettingsBeforeStartingAGame();
- break;
- case MENUACTION_RELOADIDE:
- CFileLoader::ReloadObjectTypes("GTA3.IDE");
- break;
- case MENUACTION_RELOADIPL:
- CGame::ReloadIPLs();
- break;
- case MENUACTION_SHOWCULL:
- // REMOVED(MIAMI)
- break;
- case MENUACTION_MEMCARDSAVECONFIRM:
- return;
- case MENUACTION_RESUME_FROM_SAVEZONE:
- RequestFrontEndShutDown();
- break;
- case MENUACTION_MPMAP_LIBERTY:
- case MENUACTION_MPMAP_REDLIGHT:
- case MENUACTION_MPMAP_CHINATOWN:
- case MENUACTION_MPMAP_TOWER:
- case MENUACTION_MPMAP_SEWER:
- case MENUACTION_MPMAP_INDUSTPARK:
- case MENUACTION_MPMAP_DOCKS:
- case MENUACTION_MPMAP_STAUNTON:
- m_SelectedMap = option - MENUACTION_MPMAP_LIBERTY;
- SaveSettings();
- ChangeScreen(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, 0, true, true);
- break;
- case MENUACTION_MPMAP_DEATHMATCH1:
- case MENUACTION_MPMAP_DEATHMATCH2:
- case MENUACTION_MPMAP_TEAMDEATH1:
- case MENUACTION_MPMAP_TEAMDEATH2:
- case MENUACTION_MPMAP_STASH:
- case MENUACTION_MPMAP_CAPTURE:
- case MENUACTION_MPMAP_RATRACE:
- case MENUACTION_MPMAP_DOMINATION:
- m_SelectedGameType = option - MENUACTION_MPMAP_DEATHMATCH1;
- SaveSettings();
- ChangeScreen(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, 0, true, true);
- break;
- case MENUACTION_REDEFCTRL:
- ChangeScreen(MENUPAGE_KEYBOARD_CONTROLS, 0, true, true);
- m_nSelectedListRow = 0;
- m_nCurrExLayer = HOVEROPTION_LIST;
- break;
- case MENUACTION_GETKEY:
- m_CurrCntrlAction = GetStartOptionsCntrlConfigScreens() + m_nCurrOption;
- m_bKeyIsOK = true;
- m_bWaitingForNewKeyBind = true;
- m_bStartWaitingForKeyBind = true;
- pControlEdit = &m_KeyPressedCode;
- break;
- case MENUACTION_CANCELGAME:
- DMAudio.Service();
- RsEventHandler(rsQUITAPP, nil);
- break;
- case MENUACTION_RESUME:
+ case MENUACTION_NEWGAME:
+ DoSettingsBeforeStartingAGame();
+ break;
+ case MENUACTION_RELOADIDE:
+ CFileLoader::ReloadObjectTypes("GTA3.IDE");
+ break;
+ case MENUACTION_RELOADIPL:
+ CGame::ReloadIPLs();
+ break;
+ case MENUACTION_SHOWCULL:
+ // REMOVED(MIAMI)
+ break;
+ case MENUACTION_MEMCARDSAVECONFIRM:
+ return;
+ case MENUACTION_RESUME_FROM_SAVEZONE:
+ RequestFrontEndShutDown();
+ break;
+ case MENUACTION_MPMAP_LIBERTY:
+ case MENUACTION_MPMAP_REDLIGHT:
+ case MENUACTION_MPMAP_CHINATOWN:
+ case MENUACTION_MPMAP_TOWER:
+ case MENUACTION_MPMAP_SEWER:
+ case MENUACTION_MPMAP_INDUSTPARK:
+ case MENUACTION_MPMAP_DOCKS:
+ case MENUACTION_MPMAP_STAUNTON:
+ m_SelectedMap = option - MENUACTION_MPMAP_LIBERTY;
+ SaveSettings();
+ ChangeScreen(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, 0, true, true);
+ break;
+ case MENUACTION_MPMAP_DEATHMATCH1:
+ case MENUACTION_MPMAP_DEATHMATCH2:
+ case MENUACTION_MPMAP_TEAMDEATH1:
+ case MENUACTION_MPMAP_TEAMDEATH2:
+ case MENUACTION_MPMAP_STASH:
+ case MENUACTION_MPMAP_CAPTURE:
+ case MENUACTION_MPMAP_RATRACE:
+ case MENUACTION_MPMAP_DOMINATION:
+ m_SelectedGameType = option - MENUACTION_MPMAP_DEATHMATCH1;
+ SaveSettings();
+ ChangeScreen(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_TargetMenu, 0, true, true);
+ break;
+ case MENUACTION_REDEFCTRL:
+ ChangeScreen(MENUPAGE_KEYBOARD_CONTROLS, 0, true, true);
+ m_nSelectedListRow = 0;
+ m_nCurrExLayer = HOVEROPTION_LIST;
+ break;
+ case MENUACTION_GETKEY:
+ m_CurrCntrlAction = GetStartOptionsCntrlConfigScreens() + m_nCurrOption;
+ m_bKeyIsOK = true;
+ m_bWaitingForNewKeyBind = true;
+ m_bStartWaitingForKeyBind = true;
+ pControlEdit = &m_KeyPressedCode;
+ break;
+ case MENUACTION_CANCELGAME:
+ DMAudio.Service();
+ RsEventHandler(rsQUITAPP, nil);
+ break;
+ case MENUACTION_RESUME:
#ifndef TIDY_UP_PBP
- if (m_PrefsVsyncDisp != m_PrefsVsync) {
- m_PrefsVsync = m_PrefsVsyncDisp;
- }
- RequestFrontEndShutDown();
+ if (m_PrefsVsyncDisp != m_PrefsVsync) {
+ m_PrefsVsync = m_PrefsVsyncDisp;
+ }
+ RequestFrontEndShutDown();
#else
- goBack = true;
+ goBack = true;
#endif
- break;
- case MENUACTION_DONTCANCEL:
- ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[1], aScreens[m_nCurrScreen].m_ParentEntry[1], true, true);
- break;
- case MENUACTION_SCREENRES:
- if (m_nDisplayVideoMode != m_nPrefsVideoMode) {
- m_nPrefsVideoMode = m_nDisplayVideoMode;
- _psSelectScreenVM(m_nPrefsVideoMode);
- SetHelperText(0);
- SaveSettings();
- }
- break;
+ break;
+ case MENUACTION_DONTCANCEL:
+ ChangeScreen(aScreens[m_nCurrScreen].m_PreviousPage[1], aScreens[m_nCurrScreen].m_ParentEntry[1], true, true);
+ break;
+ case MENUACTION_SCREENRES:
+ if (m_nDisplayVideoMode != m_nPrefsVideoMode) {
+ m_nPrefsVideoMode = m_nDisplayVideoMode;
+ _psSelectScreenVM(m_nPrefsVideoMode);
+ SetHelperText(0);
+ SaveSettings();
+ }
+ break;
#ifdef IMPROVED_VIDEOMODE
- case MENUACTION_SCREENMODE:
- if (m_nSelectedScreenMode != m_nPrefsWindowed) {
- m_nPrefsWindowed = m_nSelectedScreenMode;
- _psSelectScreenVM(m_nPrefsVideoMode); // apply same resolution
- SetHelperText(0);
- SaveSettings();
- }
- break;
-#endif
- case MENUACTION_AUDIOHW:
- {
- int selectedProvider = m_nPrefsAudio3DProviderIndex;
- if (selectedProvider != -1) {
- m_nPrefsAudio3DProviderIndex = DMAudio.SetCurrent3DProvider(m_nPrefsAudio3DProviderIndex);
- if (selectedProvider == m_nPrefsAudio3DProviderIndex) {
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
+ case MENUACTION_SCREENMODE:
+ if (m_nSelectedScreenMode != m_nPrefsWindowed) {
+ m_nPrefsWindowed = m_nSelectedScreenMode;
+ _psSelectScreenVM(m_nPrefsVideoMode); // apply same resolution
SetHelperText(0);
+ SaveSettings();
}
- else {
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_FAIL, 0);
- SetHelperText(4);
+ break;
+#endif
+ case MENUACTION_AUDIOHW:
+ {
+ int selectedProvider = m_nPrefsAudio3DProviderIndex;
+ if (selectedProvider != -1) {
+ m_nPrefsAudio3DProviderIndex = DMAudio.SetCurrent3DProvider(m_nPrefsAudio3DProviderIndex);
+ if (selectedProvider == m_nPrefsAudio3DProviderIndex) {
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
+ SetHelperText(0);
+ } else {
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_FAIL, 0);
+ SetHelperText(4);
+ }
+ SaveSettings();
}
- SaveSettings();
+ break;
}
- break;
- }
- case MENUACTION_SPEAKERCONF:
+ case MENUACTION_SPEAKERCONF:
#ifndef TIDY_UP_PBP
- if (m_nPrefsAudio3DProviderIndex != -1) {
- if (--m_PrefsSpeakers < 0)
- m_PrefsSpeakers = 2;
- DMAudio.SetSpeakerConfig(m_PrefsSpeakers);
- SaveSettings();
- }
+ if (m_nPrefsAudio3DProviderIndex != -1) {
+ if (--m_PrefsSpeakers < 0)
+ m_PrefsSpeakers = 2;
+ DMAudio.SetSpeakerConfig(m_PrefsSpeakers);
+ SaveSettings();
+ }
#else
- assumeIncrease = true;
+ assumeIncrease = true;
#endif
- break;
- case MENUACTION_PLAYERSETUP:
- CPlayerSkin::BeginFrontendSkinEdit();
- ChangeScreen(MENUPAGE_SKIN_SELECT, 0, true, true);
- m_nCurrExLayer = HOVEROPTION_LIST;
- m_bSkinsEnumerated = false;
- break;
- case MENUACTION_RESTOREDEF:
- if (m_nCurrScreen == MENUPAGE_SOUND_SETTINGS) {
- m_PrefsSfxVolume = 102;
- m_PrefsSpeakers = 0;
- m_PrefsMusicVolume = 102;
- m_PrefsStereoMono = 0;
- m_PrefsRadioStation = HEAD_RADIO;
- DMAudio.SetMusicMasterVolume(102);
- DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
- DMAudio.SetRadioInCar(m_PrefsRadioStation);
- DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
- SaveSettings();
- }
- else if (m_nCurrScreen == MENUPAGE_GRAPHICS_SETTINGS) {
- m_PrefsFrameLimiter = true;
- m_PrefsBrightness = 256;
- m_PrefsVsyncDisp = true;
- m_PrefsLOD = 1.2f;
- m_PrefsVsync = true;
- CRenderer::ms_lodDistScale = 1.2f;
- m_PrefsUseWideScreen = false;
- m_PrefsShowSubtitles = true;
- m_nDisplayVideoMode = m_nPrefsVideoMode;
+ break;
+ case MENUACTION_PLAYERSETUP:
+ CPlayerSkin::BeginFrontendSkinEdit();
+ ChangeScreen(MENUPAGE_SKIN_SELECT, 0, true, true);
+ m_nCurrExLayer = HOVEROPTION_LIST;
+ m_bSkinsEnumerated = false;
+ break;
+ case MENUACTION_RESTOREDEF:
+ if (m_nCurrScreen == MENUPAGE_SOUND_SETTINGS) {
+ m_PrefsSfxVolume = 102;
+ m_PrefsSpeakers = 0;
+ m_PrefsMusicVolume = 102;
+ m_PrefsStereoMono = 0;
+ m_PrefsRadioStation = HEAD_RADIO;
+ DMAudio.SetMusicMasterVolume(102);
+ DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
+ DMAudio.SetRadioInCar(m_PrefsRadioStation);
+ DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
+ SaveSettings();
+ } else if (m_nCurrScreen == MENUPAGE_GRAPHICS_SETTINGS) {
+ m_PrefsFrameLimiter = true;
+ m_PrefsBrightness = 256;
+ m_PrefsVsyncDisp = true;
+ m_PrefsLOD = 1.2f;
+ m_PrefsVsync = true;
+ CRenderer::ms_lodDistScale = 1.2f;
+ m_PrefsUseWideScreen = false;
+ m_PrefsShowSubtitles = true;
+ m_nDisplayVideoMode = m_nPrefsVideoMode;
#ifdef GTA3_1_1_PATCH
- if (_dwOperatingSystemVersion == OS_WIN98) {
- CMBlur::BlurOn = false;
- CMBlur::MotionBlurClose();
- }
- else {
- CMBlur::BlurOn = true;
- CMBlur::MotionBlurOpen(Scene.camera);
- }
+ if (_dwOperatingSystemVersion == OS_WIN98) {
+ CMBlur::BlurOn = false;
+ CMBlur::MotionBlurClose();
+ }
+ else {
+ CMBlur::BlurOn = true;
+ CMBlur::MotionBlurOpen(Scene.camera);
+ }
#else
- CMBlur::BlurOn = true;
+ CMBlur::BlurOn = true;
#endif
- SaveSettings();
- }
- else if ((m_nCurrScreen != MENUPAGE_SKIN_SELECT_OLD) && (m_nCurrScreen == MENUPAGE_CONTROLLER_PC)) {
- ControlsManager.MakeControllerActionsBlank();
- ControlsManager.InitDefaultControlConfiguration();
- ControlsManager.InitDefaultControlConfigMouse(MousePointerStateHelper.GetMouseSetUp());
+ SaveSettings();
+ } else if ((m_nCurrScreen != MENUPAGE_SKIN_SELECT_OLD) && (m_nCurrScreen == MENUPAGE_CONTROLLER_PC)) {
+ ControlsManager.MakeControllerActionsBlank();
+ ControlsManager.InitDefaultControlConfiguration();
+ ControlsManager.InitDefaultControlConfigMouse(MousePointerStateHelper.GetMouseSetUp());
#if !defined RW_GL3
- if (AllValidWinJoys.m_aJoys[JOYSTICK1].m_bInitialised) {
- DIDEVCAPS devCaps;
- devCaps.dwSize = sizeof(DIDEVCAPS);
- PSGLOBAL(joy1)->GetCapabilities(&devCaps);
- ControlsManager.InitDefaultControlConfigJoyPad(devCaps.dwButtons);
- }
+ if (AllValidWinJoys.m_aJoys[JOYSTICK1].m_bInitialised) {
+ DIDEVCAPS devCaps;
+ devCaps.dwSize = sizeof(DIDEVCAPS);
+ PSGLOBAL(joy1)->GetCapabilities(&devCaps);
+ ControlsManager.InitDefaultControlConfigJoyPad(devCaps.dwButtons);
+ }
#else
- if (PSGLOBAL(joy1id) != -1 && glfwJoystickPresent(PSGLOBAL(joy1id))) {
- int count;
- glfwGetJoystickButtons(PSGLOBAL(joy1id), &count);
- ControlsManager.InitDefaultControlConfigJoyPad(count);
- }
+ if (PSGLOBAL(joy1id) != -1 && glfwJoystickPresent(PSGLOBAL(joy1id))) {
+ int count;
+ glfwGetJoystickButtons(PSGLOBAL(joy1id), &count);
+ ControlsManager.InitDefaultControlConfigJoyPad(count);
+ }
#endif
- m_ControlMethod = CONTROL_STANDARD;
- MousePointerStateHelper.bInvertVertically = false;
- TheCamera.m_fMouseAccelHorzntl = 0.0025f;
- CVehicle::m_bDisableMouseSteering = true;
- TheCamera.m_bHeadBob = false;
- SaveSettings();
- }
- SetHelperText(2);
- break;
- case MENUACTION_CTRLMETHOD:
+ m_ControlMethod = CONTROL_STANDARD;
+ MousePointerStateHelper.bInvertVertically = false;
+ TheCamera.m_fMouseAccelHorzntl = 0.0025f;
+ CVehicle::m_bDisableMouseSteering = true;
+ TheCamera.m_bHeadBob = false;
+ SaveSettings();
+ }
+ SetHelperText(2);
+ break;
+ case MENUACTION_CTRLMETHOD:
#ifndef TIDY_UP_PBP
- if (m_ControlMethod == CONTROL_CLASSIC) {
- CCamera::m_bUseMouse3rdPerson = true;
- m_ControlMethod = CONTROL_STANDARD;
- }
- else {
- CCamera::m_bUseMouse3rdPerson = false;
- m_ControlMethod = CONTROL_CLASSIC;
- }
- SaveSettings();
+ if (m_ControlMethod == CONTROL_CLASSIC) {
+ CCamera::m_bUseMouse3rdPerson = true;
+ m_ControlMethod = CONTROL_STANDARD;
+ } else {
+ CCamera::m_bUseMouse3rdPerson = false;
+ m_ControlMethod = CONTROL_CLASSIC;
+ }
+ SaveSettings();
#else
- assumeIncrease = true;
+ assumeIncrease = true;
#endif
- break;
- case MENUACTION_LOADRADIO:
- ChangeScreen(MENUPAGE_SOUND_SETTINGS, 0, true, true);
- DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
- OutputDebugString("STARTED PLAYING FRONTEND AUDIO TRACK");
- break;
+ break;
+ case MENUACTION_LOADRADIO:
+ ChangeScreen(MENUPAGE_SOUND_SETTINGS, 0, true, true);
+ DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
+ OutputDebugString("STARTED PLAYING FRONTEND AUDIO TRACK");
+ break;
}
}
ProcessOnOffMenuOptions();
@@ -4810,8 +4695,7 @@ CMenuManager::ProcessButtonPresses(void)
if (!bottomBarActive &&
(oldScreen == MENUPAGE_NONE || oldScreen == MENUPAGE_OPTIONS)) {
bottomBarActive = true;
- }
- else
+ } else
#endif
{
ChangeScreen(oldScreen, oldOption, true, true);
@@ -4822,7 +4706,7 @@ CMenuManager::ProcessButtonPresses(void)
return;
#endif
}
- }
+ }
#ifdef PS2_LIKE_MENU
if (bottomBarActive)
@@ -4842,8 +4726,7 @@ CMenuManager::ProcessButtonPresses(void)
CheckSliderMovement(-1);
lastSliderDecrease = CTimer::GetTimeInMillisecondsPauseMode();
}
- }
- else if (CPad::GetPad(0)->GetRight() || CPad::GetPad(0)->GetPedWalkLeftRight() > 0 || CPad::GetPad(0)->GetDPadRight()) {
+ } else if (CPad::GetPad(0)->GetRight() || CPad::GetPad(0)->GetPedWalkLeftRight() > 0 || CPad::GetPad(0)->GetDPadRight()) {
static uint32 lastSliderIncrease = 0;
if (CTimer::GetTimeInMillisecondsPauseMode() - lastSliderIncrease > 150) {
CheckSliderMovement(1);
@@ -4854,8 +4737,7 @@ CMenuManager::ProcessButtonPresses(void)
if (CPad::GetPad(0)->GetRightJustDown() || CPad::GetPad(0)->GetAnaloguePadRight() || CPad::GetPad(0)->GetDPadRightJustDown()) {
m_bShowMouse = false;
increase = true;
- }
- else if (CPad::GetPad(0)->GetMouseWheelUpJustDown() && m_nCurrScreen != MENUPAGE_KEYBOARD_CONTROLS) {
+ } else if (CPad::GetPad(0)->GetMouseWheelUpJustDown() && m_nCurrScreen != MENUPAGE_KEYBOARD_CONTROLS) {
increase = true;
CheckSliderMovement(1);
m_bShowMouse = true;
@@ -4869,8 +4751,7 @@ CMenuManager::ProcessButtonPresses(void)
m_bShowMouse = true;
}
}
- }
- else {
+ } else {
m_bShowMouse = false;
decrease = true;
}
@@ -4882,105 +4763,101 @@ CMenuManager::ProcessButtonPresses(void)
if (changeValueBy != 0) {
switch (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action) {
- case MENUACTION_RADIO:
- m_PrefsRadioStation += changeValueBy;
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
- if (DMAudio.IsMP3RadioChannelAvailable()) {
- if (m_PrefsRadioStation < HEAD_RADIO)
- m_PrefsRadioStation = USERTRACK;
- if (m_PrefsRadioStation > USERTRACK)
- m_PrefsRadioStation = HEAD_RADIO;
- }
- else {
- if (m_PrefsRadioStation < HEAD_RADIO)
- m_PrefsRadioStation = CHATTERBOX;
- if (m_PrefsRadioStation > CHATTERBOX)
- m_PrefsRadioStation = HEAD_RADIO;
- }
- SaveSettings();
- DMAudio.SetRadioInCar(m_PrefsRadioStation);
- DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
- OutputDebugString("FRONTEND RADIO STATION CHANGED");
- break;
+ case MENUACTION_RADIO:
+ m_PrefsRadioStation += changeValueBy;
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
+ if (DMAudio.IsMP3RadioChannelAvailable()) {
+ if (m_PrefsRadioStation < HEAD_RADIO)
+ m_PrefsRadioStation = USERTRACK;
+ if (m_PrefsRadioStation > USERTRACK)
+ m_PrefsRadioStation = HEAD_RADIO;
+ } else {
+ if (m_PrefsRadioStation < HEAD_RADIO)
+ m_PrefsRadioStation = CHATTERBOX;
+ if (m_PrefsRadioStation > CHATTERBOX)
+ m_PrefsRadioStation = HEAD_RADIO;
+ }
+ SaveSettings();
+ DMAudio.SetRadioInCar(m_PrefsRadioStation);
+ DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
+ OutputDebugString("FRONTEND RADIO STATION CHANGED");
+ break;
#ifdef ASPECT_RATIO_SCALE
- case MENUACTION_WIDESCREEN:
- if (changeValueBy > 0) {
- m_PrefsUseWideScreen++;
- if (m_PrefsUseWideScreen > 2)
- m_PrefsUseWideScreen = 2;
- }
- else {
- m_PrefsUseWideScreen--;
- if (m_PrefsUseWideScreen < 0)
- m_PrefsUseWideScreen = 0;
- }
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
- SaveSettings();
- break;
-#endif
- case MENUACTION_SCREENRES:
- if (m_bGameNotLoaded) {
- RwChar** videoMods = _psGetVideoModeList();
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
+ case MENUACTION_WIDESCREEN:
if (changeValueBy > 0) {
- do {
- ++m_nDisplayVideoMode;
-
- if (m_nDisplayVideoMode >= _psGetNumVideModes())
- m_nDisplayVideoMode = 0;
- } while (!videoMods[m_nDisplayVideoMode]);
+ m_PrefsUseWideScreen++;
+ if (m_PrefsUseWideScreen > 2)
+ m_PrefsUseWideScreen = 2;
+ } else {
+ m_PrefsUseWideScreen--;
+ if (m_PrefsUseWideScreen < 0)
+ m_PrefsUseWideScreen = 0;
}
- else {
- do {
- --m_nDisplayVideoMode;
-
- if (m_nDisplayVideoMode < 0)
- m_nDisplayVideoMode = _psGetNumVideModes() - 1;
- } while (!videoMods[m_nDisplayVideoMode]);
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
+ SaveSettings();
+ break;
+#endif
+ case MENUACTION_SCREENRES:
+ if (m_bGameNotLoaded) {
+ RwChar** videoMods = _psGetVideoModeList();
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
+ if (changeValueBy > 0) {
+ do {
+ ++m_nDisplayVideoMode;
+
+ if (m_nDisplayVideoMode >= _psGetNumVideModes())
+ m_nDisplayVideoMode = 0;
+ } while (!videoMods[m_nDisplayVideoMode]);
+ } else {
+ do {
+ --m_nDisplayVideoMode;
+
+ if (m_nDisplayVideoMode < 0)
+ m_nDisplayVideoMode = _psGetNumVideModes() - 1;
+ } while (!videoMods[m_nDisplayVideoMode]);
+ }
}
- }
- break;
+ break;
#ifdef IMPROVED_VIDEOMODE
- case MENUACTION_SCREENMODE:
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
- m_nSelectedScreenMode = !m_nSelectedScreenMode;
- break;
+ case MENUACTION_SCREENMODE:
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
+ m_nSelectedScreenMode = !m_nSelectedScreenMode;
+ break;
#endif
- case MENUACTION_AUDIOHW:
- if (m_nPrefsAudio3DProviderIndex != -1) {
- m_nPrefsAudio3DProviderIndex += changeValueBy;
- m_nPrefsAudio3DProviderIndex = clamp(m_nPrefsAudio3DProviderIndex, 0, DMAudio.GetNum3DProvidersAvailable() - 1);
- }
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
- break;
- case MENUACTION_SPEAKERCONF:
- if (m_nPrefsAudio3DProviderIndex != -1) {
- m_PrefsSpeakers -= changeValueBy;
- m_PrefsSpeakers = clamp(m_PrefsSpeakers, 0, 2);
- DMAudio.SetSpeakerConfig(m_PrefsSpeakers);
- SaveSettings();
+ case MENUACTION_AUDIOHW:
+ if (m_nPrefsAudio3DProviderIndex != -1) {
+ m_nPrefsAudio3DProviderIndex += changeValueBy;
+ m_nPrefsAudio3DProviderIndex = clamp(m_nPrefsAudio3DProviderIndex, 0, DMAudio.GetNum3DProvidersAvailable() - 1);
+ }
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
+ break;
+ case MENUACTION_SPEAKERCONF:
+ if (m_nPrefsAudio3DProviderIndex != -1) {
+ m_PrefsSpeakers -= changeValueBy;
+ m_PrefsSpeakers = clamp(m_PrefsSpeakers, 0, 2);
+ DMAudio.SetSpeakerConfig(m_PrefsSpeakers);
+ SaveSettings();
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
+ }
+ break;
+ case MENUACTION_CTRLMETHOD:
+ m_ControlMethod = !m_ControlMethod;
+ CCamera::m_bUseMouse3rdPerson = !m_ControlMethod;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
- }
- break;
- case MENUACTION_CTRLMETHOD:
- m_ControlMethod = !m_ControlMethod;
- CCamera::m_bUseMouse3rdPerson = !m_ControlMethod;
- DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
- SaveSettings();
- break;
+ SaveSettings();
+ break;
}
ProcessOnOffMenuOptions();
if (m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS) {
if (changeValueBy < 1) {
m_nSelectedContSetupColumn = CONTSETUP_PED_COLUMN;
- }
- else {
+ } else {
m_nSelectedContSetupColumn = CONTSETUP_VEHICLE_COLUMN;
}
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0);
}
}
- }
+}
void
CMenuManager::ProcessOnOffMenuOptions()
@@ -5106,7 +4983,7 @@ CMenuManager::RequestFrontEndStartUp()
}
void
-CMenuManager::ResetHelperText()
+CMenuManager::ResetHelperText()
{
m_nHelperTextMsgId = 0;
m_nHelperTextAlpha = 300;
@@ -5116,25 +4993,25 @@ void
CMenuManager::SaveLoadFileError_SetUpErrorScreen()
{
switch (PcSaveHelper.nErrorCode) {
- case SAVESTATUS_ERR_SAVE_CREATE:
- case SAVESTATUS_ERR_SAVE_WRITE:
- case SAVESTATUS_ERR_SAVE_CLOSE:
- ChangeScreen(MENUPAGE_SAVE_FAILED, 0, true, false);
- break;
- case SAVESTATUS_ERR_LOAD_OPEN:
- case SAVESTATUS_ERR_LOAD_READ:
- case SAVESTATUS_ERR_LOAD_CLOSE:
- ChangeScreen(MENUPAGE_LOAD_FAILED, 0, true, false);
- break;
- case SAVESTATUS_ERR_DATA_INVALID:
- ChangeScreen(MENUPAGE_LOAD_FAILED_2, 0, true, false);
- break;
- case SAVESTATUS_DELETEFAILED8:
- case SAVESTATUS_DELETEFAILED9:
- case SAVESTATUS_DELETEFAILED10:
- ChangeScreen(MENUPAGE_DELETE_FAILED, 0, true, false);
- break;
- default: break;
+ case SAVESTATUS_ERR_SAVE_CREATE:
+ case SAVESTATUS_ERR_SAVE_WRITE:
+ case SAVESTATUS_ERR_SAVE_CLOSE:
+ ChangeScreen(MENUPAGE_SAVE_FAILED, 0, true, false);
+ break;
+ case SAVESTATUS_ERR_LOAD_OPEN:
+ case SAVESTATUS_ERR_LOAD_READ:
+ case SAVESTATUS_ERR_LOAD_CLOSE:
+ ChangeScreen(MENUPAGE_LOAD_FAILED, 0, true, false);
+ break;
+ case SAVESTATUS_ERR_DATA_INVALID:
+ ChangeScreen(MENUPAGE_LOAD_FAILED_2, 0, true, false);
+ break;
+ case SAVESTATUS_DELETEFAILED8:
+ case SAVESTATUS_DELETEFAILED9:
+ case SAVESTATUS_DELETEFAILED10:
+ ChangeScreen(MENUPAGE_DELETE_FAILED, 0, true, false);
+ break;
+ default: break;
}
}
@@ -5177,7 +5054,7 @@ CMenuManager::SwitchMenuOnAndOff()
bool menuWasActive = GetIsMenuActive();
// Reminder: You need REGISTER_START_BUTTON defined to make it work.
- if (CPad::GetPad(0)->GetStartJustDown()
+ if (CPad::GetPad(0)->GetStartJustDown()
#ifdef FIX_BUGS
&& !m_bGameNotLoaded
#endif
@@ -5192,8 +5069,7 @@ CMenuManager::SwitchMenuOnAndOff()
if (m_bMenuActive) {
CTimer::StartUserPause();
- }
- else {
+ } else {
#ifdef PS2_LIKE_MENU
bottomBarActive = false;
#endif
@@ -5237,14 +5113,14 @@ CMenuManager::SwitchMenuOnAndOff()
PcSaveHelper.PopulateSlotInfo();
m_nCurrOption = 0;
}
- /* // PS2 leftover
- if (m_nCurrScreen != MENUPAGE_SOUND_SETTINGS && gMusicPlaying)
- {
- DMAudio.StopFrontEndTrack();
- OutputDebugString("FRONTEND AUDIO TRACK STOPPED");
- gMusicPlaying = 0;
- }
- */
+/* // PS2 leftover
+ if (m_nCurrScreen != MENUPAGE_SOUND_SETTINGS && gMusicPlaying)
+ {
+ DMAudio.StopFrontEndTrack();
+ OutputDebugString("FRONTEND AUDIO TRACK STOPPED");
+ gMusicPlaying = 0;
+ }
+*/
if (m_bMenuActive != menuWasActive)
m_bMenuStateChanged = true;
@@ -5279,8 +5155,8 @@ CMenuManager::UnloadTextures()
void
CMenuManager::WaitForUserCD()
{
- CSprite2d* splash;
- char* splashscreen = nil;
+ CSprite2d *splash;
+ char *splashscreen = nil;
#if (!(defined RANDOMSPLASH) && !(defined GTA3_1_1_PATCH))
if (CGame::frenchGame || CGame::germanGame || !CGame::nastyGame)
@@ -5340,190 +5216,189 @@ CMenuManager::PrintController(void)
if (m_DisplayControllerOnFoot) {
switch (CPad::GetPad(0)->Mode) {
- case 0:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_LOF"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_MOV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_ENV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_ATT"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_RUN"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
- break;
- case 1:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_LOF"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_NA"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_ENV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_ATT"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_RUN"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
- break;
- case 2:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_ENV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_MOV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_LOF"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_RUN"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_ATT"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
- break;
- case 3:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_NA"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_LOF"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_RUN"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_ATT"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
- break;
- default:
- return;
+ case 0:
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_LOF"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_MOV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_CAM"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_ENV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_ATT"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_RUN"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
+ break;
+ case 1:
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_LOF"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_CAM"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_NA"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_ENV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_ATT"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_RUN"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
+ break;
+ case 2:
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_ENV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_MOV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_CAM"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_LOF"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_RUN"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_ATT"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
+ break;
+ case 3:
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_CWL"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_NA"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_MOV"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_CAM"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_PAU"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_CWR"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_TAR"));
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_JUM"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_LOF"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_RUN"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_ATT"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_FPC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_LB3"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_R3"));
+ break;
+ default:
+ return;
}
- }
- else {
+ } else {
switch (CPad::GetPad(0)->Mode) {
- case 0:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_RSC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_VES"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_HO3"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_HAB"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_BRA"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_EXV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_CAW"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_ACC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_TUC"));
- // FIX: Coordinates of this line is undefined in PC...
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_SM3"));
- break;
- case 1:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_HOR"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_NA"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_RSC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_HAB"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_BRA"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_EXV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_CAW"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_ACC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_TUC"));
- // FIX: Coordinates of this line is undefined in PC...
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_SM3"));
- break;
- case 2:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_EXV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_VES"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_RS3"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_HOR"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_BRA"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_HAB"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_CAW"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_ACC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_TUC"));
- // FIX: Coordinates of this line is undefined in PC...
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_SM3"));
- break;
- case 3:
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_HAB"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_TUC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_HO3"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_CAM"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
- CFont::SetRightJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
- CFont::SetJustifyOn(); // X
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_CAW"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_SMT"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_EXV"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_RSC"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_NA"));
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_ACC"));
- // FIX: Coordinates of this line is undefined in PC...
- CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_BRA"));
- break;
- default:
- return;
+ case 0:
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_RSC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_VES"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_HO3"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_CAM"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_HAB"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_BRA"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_EXV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_CAW"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_ACC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_TUC"));
+ // FIX: Coordinates of this line is undefined in PC...
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_SM3"));
+ break;
+ case 1:
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_HOR"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_CAM"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_NA"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_RSC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_HAB"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_BRA"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_EXV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_CAW"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_ACC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_TUC"));
+ // FIX: Coordinates of this line is undefined in PC...
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_SM3"));
+ break;
+ case 2:
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_EXV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_VES"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_RS3"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_CAM"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_HOR"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_BRA"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_HAB"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_CAW"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_ACC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_TUC"));
+ // FIX: Coordinates of this line is undefined in PC...
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_SM3"));
+ break;
+ case 3:
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(210.0f), MENU_Y(146.0f), TheText.Get("FEC_LL"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(185.0f), TheText.Get("FEC_HAB"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(225.0f), TheText.Get("FEC_TUC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(156.0f), MENU_Y(257.0f), TheText.Get("FEC_VES"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(263.0f), MENU_Y(301.0f), TheText.Get("FEC_HO3"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(290.0f), MENU_Y(288.0f), TheText.Get("FEC_CAM"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(344.0f), MENU_Y(146.0f), TheText.Get("FEC_PAU"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(185.0f), TheText.Get("FEC_LB"));
+ CFont::SetRightJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(304.0f), MENU_Y(178.0f), TheText.Get("FEC_LR"));
+ CFont::SetJustifyOn(); // X
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(212.0f), TheText.Get("FEC_CAW"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(225.0f), TheText.Get("FEC_SMT"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(238.0f), TheText.Get("FEC_EXV"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(254.0f), TheText.Get("FEC_RSC"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(269.0f), TheText.Get("FEC_NA"));
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(282.0f), TheText.Get("FEC_ACC"));
+ // FIX: Coordinates of this line is undefined in PC...
+ CFont::PrintString(MENU_X_LEFT_ALIGNED(398.0f), MENU_Y(304.0f), TheText.Get("FEC_BRA"));
+ break;
+ default:
+ return;
}
}
@@ -5638,8 +5513,7 @@ CMenuManager::PrintMap(void)
if (m_bShowMouse) {
bMapMouseShownOnce = true;
- }
- else if (!bMapMouseShownOnce) {
+ } else if (!bMapMouseShownOnce) {
mapPoint.x = SCREEN_WIDTH / 2;
mapPoint.y = SCREEN_HEIGHT / 2;
}
@@ -5667,24 +5541,19 @@ CMenuManager::PrintMap(void)
if (CPad::GetPad(0)->GetLeftMouse()) {
fMapCenterX += m_nMousePosX - m_nMouseOldPosX;
fMapCenterY += m_nMousePosY - m_nMouseOldPosY;
- }
- else if (CPad::GetPad(0)->GetLeft() || CPad::GetPad(0)->GetDPadLeft()) {
+ } else if (CPad::GetPad(0)->GetLeft() || CPad::GetPad(0)->GetDPadLeft()) {
fMapCenterX += 15.0f;
- }
- else if (CPad::GetPad(0)->GetRight() || CPad::GetPad(0)->GetDPadRight()) {
+ } else if (CPad::GetPad(0)->GetRight() || CPad::GetPad(0)->GetDPadRight()) {
fMapCenterX -= 15.0f;
- }
- else if (CPad::GetPad(0)->GetLeftStickX()) {
+ } else if (CPad::GetPad(0)->GetLeftStickX()) {
fMapCenterX -= CPad::GetPad(0)->GetLeftStickX() / 128.0f * 20.0f;
}
if (CPad::GetPad(0)->GetUp() || CPad::GetPad(0)->GetDPadUp()) {
fMapCenterY += 15.0f;
- }
- else if (CPad::GetPad(0)->GetDown() || CPad::GetPad(0)->GetDPadDown()) {
+ } else if (CPad::GetPad(0)->GetDown() || CPad::GetPad(0)->GetDPadDown()) {
fMapCenterY -= 15.0f;
- }
- else if (CPad::GetPad(0)->GetLeftStickY()) {
+ } else if (CPad::GetPad(0)->GetLeftStickY()) {
fMapCenterY -= CPad::GetPad(0)->GetLeftStickY() / 128.0f * 20.0f;
}
@@ -5693,14 +5562,13 @@ CMenuManager::PrintMap(void)
ZOOM(mapPoint.x, mapPoint.y, false);
else
ZOOM(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, false);
- }
- else if (CPad::GetPad(0)->GetMouseWheelUp() || CPad::GetPad(0)->GetPageUp() || CPad::GetPad(0)->GetRightShoulder1()) {
+ } else if (CPad::GetPad(0)->GetMouseWheelUp() || CPad::GetPad(0)->GetPageUp() || CPad::GetPad(0)->GetRightShoulder1()) {
if (CPad::GetPad(0)->GetMouseWheelUp())
ZOOM(mapPoint.x, mapPoint.y, true);
else
ZOOM(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, true);
}
-
+
if (fMapCenterX - fMapSize > SCREEN_WIDTH / 2)
fMapCenterX = fMapSize + SCREEN_WIDTH / 2;
@@ -5709,7 +5577,7 @@ CMenuManager::PrintMap(void)
if (fMapCenterY + fMapSize < SCREEN_HEIGHT - MENU_Y(60.0f))
fMapCenterY = SCREEN_HEIGHT - MENU_Y(60.0f) - fMapSize;
-
+
if (fMapCenterY - fMapSize > SCREEN_HEIGHT / 2)
fMapCenterY = SCREEN_HEIGHT / 2 + fMapSize;
@@ -5727,7 +5595,7 @@ CMenuManager::PrintMap(void)
CFont::SetColor(CRGBA(0, 0, 0, FadeIn(255)));
float nextX = MENU_X(30.0f), nextY = 95.0f;
- wchar* text;
+ wchar *text;
#ifdef MORE_LANGUAGES
#define TEXT_PIECE(key,extraSpace) \
text = TheText.Get(key);\
@@ -5789,8 +5657,8 @@ CMenuManager::ConstructStatLine(int rowIdx)
if (CGame::nastyGame) {
STAT_LINE("FEST_RP", &CStats::NumberKillFrenziesPassed, false, &CStats::TotalNumberKillFrenzies);
}
-
- CPlayerInfo& player = CWorld::Players[CWorld::PlayerInFocus];
+
+ CPlayerInfo &player = CWorld::Players[CWorld::PlayerInFocus];
float packagesPercent = 0.0f;
if (player.m_nTotalPackages != 0)
packagesPercent = player.m_nCollectedPackages * 100.0f / player.m_nTotalPackages;
@@ -5807,16 +5675,16 @@ CMenuManager::ConstructStatLine(int rowIdx)
STAT_LINE("TM_BUST", &CStats::TimesArrested, false, nil);
STAT_LINE("TM_DED", &CStats::TimesDied, false, nil);
STAT_LINE("GNG_WST", &(nTemp = CStats::PedsKilledOfThisType[PEDTYPE_GANG9] + CStats::PedsKilledOfThisType[PEDTYPE_GANG8]
- + CStats::PedsKilledOfThisType[PEDTYPE_GANG7] + CStats::PedsKilledOfThisType[PEDTYPE_GANG6]
- + CStats::PedsKilledOfThisType[PEDTYPE_GANG5] + CStats::PedsKilledOfThisType[PEDTYPE_GANG4]
- + CStats::PedsKilledOfThisType[PEDTYPE_GANG3] + CStats::PedsKilledOfThisType[PEDTYPE_GANG2]
- + CStats::PedsKilledOfThisType[PEDTYPE_GANG1]), false, nil);
+ + CStats::PedsKilledOfThisType[PEDTYPE_GANG7] + CStats::PedsKilledOfThisType[PEDTYPE_GANG6]
+ + CStats::PedsKilledOfThisType[PEDTYPE_GANG5] + CStats::PedsKilledOfThisType[PEDTYPE_GANG4]
+ + CStats::PedsKilledOfThisType[PEDTYPE_GANG3] + CStats::PedsKilledOfThisType[PEDTYPE_GANG2]
+ + CStats::PedsKilledOfThisType[PEDTYPE_GANG1]), false, nil);
STAT_LINE("DED_CRI", &(nTemp = CStats::PedsKilledOfThisType[PEDTYPE_CRIMINAL]), false, nil);
STAT_LINE("HEL_DST", &CStats::HelisDestroyed, false, nil);
STAT_LINE("KGS_EXP", &CStats::KgsOfExplosivesUsed, false, nil);
STAT_LINE("ACCURA", &(nTemp = (CStats::InstantHitsFiredByPlayer == 0 ? 0 :
- CStats::InstantHitsHitByPlayer * 100.0f / CStats::InstantHitsFiredByPlayer)), false, nil);
-
+ CStats::InstantHitsHitByPlayer * 100.0f / CStats::InstantHitsFiredByPlayer)), false, nil);
+
if (CStats::ElBurroTime > 0) {
STAT_LINE("ELBURRO", &CStats::ElBurroTime, false, nil);
}
@@ -5861,33 +5729,33 @@ CMenuManager::ConstructStatLine(int rowIdx)
}
switch (m_PrefsLanguage) {
- case LANGUAGE_AMERICAN:
+ case LANGUAGE_AMERICAN:
#ifndef USE_MEASUREMENTS_IN_METERS
- float fTemp;
- STAT_LINE("FEST_DF", &(fTemp = CStats::DistanceTravelledOnFoot * MILES_IN_METER), true, nil);
- STAT_LINE("FEST_DC", &(fTemp = CStats::DistanceTravelledInVehicle * MILES_IN_METER), true, nil);
- STAT_LINE("MMRAIN", &CStats::mmRain, false, nil);
- STAT_LINE("MXCARD", &(fTemp = CStats::MaximumJumpDistance * FEET_IN_METER), true, nil);
- STAT_LINE("MXCARJ", &(fTemp = CStats::MaximumJumpHeight * FEET_IN_METER), true, nil);
- break;
+ float fTemp;
+ STAT_LINE("FEST_DF", &(fTemp = CStats::DistanceTravelledOnFoot * MILES_IN_METER), true, nil);
+ STAT_LINE("FEST_DC", &(fTemp = CStats::DistanceTravelledInVehicle * MILES_IN_METER), true, nil);
+ STAT_LINE("MMRAIN", &CStats::mmRain, false, nil);
+ STAT_LINE("MXCARD", &(fTemp = CStats::MaximumJumpDistance * FEET_IN_METER), true, nil);
+ STAT_LINE("MXCARJ", &(fTemp = CStats::MaximumJumpHeight * FEET_IN_METER), true, nil);
+ break;
#endif
- case LANGUAGE_FRENCH:
- case LANGUAGE_GERMAN:
- case LANGUAGE_ITALIAN:
- case LANGUAGE_SPANISH:
+ case LANGUAGE_FRENCH:
+ case LANGUAGE_GERMAN:
+ case LANGUAGE_ITALIAN:
+ case LANGUAGE_SPANISH:
#ifdef MORE_LANGUAGES
- case LANGUAGE_POLISH:
- case LANGUAGE_RUSSIAN:
- case LANGUAGE_JAPANESE:
+ case LANGUAGE_POLISH:
+ case LANGUAGE_RUSSIAN:
+ case LANGUAGE_JAPANESE:
#endif
- STAT_LINE("FESTDFM", &CStats::DistanceTravelledOnFoot, true, nil);
- STAT_LINE("FESTDCM", &CStats::DistanceTravelledInVehicle, true, nil);
- STAT_LINE("MMRAIN", &CStats::mmRain, false, nil);
- STAT_LINE("MXCARDM", &CStats::MaximumJumpDistance, true, nil);
- STAT_LINE("MXCARJM", &CStats::MaximumJumpHeight, true, nil);
- break;
- default:
- break;
+ STAT_LINE("FESTDFM", &CStats::DistanceTravelledOnFoot, true, nil);
+ STAT_LINE("FESTDCM", &CStats::DistanceTravelledInVehicle, true, nil);
+ STAT_LINE("MMRAIN", &CStats::mmRain, false, nil);
+ STAT_LINE("MXCARDM", &CStats::MaximumJumpDistance, true, nil);
+ STAT_LINE("MXCARJM", &CStats::MaximumJumpHeight, true, nil);
+ break;
+ default:
+ break;
}
STAT_LINE("MXFLIP", &CStats::MaximumJumpFlips, false, nil);
@@ -5897,33 +5765,33 @@ CMenuManager::ConstructStatLine(int rowIdx)
if (counter == rowIdx) {
gUString[0] = '\0';
switch (CStats::BestStuntJump) {
- case 1:
- UnicodeStrcpy(gUString2, TheText.Get("INSTUN"));
- return 0;
- case 2:
- UnicodeStrcpy(gUString2, TheText.Get("PRINST"));
- return 0;
- case 3:
- UnicodeStrcpy(gUString2, TheText.Get("DBINST"));
- return 0;
- case 4:
- UnicodeStrcpy(gUString2, TheText.Get("DBPINS"));
- return 0;
- case 5:
- UnicodeStrcpy(gUString2, TheText.Get("TRINST"));
- return 0;
- case 6:
- UnicodeStrcpy(gUString2, TheText.Get("PRTRST"));
- return 0;
- case 7:
- UnicodeStrcpy(gUString2, TheText.Get("QUINST"));
- return 0;
- case 8:
- UnicodeStrcpy(gUString2, TheText.Get("PQUINS"));
- return 0;
- default:
- UnicodeStrcpy(gUString2, TheText.Get("NOSTUC"));
- return 0;
+ case 1:
+ UnicodeStrcpy(gUString2, TheText.Get("INSTUN"));
+ return 0;
+ case 2:
+ UnicodeStrcpy(gUString2, TheText.Get("PRINST"));
+ return 0;
+ case 3:
+ UnicodeStrcpy(gUString2, TheText.Get("DBINST"));
+ return 0;
+ case 4:
+ UnicodeStrcpy(gUString2, TheText.Get("DBPINS"));
+ return 0;
+ case 5:
+ UnicodeStrcpy(gUString2, TheText.Get("TRINST"));
+ return 0;
+ case 6:
+ UnicodeStrcpy(gUString2, TheText.Get("PRTRST"));
+ return 0;
+ case 7:
+ UnicodeStrcpy(gUString2, TheText.Get("QUINST"));
+ return 0;
+ case 8:
+ UnicodeStrcpy(gUString2, TheText.Get("PQUINS"));
+ return 0;
+ default:
+ UnicodeStrcpy(gUString2, TheText.Get("NOSTUC"));
+ return 0;
}
}
counter++;
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 6804b938..bed943a1 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -143,7 +143,7 @@ void BlowUpCarsCheat()
int i = CPools::GetVehiclePool()->GetSize();
while (i-- > 0) {
- if (CVehicle* veh = CPools::GetVehiclePool()->GetSlot(i))
+ if (CVehicle *veh = CPools::GetVehiclePool()->GetSlot(i))
veh->BlowUpCar(nil);
}
}
@@ -154,18 +154,18 @@ void ChangePlayerCheat()
if (FindPlayerPed()->IsPedInControl() && CModelInfo::GetModelInfo("player", nil)) {
CHud::SetHelpMessage(TheText.Get("CHEAT1"), true);
- CPlayerPed* ped = FindPlayerPed();
+ CPlayerPed *ped = FindPlayerPed();
AssocGroupId AnimGrp = ped->m_animGroup;
do
{
do
- modelId = CGeneral::GetRandomNumberInRange(0, MI_WFYG2 + 1);
+ modelId = CGeneral::GetRandomNumberInRange(0, MI_WFYG2+1);
while (!CModelInfo::GetModelInfo(modelId));
} while (modelId == MI_TAXI_D);
uint8 flags = CStreaming::ms_aInfoForModel[modelId].m_flags;
ped->DeleteRwObject();
- CStreaming::RequestModel(modelId, STREAMFLAGS_DEPENDENCY | STREAMFLAGS_DONT_REMOVE);
+ CStreaming::RequestModel(modelId, STREAMFLAGS_DEPENDENCY| STREAMFLAGS_DONT_REMOVE);
CStreaming::LoadAllRequestedModels(false);
ped->m_modelIndex = -1;
ped->SetModelIndex(modelId);
@@ -185,7 +185,7 @@ void MayhemCheat()
PED_FLAG_CIVMALE | PED_FLAG_CIVFEMALE | PED_FLAG_COP | PED_FLAG_GANG1 |
PED_FLAG_GANG2 | PED_FLAG_GANG3 | PED_FLAG_GANG4 | PED_FLAG_GANG5 |
PED_FLAG_GANG6 | PED_FLAG_GANG7 | PED_FLAG_GANG8 | PED_FLAG_GANG9 |
- PED_FLAG_EMERGENCY | PED_FLAG_PROSTITUTE | PED_FLAG_CRIMINAL | PED_FLAG_SPECIAL);
+ PED_FLAG_EMERGENCY | PED_FLAG_PROSTITUTE | PED_FLAG_CRIMINAL | PED_FLAG_SPECIAL );
}
void EverybodyAttacksPlayerCheat()
@@ -311,15 +311,14 @@ void PinkCarsCheat()
#ifdef KANGAROO_CHEAT
void KangarooCheat()
{
- wchar* string;
- CPed* playerPed = FindPlayerPed();
+ wchar *string;
+ CPed *playerPed = FindPlayerPed();
int m_fMass;
if (playerPed->m_ped_flagI80) {
string = TheText.Get("CHEATOF");
m_fMass = 70.0f;
- }
- else {
+ } else {
string = TheText.Get("CHEAT1");
m_fMass = 15.0f;
}
@@ -368,8 +367,8 @@ bool
CControllerState::IsAnyButtonPressed(void)
{
return !!LeftStickX || !!LeftStickY || !!RightStickX || !!RightStickY || !!LeftShoulder1 || !!LeftShoulder2 || !!RightShoulder1 || !!RightShoulder2 ||
- !!DPadUp || !!DPadDown || !!DPadLeft || !!DPadRight || !!Start || !!Select || !!Square || !!Triangle || !!Cross || !!Circle || !!LeftShock ||
- !!RightShock || !!NetworkTalk;
+ !!DPadUp || !!DPadDown || !!DPadLeft || !!DPadRight || !!Start || !!Select || !!Square || !!Triangle || !!Cross || !!Circle || !!LeftShock ||
+ !!RightShock || !!NetworkTalk;
}
#endif
@@ -387,24 +386,24 @@ CControllerState::Clear(void)
void CKeyboardState::Clear()
{
- for (int32 i = 0; i < 12; i++)
+ for ( int32 i = 0; i < 12; i++ )
F[i] = 0;
-
- for (int32 i = 0; i < 256; i++)
+
+ for ( int32 i = 0; i < 256; i++ )
VK_KEYS[i] = 0;
ESC = INS = DEL = HOME = END = PGUP = PGDN = 0;
-
+
UP = DOWN = LEFT = RIGHT = 0;
-
+
NUMLOCK = 0;
-
+
DIV = MUL = SUB = ADD = 0;
-
+
DECIMAL = NUM1 = NUM2 = NUM3 = NUM4 = 0;
-
+
NUM5 = NUM6 = NUM7 = NUM8 = 0;
-
+
NUM9 = NUM0 = SCROLLLOCK = PAUSE = 0;
BACKSP = TAB = CAPSLOCK = EXTENTER = 0;
@@ -422,10 +421,10 @@ void CPad::Initialise(void)
CPad::GetPad(i)->Clear(true);
CPad::GetPad(i)->Mode = 0;
}
-
- bObsoleteControllerMessage = false;
+
+ bObsoleteControllerMessage = false;
bOldDisplayNoControllerMessage = false;
- bDisplayNoControllerMessage = false;
+ bDisplayNoControllerMessage = false;
}
#endif
@@ -433,37 +432,37 @@ void CPad::Clear(bool bResetPlayerControls)
{
NewState.Clear();
OldState.Clear();
-
+
PCTempKeyState.Clear();
PCTempJoyState.Clear();
PCTempMouseState.Clear();
-
+
NewKeyState.Clear();
OldKeyState.Clear();
TempKeyState.Clear();
-
+
NewMouseControllerState.Clear();
OldMouseControllerState.Clear();
PCTempMouseControllerState.Clear();
-
+
Phase = 0;
ShakeFreq = 0;
ShakeDur = 0;
-
- if (bResetPlayerControls)
+
+ if ( bResetPlayerControls )
DisablePlayerControls = PLAYERCONTROL_ENABLED;
-
+
bApplyBrakes = false;
-
-
- for (int32 i = 0; i < HORNHISTORY_SIZE; i++)
+
+
+ for ( int32 i = 0; i < HORNHISTORY_SIZE; i++ )
bHornHistory[i] = false;
-
+
iCurrHornHistory = 0;
-
- for (int32 i = 0; i < ARRAY_SIZE(CheatString); i++)
+
+ for ( int32 i = 0; i < ARRAY_SIZE(CheatString); i++ )
CheatString[i] = ' ';
-
+
LastTimeTouched = CTimer::GetTimeInMilliseconds();
AverageWeapon = 0;
AverageEntries = 0;
@@ -485,7 +484,7 @@ CMouseControllerState::CMouseControllerState()
WHEELDN = 0;
MXB1 = 0;
MXB2 = 0;
-
+
x = 0.0f;
y = 0.0f;
}
@@ -504,35 +503,35 @@ void CMouseControllerState::Clear()
CMouseControllerState CMousePointerStateHelper::GetMouseSetUp()
{
CMouseControllerState state;
-
+
#if defined RW_D3D9 || defined RWLIBS
- if (PSGLOBAL(mouse) == nil)
+ if ( PSGLOBAL(mouse) == nil )
_InputInitialiseMouse();
-
- if (PSGLOBAL(mouse) != nil)
+
+ if ( PSGLOBAL(mouse) != nil )
{
DIDEVCAPS devCaps;
devCaps.dwSize = sizeof(DIDEVCAPS);
-
+
PSGLOBAL(mouse)->GetCapabilities(&devCaps);
- switch (devCaps.dwButtons)
+ switch ( devCaps.dwButtons )
{
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- state.MMB = true;
-
- case 2:
- state.RMB = true;
-
- case 1:
- state.LMB = true;
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ state.MMB = true;
+
+ case 2:
+ state.RMB = true;
+
+ case 1:
+ state.LMB = true;
}
-
- if (devCaps.dwAxes == 3)
+
+ if ( devCaps.dwAxes == 3 )
{
state.WHEELDN = true;
state.WHEELUP = true;
@@ -557,29 +556,29 @@ CMouseControllerState CMousePointerStateHelper::GetMouseSetUp()
void CPad::UpdateMouse()
{
- if (IsForegroundApp())
+ if ( IsForegroundApp() )
{
#if defined RW_D3D9 || defined RWLIBS
- if (PSGLOBAL(mouse) == nil)
+ if ( PSGLOBAL(mouse) == nil )
_InputInitialiseMouse();
-
+
DIMOUSESTATE2 state;
-
- if (PSGLOBAL(mouse) != nil && SUCCEEDED(_InputGetMouseState(&state)))
+
+ if ( PSGLOBAL(mouse) != nil && SUCCEEDED(_InputGetMouseState(&state)) )
{
int32 signX = 1;
int32 signy = 1;
- if (!FrontEndMenuManager.m_bMenuActive)
+ if ( !FrontEndMenuManager.m_bMenuActive )
{
- if (MousePointerStateHelper.bInvertVertically)
+ if ( MousePointerStateHelper.bInvertVertically )
signy = -1;
- if (MousePointerStateHelper.bInvertHorizontally)
+ if ( MousePointerStateHelper.bInvertHorizontally )
signX = -1;
}
-
+
PCTempMouseControllerState.Clear();
-
+
PCTempMouseControllerState.x = (float)(signX * state.lX);
PCTempMouseControllerState.y = (float)(signy * state.lY);
PCTempMouseControllerState.LMB = state.rgbButtons[0] & 128;
@@ -587,12 +586,12 @@ void CPad::UpdateMouse()
PCTempMouseControllerState.MMB = state.rgbButtons[2] & 128;
PCTempMouseControllerState.MXB1 = state.rgbButtons[3] & 128;
PCTempMouseControllerState.MXB2 = state.rgbButtons[4] & 128;
-
- if (state.lZ > 0)
+
+ if ( state.lZ > 0 )
PCTempMouseControllerState.WHEELUP = 1;
- else if (state.lZ < 0)
+ else if ( state.lZ < 0 )
PCTempMouseControllerState.WHEELDN = 1;
-
+
OldMouseControllerState = NewMouseControllerState;
NewMouseControllerState = PCTempMouseControllerState;
}
@@ -638,15 +637,15 @@ void CPad::UpdateMouse()
}
}
-CControllerState CPad::ReconcileTwoControllersInput(CControllerState const& State1, CControllerState const& State2)
+CControllerState CPad::ReconcileTwoControllersInput(CControllerState const &State1, CControllerState const &State2)
{
static CControllerState ReconState;
-
+
ReconState.Clear();
#define _RECONCILE_BUTTON(button) \
{ if ( State1.button || State2.button ) ReconState.button = 255; }
-
+
#define _RECONCILE_AXIS_POSITIVE(axis) \
{ if ( State1.axis >= 0 && State2.axis >= 0 ) ReconState.axis = Max(State1.axis, State2.axis); }
@@ -655,10 +654,10 @@ CControllerState CPad::ReconcileTwoControllersInput(CControllerState const& Stat
#define _RECONCILE_AXIS(axis) \
{ _RECONCILE_AXIS_POSITIVE(axis); _RECONCILE_AXIS_NEGATIVE(axis); }
-
+
#define _FIX_AXIS_DIR(axis) \
{ if ( State1.axis > 0 && State2.axis < 0 || State1.axis < 0 && State2.axis > 0 ) ReconState.axis = 0; }
-
+
#define _FIX_RECON_DIR(pos, neg, axis) \
{ if ( (ReconState.pos || ReconState.axis < 0) && (ReconState.neg || ReconState.axis > 0) ) { ReconState.pos = 0; ReconState.neg = 0; ReconState.axis = 0; } }
@@ -691,7 +690,7 @@ CControllerState CPad::ReconcileTwoControllersInput(CControllerState const& Stat
_FIX_RECON_DIR(DPadLeft, DPadRight, LeftStickX);
return ReconState;
-
+
#undef _RECONCILE_BUTTON
#undef _RECONCILE_AXIS_POSITIVE
#undef _RECONCILE_AXIS_NEGATIVE
@@ -702,20 +701,20 @@ CControllerState CPad::ReconcileTwoControllersInput(CControllerState const& Stat
void CPad::StartShake(int16 nDur, uint8 nFreq)
{
- if (!CMenuManager::m_PrefsUseVibration)
+ if ( !CMenuManager::m_PrefsUseVibration )
return;
-
- if (CCutsceneMgr::IsRunning() || CGame::playingIntro)
+
+ if ( CCutsceneMgr::IsRunning() || CGame::playingIntro )
return;
-
- if (nFreq == 0)
+
+ if ( nFreq == 0 )
{
ShakeDur = 0;
ShakeFreq = 0;
return;
}
-
- if (nDur > ShakeDur)
+
+ if ( nDur > ShakeDur )
{
ShakeDur = nDur;
ShakeFreq = nFreq;
@@ -724,24 +723,24 @@ void CPad::StartShake(int16 nDur, uint8 nFreq)
void CPad::StartShake_Distance(int16 nDur, uint8 nFreq, float fX, float fY, float fZ)
{
- if (!CMenuManager::m_PrefsUseVibration)
+ if ( !CMenuManager::m_PrefsUseVibration )
return;
-
- if (CCutsceneMgr::IsRunning() || CGame::playingIntro)
+
+ if ( CCutsceneMgr::IsRunning() || CGame::playingIntro )
return;
-
- float fDist = (TheCamera.GetPosition() - CVector(fX, fY, fZ)).Magnitude();
-
- if (fDist < 70.0f)
+
+ float fDist = ( TheCamera.GetPosition() - CVector(fX, fY, fZ) ).Magnitude();
+
+ if ( fDist < 70.0f )
{
- if (nFreq == 0)
+ if ( nFreq == 0 )
{
ShakeDur = 0;
ShakeFreq = 0;
return;
}
-
- if (nDur > ShakeDur)
+
+ if ( nDur > ShakeDur )
{
ShakeDur = nDur;
ShakeFreq = nFreq;
@@ -751,22 +750,22 @@ void CPad::StartShake_Distance(int16 nDur, uint8 nFreq, float fX, float fY, floa
void CPad::StartShake_Train(float fX, float fY)
{
- if (!CMenuManager::m_PrefsUseVibration)
+ if ( !CMenuManager::m_PrefsUseVibration )
return;
-
- if (CCutsceneMgr::IsRunning() || CGame::playingIntro)
+
+ if ( CCutsceneMgr::IsRunning() || CGame::playingIntro )
return;
-
- if (FindPlayerVehicle() != nil && FindPlayerVehicle()->IsTrain())
+
+ if (FindPlayerVehicle() != nil && FindPlayerVehicle()->IsTrain() )
return;
-
- float fDist = (TheCamera.GetPosition() - CVector(fX, fY, 0.0f)).Magnitude2D();
-
- if (fDist < 70.0f)
+
+ float fDist = ( TheCamera.GetPosition() - CVector(fX, fY, 0.0f) ).Magnitude2D();
+
+ if ( fDist < 70.0f )
{
int32 freq = (int32)((70.0f - fDist) * 70.0f / 70.0f + 30.0f);
- if (ShakeDur < 100)
+ if ( ShakeDur < 100 )
{
ShakeDur = 100;
ShakeFreq = freq;
@@ -777,102 +776,102 @@ void CPad::StartShake_Train(float fX, float fY)
#ifdef GTA_PS2_STUFF
void CPad::AddToCheatString(char c)
{
- for (int32 i = ARRAY_SIZE(CheatString) - 2; i >= 0; i--)
+ for ( int32 i = ARRAY_SIZE(CheatString) - 2; i >= 0; i-- )
CheatString[i + 1] = CheatString[i];
-
+
CheatString[0] = c;
#define _CHEATCMP(str) strncmp(str, CheatString, sizeof(str)-1)
// "4414LDRULDRU" - R2 R2 L1 R2 LEFT DOWN RIGHT UP LEFT DOWN RIGHT UP
- if (!_CHEATCMP("URDLURDL4144"))
+ if ( !_CHEATCMP("URDLURDL4144") )
WeaponCheat();
// "4411LDRULDRU" - R2 R2 L1 L1 LEFT DOWN RIGHT UP LEFT DOWN RIGHT UP
- else if (!_CHEATCMP("URDLURDL1144"))
+ else if ( !_CHEATCMP("URDLURDL1144") )
MoneyCheat();
-
+
// "4412LDRULDRU" - R2 R2 L1 L2 LEFT DOWN RIGHT UP LEFT DOWN RIGHT UP
- else if (!_CHEATCMP("URDLURDL2144"))
+ else if ( !_CHEATCMP("URDLURDL2144") )
ArmourCheat();
-
+
// "4413LDRULDRU" - R2 R2 L1 R1 LEFT DOWN RIGHT UP LEFT DOWN RIGHT UP
- else if (!_CHEATCMP("URDLURDL3144"))
+ else if ( !_CHEATCMP("URDLURDL3144") )
HealthCheat();
// "4414LRLRLR" - R2 R2 L1 R2 LEFT RIGHT LEFT RIGHT LEFT RIGHT
- else if (!_CHEATCMP("RLRLRL4144"))
+ else if ( !_CHEATCMP("RLRLRL4144") )
WantedLevelUpCheat();
-
+
// "4414UDUDUD" - R2 R2 L1 R2 UP DOWN UP DOWN UP DOWN
- else if (!_CHEATCMP("DUDUDU4144"))
+ else if ( !_CHEATCMP("DUDUDU4144") )
WantedLevelDownCheat();
-
+
// "1234432T" - L1 L2 R1 R2 R2 R1 L2 TRIANGLE
- else if (!_CHEATCMP("T2344321"))
+ else if ( !_CHEATCMP("T2344321") )
SunnyWeatherCheat();
-
+
// "1234432S" - L1 L2 R1 R2 R2 R1 L2 SQUARE
- else if (!_CHEATCMP("S2344321"))
+ else if ( !_CHEATCMP("S2344321") )
CloudyWeatherCheat();
-
+
// "1234432C" - L1 L2 R1 R2 R2 R1 L2 CIRCLE
- else if (!_CHEATCMP("C2344321"))
+ else if ( !_CHEATCMP("C2344321") )
RainyWeatherCheat();
-
+
// "1234432X" - L1 L2 R1 R2 R2 R1 L2 CROSS
- else if (!_CHEATCMP("X2344321"))
+ else if ( !_CHEATCMP("X2344321") )
FoggyWeatherCheat();
-
+
// "CCCCCC321TCT" - CIRCLE CIRCLE CIRCLE CIRCLE CIRCLE CIRCLE R1 L2 L1 TRIANGLE CIRCLE TRIANGLE
- else if (!_CHEATCMP("TCT123CCCCCC"))
+ else if ( !_CHEATCMP("TCT123CCCCCC") )
VehicleCheat(true, MI_RHINO);
-
+
// "CCCSSSSS1TCT" - CIRCLE CIRCLE CIRCLE SQUARE SQUARE SQUARE SQUARE SQUARE L1 TRIANGLE CIRCLE TRIANGLE
- else if (!_CHEATCMP("TCT1SSSSSCCC"))
+ else if ( !_CHEATCMP("TCT1SSSSSCCC") )
FastWeatherCheat();
-
+
// "241324TSCT21" - L2 R2 L1 R1 L2 R2 TRIANGLE SQUARE CIRCLE TRIANGLE L2 L1
- else if (!_CHEATCMP("12TCST423142"))
+ else if ( !_CHEATCMP("12TCST423142") )
BlowUpCarsCheat();
-
+
// "RDLU12ULDR" - RIGHT DOWN LEFT UP L1 L2 UP LEFT DOWN RIGHT
- else if (!_CHEATCMP("RDLU21ULDR"))
+ else if ( !_CHEATCMP("RDLU21ULDR") )
ChangePlayerCheat();
-
+
// "DULUX3421" - DOWN UP LEFT UP CROSS R1 R2 L2 L1
- else if (!_CHEATCMP("1243XULUD"))
+ else if ( !_CHEATCMP("1243XULUD") )
MayhemCheat();
-
+
// "DULUX3412" - DOWN UP LEFT UP CROSS R1 R2 L1 L2
- else if (!_CHEATCMP("2143XULUD"))
+ else if ( !_CHEATCMP("2143XULUD") )
EverybodyAttacksPlayerCheat();
-
+
// "43TX21UD" - R2 R1 TRIANGLE CROSS L2 L1 UP DOWN
- else if (!_CHEATCMP("DU12XT34"))
+ else if ( !_CHEATCMP("DU12XT34") )
WeaponsForAllCheat();
-
+
// "TURDS12" - TRIANGLE UP RIGHT DOWN SQUARE L1 L2
- else if (!_CHEATCMP("21SDRUT"))
+ else if ( !_CHEATCMP("21SDRUT") )
FastTimeCheat();
-
+
// "TURDS34" - TRIANGLE UP RIGHT DOWN SQUARE R1 R2
- else if (!_CHEATCMP("43SDRUT"))
+ else if ( !_CHEATCMP("43SDRUT") )
SlowTimeCheat();
// "11S4T1T" - L1 L1 SQUARE R2 TRIANGLE L1 TRIANGLE
- else if (!_CHEATCMP("T1T4S11"))
+ else if ( !_CHEATCMP("T1T4S11") )
OnlyRenderWheelsCheat();
-
+
// "R4C32D13" - RIGHT R2 CIRCLE R1 L2 DOWN L1 R1
- else if (!_CHEATCMP("31D23C4R"))
+ else if ( !_CHEATCMP("31D23C4R") )
ChittyChittyBangBangCheat();
-
+
// "3141L33T" - R1 L1 R2 L1 LEFT R1 R1 TRIANGLE
- else if (!_CHEATCMP("T33L1413"))
+ else if ( !_CHEATCMP("T33L1413") )
StrongGripCheat();
-
+
// "S1CD13TR1X" - SQUARE L1 CIRCLE DOWN L1 R1 TRIANGLE RIGHT L1 CROSS
- else if (!_CHEATCMP("X1RT31DC1S"))
+ else if ( !_CHEATCMP("X1RT31DC1S") )
NastyLimbsCheat();
#undef _CHEATCMP
}
@@ -880,153 +879,153 @@ void CPad::AddToCheatString(char c)
void CPad::AddToPCCheatString(char c)
{
- for (int32 i = ARRAY_SIZE(KeyBoardCheatString) - 2; i >= 0; i--)
+ for ( int32 i = ARRAY_SIZE(KeyBoardCheatString) - 2; i >= 0; i-- )
KeyBoardCheatString[i + 1] = KeyBoardCheatString[i];
-
+
KeyBoardCheatString[0] = c;
-
-#define _CHEATCMP(str) strncmp(str, KeyBoardCheatString, sizeof(str)-1)
-
+
+ #define _CHEATCMP(str) strncmp(str, KeyBoardCheatString, sizeof(str)-1)
+
// "GUNSGUNSGUNS"
- if (!_CHEATCMP("SNUGSNUGSNUG"))
+ if ( !_CHEATCMP("SNUGSNUGSNUG") )
WeaponCheat();
// "IFIWEREARICHMAN"
- if (!_CHEATCMP("NAMHCIRAEREWIFI"))
+ if ( !_CHEATCMP("NAMHCIRAEREWIFI") )
MoneyCheat();
-
+
// "GESUNDHEIT"
- if (!_CHEATCMP("TIEHDNUSEG"))
+ if ( !_CHEATCMP("TIEHDNUSEG") )
HealthCheat();
-
+
// "MOREPOLICEPLEASE"
- if (!_CHEATCMP("ESAELPECILOPEROM"))
+ if ( !_CHEATCMP("ESAELPECILOPEROM") )
WantedLevelUpCheat();
-
+
// "NOPOLICEPLEASE"
- if (!_CHEATCMP("ESAELPECILOPON"))
+ if ( !_CHEATCMP("ESAELPECILOPON") )
WantedLevelDownCheat();
// "PANZER"
- if (!_CHEATCMP("REZNAP"))
+ if ( !_CHEATCMP("REZNAP") )
VehicleCheat(true, MI_RHINO);
// "TRAVELINSTYLE"
- if (!_CHEATCMP("ELYTSNILEVART"))
+ if ( !_CHEATCMP("ELYTSNILEVART") )
VehicleCheat(true, MI_BLOODRA);
// "GETTHEREQUICKLY"
- if (!_CHEATCMP("YLKCIUQEREHTTEG"))
+ if ( !_CHEATCMP("YLKCIUQEREHTTEG") )
VehicleCheat(true, MI_BLOODRB);
// "GETTHEREFAST"
- if (!_CHEATCMP("TSAFEREHTTEG"))
+ if ( !_CHEATCMP("TSAFEREHTTEG") )
VehicleCheat(true, MI_SABRETUR);
// "GETTHEREVERYFASTINDEED"
- if (!_CHEATCMP("DEEDNITSAFYREVEREHTTEG"))
+ if ( !_CHEATCMP("DEEDNITSAFYREVEREHTTEG") )
VehicleCheat(true, MI_HOTRINA);
// "GETTHEREAMAZINGLYFAST"
- if (!_CHEATCMP("TSAFYLGNIZAMAEREHTTEG"))
+ if ( !_CHEATCMP("TSAFYLGNIZAMAEREHTTEG") )
VehicleCheat(true, MI_HOTRINB);
// "THELASTRIDE"
- if (!_CHEATCMP("EDIRTSALEHT"))
+ if ( !_CHEATCMP("EDIRTSALEHT") )
VehicleCheat(true, MI_ROMERO);
// "ROCKANDROLLCAR"
- if (!_CHEATCMP("RACLLORDNAKCOR"))
+ if ( !_CHEATCMP("RACLLORDNAKCOR") )
VehicleCheat(true, MI_LOVEFIST);
// "RUBBISHCAR"
- if (!_CHEATCMP("RACHSIBBUR"))
+ if ( !_CHEATCMP("RACHSIBBUR") )
VehicleCheat(true, MI_TRASH);
// "BETTERTHANWALKING"
- if (!_CHEATCMP("GNIKLAWNAHTRETTEB"))
+ if ( !_CHEATCMP("GNIKLAWNAHTRETTEB") )
VehicleCheat(true, MI_CADDY);
-
+
// "BANGBANGBANG"
- if (!_CHEATCMP("GNABGNABGNAB"))
+ if ( !_CHEATCMP("GNABGNABGNAB") )
BlowUpCarsCheat();
-
+
// "ILIKEDRESSINGUP"
- if (!_CHEATCMP("PUGNISSERDEKILI"))
+ if ( !_CHEATCMP("PUGNISSERDEKILI") )
ChangePlayerCheat();
-
+
// "ITSALLGOINGMAAAD"
- if (!_CHEATCMP("DAAAMGNIOGLLASTI"))
+ if ( !_CHEATCMP("DAAAMGNIOGLLASTI") )
MayhemCheat();
-
+
// "NOBODYLIKESME"
- if (!_CHEATCMP("EMSEKILYDOBON"))
+ if ( !_CHEATCMP("EMSEKILYDOBON") )
EverybodyAttacksPlayerCheat();
-
+
// "WEAPONSFORALL"
- if (!_CHEATCMP("LLAROFSNOPAEW"))
+ if ( !_CHEATCMP("LLAROFSNOPAEW") )
WeaponsForAllCheat();
-
+
// "TIMEFLIESWHENYOU"
- if (!_CHEATCMP("UOYNEHWSEILFEMIT"))
+ if ( !_CHEATCMP("UOYNEHWSEILFEMIT") )
FastTimeCheat();
-
+
// "BOOOOORING"
- if (!_CHEATCMP("GNIROOOOOB"))
+ if ( !_CHEATCMP("GNIROOOOOB") )
SlowTimeCheat();
-
+
#ifndef GTA3_1_1_PATCH
// "TURTOISE"
- if (!_CHEATCMP("ESIOTRUT"))
+ if ( !_CHEATCMP("ESIOTRUT") )
ArmourCheat();
#else
// "TORTOISE"
- if (!_CHEATCMP("ESIOTROT"))
+ if ( !_CHEATCMP("ESIOTROT") )
ArmourCheat();
#endif
-
+
// "SKINCANCERFORME"
- if (!_CHEATCMP("EMROFRECNACNIKS"))
+ if ( !_CHEATCMP("EMROFRECNACNIKS") )
SunnyWeatherCheat();
-
+
// "ILIKESCOTLAND"
- if (!_CHEATCMP("DNALTOCSEKILI"))
+ if ( !_CHEATCMP("DNALTOCSEKILI") )
CloudyWeatherCheat();
-
+
// "ILOVESCOTLAND"
- if (!_CHEATCMP("DNALTOCSEVOLI"))
+ if ( !_CHEATCMP("DNALTOCSEVOLI") )
RainyWeatherCheat();
-
+
// "PEASOUP"
- if (!_CHEATCMP("PUOSAEP"))
+ if ( !_CHEATCMP("PUOSAEP") )
FoggyWeatherCheat();
-
+
// "MADWEATHER"
- if (!_CHEATCMP("REHTAEWDAM"))
+ if ( !_CHEATCMP("REHTAEWDAM") )
FastWeatherCheat();
-
+
// "ANICESETOFWHEELS"
- if (!_CHEATCMP("SLEEHWFOTESECINA"))
+ if ( !_CHEATCMP("SLEEHWFOTESECINA") )
OnlyRenderWheelsCheat();
-
+
// "CHITTYCHITTYBB"
- if (!_CHEATCMP("BBYTTIHCYTTIHC"))
+ if ( !_CHEATCMP("BBYTTIHCYTTIHC") )
ChittyChittyBangBangCheat();
-
+
// "CORNERSLIKEMAD"
- if (!_CHEATCMP("DAMEKILSRENROC"))
+ if ( !_CHEATCMP("DAMEKILSRENROC") )
StrongGripCheat();
-
+
// "NASTYLIMBSCHEAT"
- if (!_CHEATCMP("TAEHCSBMILYTSAN"))
+ if ( !_CHEATCMP("TAEHCSBMILYTSAN") )
NastyLimbsCheat();
// "IWANTITPAINTEDBLACK"
- if (!_CHEATCMP("KCALBDETNIAPTITNAWI"))
+ if ( !_CHEATCMP("KCALBDETNIAPTITNAWI") )
BlackCarsCheat();
// "AHAIRDRESSERSCAR"
- if (!_CHEATCMP("RACSRESSERDRIAHA"))
+ if ( !_CHEATCMP("RACSRESSERDRIAHA") )
PinkCarsCheat();
#ifdef KANGAROO_CHEAT
@@ -1052,8 +1051,8 @@ void CPad::AddToPCCheatString(char c)
if (!_CHEATCMP("ODODRETSAMOTTNAWI"))
AltDodoCheat();
#endif
-
-#undef _CHEATCMP
+
+ #undef _CHEATCMP
}
#ifdef XINPUT
@@ -1103,7 +1102,7 @@ void CPad::AffectFromXinput(uint32 pad)
uint16 iLeftMotor = (uint16)((float)ShakeFreq / 255.0f * (float)0xffff);
uint16 iRightMotor = (uint16)((float)ShakeFreq / 255.0f * (float)0xffff);
-
+
if (ShakeDur < CTimer::GetTimeStepInMilliseconds())
ShakeDur = 0;
else
@@ -1118,10 +1117,10 @@ void CPad::AffectFromXinput(uint32 pad)
}
#endif
-void CPad::UpdatePads(void)
+void CPad::UpdatePads(void)
{
bool bUpdate = true;
-
+
GetPad(0)->UpdateMouse();
#ifdef XINPUT
GetPad(0)->AffectFromXinput(0);
@@ -1143,11 +1142,11 @@ void CPad::UpdatePads(void)
if (IsAffectedByController && (GetPad(0)->PCTempKeyState.IsAnyButtonPressed() || GetPad(0)->PCTempMouseState.IsAnyButtonPressed()))
IsAffectedByController = false;
#endif
-
- if (CReplay::IsPlayingBackFromFile())
+
+ if ( CReplay::IsPlayingBackFromFile() )
bUpdate = false;
-
- if (bUpdate)
+
+ if ( bUpdate )
{
GetPad(0)->Update(0);
GetPad(1)->Update(0);
@@ -1157,7 +1156,7 @@ void CPad::UpdatePads(void)
GetPad(1)->NewState.Clear();
GetPad(1)->OldState.Clear();
#endif
-
+
OldKeyState = NewKeyState;
NewKeyState = TempKeyState;
}
@@ -1170,7 +1169,7 @@ void CPad::ProcessPCSpecificStuff(void)
void CPad::Update(int16 unk)
{
OldState = NewState;
-
+
#if (defined GTA_PS2 || defined FIX_BUGS)
if (!CRecordDataForGame::IsPlayingBack() && !CRecordDataForChase::ShouldThisPadBeLeftAlone(unk))
#endif
@@ -1182,16 +1181,16 @@ void CPad::Update(int16 unk)
PCTempJoyState.Clear();
PCTempKeyState.Clear();
PCTempMouseState.Clear();
-
+
ProcessPCSpecificStuff();
-
- if (++iCurrHornHistory >= HORNHISTORY_SIZE)
+
+ if ( ++iCurrHornHistory >= HORNHISTORY_SIZE )
iCurrHornHistory = 0;
bHornHistory[iCurrHornHistory] = GetHorn();
- if (!bDisplayNoControllerMessage)
+ if ( !bDisplayNoControllerMessage )
CGame::bDemoMode = false;
}
@@ -1206,40 +1205,40 @@ void CPad::DoCheats(void)
void CPad::DoCheats(int16 unk)
{
#ifdef GTA_PS2_STUFF
- if (GetTriangleJustDown())
+ if ( GetTriangleJustDown() )
AddToCheatString('T');
-
- if (GetCircleJustDown())
+
+ if ( GetCircleJustDown() )
AddToCheatString('C');
-
- if (GetCrossJustDown())
+
+ if ( GetCrossJustDown() )
AddToCheatString('X');
-
- if (GetSquareJustDown())
+
+ if ( GetSquareJustDown() )
AddToCheatString('S');
-
- if (GetDPadUpJustDown())
+
+ if ( GetDPadUpJustDown() )
AddToCheatString('U');
-
- if (GetDPadDownJustDown())
+
+ if ( GetDPadDownJustDown() )
AddToCheatString('D');
-
- if (GetDPadLeftJustDown())
+
+ if ( GetDPadLeftJustDown() )
AddToCheatString('L');
-
- if (GetDPadRightJustDown())
+
+ if ( GetDPadRightJustDown() )
AddToCheatString('R');
-
- if (GetLeftShoulder1JustDown())
+
+ if ( GetLeftShoulder1JustDown() )
AddToCheatString('1');
-
- if (GetLeftShoulder2JustDown())
+
+ if ( GetLeftShoulder2JustDown() )
AddToCheatString('2');
-
- if (GetRightShoulder1JustDown())
+
+ if ( GetRightShoulder1JustDown() )
AddToCheatString('3');
-
- if (GetRightShoulder2JustDown())
+
+ if ( GetRightShoulder2JustDown() )
AddToCheatString('4');
#endif
}
@@ -1254,7 +1253,7 @@ void CPad::StopShaking(int16 unk)
;
}
-CPad* CPad::GetPad(int32 pad)
+CPad *CPad::GetPad(int32 pad)
{
return &Pads[pad];
}
@@ -1267,188 +1266,188 @@ CPad* CPad::GetPad(int32 pad)
int16 CPad::GetSteeringLeftRight(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return 0;
switch (CURMODE)
{
- case 0:
- case 2:
- {
- int16 axis = NewState.LeftStickX;
- int16 dpad = (NewState.DPadRight - NewState.DPadLeft) / 2;
-
- if (Abs(axis) > Abs(dpad))
- return axis;
- else
- return dpad;
-
- break;
- }
-
- case 1:
- case 3:
- {
- return NewState.LeftStickX;
+ case 0:
+ case 2:
+ {
+ int16 axis = NewState.LeftStickX;
+ int16 dpad = (NewState.DPadRight - NewState.DPadLeft) / 2;
+
+ if ( Abs(axis) > Abs(dpad) )
+ return axis;
+ else
+ return dpad;
+
+ break;
+ }
+
+ case 1:
+ case 3:
+ {
+ return NewState.LeftStickX;
- break;
- }
+ break;
+ }
}
-
+
return 0;
}
int16 CPad::GetSteeringUpDown(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return 0;
switch (CURMODE)
{
- case 0:
- case 2:
- {
- int16 axis = NewState.LeftStickY;
- int16 dpad = (NewState.DPadUp - NewState.DPadDown) / 2;
-
- if (Abs(axis) > Abs(dpad))
- return axis;
- else
- return dpad;
-
- break;
- }
-
- case 1:
- case 3:
- {
- return NewState.LeftStickY;
+ case 0:
+ case 2:
+ {
+ int16 axis = NewState.LeftStickY;
+ int16 dpad = (NewState.DPadUp - NewState.DPadDown) / 2;
+
+ if ( Abs(axis) > Abs(dpad) )
+ return axis;
+ else
+ return dpad;
+
+ break;
+ }
+
+ case 1:
+ case 3:
+ {
+ return NewState.LeftStickY;
- break;
- }
+ break;
+ }
}
-
+
return 0;
}
int16 CPad::GetCarGunUpDown(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return 0;
switch (CURMODE)
{
- case 0:
- case 1:
- case 2:
- {
- return NewState.RightStickY;
-
- break;
- }
-
- case 3:
- {
- return (NewState.DPadUp - NewState.DPadDown) / 2;
-
- break;
- }
+ case 0:
+ case 1:
+ case 2:
+ {
+ return NewState.RightStickY;
+
+ break;
+ }
+
+ case 3:
+ {
+ return (NewState.DPadUp - NewState.DPadDown) / 2;
+
+ break;
+ }
}
-
+
return 0;
}
int16 CPad::GetCarGunLeftRight(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return 0;
switch (CURMODE)
{
- case 0:
- case 1:
- case 2:
- {
- return NewState.RightStickX;
-
- break;
- }
-
- case 3:
- {
- return (NewState.DPadRight - NewState.DPadLeft) / 2;
-
- break;
- }
+ case 0:
+ case 1:
+ case 2:
+ {
+ return NewState.RightStickX;
+
+ break;
+ }
+
+ case 3:
+ {
+ return (NewState.DPadRight - NewState.DPadLeft) / 2;
+
+ break;
+ }
}
-
+
return 0;
}
int16 CPad::GetPedWalkLeftRight(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return 0;
switch (CURMODE)
{
- case 0:
- case 2:
- {
- int16 axis = NewState.LeftStickX;
- int16 dpad = (NewState.DPadRight - NewState.DPadLeft) / 2;
-
- if (Abs(axis) > Abs(dpad))
- return axis;
- else
- return dpad;
-
- break;
- }
-
- case 1:
- case 3:
- {
- return NewState.LeftStickX;
+ case 0:
+ case 2:
+ {
+ int16 axis = NewState.LeftStickX;
+ int16 dpad = (NewState.DPadRight - NewState.DPadLeft) / 2;
+
+ if ( Abs(axis) > Abs(dpad) )
+ return axis;
+ else
+ return dpad;
+
+ break;
+ }
+
+ case 1:
+ case 3:
+ {
+ return NewState.LeftStickX;
- break;
- }
+ break;
+ }
}
-
+
return 0;
}
int16 CPad::GetPedWalkUpDown(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return 0;
switch (CURMODE)
{
- case 0:
- case 2:
- {
- int16 axis = NewState.LeftStickY;
- int16 dpad = (NewState.DPadDown - NewState.DPadUp) / 2;
-
- if (Abs(axis) > Abs(dpad))
- return axis;
- else
- return dpad;
-
- break;
- }
-
- case 1:
- case 3:
- {
- return NewState.LeftStickY;
+ case 0:
+ case 2:
+ {
+ int16 axis = NewState.LeftStickY;
+ int16 dpad = (NewState.DPadDown - NewState.DPadUp) / 2;
+
+ if ( Abs(axis) > Abs(dpad) )
+ return axis;
+ else
+ return dpad;
+
+ break;
+ }
+
+ case 1:
+ case 3:
+ {
+ return NewState.LeftStickY;
- break;
- }
+ break;
+ }
}
-
+
return 0;
}
@@ -1456,43 +1455,43 @@ int16 CPad::GetAnalogueUpDown(void)
{
switch (CURMODE)
{
- case 0:
- case 2:
- {
- int16 axis = NewState.LeftStickY;
- int16 dpad = (NewState.DPadDown - NewState.DPadUp) / 2;
-
- if (Abs(axis) > Abs(dpad))
- return axis;
- else
- return dpad;
-
- break;
- }
-
- case 1:
- case 3:
- {
- return NewState.LeftStickY;
+ case 0:
+ case 2:
+ {
+ int16 axis = NewState.LeftStickY;
+ int16 dpad = (NewState.DPadDown - NewState.DPadUp) / 2;
+
+ if ( Abs(axis) > Abs(dpad) )
+ return axis;
+ else
+ return dpad;
+
+ break;
+ }
+
+ case 1:
+ case 3:
+ {
+ return NewState.LeftStickY;
- break;
- }
+ break;
+ }
}
-
+
return 0;
}
bool CPad::GetLookLeft(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
-
+
return !!(NewState.LeftShoulder2 && !NewState.RightShoulder2);
}
bool CPad::GetLookRight(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
return !!(NewState.RightShoulder2 && !NewState.LeftShoulder2);
@@ -1501,7 +1500,7 @@ bool CPad::GetLookRight(void)
bool CPad::GetLookBehindForCar(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
return !!(NewState.RightShoulder2 && NewState.LeftShoulder2);
@@ -1509,7 +1508,7 @@ bool CPad::GetLookBehindForCar(void)
bool CPad::GetLookBehindForPed(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
return !!NewState.RightShock;
@@ -1517,363 +1516,363 @@ bool CPad::GetLookBehindForPed(void)
bool CPad::GetHorn(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
switch (CURMODE)
{
- case 0:
- {
- return !!NewState.LeftShock;
-
- break;
- }
-
- case 1:
- {
- return !!NewState.LeftShoulder1;
-
- break;
- }
+ case 0:
+ {
+ return !!NewState.LeftShock;
- case 2:
- {
- return !!NewState.RightShoulder1;
+ break;
+ }
+
+ case 1:
+ {
+ return !!NewState.LeftShoulder1;
- break;
- }
+ break;
+ }
+
+ case 2:
+ {
+ return !!NewState.RightShoulder1;
- case 3:
- {
- return !!NewState.LeftShock;
+ break;
+ }
+
+ case 3:
+ {
+ return !!NewState.LeftShock;
- break;
- }
+ break;
+ }
}
-
+
return false;
}
bool CPad::HornJustDown(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
switch (CURMODE)
{
- case 0:
- {
- return !!(NewState.LeftShock && !OldState.LeftShock);
-
- break;
- }
-
- case 1:
- {
- return !!(NewState.LeftShoulder1 && !OldState.LeftShoulder1);
-
- break;
- }
+ case 0:
+ {
+ return !!(NewState.LeftShock && !OldState.LeftShock);
- case 2:
- {
- return !!(NewState.RightShoulder1 && !OldState.RightShoulder1);
+ break;
+ }
+
+ case 1:
+ {
+ return !!(NewState.LeftShoulder1 && !OldState.LeftShoulder1);
- break;
- }
+ break;
+ }
+
+ case 2:
+ {
+ return !!(NewState.RightShoulder1 && !OldState.RightShoulder1);
- case 3:
- {
- return !!(NewState.LeftShock && !OldState.LeftShock);
+ break;
+ }
+
+ case 3:
+ {
+ return !!(NewState.LeftShock && !OldState.LeftShock);
- break;
- }
+ break;
+ }
}
-
+
return false;
}
bool CPad::GetCarGunFired(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
switch (CURMODE)
{
- case 0:
- case 1:
- case 2:
- {
- return !!NewState.Circle;
-
- break;
- }
+ case 0:
+ case 1:
+ case 2:
+ {
+ return !!NewState.Circle;
- case 3:
- {
- return !!NewState.RightShoulder1;
+ break;
+ }
+
+ case 3:
+ {
+ return !!NewState.RightShoulder1;
- break;
- }
+ break;
+ }
}
-
+
return false;
}
bool CPad::CarGunJustDown(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
switch (CURMODE)
{
- case 0:
- case 1:
- case 2:
- {
- return !!(NewState.Circle && !OldState.Circle);
-
- break;
- }
+ case 0:
+ case 1:
+ case 2:
+ {
+ return !!(NewState.Circle && !OldState.Circle);
- case 3:
- {
- return !!(NewState.RightShoulder1 && !OldState.RightShoulder1);
+ break;
+ }
+
+ case 3:
+ {
+ return !!(NewState.RightShoulder1 && !OldState.RightShoulder1);
- break;
- }
+ break;
+ }
}
-
+
return false;
}
int16 CPad::GetHandBrake(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return 0;
switch (CURMODE)
{
- case 0:
- case 1:
- {
- return NewState.RightShoulder1;
-
- break;
- }
-
- case 2:
- {
- return NewState.Triangle;
-
- break;
- }
-
- case 3:
- {
- return NewState.LeftShoulder1;
-
- break;
- }
+ case 0:
+ case 1:
+ {
+ return NewState.RightShoulder1;
+
+ break;
+ }
+
+ case 2:
+ {
+ return NewState.Triangle;
+
+ break;
+ }
+
+ case 3:
+ {
+ return NewState.LeftShoulder1;
+
+ break;
+ }
}
-
+
return 0;
}
int16 CPad::GetBrake(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return 0;
switch (CURMODE)
{
- case 0:
- case 2:
- {
- return NewState.Square;
-
- break;
- }
-
- case 1:
- {
- return NewState.Square;
-
- break;
- }
-
- case 3:
- {
- int16 axis = 2 * NewState.RightStickY;
-
- if (axis < 0)
- return 0;
- else
- return axis;
+ case 0:
+ case 2:
+ {
+ return NewState.Square;
+
+ break;
+ }
+
+ case 1:
+ {
+ return NewState.Square;
- break;
- }
+ break;
+ }
+
+ case 3:
+ {
+ int16 axis = 2 * NewState.RightStickY;
+
+ if ( axis < 0 )
+ return 0;
+ else
+ return axis;
+
+ break;
+ }
}
-
+
return 0;
}
bool CPad::GetExitVehicle(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
switch (CURMODE)
{
- case 0:
- case 1:
- case 3:
- {
- return !!NewState.Triangle;
-
- break;
- }
-
- case 2:
- {
- return !!NewState.LeftShoulder1;
-
- break;
- }
+ case 0:
+ case 1:
+ case 3:
+ {
+ return !!NewState.Triangle;
+
+ break;
+ }
+
+ case 2:
+ {
+ return !!NewState.LeftShoulder1;
+
+ break;
+ }
}
-
+
return false;
}
bool CPad::ExitVehicleJustDown(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
switch (CURMODE)
{
- case 0:
- case 1:
- case 3:
- {
- return !!(NewState.Triangle && !OldState.Triangle);
-
- break;
- }
-
- case 2:
- {
- return !!(NewState.LeftShoulder1 && !OldState.LeftShoulder1);
-
- break;
- }
+ case 0:
+ case 1:
+ case 3:
+ {
+ return !!(NewState.Triangle && !OldState.Triangle);
+
+ break;
+ }
+
+ case 2:
+ {
+ return !!(NewState.LeftShoulder1 && !OldState.LeftShoulder1);
+
+ break;
+ }
}
-
+
return false;
}
int32 CPad::GetWeapon(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
switch (CURMODE)
{
- case 0:
- case 1:
- {
- return NewState.Circle;
-
- break;
- }
-
- case 2:
- {
- return NewState.Cross;
-
- break;
- }
-
- case 3:
- {
- return NewState.RightShoulder1;
-
- break;
- }
+ case 0:
+ case 1:
+ {
+ return NewState.Circle;
+
+ break;
+ }
+
+ case 2:
+ {
+ return NewState.Cross;
+
+ break;
+ }
+
+ case 3:
+ {
+ return NewState.RightShoulder1;
+
+ break;
+ }
}
-
+
return false;
}
bool CPad::WeaponJustDown(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
switch (CURMODE)
{
- case 0:
- case 1:
- {
- return !!(NewState.Circle && !OldState.Circle);
-
- break;
- }
-
- case 2:
- {
- return !!(NewState.Cross && !OldState.Cross);
-
- break;
- }
-
- case 3:
- {
- return !!(NewState.RightShoulder1 && !OldState.RightShoulder1);
-
- break;
- }
+ case 0:
+ case 1:
+ {
+ return !!(NewState.Circle && !OldState.Circle);
+
+ break;
+ }
+
+ case 2:
+ {
+ return !!(NewState.Cross && !OldState.Cross);
+
+ break;
+ }
+
+ case 3:
+ {
+ return !!(NewState.RightShoulder1 && !OldState.RightShoulder1);
+
+ break;
+ }
}
-
+
return false;
}
int16 CPad::GetAccelerate(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return 0;
switch (CURMODE)
{
- case 0:
- case 2:
- {
- return NewState.Cross;
-
- break;
- }
-
- case 1:
- {
- return NewState.Cross;
-
- break;
- }
-
- case 3:
- {
- int16 axis = -2 * NewState.RightStickY;
-
- if (axis < 0)
- return 0;
- else
- return axis;
-
- break;
- }
+ case 0:
+ case 2:
+ {
+ return NewState.Cross;
+
+ break;
+ }
+
+ case 1:
+ {
+ return NewState.Cross;
+
+ break;
+ }
+
+ case 3:
+ {
+ int16 axis = -2 * NewState.RightStickY;
+
+ if ( axis < 0 )
+ return 0;
+ else
+ return axis;
+
+ break;
+ }
}
-
+
return 0;
}
@@ -1881,23 +1880,23 @@ bool CPad::CycleCameraModeUpJustDown(void)
{
switch (CURMODE)
{
- case 0:
- case 2:
- case 3:
- {
- return !!(NewState.Select && !OldState.Select);
-
- break;
- }
-
- case 1:
- {
- return !!(NewState.DPadUp && !OldState.DPadUp);
-
- break;
- }
+ case 0:
+ case 2:
+ case 3:
+ {
+ return !!(NewState.Select && !OldState.Select);
+
+ break;
+ }
+
+ case 1:
+ {
+ return !!(NewState.DPadUp && !OldState.DPadUp);
+
+ break;
+ }
}
-
+
return false;
}
@@ -1905,77 +1904,77 @@ bool CPad::CycleCameraModeDownJustDown(void)
{
switch (CURMODE)
{
- case 0:
- case 2:
- case 3:
- {
- return false;
-
- break;
- }
-
- case 1:
- {
- return !!(NewState.DPadDown && !OldState.DPadDown);
-
- break;
- }
+ case 0:
+ case 2:
+ case 3:
+ {
+ return false;
+
+ break;
+ }
+
+ case 1:
+ {
+ return !!(NewState.DPadDown && !OldState.DPadDown);
+
+ break;
+ }
}
-
+
return false;
}
bool CPad::ChangeStationJustDown(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
switch (CURMODE)
{
- case 0:
- {
- return !!(NewState.LeftShoulder1 && !OldState.LeftShoulder1);
-
- break;
- }
-
- case 1:
- {
- return !!(NewState.Select && !OldState.Select);
-
- break;
- }
-
- case 2:
- {
- return !!(NewState.LeftShock && !OldState.LeftShock);
-
- break;
- }
-
- case 3:
- {
- return !!(NewState.Circle && !OldState.Circle);
-
- break;
- }
+ case 0:
+ {
+ return !!(NewState.LeftShoulder1 && !OldState.LeftShoulder1);
+
+ break;
+ }
+
+ case 1:
+ {
+ return !!(NewState.Select && !OldState.Select);
+
+ break;
+ }
+
+ case 2:
+ {
+ return !!(NewState.LeftShock && !OldState.LeftShock);
+
+ break;
+ }
+
+ case 3:
+ {
+ return !!(NewState.Circle && !OldState.Circle);
+
+ break;
+ }
}
-
+
return false;
}
bool CPad::CycleWeaponLeftJustDown(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
-
+
return !!(NewState.LeftShoulder2 && !OldState.LeftShoulder2);
}
bool CPad::CycleWeaponRightJustDown(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
return !!(NewState.RightShoulder2 && !OldState.RightShoulder2);
@@ -1983,96 +1982,96 @@ bool CPad::CycleWeaponRightJustDown(void)
bool CPad::GetTarget(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
switch (CURMODE)
{
- case 0:
- case 1:
- case 2:
- {
- return !!NewState.RightShoulder1;
-
- break;
- }
-
- case 3:
- {
- return !!NewState.LeftShoulder1;
-
- break;
- }
+ case 0:
+ case 1:
+ case 2:
+ {
+ return !!NewState.RightShoulder1;
+
+ break;
+ }
+
+ case 3:
+ {
+ return !!NewState.LeftShoulder1;
+
+ break;
+ }
}
-
+
return false;
}
bool CPad::TargetJustDown(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
switch (CURMODE)
{
- case 0:
- case 1:
- case 2:
- {
- return !!(NewState.RightShoulder1 && !OldState.RightShoulder1);
-
- break;
- }
-
- case 3:
- {
- return !!(NewState.LeftShoulder1 && !OldState.LeftShoulder1);
-
- break;
- }
+ case 0:
+ case 1:
+ case 2:
+ {
+ return !!(NewState.RightShoulder1 && !OldState.RightShoulder1);
+
+ break;
+ }
+
+ case 3:
+ {
+ return !!(NewState.LeftShoulder1 && !OldState.LeftShoulder1);
+
+ break;
+ }
}
-
+
return false;
}
bool CPad::JumpJustDown(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
-
+
return !!(NewState.Square && !OldState.Square);
}
bool CPad::GetSprint(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
switch (CURMODE)
{
- case 0:
- case 1:
- case 3:
- {
- return !!NewState.Cross;
-
- break;
- }
-
- case 2:
- {
- return !!NewState.Circle;
-
- break;
- }
+ case 0:
+ case 1:
+ case 3:
+ {
+ return !!NewState.Cross;
+
+ break;
+ }
+
+ case 2:
+ {
+ return !!NewState.Circle;
+
+ break;
+ }
}
-
+
return false;
}
bool CPad::ShiftTargetLeftJustDown(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
return !!(NewState.LeftShoulder2 && !OldState.LeftShoulder2);
@@ -2080,7 +2079,7 @@ bool CPad::ShiftTargetLeftJustDown(void)
bool CPad::ShiftTargetRightJustDown(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
return !!(NewState.RightShoulder2 && !OldState.RightShoulder2);
@@ -2089,10 +2088,10 @@ bool CPad::ShiftTargetRightJustDown(void)
bool CPad::GetAnaloguePadUp(void)
{
static int16 oldfStickY = 0;
-
+
int16 Y = CPad::GetPad(0)->GetAnalogueUpDown();
-
- if (Y < 0 && oldfStickY >= 0)
+
+ if ( Y < 0 && oldfStickY >= 0 )
{
oldfStickY = Y;
return true;
@@ -2107,10 +2106,10 @@ bool CPad::GetAnaloguePadUp(void)
bool CPad::GetAnaloguePadDown(void)
{
static int16 oldfStickY = 0;
-
+
int16 Y = CPad::GetPad(0)->GetAnalogueUpDown();
-
- if (Y > 0 && oldfStickY <= 0)
+
+ if ( Y > 0 && oldfStickY <= 0 )
{
oldfStickY = Y;
return true;
@@ -2125,10 +2124,10 @@ bool CPad::GetAnaloguePadDown(void)
bool CPad::GetAnaloguePadLeft(void)
{
static int16 oldfStickX = 0;
-
+
int16 X = CPad::GetPad(0)->GetPedWalkLeftRight();
-
- if (X < 0 && oldfStickX >= 0)
+
+ if ( X < 0 && oldfStickX >= 0 )
{
oldfStickX = X;
return true;
@@ -2143,10 +2142,10 @@ bool CPad::GetAnaloguePadLeft(void)
bool CPad::GetAnaloguePadRight(void)
{
static int16 oldfStickX = 0;
-
+
int16 X = CPad::GetPad(0)->GetPedWalkLeftRight();
-
- if (X > 0 && oldfStickX <= 0)
+
+ if ( X > 0 && oldfStickX <= 0 )
{
oldfStickX = X;
return true;
@@ -2161,19 +2160,19 @@ bool CPad::GetAnaloguePadRight(void)
bool CPad::GetAnaloguePadLeftJustUp(void)
{
static int16 oldfStickX = 0;
-
+
int16 X = GetPad(0)->GetPedWalkLeftRight();
-
- if (X == 0 && oldfStickX < 0)
+
+ if ( X == 0 && oldfStickX < 0 )
{
oldfStickX = X;
-
+
return true;
}
else
{
oldfStickX = X;
-
+
return false;
}
}
@@ -2181,107 +2180,107 @@ bool CPad::GetAnaloguePadLeftJustUp(void)
bool CPad::GetAnaloguePadRightJustUp(void)
{
static int16 oldfStickX = 0;
-
+
int16 X = GetPad(0)->GetPedWalkLeftRight();
-
- if (X == 0 && oldfStickX > 0)
+
+ if ( X == 0 && oldfStickX > 0 )
{
oldfStickX = X;
-
+
return true;
}
else
{
oldfStickX = X;
-
+
return false;
}
}
bool CPad::ForceCameraBehindPlayer(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
switch (CURMODE)
{
- case 0:
- case 1:
- {
- return !!NewState.LeftShoulder1;
-
- break;
- }
-
- case 2:
- {
- return !!NewState.Triangle;
-
- break;
- }
-
- case 3:
- {
- return !!NewState.Circle;
-
- break;
- }
+ case 0:
+ case 1:
+ {
+ return !!NewState.LeftShoulder1;
+
+ break;
+ }
+
+ case 2:
+ {
+ return !!NewState.Triangle;
+
+ break;
+ }
+
+ case 3:
+ {
+ return !!NewState.Circle;
+
+ break;
+ }
}
-
+
return false;
}
bool CPad::SniperZoomIn(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
switch (CURMODE)
{
- case 0:
- case 1:
- case 3:
- {
- return !!NewState.Square;
-
- break;
- }
-
- case 2:
- {
- return !!NewState.Triangle;
+ case 0:
+ case 1:
+ case 3:
+ {
+ return !!NewState.Square;
- break;
- }
+ break;
+ }
+
+ case 2:
+ {
+ return !!NewState.Triangle;
+
+ break;
+ }
}
-
+
return false;
}
bool CPad::SniperZoomOut(void)
{
- if (ArePlayerControlsDisabled())
+ if ( ArePlayerControlsDisabled() )
return false;
switch (CURMODE)
{
- case 0:
- case 1:
- case 3:
- {
- return !!NewState.Cross;
-
- break;
- }
-
- case 2:
- {
- return !!NewState.Square;
+ case 0:
+ case 1:
+ case 3:
+ {
+ return !!NewState.Cross;
- break;
- }
+ break;
+ }
+
+ case 2:
+ {
+ return !!NewState.Square;
+
+ break;
+ }
}
-
+
return false;
}
@@ -2291,8 +2290,8 @@ int16 CPad::SniperModeLookLeftRight(void)
{
int16 axis = NewState.LeftStickX;
int16 dpad = (NewState.DPadRight - NewState.DPadLeft) / 2;
-
- if (Abs(axis) > Abs(dpad))
+
+ if ( Abs(axis) > Abs(dpad) )
return axis;
else
return dpad;
@@ -2305,8 +2304,8 @@ int16 CPad::SniperModeLookUpDown(void)
axis = -axis;
#endif
int16 dpad = (NewState.DPadUp - NewState.DPadDown) / 2;
-
- if (Abs(axis) > Abs(dpad))
+
+ if ( Abs(axis) > Abs(dpad) )
return axis;
else
return dpad;
@@ -2315,15 +2314,15 @@ int16 CPad::SniperModeLookUpDown(void)
int16 CPad::LookAroundLeftRight(void)
{
float axis = GetPad(0)->NewState.RightStickX;
-
- if (Abs(axis) > 85 && !GetLookBehindForPed())
- return (int16)((axis + ((axis > 0) ? -85 : 85))
- * (127.0f / 32.0f)); // 3.96875f
-
- else if (TheCamera.Cams[0].Using3rdPersonMouseCam() && Abs(axis) > 10)
- return (int16)((axis + ((axis > 0) ? -10 : 10))
- * (127.0f / 64.0f)); // 1.984375f
-
+
+ if ( Abs(axis) > 85 && !GetLookBehindForPed() )
+ return (int16) ( (axis + ( ( axis > 0 ) ? -85 : 85) )
+ * (127.0f / 32.0f) ); // 3.96875f
+
+ else if ( TheCamera.Cams[0].Using3rdPersonMouseCam() && Abs(axis) > 10 )
+ return (int16) ( (axis + ( ( axis > 0 ) ? -10 : 10) )
+ * (127.0f / 64.0f) ); // 1.984375f
+
return 0;
}
@@ -2335,13 +2334,13 @@ int16 CPad::LookAroundUpDown(void)
axis = -axis;
#endif
- if (Abs(axis) > 85 && !GetLookBehindForPed())
- return (int16)((axis + ((axis > 0) ? -85 : 85))
- * (127.0f / 32.0f)); // 3.96875f
+ if ( Abs(axis) > 85 && !GetLookBehindForPed() )
+ return (int16) ( (axis + ( ( axis > 0 ) ? -85 : 85) )
+ * (127.0f / 32.0f) ); // 3.96875f
- else if (TheCamera.Cams[0].Using3rdPersonMouseCam() && Abs(axis) > 40)
- return (int16)((axis + ((axis > 0) ? -40 : 40))
- * (127.0f / 64.0f)); // 1.984375f
+ else if ( TheCamera.Cams[0].Using3rdPersonMouseCam() && Abs(axis) > 40 )
+ return (int16) ( (axis + ( ( axis > 0 ) ? -40 : 40) )
+ * (127.0f / 64.0f) ); // 1.984375f
return 0;
}
@@ -2355,7 +2354,7 @@ void CPad::ResetAverageWeapon(void)
void CPad::PrintErrorMessage(void)
{
- if (bDisplayNoControllerMessage && !CGame::playingIntro && !FrontEndMenuManager.m_bMenuActive)
+ if ( bDisplayNoControllerMessage && !CGame::playingIntro && !FrontEndMenuManager.m_bMenuActive )
{
CFont::SetScale(0.85f, 1.0f);
CFont::SetJustifyOff();
@@ -2367,12 +2366,12 @@ void CPad::PrintErrorMessage(void)
CFont::SetFontStyle(FONT_BANK);
CFont::PrintString
(
- SCREEN_WIDTH / 2,
+ SCREEN_WIDTH / 2,
SCREEN_HEIGHT / 2,
TheText.Get("NOCONT") // Please reconnect an analog controller (DUALSHOCK@) or analog controller (DUALSHOCK@2). to controller port 1 to continue
- );
+ );
}
- else if (bObsoleteControllerMessage)
+ else if ( bObsoleteControllerMessage )
{
CFont::SetScale(0.85f, 1.0f);
CFont::SetJustifyOff();
@@ -2384,31 +2383,31 @@ void CPad::PrintErrorMessage(void)
CFont::SetFontStyle(FONT_BANK);
CFont::PrintString
(
- SCREEN_WIDTH / 2,
+ SCREEN_WIDTH / 2,
SCREEN_HEIGHT / 2,
TheText.Get("WRCONT") // The controller connected to controller port 1 is an unsupported controller. Grand Theft Auto III requires an analog controller (DUALSHOCK@) or analog controller (DUALSHOCK@2).
- );
+ );
}
-
+
}
void LittleTest(void)
{
static int32 Cunt = 0;
-
+
Cunt++; // ???
}
void CPad::ResetCheats(void)
{
CWeather::ReleaseWeather();
-
+
CPopulation::ms_bGivePedsWeapons = false;
-
+
CPed::bNastyLimbsCheat = false;
CPed::bPedCheat2 = false;
CPed::bPedCheat3 = false;
-
+
CVehicle::bWheelsOnlyCheat = false;
CVehicle::bAllDodosCheat = false;
CVehicle::bCheat3 = false;
@@ -2416,210 +2415,210 @@ void CPad::ResetCheats(void)
CVehicle::bCheat5 = false;
gbBlackCars = false;
gbPinkCars = false;
-
+
gbFastTime = false;
CTimer::SetTimeScale(1.0f);
}
-char* CPad::EditString(char* pStr, int32 nSize)
+char *CPad::EditString(char *pStr, int32 nSize)
{
int32 pos = strlen(pStr);
-
+
// letters
- for (int32 i = 0; i < ('Z' - 'A' + 1); i++)
+ for ( int32 i = 0; i < ('Z' - 'A' + 1); i++ )
{
- if (GetPad(0)->GetCharJustDown(i + 'A') && pos < nSize - 1)
+ if ( GetPad(0)->GetCharJustDown(i + 'A') && pos < nSize - 1 )
{
pStr[pos++] = i + 'A';
pStr[pos] = '\0';
}
-
- if (GetPad(0)->GetCharJustDown(i + 'a') && pos < nSize - 1)
+
+ if ( GetPad(0)->GetCharJustDown(i + 'a') && pos < nSize - 1 )
{
pStr[pos++] = i + 'a';
pStr[pos] = '\0';
}
}
-
+
// numbers
- for (int32 i = 0; i < ('9' - '0' + 1); i++)
+ for ( int32 i = 0; i < ('9' - '0' + 1); i++ )
{
- if (GetPad(0)->GetCharJustDown(i + '0') && pos < nSize - 1)
+ if ( GetPad(0)->GetCharJustDown(i + '0') && pos < nSize - 1 )
{
pStr[pos++] = i + '0';
pStr[pos] = '\0';
}
}
-
+
// space
- if (GetPad(0)->GetCharJustDown(' ') && pos < nSize - 1)
+ if ( GetPad(0)->GetCharJustDown(' ') && pos < nSize - 1 )
{
pStr[pos++] = ' ';
pStr[pos] = '\0';
}
-
-
+
+
// del
- if (GetPad(0)->GetDeleteJustDown() || GetPad(0)->GetBackspaceJustDown())
+ if ( GetPad(0)->GetDeleteJustDown() || GetPad(0)->GetBackspaceJustDown() )
{
- if (pos > 0)
+ if ( pos > 0 )
pStr[pos - 1] = '\0';
}
// extenter/up/down
- if (GetPad(0)->GetReturnJustDown() || GetPad(0)->GetUpJustDown() || GetPad(0)->GetDownJustDown())
+ if ( GetPad(0)->GetReturnJustDown() || GetPad(0)->GetUpJustDown() || GetPad(0)->GetDownJustDown() )
return nil;
-
+
return pStr;
}
-int32* CPad::EditCodesForControls(int32* pRsKeys, int32 nSize)
+int32 *CPad::EditCodesForControls(int32 *pRsKeys, int32 nSize)
{
*pRsKeys = rsNULL;
- for (int32 i = 0; i < 255; i++)
+ for ( int32 i = 0; i < 255; i++ )
{
- if (GetPad(0)->GetCharJustDown(i))
+ if ( GetPad(0)->GetCharJustDown(i) )
*pRsKeys = i;
}
-
- for (int32 i = 0; i < 12; i++)
+
+ for ( int32 i = 0; i < 12; i++ )
{
- if (GetPad(0)->GetFJustDown(i))
+ if ( GetPad(0)->GetFJustDown(i) )
*pRsKeys = i + rsF1;
}
-
- if (GetPad(0)->GetEscapeJustDown())
+
+ if ( GetPad(0)->GetEscapeJustDown() )
*pRsKeys = rsESC;
-
- if (GetPad(0)->GetInsertJustDown())
+
+ if ( GetPad(0)->GetInsertJustDown() )
*pRsKeys = rsINS;
-
- if (GetPad(0)->GetDeleteJustDown())
+
+ if ( GetPad(0)->GetDeleteJustDown() )
*pRsKeys = rsDEL;
-
- if (GetPad(0)->GetHomeJustDown())
+
+ if ( GetPad(0)->GetHomeJustDown() )
*pRsKeys = rsHOME;
-
- if (GetPad(0)->GetEndJustDown())
+
+ if ( GetPad(0)->GetEndJustDown() )
*pRsKeys = rsEND;
-
- if (GetPad(0)->GetPageUpJustDown())
+
+ if ( GetPad(0)->GetPageUpJustDown() )
*pRsKeys = rsPGUP;
-
- if (GetPad(0)->GetPageDownJustDown())
+
+ if ( GetPad(0)->GetPageDownJustDown() )
*pRsKeys = rsPGDN;
-
- if (GetPad(0)->GetUpJustDown())
+
+ if ( GetPad(0)->GetUpJustDown() )
*pRsKeys = rsUP;
-
- if (GetPad(0)->GetDownJustDown())
+
+ if ( GetPad(0)->GetDownJustDown() )
*pRsKeys = rsDOWN;
-
- if (GetPad(0)->GetLeftJustDown())
+
+ if ( GetPad(0)->GetLeftJustDown() )
*pRsKeys = rsLEFT;
-
- if (GetPad(0)->GetRightJustDown())
+
+ if ( GetPad(0)->GetRightJustDown() )
*pRsKeys = rsRIGHT;
-
- if (GetPad(0)->GetScrollLockJustDown())
+
+ if ( GetPad(0)->GetScrollLockJustDown() )
*pRsKeys = rsSCROLL;
-
- if (GetPad(0)->GetPauseJustDown())
+
+ if ( GetPad(0)->GetPauseJustDown() )
*pRsKeys = rsPAUSE;
-
- if (GetPad(0)->GetNumLockJustDown())
+
+ if ( GetPad(0)->GetNumLockJustDown() )
*pRsKeys = rsNUMLOCK;
-
- if (GetPad(0)->GetDivideJustDown())
+
+ if ( GetPad(0)->GetDivideJustDown() )
*pRsKeys = rsDIVIDE;
-
- if (GetPad(0)->GetTimesJustDown())
+
+ if ( GetPad(0)->GetTimesJustDown() )
*pRsKeys = rsTIMES;
-
- if (GetPad(0)->GetMinusJustDown())
+
+ if ( GetPad(0)->GetMinusJustDown() )
*pRsKeys = rsMINUS;
-
- if (GetPad(0)->GetPlusJustDown())
+
+ if ( GetPad(0)->GetPlusJustDown() )
*pRsKeys = rsPLUS;
- if (GetPad(0)->GetPadEnterJustDown())
+ if ( GetPad(0)->GetPadEnterJustDown() )
*pRsKeys = rsPADENTER;
- if (GetPad(0)->GetPadDelJustDown())
+ if ( GetPad(0)->GetPadDelJustDown() )
*pRsKeys = rsPADDEL;
- if (GetPad(0)->GetPad1JustDown())
+ if ( GetPad(0)->GetPad1JustDown() )
*pRsKeys = rsPADEND;
-
- if (GetPad(0)->GetPad2JustDown())
+
+ if ( GetPad(0)->GetPad2JustDown() )
*pRsKeys = rsPADDOWN;
-
- if (GetPad(0)->GetPad3JustDown())
+
+ if ( GetPad(0)->GetPad3JustDown() )
*pRsKeys = rsPADPGDN;
-
- if (GetPad(0)->GetPad4JustDown())
+
+ if ( GetPad(0)->GetPad4JustDown() )
*pRsKeys = rsPADLEFT;
-
- if (GetPad(0)->GetPad5JustDown())
+
+ if ( GetPad(0)->GetPad5JustDown() )
*pRsKeys = rsPAD5;
-
- if (GetPad(0)->GetPad6JustDown())
+
+ if ( GetPad(0)->GetPad6JustDown() )
*pRsKeys = rsPADRIGHT;
-
- if (GetPad(0)->GetPad7JustDown())
+
+ if ( GetPad(0)->GetPad7JustDown() )
*pRsKeys = rsPADHOME;
-
- if (GetPad(0)->GetPad8JustDown())
+
+ if ( GetPad(0)->GetPad8JustDown() )
*pRsKeys = rsPADUP;
-
- if (GetPad(0)->GetPad9JustDown())
+
+ if ( GetPad(0)->GetPad9JustDown() )
*pRsKeys = rsPADPGUP;
-
- if (GetPad(0)->GetPad0JustDown())
+
+ if ( GetPad(0)->GetPad0JustDown() )
*pRsKeys = rsPADINS;
- if (GetPad(0)->GetBackspaceJustDown())
+ if ( GetPad(0)->GetBackspaceJustDown() )
*pRsKeys = rsBACKSP;
-
- if (GetPad(0)->GetTabJustDown())
+
+ if ( GetPad(0)->GetTabJustDown() )
*pRsKeys = rsTAB;
-
- if (GetPad(0)->GetCapsLockJustDown())
+
+ if ( GetPad(0)->GetCapsLockJustDown() )
*pRsKeys = rsCAPSLK;
-
- if (GetPad(0)->GetReturnJustDown())
+
+ if ( GetPad(0)->GetReturnJustDown() )
*pRsKeys = rsENTER;
-
- if (GetPad(0)->GetLeftShiftJustDown())
+
+ if ( GetPad(0)->GetLeftShiftJustDown() )
*pRsKeys = rsLSHIFT;
-
- if (GetPad(0)->GetShiftJustDown())
+
+ if ( GetPad(0)->GetShiftJustDown() )
*pRsKeys = rsSHIFT;
-
- if (GetPad(0)->GetRightShiftJustDown())
+
+ if ( GetPad(0)->GetRightShiftJustDown() )
*pRsKeys = rsRSHIFT;
-
- if (GetPad(0)->GetLeftCtrlJustDown())
+
+ if ( GetPad(0)->GetLeftCtrlJustDown() )
*pRsKeys = rsLCTRL;
-
- if (GetPad(0)->GetRightCtrlJustDown())
+
+ if ( GetPad(0)->GetRightCtrlJustDown() )
*pRsKeys = rsRCTRL;
-
- if (GetPad(0)->GetLeftAltJustDown())
+
+ if ( GetPad(0)->GetLeftAltJustDown() )
*pRsKeys = rsLALT;
-
- if (GetPad(0)->GetRightAltJustDown())
+
+ if ( GetPad(0)->GetRightAltJustDown() )
*pRsKeys = rsRALT;
-
- if (GetPad(0)->GetLeftWinJustDown())
+
+ if ( GetPad(0)->GetLeftWinJustDown() )
*pRsKeys = rsLWIN;
-
- if (GetPad(0)->GetRightWinJustDown())
+
+ if ( GetPad(0)->GetRightWinJustDown() )
*pRsKeys = rsRWIN;
-
- if (GetPad(0)->GetAppsJustDown())
+
+ if ( GetPad(0)->GetAppsJustDown() )
*pRsKeys = rsAPPS;
-
+
return pRsKeys;
}