#define D_Micros_StructureDefine
#define D_Micros_VariableDefine
#define D_Brain_StructureDefine
 
#include "ToolsCPA.h"
 
#include "SND.h"
 
#include "Options/Options.h"
#include "macros.h"
#include "GameEng.h"
#include "Structur/State.h"
#include "Actions/AllActs.h"
 
#include "Structur/Anim_s.h"
#include "Structur/GameScpt.h"
#include "Structur/ErrGame.h"
#include "Structur/MemGame.h"
#include "Structur/StdObjSt.h"
#include "Structur/EngMode.h"
#include "Structur/Objects.h"
 
#include "Basic.h"
#include "Zemem.h"
#include "Micros.h"
#include "always.h"
 
#include "mainchar.h"
/* Well, ambiant music is audible up to ten meters underwater*/
#define C_xMaxDepthForMusic      MTH_M_xDoubleToReal(10.0)
 
#if defined (ACTIVE_EDITOR) || defined (RETAIL)
#define ENGassert(param)
#else
#define ENGassert(param) assert(param)
#endif

/*
 * Temporary define; waiting for SIF module update
 */
typedef enum _SIF_eInfoTypeId
{
	ENVIRONMENT_INFO,
	MATERIAL_INFO,
	NB_INFO_TYPES,
 
} SIF_eInfoTypeId;
 
 /*-----------------------------------------------------------------------------
 *  Description :   Return to SoundLibrary Postion and speed for an object
 *-----------------------------------------------------------------------------
 *  Input :         void
 *  Output :        void
 *-----------------------------------------------------------------------------
 *  Creation date : 13/02/97            Author : SOUND
 *---------------------------------------------------------------------------*/
long RetObjetSonoreXAnim(long indice)
{
    MTH3D_tdstVector stVertex;
 
    POS_fn_vGetTranslationVector(HIE_fn_hGetSuperObjectGlobalMatrix((HIE_tdxHandleToSuperObject)indice),&stVertex);
    return (long)M_Fixed1616ToRealSnd(MTH_M_xRealToFixed16_16(stVertex.xX));
}
 
long RetObjetSonoreYAnim(long indice)
{
    MTH3D_tdstVector stVertex;
 
    POS_fn_vGetTranslationVector(HIE_fn_hGetSuperObjectGlobalMatrix((HIE_tdxHandleToSuperObject)indice),&stVertex);
    return (long)M_Fixed1616ToRealSnd(MTH_M_xRealToFixed16_16(stVertex.xY));
}
 
long RetObjetSonoreZAnim(long indice)
{
    MTH3D_tdstVector stVertex;
 
    POS_fn_vGetTranslationVector(HIE_fn_hGetSuperObjectGlobalMatrix((HIE_tdxHandleToSuperObject)indice),&stVertex);
    return (long)M_Fixed1616ToRealSnd(MTH_M_xRealToFixed16_16(stVertex.xZ));
}
 
long RetObjetSonoreVXAnim(long indice)
{
    DNM_tdstDynamics *p_stDynamics;
/*    DNM_tdstReport *p_stReport;*/
 
    MTH3D_tdstVector stVertex;
 
    if( !M_GetMSHandle((HIE_tdxHandleToSuperObject)indice,Dynam) )
       return 0;
    if((p_stDynamics = fn_p_stDynamGetDynamics(M_GetMSHandle((HIE_tdxHandleToSuperObject)indice,Dynam))) == NULL)
		return 0;
 
/*	p_stReport = DNM_M_p_stDynamicsGetReport(p_stDynamics);*/
/*    MTH3D_M_vCopyVector(&stVertex,MTH_M_p_stMoveGetLinear(DNM_M_p_stReportGetAbsoluteCurrSpeed(p_stReport)));*/
 
	MTH3D_M_vCopyVector(&stVertex, DNM_M_pDynamicsGetPreviousSpeed(p_stDynamics));
 
    return (long)M_Fixed1616ToRealSnd(MTH_M_xRealToFixed16_16(stVertex.xX));
}
 
