From 1dc2801c7f0a9c8537f73085e1f634490635fb48 Mon Sep 17 00:00:00 2001 From: avolkov Date: Fri, 24 Mar 2006 20:29:14 +0000 Subject: [PATCH] Clear menu sound interface git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2287 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/sounds.c | 9 ++++++++- sc2/src/sc2code/sounds.h | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/sc2/src/sc2code/sounds.c b/sc2/src/sc2code/sounds.c index c7dccdfce..494f12d48 100644 --- a/sc2/src/sc2code/sounds.c +++ b/sc2/src/sc2code/sounds.c @@ -27,7 +27,6 @@ static BYTE num_sounds = 0; static SOUND sound_buf[MAX_SOUNDS]; static ELEMENTPTR sound_posobj[MAX_SOUNDS]; - void PlaySound (SOUND S, SoundPosition Pos, ELEMENTPTR PositionalObject, BYTE Priority) @@ -73,6 +72,14 @@ PlaySound (SOUND S, SoundPosition Pos, ELEMENTPTR PositionalObject, PlaySoundEffect (S, chan + MIN_FX_CHANNEL, Pos, PositionalObject, Priority); } +void +PlayMenuSound (MENU_SOUND_EFFECT S) +{ + PlaySoundEffect (SetAbsSoundIndex (MenuSounds, S), + 0, NotPositional (), NULL, + GAME_SOUND_PRIORITY); +} + void ProcessSound (SOUND Sound, ELEMENTPTR PositionalObject) { diff --git a/sc2/src/sc2code/sounds.h b/sc2/src/sc2code/sounds.h index 817acddae..c8892c46f 100644 --- a/sc2/src/sc2code/sounds.h +++ b/sc2/src/sc2code/sounds.h @@ -33,6 +33,14 @@ typedef enum TARGET_DAMAGED_FOR_6_PLUS_PT } SOUND_EFFECTS; +typedef enum +{ + MENU_SOUND_MOVE = 0, + MENU_SOUND_SUCCESS, + MENU_SOUND_FAILURE, + MENU_SOUND_INVOKED, +} MENU_SOUND_EFFECT; + extern SOUND MenuSounds; extern SOUND GameSounds; @@ -58,6 +66,7 @@ extern void GetMenuSounds (MENU_SOUND_FLAGS *sound_0, extern void PlaySound (SOUND S, SoundPosition Pos, ELEMENTPTR PositionalObject, BYTE Priority); +extern void PlayMenuSound (MENU_SOUND_EFFECT S); extern void ProcessSound (SOUND Sound, ELEMENTPTR PositionalObject); extern SoundPosition CalcSoundPosition (ELEMENTPTR ElementPtr); extern SoundPosition NotPositional (void);