Added radio sound.

This commit is contained in:
Steve 2015-11-29 12:55:36 +00:00
parent eeaccec327
commit 76eb50d92c
5 changed files with 17 additions and 7 deletions

Binary file not shown.

View File

@ -34,6 +34,11 @@ void addMessageBox(char *title, char *body)
MessageBox *msg;
float time;
if (tail == &head)
{
playSound(SND_RADIO);
}
msg = malloc(sizeof(MessageBox));
memset(msg, 0, sizeof(MessageBox));
tail->next = msg;
@ -49,10 +54,9 @@ void addMessageBox(char *title, char *body)
void doMessageBox(void)
{
MessageBox *msg, *prev;
MessageBox *msg;
msg = head.next;
prev = &head;
if (msg)
{
@ -60,15 +64,18 @@ void doMessageBox(void)
{
if (msg == tail)
{
tail = prev;
tail = &head;
}
prev->next = msg->next;
head.next = msg->next;
free(msg);
msg = prev;
msg = &head;
if (head.next)
{
playSound(SND_RADIO);
}
}
prev = msg;
}
}

View File

@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern void limitTextWidth(int width);
extern void playSound(int sound);
extern App app;
extern Colors colors;

View File

@ -167,6 +167,7 @@ enum
SND_MISSILE,
SND_INCOMING,
SND_BOOST,
SND_RADIO,
SND_GUI_CLICK,
SND_GUI_SELECT,
SND_GUI_CLOSE,

View File

@ -101,6 +101,7 @@ static void loadSounds(void)
sounds[SND_MISSILE] = Mix_LoadWAV("sound/65787__iwilldstroyu__laserrocket.ogg");
sounds[SND_BOOST] = Mix_LoadWAV("sound/18380__inferno__hvrl.ogg");
/*sounds[SND_ECM] = Mix_LoadWAV("sound/18380__inferno__hvrl.ogg");*/
sounds[SND_RADIO] = Mix_LoadWAV("sound/321906__bruce965__walkie-talkie-roger-beep.ogg");
sounds[SND_INCOMING] = Mix_LoadWAV("sound/242856__plasterbrain__nuclear-alarm.ogg");
sounds[SND_GET_ITEM] = Mix_LoadWAV("sound/88275__s-dij__gbc-reload-06.ogg");
sounds[SND_EXPLOSION_1] = Mix_LoadWAV("sound/162265__qubodup__explosive.ogg");