long RetObjetSonoreVYAnim(long indice)
{
    DNM_tdstDynamics *p_stDynamics;
/*    DNM_tdstReport *p_stReport;*/
 
    MTH3D_tdstVector stVertex;
 
    if( !M_GetMSHandle((HIE_tdxHandleToSuperObject)indice,Dynam) )
       return 0;
    if((p_stDynamics = fn_p_stDynamGetDynamics(M_GetMSHandle((HIE_tdxHandleToSuperObject)indice,Dynam))) == NULL)
		return 0;
 
/*    p_stReport = DNM_M_p_stDynamicsGetReport(p_stDynamics);*/
/*    MTH3D_M_vCopyVector(&stVertex,MTH_M_p_stMoveGetLinear(DNM_M_p_stReportGetAbsoluteCurrSpeed(p_stReport)));*/
 
	MTH3D_M_vCopyVector(&stVertex, DNM_M_pDynamicsGetPreviousSpeed(p_stDynamics));
 
 
    return (long)M_Fixed1616ToRealSnd(MTH_M_xRealToFixed16_16(stVertex.xY));
}
 
long RetObjetSonoreVZAnim(long indice)
{
    DNM_tdstDynamics *p_stDynamics;
 /*   DNM_tdstReport *p_stReport;*/
 
    MTH3D_tdstVector stVertex;
 
    if( !M_GetMSHandle((HIE_tdxHandleToSuperObject)indice,Dynam) )
       return 0;
    if((p_stDynamics = fn_p_stDynamGetDynamics(M_GetMSHandle((HIE_tdxHandleToSuperObject)indice,Dynam))) == NULL)
		return 0;
 
/*    p_stReport = DNM_M_p_stDynamicsGetReport(p_stDynamics);*/
/*    MTH3D_M_vCopyVector(&stVertex,MTH_M_p_stMoveGetLinear(DNM_M_p_stReportGetAbsoluteCurrSpeed(p_stReport)));*/
 
	MTH3D_M_vCopyVector(&stVertex, DNM_M_pDynamicsGetPreviousSpeed(p_stDynamics));
  
	return (long)M_Fixed1616ToRealSnd(MTH_M_xRealToFixed16_16(stVertex.xZ));
}
 
unsigned char RetObjetSonoreREVERBAnim(long indice)
{
        return 0;
}
 
void RetObjetSonoreExtraCoefAnim(long indice,SND_tduRefEvt evt,SndReal* pitch,SndReal* pan,SndReal* vol)
{/**/
	DNM_tdstDynamics *p_stDynamics;
/*	DNM_tdstReport *p_stReport;*/
	MTH3D_tdstVector stVertex;
	SndReal rTmpPitch, rTmpVol, rTmpPan;
 
	/* Extra-Pitch Sound according to speed*/
	rTmpPitch = C_SNDREAL_0;
	for (; pitch && rTmpPitch == C_SNDREAL_0;)
	{
		if( !M_GetMSHandle((HIE_tdxHandleToSuperObject)indice,Dynam) )
		{
			*pitch = C_SNDREAL_0;
			break;
		}
		if((p_stDynamics = fn_p_stDynamGetDynamics(M_GetMSHandle((HIE_tdxHandleToSuperObject)indice,Dynam))) == NULL)
		{
			*pitch = C_SNDREAL_0;
			break;
		}
/*		p_stReport = DNM_M_p_stDynamicsGetReport(p_stDynamics);*/
/*		MTH3D_M_vCopyVector(&stVertex,MTH_M_p_stMoveGetLinear(DNM_M_p_stReportGetAbsoluteCurrSpeed(p_stReport)));*/
 
		MTH3D_M_vCopyVector(&stVertex,DNM_M_pDynamicsGetPreviousSpeed(p_stDynamics));
		
		rTmpPitch = M_Fixed1616ToRealSnd(MTH_M_xRealToFixed16_16(MTH3D_M_xNormVector(&stVertex)));
		
		/* normalize speed to adapt sound frequencies to be hearable ....*/
		if (rTmpPitch > M_DoubleToRealSnd(200.0))
			rTmpPitch = M_DoubleToRealSnd(200.0); 
		else
			if (rTmpPitch < M_DoubleToRealSnd(0.1))
				rTmpPitch = M_DoubleToRealSnd(0.1); 
		*pitch = rTmpPitch >> 7; 
	}
	/* Extra-Vol Sound according to anything*/
	rTmpVol = C_SNDREAL_0;
	for (; vol && rTmpVol ==  C_SNDREAL_0;)
	{
		/* set volume mult here*/
		rTmpVol = C_SNDREAL_1;
		/* normalize speed to adapt sound frequencies to be hearable ....*/
		if (rTmpVol > M_DoubleToRealSnd(127.0))
			rTmpVol = M_DoubleToRealSnd(127.0); 
		else
			if (rTmpVol < C_SNDREAL_0)
				break;
		*vol = rTmpVol; 
	}
	/* Extra-Pan Sound according to anything*/
	rTmpPan = C_SNDREAL_0;
	for (; pan && rTmpPan ==  C_SNDREAL_0;)
	{
		/* set pan mult here*/
		rTmpPan = C_SNDREAL_1;
		/* normalize speed to adapt sound frequencies to be hearable ....*/
		if (rTmpPan > M_DoubleToRealSnd(127.0))
			rTmpPan = M_DoubleToRealSnd(127.0); 
		else
			if (rTmpPan < C_SNDREAL_0)
				break;
		*pan = rTmpPan; 
	}
}
 
long RetObjetSonoreSwitchAnim(long indice,long toto)
{
   SIF_eInfoTypeId eTypeId = (SIF_eInfoTypeId)toto;
   HIE_tdxHandleToSuperObject hCharacter;
 
   hCharacter = (HIE_tdxHandleToSuperObject)indice;
   switch( eTypeId )
   {
/* Shaitan Clean Env {*/
/*
      case ENVIRONMENT_INFO:
         {
            MTH3D_tdstVector stPosition;
            ENV_tdxHandleToEnvironment hEnvironment;
 
            POS_fn_vGetTranslationVector(
               HIE_fn_hGetSuperObjectGlobalMatrix(hCharacter),
               &stPosition);
            hEnvironment = SCT_fn_hGetEnvironmentFromPosition(&stPosition,
               fn_h_SectInfoGetCurrentSector(
                  M_GetMSHandle(hCharacter,SectInfo)) );
            if( hEnvironment )
            {
               return (long)ENV_fn_hGetSoundEnvironment(hEnvironment);
            }
			else
				return 0;
         }
         break;
*/
/* End Shaitan Clan Env }*/
      case MATERIAL_INFO:
         {
            DNM_tdstReport * p_stReport;
            struct DNM_stDynamics * p_stDynamics;
            unsigned long ulSurfState;
            DNM_tdstObstacle * p_stObstacle;
            GMT_tdxHandleToGameMaterial hGMT;
            
            if( M_GetMSHandle(hCharacter,Dynam) )
            {
               p_stDynamics = fn_p_stDynamGetDynamics(
                  M_GetMSHandle(hCharacter,Dynam));
               if( !p_stDynamics )
                  return 0;
               p_stReport = DNM_M_p_stDynamicsGetReport(p_stDynamics);
               ulSurfState = 
                  DNM_M_ulReportGetSurfaceState(p_stReport);
			   /* GI check ceiling*/
               if( DNM_M_bDynamicsIsGi(p_stDynamics) && (ulSurfState&C_WOT_ulCeiling)) {
                  p_stObstacle = DNM_M_p_stReportGetCeil(p_stReport);
                  hGMT = DNM_M_hObstacleGetCollidedMaterial(p_stObstacle);
                  if( hGMT )
                     return (long)GMT_fn_hGetSoundMaterial(hGMT);
                  else 
                     return 0;
               }
			   /* Climbing Check wall*/
               else if( DNM_M_bDynamicsIsClimb(p_stDynamics) && (ulSurfState&C_WOT_ulWall)) {
                  p_stObstacle = DNM_M_p_stReportGetWall(p_stReport);
                  hGMT = DNM_M_hObstacleGetCollidedMaterial(p_stObstacle);
                  if( hGMT )
                     return (long)GMT_fn_hGetSoundMaterial(hGMT);
                  else 
                     return 0;
			   }
			   /* other case check ground*/
               else if(ulSurfState&C_WOT_ulGround) {
                  p_stObstacle = DNM_M_p_stReportGetGround(p_stReport);
                  hGMT = DNM_M_hObstacleGetCollidedMaterial(p_stObstacle);
                  if( hGMT )
                     return (long)GMT_fn_hGetSoundMaterial(hGMT);
                  else 
                     return 0;
			   }
               else 
                  return 0;
            }
            else
            {
               return 0;
            }
         }
         break;
      case NB_INFO_TYPES:
         return 0;
         break;
      default:
         return 0;
         break;
   }
}
 
