diff options
author | Roman Masanin <36927roma@gmail.com> | 2020-10-26 00:16:46 +0300 |
---|---|---|
committer | Roman Masanin <36927roma@gmail.com> | 2020-10-26 00:16:46 +0300 |
commit | 44bbcbd14ac86e22c1514b78bbc2fad2f0f9cf24 (patch) | |
tree | 285278bf5fda41d6a528a7912153a892746262ed /src | |
parent | 96ccb1333b2d8cabe914c4a9f65a640f3db81c56 (diff) | |
parent | 3bdc974ff5e05868351a007e37ceb7680c80e7bf (diff) |
merge upstream
Diffstat (limited to 'src')
-rw-r--r-- | src/audio/AudioLogic.cpp | 244 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 6 | ||||
-rw-r--r-- | src/audio/DMAudio.cpp | 13 | ||||
-rw-r--r-- | src/audio/DMAudio.h | 10 | ||||
-rw-r--r-- | src/audio/MusicManager.cpp | 2 | ||||
-rw-r--r-- | src/audio/soundlist.h | 11 | ||||
-rw-r--r-- | src/core/Frontend.cpp | 319 | ||||
-rw-r--r-- | src/core/Frontend.h | 6 | ||||
-rw-r--r-- | src/core/main.cpp | 44 | ||||
-rw-r--r-- | src/core/main.h | 2 | ||||
-rw-r--r-- | src/core/timebars.h | 9 | ||||
-rw-r--r-- | src/render/Glass.cpp | 8 | ||||
-rw-r--r-- | src/render/Hud.cpp | 29 | ||||
-rw-r--r-- | src/render/WindModifiers.cpp | 2 | ||||
-rw-r--r-- | src/rw/RwHelper.cpp | 2 | ||||
-rw-r--r-- | src/text/Messages.cpp | 33 |
16 files changed, 363 insertions, 377 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 436c5ba9..40e0ba6c 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -4899,7 +4899,7 @@ cAudioManager::SetPedTalkingStatus(CPed *ped, uint8 status) } void -cAudioManager::SetPlayersMood(uint8 mood, int32 time) +cAudioManager::SetPlayersMood(uint8 mood, uint32 time) { if (!m_bIsInitialised) return; @@ -5907,18 +5907,21 @@ cAudioManager::ProcessFrontEnd() bool stereo; bool processedPickup; bool processedMission; - bool frontendBank; + bool staticFreq; + bool center; int16 sample; static uint8 iSound = 0; static uint32 cPickupNextFrame = 0; static uint32 cPartMisComNextFrame = 0; + static uint32 radioDial = SFX_RADIO_DIAL_1; for (uint32 i = 0; i < m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_AudioEvents; i++) { + staticFreq = false; processedPickup = false; - stereo = false; + center = false; processedMission = false; - frontendBank = false; + stereo = false; switch (m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i]) { case SOUND_WEAPON_SNIPER_SHOT_NO_ZOOM: m_sQueueSample.m_nSampleIndex = SFX_ERROR_FIRE_RIFLE; @@ -5926,102 +5929,124 @@ cAudioManager::ProcessFrontEnd() case SOUND_WEAPON_ROCKET_SHOT_NO_ZOOM: m_sQueueSample.m_nSampleIndex = SFX_ERROR_FIRE_ROCKET_LAUNCHER; break; - //case SOUND_GARAGE_NO_MONEY: - //case SOUND_GARAGE_BAD_VEHICLE: - //case SOUND_GARAGE_BOMB_ALREADY_SET: - // m_sQueueSample.m_nSampleIndex = SFX_PICKUP_ERROR_LEFT; - // stereo = true; - // break; - //case SOUND_GARAGE_OPENING: - //case SOUND_GARAGE_BOMB1_SET: - //case SOUND_GARAGE_BOMB2_SET: - //case SOUND_GARAGE_BOMB3_SET: - //case SOUND_41: - //case SOUND_GARAGE_VEHICLE_DECLINED: - //case SOUND_GARAGE_VEHICLE_ACCEPTED: - //case SOUND_PICKUP_HEALTH: - //case SOUND_4B: - //case SOUND_PICKUP_ADRENALINE: - //case SOUND_PICKUP_ARMOUR: - //case SOUND_EVIDENCE_PICKUP: - //case SOUND_UNLOAD_GOLD: - // m_sQueueSample.m_nSampleIndex = SFX_PICKUP_2_LEFT; - // processedPickup = true; - // stereo = true; - // break; - //case SOUND_PICKUP_WEAPON_BOUGHT: - //case SOUND_PICKUP_WEAPON: - // m_sQueueSample.m_nSampleIndex = SFX_PICKUP_1_LEFT; - // processedPickup = true; - // stereo = true; - // break; - //case SOUND_PICKUP_ERROR: - // m_sQueueSample.m_nSampleIndex = SFX_PICKUP_ERROR_LEFT; - // processedPickup = true; - // stereo = true; - // break; - //case SOUND_PICKUP_BONUS: - //case SOUND_PICKUP_MONEY: - //case SOUND_PICKUP_HIDDEN_PACKAGE: - //case SOUND_PICKUP_PACMAN_PILL: - //case SOUND_PICKUP_PACMAN_PACKAGE: - //case SOUND_PICKUP_FLOAT_PACKAGE: - // m_sQueueSample.m_nSampleIndex = SFX_PICKUP_3_LEFT; - // processedPickup = true; - // stereo = true; - // break; - //case SOUND_PAGER: - // m_sQueueSample.m_nSampleIndex = SFX_PAGER; - // break; - case SOUND_RACE_START_3: - case SOUND_RACE_START_2: - case SOUND_RACE_START_1: - case SOUND_CLOCK_TICK: - m_sQueueSample.m_nSampleIndex = SFX_TIMER_BEEP; + case SOUND_GARAGE_NO_MONEY: + case SOUND_GARAGE_BAD_VEHICLE: + case SOUND_GARAGE_BOMB_ALREADY_SET: + m_sQueueSample.m_nSampleIndex = SFX_WEAPON_LEFT; + stereo = true; + staticFreq = true; + center = true; break; - case SOUND_RACE_START_GO: + case SOUND_GARAGE_OPENING: + case SOUND_71: //case SOUND_41: + case SOUND_GARAGE_VEHICLE_DECLINED: + case SOUND_GARAGE_VEHICLE_ACCEPTED: + case SOUND_EVIDENCE_PICKUP: + case SOUND_UNLOAD_GOLD: + stereo = true; + processedPickup = true; + m_sQueueSample.m_nSampleIndex = SFX_MONEY_LEFT; + break; + case SOUND_GARAGE_BOMB1_SET: + case SOUND_GARAGE_BOMB2_SET: + case SOUND_GARAGE_BOMB3_SET: + center = true; + processedPickup = true; + m_sQueueSample.m_nSampleIndex = SFX_WEAPON_LEFT; + stereo = true; + break; + case SOUND_PICKUP_HEALTH: + case SOUND_81: //case SOUND_4B: + case SOUND_PICKUP_ADRENALINE: + case SOUND_PICKUP_ARMOUR: + stereo = true; + processedPickup = true; + m_sQueueSample.m_nSampleIndex = SFX_MONEY_LEFT; + break; + case SOUND_80: + stereo = true; + processedPickup = true; + m_sQueueSample.m_nSampleIndex = SFX_WEAPON_LEFT; + center = true; + staticFreq = true; + break; + case SOUND_PICKUP_BONUS: + case SOUND_FRONTEND_MENU_STARTING: + case SOUND_HUD_SOUND: + stereo = true; + m_sQueueSample.m_nSampleIndex = SFX_INFO_LEFT; + center = true; + break; + case SOUND_PICKUP_MONEY: + stereo = true; + processedPickup = true; + m_sQueueSample.m_nSampleIndex = SFX_MONEY_LEFT; + break; + case SOUND_PICKUP_HIDDEN_PACKAGE: + case SOUND_PICKUP_PACMAN_PILL: + case SOUND_PICKUP_PACMAN_PACKAGE: + case SOUND_PICKUP_FLOAT_PACKAGE: + center = true; + processedPickup = true; m_sQueueSample.m_nSampleIndex = SFX_PART_MISSION_COMPLETE_LEFT; + stereo = true; break; + case SOUND_RACE_START_3: + case SOUND_RACE_START_2: + case SOUND_RACE_START_1: case SOUND_PART_MISSION_COMPLETE: + stereo = true; m_sQueueSample.m_nSampleIndex = SFX_PART_MISSION_COMPLETE_LEFT; processedMission = true; + center = true; break; - case SOUND_FRONTEND_MENU_STARTING: - m_sQueueSample.m_nSampleIndex = SFX_FE_HIGHLIGHT_LEFT; + case SOUND_RACE_START_GO: stereo = true; + m_sQueueSample.m_nSampleIndex = SFX_GO_LEFT; + center = true; break; - case SOUND_FRONTEND_MENU_NEW_PAGE: - m_sQueueSample.m_nSampleIndex = SFX_FE_HIGHLIGHT_LEFT; + case SOUND_CLOCK_TICK: + m_sQueueSample.m_nSampleIndex = SFX_TIMER; + break; + case SOUND_FRONTEND_NO_RADIO: + case SOUND_FRONTEND_RADIO_CHANGE: + m_sQueueSample.m_nSampleIndex = SFX_RADIO_CLICK; + break; + case SOUND_FRONTEND_RADIO_CHANGE_2: + m_sQueueSample.m_nSampleIndex = SFX_HURRICANE_MA; + break; + case SOUND_BULLETTRACE_1: + case SOUND_BULLETTRACE_2: + m_sQueueSample.m_nSampleIndex = (m_anRandomTable[0] % 2) + SFX_BULLET_PASS_1; + break; + case SOUND_AMMUNATION_IMRAN_ARM_BOMB: + m_sQueueSample.m_nSampleIndex = SFX_ARM_BOMB; + break; + case SOUND_RADIO_CHANGE: + m_sQueueSample.m_nSampleIndex = (m_anRandomTable[1] % 2) ? radioDial + 1 : radioDial + 2; + if (m_sQueueSample.m_nSampleIndex > SFX_RADIO_DIAL_12) + m_sQueueSample.m_nSampleIndex -= 12; + radioDial = m_sQueueSample.m_nSampleIndex; + break; + case SOUND_FRONTEND_HIGHLIGHT_OPTION: stereo = true; - frontendBank = true; - frontendBank = true; + m_sQueueSample.m_nSampleIndex = SFX_FE_HIGHLIGHT_LEFT; break; - case SOUND_FRONTEND_MENU_SETTING_CHANGE: + case SOUND_FRONTEND_ENTER_OR_ADJUST: + stereo = true; m_sQueueSample.m_nSampleIndex = SFX_FE_SELECT_LEFT; + break; + case SOUND_FRONTEND_BACK: stereo = true; - frontendBank = true; - - + m_sQueueSample.m_nSampleIndex = SFX_FE_BACK_LEFT; break; - //case SOUND_FRONTEND_EXIT: - // m_sQueueSample.m_nSampleIndex = SFX_SUB_MENU_BACK_LEFT; - // stereo = true; - // break; - //case SOUND_FRONTEND_AUDIO_TEST: - // m_sQueueSample.m_nSampleIndex = m_anRandomTable[0] % 3 + SFX_NOISE_BURST_1; - // break; case SOUND_FRONTEND_FAIL: - m_sQueueSample.m_nSampleIndex = SFX_FE_ERROR_LEFT; - frontendBank = true; stereo = true; + m_sQueueSample.m_nSampleIndex = SFX_FE_ERROR_LEFT; break; - case SOUND_FRONTEND_NO_RADIO: - case SOUND_FRONTEND_RADIO_CHANGE: - m_sQueueSample.m_nSampleIndex = SFX_RADIO_CLICK; + case SOUND_FRONTEND_AUDIO_TEST: + m_sQueueSample.m_nSampleIndex = m_anRandomTable[0] % 3 + SFX_FE_NOISE_BURST_1; break; - //case SOUND_HUD_SOUND: - // m_sQueueSample.m_nSampleIndex = SFX_INFO; - // break; default: continue; } @@ -6037,37 +6062,64 @@ cAudioManager::ProcessFrontEnd() } sample = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i]; - if (sample == SFX_RAIN) { + + if (sample == SOUND_FRONTEND_NO_RADIO) m_sQueueSample.m_nFrequency = 28509; - /*} else if (sample == SFX_PICKUP_1_LEFT) { - if (m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i] == 1.0f) - m_sQueueSample.m_nFrequency = 32000; - else - m_sQueueSample.m_nFrequency = 48000;*/ - } else { + else if (sample == SOUND_FRONTEND_RADIO_CHANGE) + m_sQueueSample.m_nFrequency = 32000; + else if (sample == SOUND_BULLETTRACE_1 || sample == SOUND_BULLETTRACE_2) { m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); - } - m_sQueueSample.m_nVolume = 110; + m_sQueueSample.m_nFrequency += RandomDisplacement(m_sQueueSample.m_nFrequency / 32); + } else if (staticFreq) + m_sQueueSample.m_nFrequency = 5382; + else + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); + + m_sQueueSample.m_nVolume = 127; + if (m_sQueueSample.m_nSampleIndex == SFX_HURRICANE_MA && CWeather::Wind > 1.0f) + m_sQueueSample.m_nVolume = (CWeather::Wind - 1.0f) * m_sQueueSample.m_nVolume; m_sQueueSample.m_nCounter = iSound++; m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_bReleasingSoundFlag = true; - m_sQueueSample.m_nBankIndex = frontendBank ? SFX_BANK_FRONT_END_MENU : SFX_BANK_0; + m_sQueueSample.m_nBankIndex = SFX_BANK_FRONT_END_MENU; m_sQueueSample.m_nReleasingVolumeModificator = 0; m_sQueueSample.m_bIs2D = true; m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume; m_sQueueSample.m_nLoopStart = 0; m_sQueueSample.m_nLoopEnd = -1; - if (stereo) - m_sQueueSample.m_nOffset = m_anRandomTable[0] & 31; - else + m_sQueueSample.m_fDistance = 1.0f; + if (stereo) + m_sQueueSample.m_nOffset = 0; + else { + sample = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_awAudioEvent[i]; + if (sample == SOUND_BULLETTRACE_1) { + m_sQueueSample.m_nOffset = 20; + m_sQueueSample.m_nVolume = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i]; + m_sQueueSample.m_nReleasingVolumeModificator = 10; + m_sQueueSample.m_fDistance = 100.0f; + } + if (sample == SOUND_BULLETTRACE_2) { + m_sQueueSample.m_nOffset = 107; + m_sQueueSample.m_nVolume = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i]; + m_sQueueSample.m_nReleasingVolumeModificator = 10; + m_sQueueSample.m_fDistance = 100.0f; + } m_sQueueSample.m_nOffset = 63; + } m_sQueueSample.m_bReverbFlag = false; m_sQueueSample.m_bRequireReflection = false; AddSampleToRequestedQueue(); if (stereo) { ++m_sQueueSample.m_nSampleIndex; m_sQueueSample.m_nCounter = iSound++; - m_sQueueSample.m_nOffset = MAX_VOLUME - m_sQueueSample.m_nOffset; + m_sQueueSample.m_nOffset = 127 - m_sQueueSample.m_nOffset; + AddSampleToRequestedQueue(); + } + if (center) { + ++m_sQueueSample.m_nSampleIndex; + m_sQueueSample.m_nCounter = iSound++; + m_sQueueSample.m_nOffset = 63; + m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(m_sQueueSample.m_nSampleIndex); AddSampleToRequestedQueue(); } } diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index 3c4b2116..eb8c0bf2 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -321,8 +321,8 @@ public: void ProcessEntity(int32 sound); // done void ProcessExplosions(int32 explosion); // done void ProcessFireHydrant(); // done - void ProcessFires(int32 entity); // done - void ProcessFrontEnd(); // + void ProcessFires(int32 entity); // + void ProcessFrontEnd(); // done void ProcessGarages(); // void ProcessCarHeli(cVehicleParams* params); // done void ProcessVehicleFlatTyre(cVehicleParams* params); // done @@ -418,7 +418,7 @@ public: CVehicle *FindVehicleOfPlayer(); //done void SetPedTalkingStatus(CPed *ped, uint8 status); - void SetPlayersMood(uint8 mood, int32 time); + void SetPlayersMood(uint8 mood, uint32 time); #ifdef GTA_PC // only used in pc diff --git a/src/audio/DMAudio.cpp b/src/audio/DMAudio.cpp index ade53d9b..7c99e89f 100644 --- a/src/audio/DMAudio.cpp +++ b/src/audio/DMAudio.cpp @@ -5,9 +5,6 @@ #include "AudioManager.h" #include "AudioScriptObject.h" #include "sampman.h" -#include "Font.h" -#include "Text.h" -#include "crossplatform.h" cDMAudio DMAudio; @@ -241,13 +238,13 @@ cDMAudio::PlayFrontEndSound(uint16 frontend, uint32 volume) } void -cDMAudio::PlayRadioAnnouncement(uint8 announcement) +cDMAudio::PlayRadioAnnouncement(uint32 announcement) { MusicManager.PlayAnnouncement(announcement); } void -cDMAudio::PlayFrontEndTrack(uint8 track, uint8 frontendFlag) +cDMAudio::PlayFrontEndTrack(uint32 track, uint8 frontendFlag) { MusicManager.PlayFrontEndTrack(track, frontendFlag); } @@ -271,7 +268,7 @@ cDMAudio::ChangeMusicMode(uint8 mode) } void -cDMAudio::PreloadCutSceneMusic(uint8 track) +cDMAudio::PreloadCutSceneMusic(uint32 track) { MusicManager.PreloadCutSceneMusic(track); } @@ -337,7 +334,7 @@ cDMAudio::SetRadioInCar(uint32 radio) } void -cDMAudio::SetRadioChannel(int8 radio, int32 pos) +cDMAudio::SetRadioChannel(uint32 radio, int32 pos) { MusicManager.SetRadioChannelByScript(radio, pos); } @@ -373,7 +370,7 @@ cDMAudio::SetPedTalkingStatus(CPed *ped, uint8 status) } void -cDMAudio::SetPlayersMood(uint8 mood, int32 time) +cDMAudio::SetPlayersMood(uint8 mood, uint32 time) { return AudioManager.SetPlayersMood(mood, time); } diff --git a/src/audio/DMAudio.h b/src/audio/DMAudio.h index ef62294e..2c10043f 100644 --- a/src/audio/DMAudio.h +++ b/src/audio/DMAudio.h @@ -69,15 +69,15 @@ public: void ReportCollision(CEntity *entityA, CEntity *entityB, uint8 surfaceTypeA, uint8 surfaceTypeB, float collisionPower, float velocity); void PlayFrontEndSound(uint16 frontend, uint32 volume); - void PlayRadioAnnouncement(uint8 announcement); - void PlayFrontEndTrack(uint8 track, uint8 frontendFlag); + void PlayRadioAnnouncement(uint32 announcement); + void PlayFrontEndTrack(uint32 track, uint8 frontendFlag); void StopFrontEndTrack(void); void ResetTimers(uint32 time); void ChangeMusicMode(uint8 mode); - void PreloadCutSceneMusic(uint8 track); + void PreloadCutSceneMusic(uint32 track); void PlayPreloadedCutSceneMusic(void); void StopCutSceneMusic(void); @@ -90,14 +90,14 @@ public: uint8 GetRadioInCar(void); void SetRadioInCar(uint32 radio); - void SetRadioChannel(int8 radio, int32 pos); + void SetRadioChannel(uint32 radio, int32 pos); void SetStartingTrackPositions(uint8 isStartGame); float *GetListenTimeArray(); uint32 GetFavouriteRadioStation(); int32 GetRadioPosition(uint32 station); void SetPedTalkingStatus(class CPed *ped, uint8 status); - void SetPlayersMood(uint8 mood, int32 time); + void SetPlayersMood(uint8 mood, uint32 time); void ShutUpPlayerTalking(uint8 state); }; extern cDMAudio DMAudio; diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp index adae2708..8aedf306 100644 --- a/src/audio/MusicManager.cpp +++ b/src/audio/MusicManager.cpp @@ -618,7 +618,7 @@ cMusicManager::ServiceGameMode() } if (RadioStaticCounter < 2 && CTimer::GetTimeInMilliseconds() > RadioStaticTimer + 800) { - AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_194, 0.0f); + AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_RADIO_CHANGE, 0.0f); RadioStaticCounter++; RadioStaticTimer = CTimer::GetTimeInMilliseconds(); } diff --git a/src/audio/soundlist.h b/src/audio/soundlist.h index 44056d55..a4235d2b 100644 --- a/src/audio/soundlist.h +++ b/src/audio/soundlist.h @@ -193,15 +193,12 @@ enum eSound : uint16 SOUND_WEAPON_MINIGUN_2, SOUND_WEAPON_MINIGUN_3, SOUND_AMMUNATION_IMRAN_ARM_BOMB, - SOUND_194, - - // TODO(Miami): They're frontend sounds but names are copy-paste and incorrect - SOUND_FRONTEND_MENU_NEW_PAGE, + SOUND_RADIO_CHANGE, + SOUND_FRONTEND_HIGHLIGHT_OPTION, + SOUND_FRONTEND_ENTER_OR_ADJUST, + SOUND_FRONTEND_BACK, SOUND_FRONTEND_FAIL, - SOUND_FRONTEND_MENU_SETTING_CHANGE, - SOUND_FRONTEND_MENU_BACK, SOUND_FRONTEND_AUDIO_TEST, - SOUND_INJURED_PED_MALE_OUCH, SOUND_INJURED_PED_FEMALE, SOUND_SET_202, diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 4eda2301..eba0ca18 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -219,7 +219,7 @@ CMenuManager::PageUpList(bool playSoundOnSuccess) if (m_nTotalListRow > MAX_VISIBLE_LIST_ROW) { if (m_nFirstVisibleRowOnList > 0) { if(playSoundOnSuccess) - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_HIGHLIGHT_OPTION, 0); m_nFirstVisibleRowOnList = Max(0, m_nFirstVisibleRowOnList - MAX_VISIBLE_LIST_ROW); m_nSelectedListRow = Min(m_nSelectedListRow, m_nFirstVisibleRowOnList + MAX_VISIBLE_LIST_ROW - 1); @@ -237,7 +237,7 @@ CMenuManager::PageDownList(bool playSoundOnSuccess) if (m_nTotalListRow > MAX_VISIBLE_LIST_ROW) { if (m_nFirstVisibleRowOnList < m_nTotalListRow - MAX_VISIBLE_LIST_ROW) { if(playSoundOnSuccess) - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_HIGHLIGHT_OPTION, 0); m_nFirstVisibleRowOnList = Min(m_nFirstVisibleRowOnList + MAX_VISIBLE_LIST_ROW, m_nTotalListRow - MAX_VISIBLE_LIST_ROW); m_nSelectedListRow = Max(m_nSelectedListRow, m_nFirstVisibleRowOnList); @@ -489,6 +489,7 @@ CMenuManager::CentreMousePointer() } } +// --MIAMI: Done void CMenuManager::CheckCodesForControls(int typeOfControl) { @@ -524,26 +525,23 @@ CMenuManager::CheckCodesForControls(int typeOfControl) 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 { - if (typeOfControl == MOUSE) { - ControlsManager.DeleteMatchingActionInitiators(action, MouseButtonJustClicked, MOUSE); - } else if (typeOfControl == JOYSTICK) { - ControlsManager.DeleteMatchingActionInitiators(action, JoyButtonJustClicked, JOYSTICK); - } + } else if (typeOfControl == MOUSE) { + ControlsManager.DeleteMatchingActionInitiators(action, MouseButtonJustClicked, MOUSE); + } else if (typeOfControl == JOYSTICK) { + ControlsManager.DeleteMatchingActionInitiators(action, JoyButtonJustClicked, JOYSTICK); } + if (typeOfControl == KEYBOARD) { ControlsManager.SetControllerKeyAssociatedWithAction(action, *pControlEdit, typeToSave); - } else if (typeOfControl == MOUSE) { ControlsManager.SetControllerKeyAssociatedWithAction(action, MouseButtonJustClicked, typeToSave); - } else { - if (typeOfControl == JOYSTICK) { - ControlsManager.SetControllerKeyAssociatedWithAction(action, JoyButtonJustClicked, typeToSave); - } + } else if (typeOfControl == JOYSTICK) { + ControlsManager.SetControllerKeyAssociatedWithAction(action, JoyButtonJustClicked, typeToSave); } pControlEdit = nil; m_bWaitingForNewKeyBind = false; @@ -551,14 +549,6 @@ CMenuManager::CheckCodesForControls(int typeOfControl) m_bStartWaitingForKeyBind = false; SaveSettings(); } - - if (escPressed) { - pControlEdit = nil; - m_bWaitingForNewKeyBind = false; - m_KeyPressedCode = -1; - m_bStartWaitingForKeyBind = false; - SaveSettings(); - } } bool @@ -1360,6 +1350,7 @@ CMenuManager::DrawStandardMenus(bool activeScreen) } } +// --MIAMI: Done int CMenuManager::GetNumOptionsCntrlConfigScreens(void) { @@ -1376,10 +1367,10 @@ CMenuManager::GetNumOptionsCntrlConfigScreens(void) case MENUPAGE_KEYBOARD_CONTROLS: switch (m_ControlMethod) { case CONTROL_STANDARD: - number = 25; + number = 27; break; case CONTROL_CLASSIC: - number = 30; + number = 32; break; } break; @@ -1706,8 +1697,6 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8 CFont::SetRightJustifyOff(); CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE), MENU_Y(SMALLESTTEXT_Y_SCALE)); CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); - if (!m_bKeyIsOK) - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); m_bKeyIsOK = true; } else { @@ -1736,6 +1725,7 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8 } } +// --MIAMI: Done void CMenuManager::DrawControllerScreenExtraText(int yStart, int xStart, int lineHeight) { @@ -1777,7 +1767,7 @@ CMenuManager::DrawControllerScreenExtraText(int yStart, int xStart, int lineHeig if (waitingTextVisible) { CFont::SetColor(CRGBA(255, 255, 0, FadeIn(255))); CFont::PrintString(nextX, MENU_Y(yStart), TheText.Get("FEC_QUE")); - CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255))); + CFont::SetColor(CRGBA(LABEL_COLOR.r, LABEL_COLOR.g, LABEL_COLOR.b, FadeIn(255))); } } yStart += lineHeight; @@ -1815,20 +1805,19 @@ CMenuManager::DrawControllerSetupScreen() CFont::SetBackGroundOnlyTextOn(); CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN)); CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENU_UNK_WIDTH)); + PREPARE_MENU_HEADER switch (m_ControlMethod) { case CONTROL_STANDARD: - PREPARE_MENU_HEADER CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255))); CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X) - MENU_X(7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), - TheText.Get(aScreens[m_nCurrScreen].m_ScreenName)); + TheText.Get("FET_STI")); CFont::SetColor(CRGBA(HEADER_COLOR.r, HEADER_COLOR.g, HEADER_COLOR.b, FadeIn(255))); CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), - TheText.Get(aScreens[m_nCurrScreen].m_ScreenName)); + TheText.Get("FET_STI")); break; case CONTROL_CLASSIC: - PREPARE_MENU_HEADER CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255))); CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X) - MENU_X(7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), TheText.Get("FET_CTI")); @@ -1840,7 +1829,7 @@ CMenuManager::DrawControllerSetupScreen() default: break; } - wchar *actionTexts[31]; + wchar *actionTexts[33]; actionTexts[0] = TheText.Get("FEC_FIR"); actionTexts[1] = TheText.Get("FEC_NWE"); actionTexts[2] = TheText.Get("FEC_PWE"); @@ -1859,29 +1848,31 @@ CMenuManager::DrawControllerSetupScreen() actionTexts[15] = TheText.Get("FEC_SPN"); actionTexts[16] = TheText.Get("FEC_HND"); actionTexts[17] = TheText.Get("FEC_TAR"); + actionTexts[18] = TheText.Get("FEC_CRO"); + actionTexts[19] = TheText.Get("FEC_ANS"); if (m_ControlMethod == CONTROL_CLASSIC) { - actionTexts[18] = TheText.Get("FEC_TFL"); - actionTexts[19] = TheText.Get("FEC_TFR"); - actionTexts[20] = TheText.Get("FEC_TFU"); - actionTexts[21] = TheText.Get("FEC_TFD"); - actionTexts[22] = TheText.Get("FEC_LBA"); - actionTexts[23] = TheText.Get("FEC_LOL"); - actionTexts[24] = TheText.Get("FEC_LOR"); - actionTexts[25] = TheText.Get("FEC_LUD"); - actionTexts[26] = TheText.Get("FEC_LDU"); - actionTexts[27] = TheText.Get("FEC_NTR"); - actionTexts[28] = TheText.Get("FEC_PTT"); - actionTexts[29] = TheText.Get("FEC_CEN"); - actionTexts[30] = nil; + actionTexts[20] = TheText.Get("FEC_TFL"); + actionTexts[21] = TheText.Get("FEC_TFR"); + actionTexts[22] = TheText.Get("FEC_TFU"); + actionTexts[23] = TheText.Get("FEC_TFD"); + actionTexts[24] = TheText.Get("FEC_LBA"); + actionTexts[25] = TheText.Get("FEC_LOL"); + actionTexts[26] = TheText.Get("FEC_LOR"); + actionTexts[27] = TheText.Get("FEC_LUD"); + actionTexts[28] = TheText.Get("FEC_LDU"); + actionTexts[29] = TheText.Get("FEC_NTR"); + actionTexts[30] = TheText.Get("FEC_PTT"); + actionTexts[31] = TheText.Get("FEC_CEN"); + actionTexts[32] = nil; } else { - actionTexts[18] = TheText.Get("FEC_TFL"); - actionTexts[19] = TheText.Get("FEC_TFR"); - actionTexts[20] = TheText.Get("FEC_TFU"); - actionTexts[21] = TheText.Get("FEC_TFD"); - actionTexts[22] = TheText.Get("FEC_LBA"); - actionTexts[23] = TheText.Get("FEC_LOL"); - actionTexts[24] = TheText.Get("FEC_LOR"); - actionTexts[25] = nil; + actionTexts[20] = TheText.Get("FEC_TFL"); + actionTexts[21] = TheText.Get("FEC_TFR"); + actionTexts[22] = TheText.Get("FEC_TFU"); + actionTexts[23] = TheText.Get("FEC_TFD"); + actionTexts[24] = TheText.Get("FEC_LBA"); + actionTexts[25] = TheText.Get("FEC_LOL"); + actionTexts[26] = TheText.Get("FEC_LOR"); + actionTexts[27] = nil; } // Gray panel background @@ -1915,56 +1906,49 @@ CMenuManager::DrawControllerSetupScreen() if (!actionText) break; - 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)) { - - float curOptY = i * rowHeight + yStart; - if (m_nMousePosY > MENU_Y(curOptY) && m_nMousePosY < MENU_Y(rowHeight + curOptY)) { - if (m_nOptionMouseHovering != i && m_nCurrExLayer == HOVEROPTION_LIST) - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); + if (!m_bWaitingForNewKeyBind) { + 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_nOptionMouseHovering = i; - if (m_nMouseOldPosX != m_nMousePosX || m_nMouseOldPosY != m_nMousePosY) { - m_nCurrExLayer = HOVEROPTION_LIST; - m_nSelectedListRow = i; + float curOptY = i * rowHeight + yStart; + if (m_nMousePosY > MENU_Y(curOptY) && m_nMousePosY < MENU_Y(rowHeight + curOptY)) { + m_nOptionMouseHovering = 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_NEW_PAGE, 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_NEW_PAGE, 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))); + if (m_nSelectedListRow != i) + CFont::SetColor(CRGBA(MENUOPTION_COLOR.r, MENUOPTION_COLOR.g, MENUOPTION_COLOR.b, FadeIn(255))); else if (m_nCurrExLayer == HOVEROPTION_LIST) - CFont::SetColor(CRGBA(255, 217, 106, FadeIn(255))); + CFont::SetColor(CRGBA(SELECTEDMENUOPTION_COLOR.r, SELECTEDMENUOPTION_COLOR.g, SELECTEDMENUOPTION_COLOR.b, FadeIn(255))); CFont::SetRightJustifyOff(); if (m_PrefsLanguage != LANGUAGE_GERMAN || i != 20 && i != 21) @@ -1976,19 +1960,22 @@ CMenuManager::DrawControllerSetupScreen() } 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)); - if ((m_nMousePosX > MENU_X_RIGHT_ALIGNED(CONTSETUP_BACK_RIGHT) - CFont::GetStringWidth(TheText.Get("FEDS_TB"), true) - && m_nMousePosX < MENU_X_RIGHT_ALIGNED(CONTSETUP_BACK_RIGHT) && m_nMousePosY > SCREEN_SCALE_FROM_BOTTOM(CONTSETUP_BACK_BOTTOM) - && m_nMousePosY < SCREEN_SCALE_FROM_BOTTOM(CONTSETUP_BACK_BOTTOM - CONTSETUP_BACK_HEIGHT)) || m_nCurrExLayer == HOVEROPTION_BACK) { - m_nHoverOption = HOVEROPTION_BACK; + if (!m_bWaitingForNewKeyBind) { + CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X), MENU_Y(MENU_TEXT_SIZE_Y)); - } 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; + if ((m_nMousePosX > MENU_X_RIGHT_ALIGNED(CONTSETUP_BACK_RIGHT) - CFont::GetStringWidth(TheText.Get("FEDS_TB"), true) + && m_nMousePosX < MENU_X_RIGHT_ALIGNED(CONTSETUP_BACK_RIGHT) && m_nMousePosY > SCREEN_SCALE_FROM_BOTTOM(CONTSETUP_BACK_BOTTOM) + && m_nMousePosY < SCREEN_SCALE_FROM_BOTTOM(CONTSETUP_BACK_BOTTOM - CONTSETUP_BACK_HEIGHT)) || m_nCurrExLayer == HOVEROPTION_BACK) { + m_nHoverOption = HOVEROPTION_BACK; - } else { - m_nHoverOption = HOVEROPTION_NOT_HOVERING; + } 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 { + m_nHoverOption = HOVEROPTION_NOT_HOVERING; + } } // Back button and it's shadow @@ -2257,6 +2244,7 @@ CMenuManager::DrawBackground(bool transitionCall) } } +// --MIAMI: Done void CMenuManager::DrawPlayerSetupScreen(bool activeScreen) { @@ -2270,12 +2258,7 @@ CMenuManager::DrawPlayerSetupScreen(bool activeScreen) CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN)); CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENU_UNK_WIDTH)); - PREPARE_MENU_HEADER - - CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get("FET_PS")); - // lstrcpy's changed with strcpy - if (!m_bSkinsEnumerated) { OutputDebugString("Enumerating skin filenames from skins..."); m_pSkinListHead.nextSkin = nil; @@ -2358,15 +2341,23 @@ CMenuManager::DrawPlayerSetupScreen(bool activeScreen) 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))); + MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM)), CRGBA(49, 101, 148, FadeIn(130))); + + PREPARE_MENU_HEADER + CFont::SetColor(CRGBA(30, 30, 30, FadeIn(255))); + CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X) - MENU_X(7.f), SCREEN_SCALE_Y(MENUHEADER_POS_Y + 7.f), TheText.Get("FET_PS")); + + CFont::SetColor(CRGBA(HEADER_COLOR.r, HEADER_COLOR.g, HEADER_COLOR.b, FadeIn(255))); + CFont::PrintString(SCREEN_STRETCH_FROM_RIGHT(MENUHEADER_POS_X), SCREEN_SCALE_Y(MENUHEADER_POS_Y), TheText.Get("FET_PS")); // Header (Skin - Date) if (m_nCurrExLayer == HOVEROPTION_LIST) { - CFont::SetColor(CRGBA(255, 217, 106, FadeIn(255))); + CFont::SetColor(CRGBA(SELECTEDMENUOPTION_COLOR.r, SELECTEDMENUOPTION_COLOR.g, SELECTEDMENUOPTION_COLOR.b, FadeIn(255))); } else { - CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255))); + CFont::SetColor(CRGBA(MENUOPTION_COLOR.r, MENUOPTION_COLOR.g, MENUOPTION_COLOR.b, FadeIn(255))); } - CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING)); + CFont::SetDropShadowPosition(2); + CFont::SetDropColor(CRGBA(0, 0, 0, 255)); CFont::SetScale(MENU_X(MENUACTION_SCALE_MULT), MENU_Y(MENUACTION_SCALE_MULT)); CFont::SetRightJustifyOn(); CFont::PrintString(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_DATE_COLUMN_RIGHT), MENU_Y(PLAYERSETUP_LIST_TOP), TheText.Get("FES_DAT")); @@ -2381,6 +2372,7 @@ CMenuManager::DrawPlayerSetupScreen(bool activeScreen) } CFont::SetRightJustifyOff(); CFont::PrintString(MENU_X_LEFT_ALIGNED(PLAYERSETUP_SKIN_COLUMN_LEFT), MENU_Y(PLAYERSETUP_LIST_TOP), TheText.Get("FES_SKN")); + CFont::SetDropShadowPosition(0); // Skin list CFont::SetRightJustifyOff(); @@ -2407,13 +2399,11 @@ CMenuManager::DrawPlayerSetupScreen(bool activeScreen) if (rowIdx == m_nSelectedListRow) { m_nHoverOption = HOVEROPTION_NOT_HOVERING; if (m_nSkinsTotal > 0) { - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); strcpy(m_PrefsSkinFile, m_aSkinName); CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile); SaveSettings(); } } else { - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); m_nCurrExLayer = HOVEROPTION_LIST; m_nSelectedListRow = rowIdx; m_nHoverOption = HOVEROPTION_NOT_HOVERING; @@ -2486,7 +2476,7 @@ CMenuManager::DrawPlayerSetupScreen(bool activeScreen) } CSprite2d::DrawRect(CRect(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 4), scrollbarTop, MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - PLAYERSETUP_SCROLLBAR_WIDTH), scrollbarBottom), - CRGBA(235, 170, 50, FadeIn(255))); + CRGBA(255, 150, 225, FadeIn(255))); // FIX: Scroll button dimensions are buggy, because: // 1 - stretches the original image @@ -2556,35 +2546,29 @@ CMenuManager::DrawPlayerSetupScreen(bool activeScreen) CFont::SetScale(MENU_X(1.9f), MENU_Y(1.9f)); break; } - CFont::SetColor(CRGBA(255, 217, 106, FadeIn(120))); + CFont::SetColor(CRGBA(MENUOPTION_COLOR.r, MENUOPTION_COLOR.g, MENUOPTION_COLOR.b, FadeIn(120))); CFont::SetRightJustifyOff(); - CFont::PrintString(MENU_X_LEFT_ALIGNED(20.0f), MENU_Y(220.0f), TheText.Get("FET_APL")); + CFont::PrintString(MENU_X_LEFT_ALIGNED(24.0f), MENU_Y(220.0f), TheText.Get("FET_APP")); } CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING)); - CFont::SetScale(MENU_X(SMALLTEXT_X_SCALE), MENU_Y(SMALLTEXT_Y_SCALE)); + CFont::SetScale(MENU_X(BIGTEXT_X_SCALE), MENU_Y(BIGTEXT_Y_SCALE)); if ((m_nMousePosX > MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 1) - CFont::GetStringWidth(TheText.Get("FEDS_TB"), true) && m_nMousePosX < MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 1) && m_nMousePosY > SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM - 3) && m_nMousePosY < SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM - 26)) || m_nCurrExLayer == HOVEROPTION_BACK) { - if (m_nHoverOption != HOVEROPTION_BACK) - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); m_nHoverOption = HOVEROPTION_BACK; - } 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) && m_nMousePosY < SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM - 26)) || m_nCurrExLayer == HOVEROPTION_USESKIN) { - if (m_nHoverOption != HOVEROPTION_USESKIN) - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); m_nHoverOption = HOVEROPTION_USESKIN; - } 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) @@ -2639,36 +2623,28 @@ CMenuManager::DrawPlayerSetupScreen(bool activeScreen) } } CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING)); - CFont::SetScale(MENU_X(SMALLTEXT_X_SCALE), MENU_Y(SMALLTEXT_Y_SCALE)); + CFont::SetScale(MENU_X(BIGTEXT_X_SCALE), MENU_Y(BIGTEXT_Y_SCALE)); CFont::SetRightJustifyOn(); - CFont::SetColor(CRGBA(0, 0, 0, FadeIn(90))); + CFont::SetColor(CRGBA(MENUOPTION_COLOR.r, MENUOPTION_COLOR.g, MENUOPTION_COLOR.b, FadeIn(255))); + CFont::SetDropShadowPosition(2); + CFont::SetDropColor(CRGBA(0, 0, 0, FadeIn(255))); // Back button - for (int i = 0; i < 2; i++) { - 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 { - CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255))); - } - } + CFont::PrintString(MENU_X_RIGHT_ALIGNED(PLAYERSETUP_LIST_RIGHT - 3), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM - 5), TheText.Get("FEDS_TB")); CFont::SetRightJustifyOff(); - CFont::SetColor(CRGBA(0, 0, 0, FadeIn(90))); - // Use skin button - for (int i = 0; i < 2; i++) { - 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) { - CFont::SetColor(CRGBA(255, 217, 106, FadeIn(255))); - } else { - CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255))); - } + if (!strcmp(m_aSkinName, m_PrefsSkinFile)) { + CFont::SetColor(CRGBA(DARKMENUOPTION_COLOR.r, DARKMENUOPTION_COLOR.g, DARKMENUOPTION_COLOR.b, FadeIn(255))); + } else { + CFont::SetColor(CRGBA(MENUOPTION_COLOR.r, MENUOPTION_COLOR.g, MENUOPTION_COLOR.b, FadeIn(255))); } + // Use skin button + CFont::PrintString(MENU_X_LEFT_ALIGNED(PLAYERSETUP_LIST_LEFT), SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM - 5), TheText.Get("FES_SET")); + CFont::SetDropShadowPosition(0); } +// --MIAMI: Done int CMenuManager::FadeIn(int alpha) { @@ -2693,6 +2669,7 @@ CMenuManager::FilterOutColorMarkersFromString(wchar *str) str[newIdx] = '\0'; } +// --MIAMI: Done int CMenuManager::GetStartOptionsCntrlConfigScreens() { @@ -3292,7 +3269,7 @@ CMenuManager::ProcessList(bool &optionSelected, bool &goBack) } if (CPad::GetPad(0)->GetTabJustDown()) { - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_HIGHLIGHT_OPTION, 0); m_bShowMouse = false; switch (m_nCurrExLayer) { case HOVEROPTION_BACK: @@ -3328,7 +3305,7 @@ CMenuManager::ProcessList(bool &optionSelected, bool &goBack) if (!m_bPressedUpOnList) { m_bPressedUpOnList = true; lastTimeClickedScrollButton = CTimer::GetTimeInMillisecondsPauseMode(); - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_HIGHLIGHT_OPTION, 0); ScrollUpListByOne(); } } else { @@ -3350,7 +3327,7 @@ CMenuManager::ProcessList(bool &optionSelected, bool &goBack) if (!m_bPressedDownOnList) { m_bPressedDownOnList = true; lastTimeClickedScrollButton = CTimer::GetTimeInMillisecondsPauseMode(); - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_HIGHLIGHT_OPTION, 0); ScrollDownListByOne(); } } else { @@ -3366,7 +3343,7 @@ CMenuManager::ProcessList(bool &optionSelected, bool &goBack) m_bPressedPgUpOnList = true; lastTimeClickedScrollButton = CTimer::GetTimeInMillisecondsPauseMode(); m_bShowMouse = false; - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_HIGHLIGHT_OPTION, 0); PageUpList(false); } } @@ -3378,14 +3355,14 @@ CMenuManager::ProcessList(bool &optionSelected, bool &goBack) m_bPressedPgDnOnList = true; lastTimeClickedScrollButton = CTimer::GetTimeInMillisecondsPauseMode(); m_bShowMouse = false; - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_HIGHLIGHT_OPTION, 0); PageDownList(false); } } if (CPad::GetPad(0)->GetHome()) { m_nCurrExLayer = HOVEROPTION_LIST; m_bShowMouse = false; - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_HIGHLIGHT_OPTION, 0); if (m_nTotalListRow >= MAX_VISIBLE_LIST_ROW) { m_nFirstVisibleRowOnList = 0; } @@ -3395,7 +3372,7 @@ CMenuManager::ProcessList(bool &optionSelected, bool &goBack) if (CPad::GetPad(0)->GetEnd()) { m_nCurrExLayer = HOVEROPTION_LIST; m_bShowMouse = false; - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_HIGHLIGHT_OPTION, 0); if (m_nTotalListRow >= MAX_VISIBLE_LIST_ROW) { m_nFirstVisibleRowOnList = m_nTotalListRow - MAX_VISIBLE_LIST_ROW; } @@ -3422,7 +3399,6 @@ CMenuManager::ProcessList(bool &optionSelected, bool &goBack) break; case HOVEROPTION_USESKIN: if (m_nSkinsTotal > 0) { - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); m_pSelectedSkin = m_pSkinListHead.nextSkin; strcpy(m_PrefsSkinFile, m_aSkinName); CWorld::Players[0].SetPlayerSkin(m_PrefsSkinFile); @@ -3535,7 +3511,7 @@ CMenuManager::UserInput(void) ++m_nOptionMouseHovering; } m_nOptionHighlightTransitionBlend = 0; - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_HIGHLIGHT_OPTION, 0); } } @@ -3623,11 +3599,11 @@ CMenuManager::UserInput(void) || CPad::GetPad(0)->GetMouseWheelUpJustDown() || CPad::GetPad(0)->GetMouseWheelDownJustDown()) { int option = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action; if (option == MENUACTION_BRIGHTNESS) - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_FAIL, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_ENTER_OR_ADJUST, 0); else if (option == MENUACTION_SFXVOLUME) DMAudio.PlayFrontEndSound(SOUND_FRONTEND_AUDIO_TEST, 0); else if (option == MENUACTION_DRAWDIST || option == MENUACTION_MOUSESTEER) - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_FAIL, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_ENTER_OR_ADJUST, 0); } if (CPad::GetPad(0)->GetBackJustDown() || CPad::GetPad(0)->GetEscapeJustDown()) { @@ -3702,7 +3678,7 @@ CMenuManager::UserInput(void) && aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action != MENUACTION_DRAWDIST && aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action != MENUACTION_MOUSESENS && aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action != MENUACTION_MP3VOLUMEBOOST) { - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_FAIL, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_ENTER_OR_ADJUST, 0); } } ProcessUserInput(goDown, goUp, optionSelected, goBack, changeValueBy); @@ -3749,28 +3725,20 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u TypeOfControl = KEYBOARD; if (!m_bKeyIsOK) { - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_FAIL, 0); pControlEdit = nil; 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_159 = true; - } - else { - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); + } else { for (int i = 0; i < 4; i++) ControlsManager.ClearSettingsAssociatedWithAction((e_ControllerAction)m_CurrCntrlAction, (eControllerType)i); m_bKeyIsOK = false; m_bKeyChangeNotProcessed = false; - pControlEdit = nil; - m_bWaitingForNewKeyBind = false; - m_KeyPressedCode = -1; - m_bStartWaitingForKeyBind = false; } } } @@ -3799,7 +3767,7 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u int oldOption = m_nCurrOption; if (goDown) { if (m_nCurrScreen != MENUPAGE_MAP) - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_HIGHLIGHT_OPTION, 0); m_nCurrOption++; if (m_nCurrOption == NUM_MENUROWS || (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action == MENUACTION_NOTHING)) { @@ -3810,7 +3778,7 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u } if (goUp) { if (m_nCurrScreen != MENUPAGE_MAP) - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_HIGHLIGHT_OPTION, 0); if (m_nCurrOption == (aScreens[m_nCurrScreen].m_aEntries[0].m_Action == MENUACTION_LABEL)) { while (m_nCurrOption != NUM_MENUROWS - 1 @@ -4116,21 +4084,21 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u int saveSlot = aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_SaveSlot; if (saveSlot >= 2 && saveSlot <= 9 && Slots[m_nCurrOption] != SLOT_OK) - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_BACK, 0); - else DMAudio.PlayFrontEndSound(SOUND_FRONTEND_FAIL, 0); + else + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_ENTER_OR_ADJUST, 0); } } if (goBack) { if (m_NoEmptyBinding) { - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_BACK, 0); SwitchToNewScreen(-2); if ((m_nCurrScreen == MENUPAGE_SKIN_SELECT) || (m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS)) { m_nTotalListRow = 0; } } else { - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_BACK, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_FAIL, 0); m_ShowEmptyBindingError = true; } } @@ -4158,14 +4126,12 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u if (m_PrefsUseWideScreen < 0) m_PrefsUseWideScreen = 2; } - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); SaveSettings(); break; #endif case MENUACTION_SCREENRES: if (m_bGameNotLoaded) { RwChar** videoMods = _psGetVideoModeList(); - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); if (changeAmount > 0) { do { ++m_nDisplayVideoMode; @@ -4185,7 +4151,6 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u break; #ifdef IMPROVED_VIDEOMODE case MENUACTION_SCREENFORMAT: - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0); m_nSelectedScreenMode = !m_nSelectedScreenMode; break; #endif @@ -4740,7 +4705,7 @@ CMenuManager::PrintMap(void) CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(40.0f)); CFont::SetRightJustifyWrap(SCREEN_SCALE_X(84.0f)); CFont::SetBackGroundOnlyTextOff(); - CFont::SetColor(CRGBA(255, 150, 225, FadeIn(255))); + CFont::SetColor(CRGBA(LABEL_COLOR.r, LABEL_COLOR.g, LABEL_COLOR.b, FadeIn(255))); CFont::SetDropShadowPosition(2); CFont::SetDropColor(CRGBA(0, 0, 0, FadeIn(255))); CFont::SetCentreOn(); @@ -4812,7 +4777,7 @@ CMenuManager::PrintMap(void) float x = ((mapPoint.x - diffX) / (m_fMapSize * 2)) * (WORLD_SIZE_X / MENU_MAP_WIDTH_SCALE) - (WORLD_SIZE_X / 2 + MENU_MAP_LEFT_OFFSET * MENU_MAP_LENGTH_UNIT); float y = (WORLD_SIZE_Y / 2 - MENU_MAP_TOP_OFFSET * MENU_MAP_LENGTH_UNIT) - ((mapPoint.y - diffY) / (m_fMapSize * 2)) * (WORLD_SIZE_Y / MENU_MAP_HEIGHT_SCALE); CRadar::ToggleTargetMarker(x, y); - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_BACK, 0); } } @@ -5037,10 +5002,10 @@ CMenuManager::ChangeRadioStation(uint8 increaseBy) #if 0 m_ScrollRadioBy = increaseBy; if (m_ScrollRadioBy == 1) { - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_FAIL, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_ENTER_OR_ADJUST, 0); field_F0 = 238.0f; } else { - DMAudio.PlayFrontEndSound(SOUND_FRONTEND_FAIL, 0); + DMAudio.PlayFrontEndSound(SOUND_FRONTEND_ENTER_OR_ADJUST, 0); field_F0 = 118.0f; } #endif @@ -5058,7 +5023,7 @@ CMenuManager::ChangeRadioStation(uint8 increaseBy) } #if 0 DMAudio.StopFrontEndTrack(); - DMAudio.PlayFrontEndSound(SOUND_194, 0); + DMAudio.PlayFrontEndSound(SOUND_RADIO_CHANGE, 0); #else SaveSettings(); DMAudio.SetRadioInCar(m_PrefsRadioStation); diff --git a/src/core/Frontend.h b/src/core/Frontend.h index 0dab83a4..4c44e5e6 100644 --- a/src/core/Frontend.h +++ b/src/core/Frontend.h @@ -42,8 +42,8 @@ #define SMALLESTTEXT_X_SCALE 0.3f #define SMALLESTTEXT_Y_SCALE 0.7f -#define PLAYERSETUP_LIST_TOP 28.0f -#define PLAYERSETUP_LIST_BOTTOM 125.0f +#define PLAYERSETUP_LIST_TOP 58.0f +#define PLAYERSETUP_LIST_BOTTOM 95.0f #define PLAYERSETUP_LIST_LEFT 200.0f #define PLAYERSETUP_LIST_RIGHT 36.0f #ifdef FIX_BUGS // See the scrollbar button drawing code @@ -57,7 +57,7 @@ #define PLAYERSETUP_ROW_TEXT_Y_SCALE 0.6f #define PLAYERSETUP_SKIN_COLUMN_LEFT 220.0f #define PLAYERSETUP_DATE_COLUMN_RIGHT 56.0f -#define PLAYERSETUP_LIST_BODY_TOP 47 +#define PLAYERSETUP_LIST_BODY_TOP 77 #define PLAYERSETUP_ROW_HEIGHT 9 #define STATS_ROW_HEIGHT 17.0f diff --git a/src/core/main.cpp b/src/core/main.cpp index 012dda2e..b1f1ea50 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -1009,28 +1009,20 @@ Idle(void *arg) { CTimer::Update(); -#ifdef TIMEBARS tbInit(); -#endif CSprite2d::InitPerFrame(); CFont::InitPerFrame(); CPointLights::InitPerFrame(); -#ifdef TIMEBARS + tbStartTimer(0, "CGame::Process"); -#endif CGame::Process(); -#ifdef TIMEBARS tbEndTimer("CGame::Process"); - tbStartTimer(0, "DMAudio.Service"); -#endif + tbStartTimer(0, "DMAudio.Service"); DMAudio.Service(); - -#ifdef TIMEBARS tbEndTimer("DMAudio.Service"); -#endif if(CGame::bDemoMode && CTimer::GetTimeInMilliseconds() > (3*60 + 30)*1000 && !CCutsceneMgr::IsCutsceneProcessing()){ #ifdef PS2_MENU @@ -1066,21 +1058,16 @@ Idle(void *arg) pos.y = SCREEN_HEIGHT / 2.0f; RsMouseSetPos(&pos); #endif -#ifdef TIMEBARS tbStartTimer(0, "CnstrRenderList"); -#endif #ifdef PC_WATER CWaterLevel::PreCalcWaterGeometry(); #endif CRenderer::ConstructRenderList(); -#ifdef TIMEBARS tbEndTimer("CnstrRenderList"); + tbStartTimer(0, "PreRender"); -#endif CRenderer::PreRender(); -#ifdef TIMEBARS tbEndTimer("PreRender"); -#endif #ifdef FIX_BUGS RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE); // TODO: temp? this fixes OpenGL render but there should be a better place for this @@ -1106,13 +1093,9 @@ Idle(void *arg) RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart()); #endif -#ifdef TIMEBARS tbStartTimer(0, "RenderScene"); -#endif RenderScene(); -#ifdef TIMEBARS tbEndTimer("RenderScene"); -#endif #ifdef EXTENDED_PIPELINES CustomPipes::EnvMapRender(); @@ -1121,21 +1104,16 @@ Idle(void *arg) RenderDebugShit(); RenderEffects(); -#ifdef TIMEBARS tbStartTimer(0, "RenderMotionBlur"); -#endif if((TheCamera.m_BlurType == MOTION_BLUR_NONE || TheCamera.m_BlurType == MOTION_BLUR_LIGHT_SCENE) && TheCamera.m_ScreenReductionPercentage > 0.0f) TheCamera.SetMotionBlurAlpha(150); TheCamera.RenderMotionBlur(); -#ifdef TIMEBARS tbEndTimer("RenderMotionBlur"); + tbStartTimer(0, "Render2dStuff"); -#endif Render2dStuff(); -#ifdef TIMEBARS tbEndTimer("Render2dStuff"); -#endif }else{ CDraw::CalculateAspectRatio(); #ifdef ASPECT_RATIO_SCALE @@ -1149,35 +1127,27 @@ Idle(void *arg) return; } -#ifdef TIMEBARS tbStartTimer(0, "RenderMenus"); -#endif RenderMenus(); -#ifdef TIMEBARS tbEndTimer("RenderMenus"); - tbStartTimer(0, "DoFade"); -#endif #ifdef PS2_MENU if ( TheMemoryCard.m_bWantToLoad ) return; #endif + + tbStartTimer(0, "DoFade"); DoFade(); -#ifdef TIMEBARS tbEndTimer("DoFade"); + tbStartTimer(0, "Render2dStuff-Fade"); -#endif Render2dStuffAfterFade(); -#ifdef TIMEBARS tbEndTimer("Render2dStuff-Fade"); -#endif // CCredits::Render(); // They added it to function above and also forgot it here -#ifdef TIMEBARS if (gbShowTimebars) tbDisplay(); -#endif DoRWStuffEndOfFrame(); diff --git a/src/core/main.h b/src/core/main.h index 96fbef05..8bf06c30 100644 --- a/src/core/main.h +++ b/src/core/main.h @@ -16,6 +16,8 @@ extern bool gbPrintShite; extern bool gbModelViewer; #ifdef TIMEBARS extern bool gbShowTimebars; +#else +#define gbShowTimebars false #endif class CSprite2d; diff --git a/src/core/timebars.h b/src/core/timebars.h index 3871b61c..c4939802 100644 --- a/src/core/timebars.h +++ b/src/core/timebars.h @@ -1,6 +1,13 @@ #pragma once +#ifdef TIMEBARS void tbInit(); void tbStartTimer(int32, Const char*); void tbEndTimer(Const char*); -void tbDisplay();
\ No newline at end of file +void tbDisplay(); +#else +#define tbInit() +#define tbStartTimer(a, b) +#define tbEndTimer(a) +#define tbDisplay() +#endif diff --git a/src/render/Glass.cpp b/src/render/Glass.cpp index 0e26ee0b..426fa7f1 100644 --- a/src/render/Glass.cpp +++ b/src/render/Glass.cpp @@ -668,7 +668,7 @@ CGlass::WindowRespondsToCollision(CEntity *entity, float amount, CVector speed, object->bGlassBroken = true; object->bIsVisible = false; - object->bUsesCollision = true; + object->bUsesCollision = false; } void @@ -868,11 +868,11 @@ CGlass::HasGlassBeenShatteredAtCoors(float x, float y, float z) CWorld::AdvanceCurrentScanCode(); - for ( int32 y = nStartY; y <= nEndY; y++ ) + for ( int32 ys = nStartY; ys <= nEndY; ys++ ) { - for ( int32 x = nStartX; x <= nEndX; x++ ) + for ( int32 xs = nStartX; xs <= nEndX; xs++ ) { - CSector *sector = CWorld::GetSector(x, y); + CSector *sector = CWorld::GetSector(xs, ys); ASSERT(sector != nil); diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp index 753bb42b..94e09044 100644 --- a/src/render/Hud.cpp +++ b/src/render/Hud.cpp @@ -468,14 +468,10 @@ void CHud::Draw() Sprites[WeaponType].Draw( CRect(SCREEN_SCALE_FROM_RIGHT(99.0f), SCREEN_SCALE_Y(27.0f), SCREEN_SCALE_FROM_RIGHT(35.0f), SCREEN_SCALE_Y(91.0f)), CRGBA(255, 255, 255, alpha), - 0.015f, - 0.015f, - 1.0f, - 0.0f, - 0.015f, - 1.0f, - 1.0f, - 1.0f); + 0.015f, 0.015f, + 1.0f, 0.0f, + 0.015f, 1.0f, + 1.0f, 1.0f); } else { CBaseModelInfo *weaponModel = CModelInfo::GetModelInfo(weaponInfo->m_nModelId); RwTexDictionary *weaponTxd = CTxdStore::GetSlot(weaponModel->GetTxdSlot())->texDict; @@ -483,13 +479,26 @@ void CHud::Draw() RwTexture *weaponIcon = RwTexDictionaryFindNamedTexture(weaponTxd, weaponModel->GetName()); if (weaponIcon) { RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR); +#ifndef FIX_BUGS + const float xSize = SCREEN_SCALE_X(64.0f / 2.0f); + const float ySize = SCREEN_SCALE_Y(64.0f / 2.0f); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(weaponIcon)); - const float xSize = SCREEN_SCALE_X(64.0f / 2.0f); - const float ySize = SCREEN_SCALE_X(64.0f / 2.0f); CSprite::RenderOneXLUSprite(SCREEN_SCALE_FROM_RIGHT(99.0f) + xSize, SCREEN_SCALE_Y(25.0f) + ySize, 1.0f, xSize, ySize, 255, 255, 255, 255, 1.0f, 255); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE); +#else + static CSprite2d sprite; + sprite.m_pTexture = weaponIcon; + sprite.Draw( + CRect(SCREEN_SCALE_FROM_RIGHT(99.0f), SCREEN_SCALE_Y(27.0f), SCREEN_SCALE_FROM_RIGHT(35.0f), SCREEN_SCALE_Y(91.0f)), + CRGBA(255, 255, 255, alpha), + 0.015f, 0.015f, + 1.0f, 0.0f, + 0.015f, 1.0f, + 1.0f, 1.0f); + sprite.m_pTexture = nil; +#endif } } } diff --git a/src/render/WindModifiers.cpp b/src/render/WindModifiers.cpp index 2061df6a..b72e362e 100644 --- a/src/render/WindModifiers.cpp +++ b/src/render/WindModifiers.cpp @@ -33,7 +33,7 @@ CWindModifiers::FindWindModifier(CVector pos, float *x, float *y) float dist = (pos - Array[i].m_pos).Magnitude(); if (dist < MAX_FADE_DIST) { float distFade = dist < MIN_FADE_DIST ? 1.0f : 1.0f - (dist - MIN_FADE_DIST) / (MAX_FADE_DIST - MIN_FADE_DIST); - float heightFade = 1.0f - zDist / MAX_HEIGHT_DIST; + float heightFade = distFade * ((1.0f - zDist / MAX_HEIGHT_DIST) / 2.0f); dir = (pos - Array[i].m_pos) * heightFade / dist; bWasWindModifierFound = true; } diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index 85418edd..503027af 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -549,12 +549,14 @@ CameraSize(RwCamera * camera, RwRect * rect, if( raster ) { RwRasterDestroy(raster); + camera->frameBuffer = nil; } zRaster = RwCameraGetZRaster(camera); if( zRaster ) { RwRasterDestroy(zRaster); + camera->zBuffer = nil; } /* diff --git a/src/text/Messages.cpp b/src/text/Messages.cpp index a2409289..db0865ae 100644 --- a/src/text/Messages.cpp +++ b/src/text/Messages.cpp @@ -71,7 +71,7 @@ CMessages::WideStringCompare(wchar *str1, wchar *str2, uint16 size) if (len1 != len2 && (len1 < size || len2 < size)) return false; - for (int32 i = 0; FixupChar(str1[i]) != '\0' && i < size; i++) { + for (int32 i = 0; i < size && FixupChar(str1[i]) != '\0'; i++) { if (FixupChar(str1[i]) != FixupChar(str2[i])) return false; } @@ -99,13 +99,9 @@ CMessages::Process() if (BriefMessages[0].m_pText != nil && CTimer::GetTimeInMilliseconds() > BriefMessages[0].m_nTime + BriefMessages[0].m_nStartTime) { BriefMessages[0].m_pText = nil; - int32 i = 0; - while (i < NUMBRIEFMESSAGES-1) { - if (BriefMessages[i + 1].m_pText == nil) - break; - + int32 i; + for (i = 0; i < NUMBRIEFMESSAGES-1 && BriefMessages[i + 1].m_pText != nil; i++) { BriefMessages[i] = BriefMessages[i + 1]; - i++; } CMessages::BriefMessages[i].m_pText = nil; CMessages::BriefMessages[0].m_nStartTime = CTimer::GetTimeInMilliseconds(); @@ -328,7 +324,7 @@ void CMessages::AddToPreviousBriefArray(wchar *text, int32 n1, int32 n2, int32 n3, int32 n4, int32 n5, int32 n6, wchar *string) { int32 i; - for (i = 0; PreviousBriefs[i].m_pText && i < NUMPREVIOUSBRIEFS; i++) { + for (i = 0; i < NUMPREVIOUSBRIEFS && PreviousBriefs[i].m_pText != nil; i++) { if (PreviousBriefs[i].m_nNumber[0] == n1 && PreviousBriefs[i].m_nNumber[1] == n2 && PreviousBriefs[i].m_nNumber[2] == n3 @@ -505,7 +501,7 @@ CMessages::AddMessageWithNumber(wchar *str, uint32 time, uint16 flag, int32 n1, GetWideStringLength(outstr); uint16 i = 0; - while (i < NUMBRIEFMESSAGES && BriefMessages[i].m_pText) + while (i < NUMBRIEFMESSAGES && BriefMessages[i].m_pText != nil) i++; if (i >= NUMBRIEFMESSAGES) return; @@ -722,35 +718,24 @@ CMessages::ClearThisPrint(wchar *str) do { equal = false; - uint16 i = 0; - while (i < NUMBRIEFMESSAGES) { - if (BriefMessages[i].m_pText == nil) - break; - + uint16 i; + for (i = 0; i < NUMBRIEFMESSAGES && BriefMessages[i].m_pText != nil; i++) { equal = FastWideStringComparison(str, BriefMessages[i].m_pText); if (equal) break; - i++; } if (equal) { if (i != 0) { BriefMessages[i].m_pText = nil; - while (i < NUMBRIEFMESSAGES-1) { - if (BriefMessages[i + 1].m_pText == nil) - break; - + for (; i < NUMBRIEFMESSAGES-1 && BriefMessages[i+1].m_pText != nil; i++) { BriefMessages[i] = BriefMessages[i + 1]; - i++; } BriefMessages[i].m_pText = nil; } else { BriefMessages[0].m_pText = nil; - while (i < NUMBRIEFMESSAGES-1) { - if (BriefMessages[i + 1].m_pText == nil) - break; + for (; i < NUMBRIEFMESSAGES-1 && BriefMessages[i+1].m_pText != nil; i++) { BriefMessages[i] = BriefMessages[i + 1]; - i++; } BriefMessages[i].m_pText = nil; BriefMessages[0].m_nStartTime = CTimer::GetTimeInMilliseconds(); |