Added radio sound.
This commit is contained in:
parent
eeaccec327
commit
76eb50d92c
Binary file not shown.
|
@ -34,6 +34,11 @@ void addMessageBox(char *title, char *body)
|
||||||
MessageBox *msg;
|
MessageBox *msg;
|
||||||
float time;
|
float time;
|
||||||
|
|
||||||
|
if (tail == &head)
|
||||||
|
{
|
||||||
|
playSound(SND_RADIO);
|
||||||
|
}
|
||||||
|
|
||||||
msg = malloc(sizeof(MessageBox));
|
msg = malloc(sizeof(MessageBox));
|
||||||
memset(msg, 0, sizeof(MessageBox));
|
memset(msg, 0, sizeof(MessageBox));
|
||||||
tail->next = msg;
|
tail->next = msg;
|
||||||
|
@ -49,10 +54,9 @@ void addMessageBox(char *title, char *body)
|
||||||
|
|
||||||
void doMessageBox(void)
|
void doMessageBox(void)
|
||||||
{
|
{
|
||||||
MessageBox *msg, *prev;
|
MessageBox *msg;
|
||||||
|
|
||||||
msg = head.next;
|
msg = head.next;
|
||||||
prev = &head;
|
|
||||||
|
|
||||||
if (msg)
|
if (msg)
|
||||||
{
|
{
|
||||||
|
@ -60,15 +64,18 @@ void doMessageBox(void)
|
||||||
{
|
{
|
||||||
if (msg == tail)
|
if (msg == tail)
|
||||||
{
|
{
|
||||||
tail = prev;
|
tail = &head;
|
||||||
}
|
}
|
||||||
|
|
||||||
prev->next = msg->next;
|
head.next = msg->next;
|
||||||
free(msg);
|
free(msg);
|
||||||
msg = prev;
|
msg = &head;
|
||||||
|
|
||||||
|
if (head.next)
|
||||||
|
{
|
||||||
|
playSound(SND_RADIO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
prev = msg;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
|
||||||
extern void limitTextWidth(int width);
|
extern void limitTextWidth(int width);
|
||||||
|
extern void playSound(int sound);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Colors colors;
|
extern Colors colors;
|
||||||
|
|
|
@ -167,6 +167,7 @@ enum
|
||||||
SND_MISSILE,
|
SND_MISSILE,
|
||||||
SND_INCOMING,
|
SND_INCOMING,
|
||||||
SND_BOOST,
|
SND_BOOST,
|
||||||
|
SND_RADIO,
|
||||||
SND_GUI_CLICK,
|
SND_GUI_CLICK,
|
||||||
SND_GUI_SELECT,
|
SND_GUI_SELECT,
|
||||||
SND_GUI_CLOSE,
|
SND_GUI_CLOSE,
|
||||||
|
|
|
@ -101,6 +101,7 @@ static void loadSounds(void)
|
||||||
sounds[SND_MISSILE] = Mix_LoadWAV("sound/65787__iwilldstroyu__laserrocket.ogg");
|
sounds[SND_MISSILE] = Mix_LoadWAV("sound/65787__iwilldstroyu__laserrocket.ogg");
|
||||||
sounds[SND_BOOST] = Mix_LoadWAV("sound/18380__inferno__hvrl.ogg");
|
sounds[SND_BOOST] = Mix_LoadWAV("sound/18380__inferno__hvrl.ogg");
|
||||||
/*sounds[SND_ECM] = 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_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_GET_ITEM] = Mix_LoadWAV("sound/88275__s-dij__gbc-reload-06.ogg");
|
||||||
sounds[SND_EXPLOSION_1] = Mix_LoadWAV("sound/162265__qubodup__explosive.ogg");
|
sounds[SND_EXPLOSION_1] = Mix_LoadWAV("sound/162265__qubodup__explosive.ogg");
|
||||||
|
|
Loading…
Reference in New Issue