/*
SndBool RetObjetSonoreLinkAnim(long indice,long micro)
{
        return TRUE;
}
*/
 
/* Modif 23/07/98 MAin Character always audible - Carlos Torres*/
SndBool RetObjetSonoreLinkAnim(long objet,long micro)
{
   HIE_tdxHandleToSuperObject hObjectSector,hMicroSector,hSuperObj;
   unsigned long ulI;
   SECT_tdxHandleOfElementLstSoundInteraction hSoundList;
   
   hObjectSector=fn_h_SectInfoGetCurrentSector( M_GetMSHandle(((HIE_tdxHandleToSuperObject)objet),SectInfo) );
   hSuperObj = M_GetSuperObject( fn_hReturnHandleMicroFromIndex(micro) );
 
   /* main charcater always audible*/
   if (((HIE_tdxHandleToSuperObject)objet) == MC_fn_hGetCharacterInMainCharacterNode(MC_fn_hGetFirstMainCharNode()))
	   return TRUE;
 
   hMicroSector=fn_h_SectInfoGetCurrentSector( M_GetMSHandle(hSuperObj,SectInfo) );
   if( hObjectSector==hMicroSector )
      return TRUE;
   SECT_M_ForEachSoundNodeInSoundInteractionList(hMicroSector,hSoundList,ulI)
   {
	   /* If the sector is in the audibility list, it is audible if volume!=VolMin.*/
      if( SECT_GetSectorInSoundList(hSoundList)==hObjectSector )
         return (SCT_fn_lGetVolumeInSoundList(hSoundList)!=C_MSMicro_MinVolume);
   }
   return TRUE; /* if sector is not in list, it is supposed to be audible*/
}
 
 
#ifndef _FIRE_DEADCODE_U64_
void RetObjetInfoAnim(long obj,char* str,long size_str)
{
	HIE_tduLinkedObject hObj;
	MS_tdxHandleTo3dData h_3dData;
	tdxHandleToState h_State;
#ifdef _DEBUG_STRING_FOR_PLA_
	tdstAnim3d * p_stAnim;
#endif
 
	/* treatment for ghost object - ambiance*/
	if (obj == SND_C_OBJET_FANTOME) {
		strncpy(str,"Ghost Object",size_str);
		return;
	}
 
	hObj=((HIE_tdxHandleToSuperObject)obj)->hLinkedObject;
 
	/* get the anim*/
	h_3dData = M_GetMSHandle( (HIE_tdxHandleToSuperObject)obj, 3dData ); 
	h_State  = fn_h3dDataGetCurrentState(h_3dData);
 
	strncpy(str,"Perso:",size_str);
 
	if (((HIE_tdxHandleToSuperObject)obj)->ulTypeOfLinkedObject==HIE_C_ulActor)
	{
		if (!fn_ucIsAnAlwaysObject(hObj.p_stCharacter))
		{
			if (hObj.p_stCharacter->h_Brain)
				strncat(str,AI_M_szGetPersoName(hObj.p_stCharacter->h_Brain->p_stMind),size_str-strlen(str));
			else
				strncat(str,"no intelligence",size_str-strlen(str));
		}
		else
		{
			strncat(str,"Always",size_str-strlen(str));
		}
	}
 
#ifdef _DEBUG_STRING_FOR_PLA_
	strncat(str,"=",size_str-strlen(str));
 
	if ( h_State != NULL )
	{
		p_stAnim = fn_p_stGetAnimInState(h_State);
		
		if (p_stAnim)
			strncat(str,p_stAnim->szAnimName,size_str-strlen(str));
	}
#endif
}
#endif /* _FIRE_DEADCODE_U64_ */
 

