Commit 7aa6b1c0 authored by Gerstrong's avatar Gerstrong

Now council member sound is played when keen touches him and the game gets...

Now council member sound is played when keen touches him and the game gets paused as it is in the original + cleanups
parent 82ee483a
......@@ -8,6 +8,7 @@
#include "CCouncilMember.h"
#include "CPlayerLevel.h"
#include "misc.h"
#include "sdl/sound/CSound.h"
namespace galaxy {
......@@ -115,16 +116,15 @@ void CCouncilMember::getTouchedBy(CObject &theObject)
// TODO: In this part we have to check which level we are and send the proper messages
g_pSound->playSound(SOUND_RESCUE_COUNCIL_MEMBER, PLAY_PAUSEALL);
std::string elder_text[2];
elder_text[0] = g_pBehaviorEngine->getString("KEEN_NOSWEAT_TEXT");
elder_text[1] = g_pBehaviorEngine->getString("ELDERS_TEXT");
elder_text[0] = g_pBehaviorEngine->getString("ELDERS_TEXT");
elder_text[1] = g_pBehaviorEngine->getString("KEEN_NOSWEAT_TEXT");
EventContainer.add( new EventSendBitmapDialogMsg(104, elder_text[0], LEFT) );
EventContainer.add( new EventSendBitmapDialogMsg(106, elder_text[1], RIGHT) );
EventContainer.add( new EventExitLevel(mp_Map->getLevel(), true) );
Player.m_Inventory.Item.m_special.ep4.elders++;
......
......@@ -237,12 +237,15 @@ void CSound::callback(void *unused, Uint8 *stream, int len)
// if priorities allow, plays the sound "snd".
// nonzero return value indicates a higher priority sound is playing.
void CSound::playSound(GameSound snd, char mode)
void CSound::playSound( const GameSound snd,
const SoundPlayMode mode )
{
playStereosound(snd, mode, 0);
}
void CSound::playStereofromCoord(GameSound snd, char mode, unsigned int xcoordinate)
void CSound::playStereofromCoord( const GameSound snd,
const SoundPlayMode mode,
const unsigned int xcoordinate)
{
if(AudioSpec.channels == 2)
{
......
......@@ -37,8 +37,11 @@ public:
void callback(void *unused, Uint8 *stream, int len);
void pauseSound(void);
void resumeSounds(void);
void playSound(GameSound snd, char mode=PLAY_NOW);
void playStereofromCoord(GameSound snd, char mode, unsigned int xcoordinate);
void playSound( const GameSound snd,
const SoundPlayMode mode = PLAY_NOW );
void playStereofromCoord(const GameSound snd,
const SoundPlayMode mode,
const unsigned int xcoordinate);
void playStereosound(const GameSound snd, const char mode, const short balance);
bool isPlaying(const GameSound snd);
void stopSound(const GameSound snd);
......
......@@ -16,11 +16,11 @@ m_AudioSpec(AudioSpec)
m_sound_paused = true;
m_sound_forced = false;
m_balance = 0;
}
void CSoundChannel::stopSound()
{
m_balance = 0;
m_sound_ptr = 0;
m_sound_playing = false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment