From 49fbd74ed4a97f839656121bf7dc51a61ba0945c Mon Sep 17 00:00:00 2001 From: avolkov Date: Fri, 19 Sep 2003 15:37:53 +0000 Subject: [PATCH] Better forward-declare version git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1245 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/sound/sound.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sc2/src/sc2code/libs/sound/sound.h b/sc2/src/sc2code/libs/sound/sound.h index d4e29394b..52c00ab62 100644 --- a/sc2/src/sc2code/libs/sound/sound.h +++ b/sc2/src/sc2code/libs/sound/sound.h @@ -14,6 +14,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _UQM_SOUND_H // try avoiding collisions on id +#define _UQM_SOUND_H + #include "starcon.h" #include "misc.h" #include "libs/strings/strintrn.h" @@ -41,24 +44,24 @@ typedef struct } TFB_SoundTag; // forward-declare -struct tfb_soundsample; +typedef struct tfb_soundsample TFB_SoundSample; typedef struct tfb_soundcallbacks { // return TRUE to continue, FALSE to abort - bool (* OnStartStream) (struct tfb_soundsample*); + bool (* OnStartStream) (TFB_SoundSample*); // return TRUE to continue, FALSE to abort - bool (* OnEndChunk) (struct tfb_soundsample*, TFBSound_Object); + bool (* OnEndChunk) (TFB_SoundSample*, TFBSound_Object); // return TRUE to continue, FALSE to abort - void (* OnEndStream) (struct tfb_soundsample*); + void (* OnEndStream) (TFB_SoundSample*); // tagged buffer callback - void (* OnTaggedBuffer) (struct tfb_soundsample*, TFB_SoundTag*); + void (* OnTaggedBuffer) (TFB_SoundSample*, TFB_SoundTag*); // buffer just queued - void (* OnQueueBuffer) (struct tfb_soundsample*, TFBSound_Object); + void (* OnQueueBuffer) (TFB_SoundSample*, TFBSound_Object); } TFB_SoundCallbacks; // audio data -typedef struct tfb_soundsample +struct tfb_soundsample { TFB_SoundDecoder *decoder; // decoder to read from float length; // total length of decoder chain in seconds @@ -68,7 +71,7 @@ typedef struct tfb_soundsample sint32 offset; // initial offset void* data; // user-defined data TFB_SoundCallbacks callbacks; // user-defined callbacks -} TFB_SoundSample; +}; // equivalent to channel in legacy sound code typedef struct tfb_soundsource @@ -100,3 +103,5 @@ void SetSFXVolume (float volume); void SetSpeechVolume (float volume); #include "stream.h" + +#endif // _UQM_SOUND_H