#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC 04/06/99 */
void RetObjetInfoLipsSync(long obj,char* str,long size_str)
{
	HIE_tduLinkedObject hObj;
 
	/* treatment for ghost object*/
	if (obj == SND_C_OBJET_FANTOME) {
		strncpy(str,"Ghost Object",size_str);
		return;
	}
 
	hObj=((HIE_tdxHandleToSuperObject)obj)->hLinkedObject;
 
	strncpy(str,"Lips:",size_str);
 
	if (((HIE_tdxHandleToSuperObject)obj)->ulTypeOfLinkedObject==HIE_C_ulActor)
	{
		if (!fn_ucIsAnAlwaysObject(hObj.p_stCharacter))
		{
			strncat(str,AI_M_szGetPersoName(hObj.p_stCharacter->h_Brain->p_stMind),size_str-strlen(str));
		}
		else
		{
			strncat(str,"Always",size_str-strlen(str));
		}
	}
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC 04/06/99 */

 
 /*-----------------------------------------------------------------------------
 *  Description :   Return to SoundLibrary Postion and speed for an object
 *-----------------------------------------------------------------------------
 *  Input :         void
 *  Output :        void
 *-----------------------------------------------------------------------------
 *  Creation date : 13/02/97            Author : SOUND
 *---------------------------------------------------------------------------*/
long RetObjetSonoreXMusic(long indice)
{
	return 0;
}
 
long RetObjetSonoreYMusic(long indice)
{
	return 0;
}
 
long RetObjetSonoreZMusic(long indice)
{
	return 0;
}
 
long RetObjetSonoreVXMusic(long indice)
{
	return 0;
}
 
long RetObjetSonoreVYMusic(long indice)
{
	return 0;
}
 
long RetObjetSonoreVZMusic(long indice)
{
	return 0;
}
 
unsigned char RetObjetSonoreREVERBMusic(long indice)
{
        return 0;
}
 
void RetObjetSonoreExtraCoefMusic(long indice,SND_tduRefEvt evt,SndReal* pitch,SndReal* pan,SndReal* vol)
{
   struct tdstEngineObject_ * p_stEngineMicro;
   MTH3D_tdstVector stMicroPosition;
/*   DNM_tdeFluidEnvironment eCurrentFluidEnvironment;*/
   MTH_tdxReal xDepth = 0;
   /* C_xMaxDepthForMusic */
   if( vol==NULL )
      return;
   p_stEngineMicro = fn_p_stGetFirstEngineObjectInMicroList();
   /* JO 22/10/97 for music during loading*/
   if( !p_stEngineMicro )
   {
      *vol = C_SNDREAL_1;
      return;
   }
   if( !p_stEngineMicro->h_3dData )
   {
      *vol = C_SNDREAL_1;
      return;
   }
/*   eCurrentFluidEnvironment = fn_l3dDataGetEnvironmentOfCharacter(p_stEngineMicro->h_3dData);*/
/*   if( eCurrentFluidEnvironment!=DNM_Fluid_Water )*/
/*   {*/
/*      *vol = C_SNDREAL_1;*/
/*      return;*/
/*   }*/
   POS_fn_vGetTranslationVector(HIE_fn_hGetSuperObjectGlobalMatrix(fn_h_StandardGameGetSuperObject(p_stEngineMicro->h_StandardGame)),&stMicroPosition);   
/*   SECT_hGetDNMEnvironmentAndDepth(*/
/*      NULL,*/
/*      &stMicroPosition,*/
/*      fn_h_SectInfoGetCurrentSector(p_stEngineMicro->h_SectInfo), */
/*      &xDepth);*/
   if( xDepth >= C_xMaxDepthForMusic )
   {
      *vol = C_SNDREAL_0;
   }
   else
   {
      xDepth = (C_xMaxDepthForMusic - xDepth)/C_xMaxDepthForMusic;
      *vol = M_Fixed1616ToRealSnd(MTH_M_xRealToFixed16_16(xDepth));
   }
}
 
long RetObjetSonoreSwitchMusic(long indice,long toto)
{
	return 0;
}
 
SndBool RetObjetSonoreLinkMusic(long indice,long micro)
{
        return TRUE;
}
 
#ifndef _FIRE_DEADCODE_U64_
void RetObjetInfoMusic(long obj,char* str,long size_str)
{
	strncpy(str,"music ???",size_str);
}
#endif /* _FIRE_DEADCODE_U64_ */
 
#ifndef _FIRE_DEADCODE_U64_
void RetObjetInfoMenu(long obj,char* str,long size_str)
{
	strncpy(str,"menu ???",size_str);
}
#endif /* _FIRE_DEADCODE_U64_ */

 /*-----------------------------------------------------------------------------
 *  Description :   init sound-object type for anim player
 *-----------------------------------------------------------------------------
 *  Input :         void
 *  Output :        void
 *-----------------------------------------------------------------------------
 *  Creation date : 13/02/97            Author : SOUND
 *---------------------------------------------------------------------------*/
void fn_lInitSoundForAnim()
{
	tdstAllRetObjectSound st_pfnRetObjectSound;
	/*long lSoundObjectTypeAnim;*/
	
	memset(&st_pfnRetObjectSound,0,sizeof(st_pfnRetObjectSound));
	st_pfnRetObjectSound.X = RetObjetSonoreXAnim;
	st_pfnRetObjectSound.Y = RetObjetSonoreYAnim;
	st_pfnRetObjectSound.Z = RetObjetSonoreZAnim;
	st_pfnRetObjectSound.VX = RetObjetSonoreVXAnim;
	st_pfnRetObjectSound.VY = RetObjetSonoreVYAnim;
	st_pfnRetObjectSound.VZ = RetObjetSonoreVZAnim;
	st_pfnRetObjectSound.REVERB = RetObjetSonoreREVERBAnim;
	st_pfnRetObjectSound.ExtraCoef = RetObjetSonoreExtraCoefAnim;
	st_pfnRetObjectSound.Switch = RetObjetSonoreSwitchAnim;
	st_pfnRetObjectSound.MicroLink = RetObjetSonoreLinkAnim;
	
	g_lSoundVolumeLineSound=SND_fn_lAddVolumeLineSound();
	g_lSoundObjectTypeAnim = SND_fn_lAddObjectTypeSound2(&st_pfnRetObjectSound,g_lSoundVolumeLineSound);
#ifndef _FIRE_DEADCODE_U64_
	SND_fn_vSetInfoForTypeSound(g_lSoundObjectTypeAnim,RetObjetInfoAnim);
#endif /* _FIRE_DEADCODE_U64_ */
	
#ifdef D_USE_LIPSYNC
	g_lSoundVolumeLineVoices=SND_fn_lAddVolumeLineSound();
	g_lSoundObjectTypeLipsSynchro = SND_fn_lAddObjectTypeSound2(&st_pfnRetObjectSound,g_lSoundVolumeLineVoices);
	SND_fn_vSetInfoForTypeSound(g_lSoundObjectTypeLipsSynchro,RetObjetInfoLipsSync);
#endif
	
	memset(&st_pfnRetObjectSound,0,sizeof(st_pfnRetObjectSound));
	st_pfnRetObjectSound.X = RetObjetSonoreXMusic;
	st_pfnRetObjectSound.Y = RetObjetSonoreYMusic;
	st_pfnRetObjectSound.Z = RetObjetSonoreZMusic;
	st_pfnRetObjectSound.VX = RetObjetSonoreVXMusic;
	st_pfnRetObjectSound.VY = RetObjetSonoreVYMusic;
	st_pfnRetObjectSound.VZ = RetObjetSonoreVZMusic;
	st_pfnRetObjectSound.REVERB = RetObjetSonoreREVERBMusic;
	st_pfnRetObjectSound.ExtraCoef = RetObjetSonoreExtraCoefMusic;
	st_pfnRetObjectSound.Switch = RetObjetSonoreSwitchMusic;
	st_pfnRetObjectSound.MicroLink = RetObjetSonoreLinkMusic;
	
	g_lSoundVolumeLineMusic=SND_fn_lAddVolumeLineSound();
	g_lSoundObjectTypeMusic = SND_fn_lAddObjectTypeSound2(&st_pfnRetObjectSound,g_lSoundVolumeLineMusic);
#ifndef _FIRE_DEADCODE_U64_
	SND_fn_vSetInfoForTypeSound(g_lSoundObjectTypeMusic,RetObjetInfoMusic);
#endif /* _FIRE_DEADCODE_U64_ */
/*---------------------------------------------------------------*/
	memset(&st_pfnRetObjectSound,0,sizeof(st_pfnRetObjectSound));
	st_pfnRetObjectSound.X = RetObjetSonoreXMusic;
	st_pfnRetObjectSound.Y = RetObjetSonoreYMusic;
	st_pfnRetObjectSound.Z = RetObjetSonoreZMusic;
	st_pfnRetObjectSound.VX = RetObjetSonoreVXMusic;
	st_pfnRetObjectSound.VY = RetObjetSonoreVYMusic;
	st_pfnRetObjectSound.VZ = RetObjetSonoreVZMusic;
	st_pfnRetObjectSound.REVERB = RetObjetSonoreREVERBMusic;
	st_pfnRetObjectSound.ExtraCoef = RetObjetSonoreExtraCoefMusic;
	st_pfnRetObjectSound.Switch = RetObjetSonoreSwitchMusic;
	st_pfnRetObjectSound.MicroLink = RetObjetSonoreLinkMusic;
	
	/*	g_lSoundVolumeLineMusic=SND_fn_lAddVolumeLineSound();*/
	g_lSoundObjectTypeMenu = SND_fn_lAddObjectTypeSound2(&st_pfnRetObjectSound,g_lSoundVolumeLineSound);/*à changer*/
#ifndef _FIRE_DEADCODE_U64_
	SND_fn_vSetInfoForTypeSound(g_lSoundObjectTypeMenu,RetObjetInfoMenu);
#endif /* _FIRE_DEADCODE_U64_ */
/*---------------------------------------------------------------*/
	/* RollOff initialisation*/
	SND_fn_vSetRollOffFunctionForTypeSound(g_lSoundObjectTypeAnim,fn_bRetRollOffFactor);
/*---------------------------------------------------------------*/
	memset (ga_pstBlockEventSlotMemory , 0 ,GAM_C_NBLOCKEVENTSLOTNUMBER * sizeof(SND_tdstBlockEvent*));

	return;
}

 /*-----------------------------------------------------------------------------
 *  Description :   
 *-----------------------------------------------------------------------------
 *  Input :         
 *  Output :        void
 *-----------------------------------------------------------------------------
 *  Creation date : 26/02/99            Author : MT
 *---------------------------------------------------------------------------*/
void GAM_fn_lSaveBlockEventSlotMemory(SND_tdstBlockEvent *_p_stBlockEvent,unsigned long _ulIndex)
{
	ENGassert(_ulIndex < GAM_C_NBLOCKEVENTSLOTNUMBER);
	ga_pstBlockEventSlotMemory [_ulIndex] = _p_stBlockEvent;
}

 /*-----------------------------------------------------------------------------
 *  Description :   
 *-----------------------------------------------------------------------------
 *  Input :         
 *  Output :        
 *-----------------------------------------------------------------------------
 *  Creation date : 26/02/99            Author : MT
 *---------------------------------------------------------------------------*/
SND_tdstBlockEvent *GAM_p_stGetBlockEventSlotMemory(unsigned long _ulIndex)
{
	ENGassert(_ulIndex < GAM_C_NBLOCKEVENTSLOTNUMBER);
	return ga_pstBlockEventSlotMemory [_ulIndex];
}

 
#undef D_Micros_StructureDefine
#undef D_Micros_VariableDefine
