mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Remove useless bool
This commit is contained in:
parent
2347b6a86c
commit
016581ff18
@ -1936,25 +1936,21 @@ bool CEvent::DrawButtons()
|
||||
|
||||
volume = m_pSound->GetAudioVolume();
|
||||
bEnable = true;
|
||||
if (volume == 0 ||
|
||||
!m_pSound->GetEnable())
|
||||
if (volume == 0)
|
||||
bEnable = false;
|
||||
SetEnable (WM_BUTTON3, bEnable);
|
||||
bEnable = true;
|
||||
if (volume >= MAXVOLUME ||
|
||||
!m_pSound->GetEnable())
|
||||
if (volume >= MAXVOLUME)
|
||||
bEnable = false;
|
||||
SetEnable (WM_BUTTON4, bEnable);
|
||||
|
||||
volume = m_pSound->GetMidiVolume();
|
||||
bEnable = true;
|
||||
if (volume == 0 ||
|
||||
!m_pSound->GetEnable())
|
||||
if (volume == 0)
|
||||
bEnable = false;
|
||||
SetEnable (WM_BUTTON5, bEnable);
|
||||
bEnable = true;
|
||||
if (volume >= MAXVOLUME ||
|
||||
!m_pSound->GetEnable())
|
||||
if (volume >= MAXVOLUME)
|
||||
bEnable = false;
|
||||
SetEnable (WM_BUTTON6, bEnable);
|
||||
|
||||
|
@ -27,7 +27,6 @@ CSound::CSound()
|
||||
{
|
||||
Sint32 i;
|
||||
|
||||
m_bEnable = false;
|
||||
m_bState = false;
|
||||
m_MIDIFilename[0] = 0;
|
||||
m_audioVolume = 20;
|
||||
@ -64,8 +63,6 @@ CSound::~CSound()
|
||||
|
||||
bool CSound::Create()
|
||||
{
|
||||
m_bEnable = true;
|
||||
|
||||
if (Mix_OpenAudio (44100, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, 4096) == -1)
|
||||
return false;
|
||||
|
||||
@ -79,15 +76,6 @@ bool CSound::Create()
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Retourne l'�tat de DirectSound.
|
||||
|
||||
bool CSound::GetEnable()
|
||||
{
|
||||
return m_bEnable;
|
||||
}
|
||||
|
||||
|
||||
// Enclenche ou d�clenche le son.
|
||||
|
||||
void CSound::SetState (bool bState)
|
||||
@ -105,8 +93,6 @@ void CSound::SetAudioVolume (Sint32 volume)
|
||||
|
||||
Sint32 CSound::GetAudioVolume()
|
||||
{
|
||||
if (!m_bEnable)
|
||||
return 0;
|
||||
return m_audioVolume;
|
||||
}
|
||||
|
||||
@ -117,8 +103,6 @@ void CSound::SetMidiVolume (Sint32 volume)
|
||||
|
||||
Sint32 CSound::GetMidiVolume()
|
||||
{
|
||||
if (!m_bEnable)
|
||||
return 0;
|
||||
return m_midiVolume;
|
||||
}
|
||||
|
||||
@ -130,9 +114,6 @@ void CSound::CacheAll()
|
||||
Sint32 i;
|
||||
char name[50];
|
||||
|
||||
if (!m_bEnable)
|
||||
return;
|
||||
|
||||
for (i = 0 ; i < MAXSOUND ; i++)
|
||||
{
|
||||
sprintf (name, "sound%.3d.wav", i);
|
||||
@ -145,8 +126,6 @@ void CSound::CacheAll()
|
||||
|
||||
bool CSound::Cache (Sint32 channel, const std::string &pFilename)
|
||||
{
|
||||
if (!m_bEnable)
|
||||
return false;
|
||||
if (channel < 0 || channel >= MAXSOUND)
|
||||
return false;
|
||||
|
||||
@ -187,8 +166,6 @@ void CSound::FlushAll ()
|
||||
|
||||
void CSound::Flush (Sint32 channel)
|
||||
{
|
||||
if (!m_bEnable)
|
||||
return;
|
||||
if (channel < 0 || channel >= MAXSOUND)
|
||||
return;
|
||||
|
||||
@ -206,9 +183,6 @@ void CSound::Flush (Sint32 channel)
|
||||
|
||||
bool CSound::Play (Sint32 channel, Sint32 volume, Uint8 panLeft, Uint8 panRight)
|
||||
{
|
||||
if (!m_bEnable)
|
||||
return true;
|
||||
|
||||
if (!m_bState || !m_audioVolume)
|
||||
return true;
|
||||
|
||||
@ -295,8 +269,6 @@ bool CSound::PlayMusic (const char *lpszMIDIFilename)
|
||||
{
|
||||
std::string path = GetBaseDir();
|
||||
|
||||
if (!m_bEnable)
|
||||
return true;
|
||||
if (m_midiVolume == 0)
|
||||
return true;
|
||||
|
||||
@ -328,8 +300,7 @@ bool CSound::PlayMusic (const char *lpszMIDIFilename)
|
||||
bool CSound::RestartMusic()
|
||||
{
|
||||
OutputDebug ("RestartMusic\n");
|
||||
if (!m_bEnable)
|
||||
return true;
|
||||
|
||||
if (m_midiVolume == 0)
|
||||
return true;
|
||||
if (m_MIDIFilename[0] == 0)
|
||||
@ -342,9 +313,6 @@ bool CSound::RestartMusic()
|
||||
|
||||
void CSound::SuspendMusic()
|
||||
{
|
||||
if (!m_bEnable)
|
||||
return;
|
||||
|
||||
if (m_nbSuspendSkip != 0)
|
||||
{
|
||||
m_nbSuspendSkip --;
|
||||
|
@ -46,7 +46,6 @@ public:
|
||||
bool StopAllSounds();
|
||||
|
||||
protected:
|
||||
bool m_bEnable;
|
||||
bool m_bState;
|
||||
bool m_bStopped;
|
||||
Mix_Music *m_pMusic;
|
||||
|
Loading…
x
Reference in New Issue
Block a user