Skip to content

Commit 3094a1b

Browse files
committed
Formatting
1 parent 73bc9f6 commit 3094a1b

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

Source/Lua/LuaAdapterDefinitions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ namespace RTE {
439439
static bool CyclePlayingSoundContainers2(MusicMan& musicMan, bool fadeOutCurrent);
440440
};
441441
#pragma endregion
442-
442+
443443
#pragma region TimerMan Lua Adapters
444444
struct LuaAdaptersTimerMan {
445445
/// Gets the current number of ticks that the simulation should be updating with. Lua can't handle int64 (or long long apparently) so we'll expose this specialized function.

Source/Managers/ActivityMan.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ int ActivityMan::StartActivity(Activity* activity) {
292292
m_Activity.reset(dynamic_cast<Activity*>(m_StartActivity->Clone()));
293293

294294
g_MusicMan.ResetMusicState();
295-
295+
296296
m_Activity->SetupPlayers();
297297
int error = m_Activity->Start();
298298

@@ -315,7 +315,7 @@ int ActivityMan::StartActivity(Activity* activity) {
315315

316316
// Reset the mouse input to the center
317317
g_UInputMan.SetMouseValueMagnitude(0.05F);
318-
318+
319319
g_AudioMan.PauseIngameSounds(false);
320320

321321
g_PerformanceMan.ResetPerformanceTimings();

Source/Managers/MusicMan.cpp

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ bool MusicMan::PlayDynamicSong(const std::string& songName, const std::string& s
122122
if (m_PreviousSoundContainer) {
123123
m_PreviousSoundContainer->Stop();
124124
m_PreviousSoundContainer = nullptr;
125-
}
125+
}
126+
126127
if (m_CurrentSoundContainer) {
127128
m_PreviousSoundContainerSetToFade = true;
128129
m_MusicFadeTimer.Reset();
@@ -186,14 +187,15 @@ bool MusicMan::EndDynamicMusic(bool fadeOutCurrent) {
186187
}
187188

188189
m_CurrentSong = nullptr;
189-
190+
190191
if (m_PreviousSoundContainer && m_PreviousSoundContainer->IsBeingPlayed()) {
191192
m_PreviousSoundContainer->FadeOut(500);
192193
}
194+
193195
if (fadeOutCurrent && m_CurrentSoundContainer && m_CurrentSoundContainer->IsBeingPlayed()) {
194196
m_CurrentSoundContainer->FadeOut(2000);
195197
}
196-
198+
197199
m_MusicTimer.Reset();
198200
m_MusicTimer.SetRealTimeLimitMS(0);
199201
m_MusicPausedTime = 0.0;
@@ -218,7 +220,7 @@ void MusicMan::PlayInterruptingMusic(SoundContainer* soundContainer) {
218220
if (m_NextSoundContainer != nullptr) {
219221
m_NextSoundContainer->SetPaused(true);
220222
}
221-
223+
222224
m_InterruptingMusicSoundContainer = std::unique_ptr<SoundContainer>(dynamic_cast<SoundContainer*>(soundContainer->Clone()));
223225
m_InterruptingMusicSoundContainer->Play();
224226
if (m_IsPlayingDynamicMusic) {
@@ -254,16 +256,18 @@ void MusicMan::EndInterruptingMusic() {
254256
}
255257

256258
void MusicMan::SelectNextSongSection() {
257-
if (!m_CurrentSongSection || m_CurrentSongSection->GetSectionType() != m_CurrentSongSectionType) {
258-
for (DynamicSongSection& dynamicSongSection: m_CurrentSong->GetSongSections()) {
259-
if (dynamicSongSection.GetSectionType() == m_CurrentSongSectionType) {
260-
m_CurrentSongSection = &dynamicSongSection;
261-
return;
262-
}
263-
}
264-
} else {
259+
if (m_CurrentSongSection && m_CurrentSongSection->GetSectionType() == m_CurrentSongSectionType) {
260+
// Our current song section is already suitable
265261
return;
266262
}
263+
264+
for (DynamicSongSection& dynamicSongSection: m_CurrentSong->GetSongSections()) {
265+
if (dynamicSongSection.GetSectionType() == m_CurrentSongSectionType) {
266+
m_CurrentSongSection = &dynamicSongSection;
267+
return;
268+
}
269+
}
270+
267271
m_CurrentSongSection = &m_CurrentSong->GetDefaultSongSection();
268272
}
269273

Source/Managers/MusicMan.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ namespace RTE {
1111
class MusicMan : public Singleton<MusicMan> {
1212

1313
public:
14-
1514
#pragma region Creation
1615
/// Constructor method used to instantiate a MusicMan object in system memory.
1716
/// Create() should be called before using the object.
@@ -98,11 +97,11 @@ namespace RTE {
9897
SoundContainer* m_ScenarioMenuMusicSoundContainer; //!< SoundContainer for hardcoded scenario menu music.
9998

10099
std::unique_ptr<SoundContainer> m_InterruptingMusicSoundContainer; //!< Current interrupting music being played.
101-
100+
102101
std::unique_ptr<DynamicSong> m_CurrentSong; //!< The current DynamicSong being played.
103102
std::string m_CurrentSongSectionType; //!< The current type of DynamicSongSection we are trying to play.
104103
DynamicSongSection* m_CurrentSongSection; //!< The current DynamicSongSection we are actually playing.
105-
104+
106105
std::unique_ptr<SoundContainer> m_PreviousSoundContainer; //!< The previous SoundContainer that was played as music. We keep it to allow it to play out while Current ramps up.
107106
std::unique_ptr<SoundContainer> m_CurrentSoundContainer; //!< The current selected SoundContainer playing as music.
108107
SoundContainer* m_NextSoundContainer; //!< The next selected SoundContainer to play as music.

0 commit comments

Comments
 (0)