Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 06147c6

Browse files
committed
Minor cleanup
1 parent f8f58ae commit 06147c6

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

Entities/SoundContainer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ namespace RTE {
138138

139139
for (std::vector<std::pair<ContentFile, FMOD::Sound * >>::const_iterator itr = m_Sounds.begin(); itr != m_Sounds.end() && result == FMOD_OK; ++itr) {
140140
FMOD_MODE soundMode = (m_Loops == 0) ? FMOD_LOOP_OFF : FMOD_LOOP_NORMAL;
141-
(soundMode |= m_Immobile) ? FMOD_3D_HEADRELATIVE : FMOD_3D_WORLDRELATIVE;
141+
soundMode |= m_Immobile ? FMOD_3D_HEADRELATIVE : FMOD_3D_WORLDRELATIVE;
142142

143143
result = (result == FMOD_OK) ? itr->second->setMode(soundMode) : result;
144144
result = (result == FMOD_OK) ? itr->second->setLoopCount(m_Loops) : result;

Managers/AudioMan.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ namespace RTE {
297297
// Decipher the number of secs we're supposed to wait
298298
int seconds = 0;
299299
sscanf(nextString.c_str(), "@%i", &seconds);
300-
m_SilenceTimer.SetRealTimeLimitS((seconds > 0 )? seconds : 0);
300+
m_SilenceTimer.SetRealTimeLimitS((seconds > 0 ) ? seconds : 0);
301301
m_SilenceTimer.Reset();
302302

303303
bool isPlaying;
@@ -306,9 +306,7 @@ namespace RTE {
306306
if (m_IsInMultiplayerMode) { RegisterMusicEvent(-1, MUSIC_SILENCE, NULL, seconds); }
307307
result = m_MusicChannelGroup->stop();
308308
}
309-
if (result != FMOD_OK) {
310-
g_ConsoleMan.PrintString("ERROR: Could not set play silence as specified in music queue, when trying to play next stream: " + std::string(FMOD_ErrorString(result)));
311-
}
309+
if (result != FMOD_OK) { g_ConsoleMan.PrintString("ERROR: Could not set play silence as specified in music queue, when trying to play next stream: " + std::string(FMOD_ErrorString(result))); }
312310
} else {
313311
// Loop music if it's the last track in the playlist, otherwise just go to the next one
314312
PlayMusic(nextString.c_str(), m_MusicPlayList.empty() ? -1 : 0);
@@ -417,9 +415,8 @@ namespace RTE {
417415
return false;
418416
}
419417
result = channel->setPaused(false);
420-
if (result != FMOD_OK) {
421-
g_ConsoleMan.PrintString("ERROR: Failed to start playing sounds from SoundContainer " + soundContainer->GetPresetName() + " after setting it up: " + std::string(FMOD_ErrorString(result)));
422-
}
418+
if (result != FMOD_OK) { g_ConsoleMan.PrintString("ERROR: Failed to start playing sounds from SoundContainer " + soundContainer->GetPresetName() + " after setting it up: " + std::string(FMOD_ErrorString(result))); }
419+
423420
soundContainer->AddPlayingChannel(channelIndex);
424421

425422
// Now that the sound is playing we can register an event with the SoundContainer's channels, which can be used by clients to identify the sound being played.
@@ -447,10 +444,7 @@ namespace RTE {
447444
result = m_AudioSystem->getChannel((*channelIterator), &soundChannel);
448445
++channelIterator; // NOTE - stopping the sound will remove the channel, screwing things up if we don't move to the next iterator preemptively
449446
result = (result == FMOD_OK) ? soundChannel->stop() : result;
450-
if (result != FMOD_OK) {
451-
g_ConsoleMan.PrintString("Error: Failed to stop playing channel in SoundContainer " + soundContainer->GetPresetName() + ": " + std::string(FMOD_ErrorString(result)));
452-
}
453-
447+
if (result != FMOD_OK) { g_ConsoleMan.PrintString("Error: Failed to stop playing channel in SoundContainer " + soundContainer->GetPresetName() + ": " + std::string(FMOD_ErrorString(result))); }
454448
}
455449
}
456450
return anySoundsPlaying;

0 commit comments

Comments
 (0)