 
/*#include "windows.h"*/
/*#include "winuser.h"*/
/*#ifndef NO_ACP_SCRIPT*/
/*#endif*/
#include "SCR.h"
#include "SND.H"
#include "SIF.h"
#include "SifLoadS.h"
 
 
typedef enum _SIF_eInfoTypeId
{
	ENVIRONMENT_INFO,
	MATERIAL_INFO,
	NB_INFO_TYPES,
} SIF_eInfoTypeId;
 
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
SIF_tdstInfoType SIF_ga_stInfoDescr[NB_INFO_TYPES]=
{
	{/*ENVIRONMENT_INFO,*/"Environment"},
	{/*MATERIAL_INFO,*/"Material"},
};
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
 
 
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
SIF_tdstInfoType *SIF_fn_pstGetSoundInfosDescriptor(int _iInfoType)
{
/*	ASSERT(_iInfoType<SIF_fn_iGetSoundInfosCount());*/
	return &SIF_ga_stInfoDescr[_iInfoType];
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
int SIF_fn_iGetSoundInfosCount(void)
{
	return NB_INFO_TYPES;
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
 
 
 
#ifndef NO_ACP_SCRIPT
 
/*SCR_tdst_Link_Table SIF_ga_stSndInfoTable[NB_INFO_TYPES];*/
 
#if !defined(U64)
SCR_tde_Anl_ReturnValue SIF_fn_eLoadInfoType(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType)
{
	unsigned long ulTemp;
 
	ulTemp=NB_INFO_TYPES;
	switch (cType)
	{
		case SCR_EA_Anl_BeginSection:/* new switch type:*/
			if (strcmp(szAction,"Material")==0) ulTemp=(unsigned long)MATERIAL_INFO;
			if (strcmp(szAction,"Environment")==0) ulTemp=(unsigned long)ENVIRONMENT_INFO;
			
			if (ulTemp==NB_INFO_TYPES)
				SND_fn_vDisplayError(E_uwSndInvalidTypeOfResource,"SIF:Unknown Sound Info Type found in scrip");
			SCR_M_RdL0_SetSectionLong(0,0,ulTemp);
			break;
	}
	return  R_SCRIPT_NormalReturn;
}
#endif /* U64 */
 
 
 
SCR_tde_Anl_ReturnValue SIF_fn_eLoadInfoValue(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType)
{
/*	CString csActionName,csReachableName,csFileName;*/
	char *szValueName,*szSectionName;
	int iInfoType;
	unsigned long ulValue;
	
	switch (cType)
	{
		case SCR_EA_Anl_BeginSection:/* new switch info:*/
			
			break;
		case SCR_EA_Anl_Entry:  
			if (strcmp(szAction,"SetValue")==0)
			{
				/* The Information Type is the parent section's result:*/
				SCR_M_RdL0_GetSectionLong(-1,0,int,iInfoType);
 
				/* Get the different names:*/
				szValueName=SCR_M_RdL0_GetIdSectionNameR(0);
				szSectionName=SCR_M_RdL0_GetCompleteSectionNameR(0);
 
				/* Add a key on the corresponding table:*/
				ulValue=SCR_M_RdL0_LONG(szParams[0]);
				SCR_fnp_st_Link_SetValue(&SIF_ga_stInfoDescr[iInfoType].m_Table,/* Link table*/
											szSectionName,	/* Section name*/
											ulValue);/* value*/
				SCR_M_RdL0_SetSectionLong(0,0,ulValue);
 
			} /* end case szAction=="SetValue"*/
			break;
	}  /* end switch (cType)*/
 
	return  R_SCRIPT_NormalReturn;
 
}
#endif /*NO_ACP_SCRIPT*/
 
 
BOOL SIF_fn_bInitSoundInfos()
{
#ifndef NO_ACP_SCRIPT
	int iInfoType;
	
	/* Register callbacks:*/
	SCR_fn_v_RdL0_RegisterCallback("Sif_Type",SIF_fn_eLoadInfoType,SCR_CRC_c_RdL0_ForSection);
	SCR_fn_v_RdL0_RegisterCallback("Sif_Value",SIF_fn_eLoadInfoValue,SCR_CRC_c_RdL0_ForSection);
 
	/* init link tables:*/
	for (iInfoType=0;iInfoType<NB_INFO_TYPES;iInfoType++)
	{
		SCR_fn_v_Link_InitTable(&SIF_ga_stInfoDescr[iInfoType].m_Table);
	}
#endif
	return TRUE;
}
 

#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC 04/06/99 */
BOOL SIF_fn_bDesInitSoundInfos(void)
{
#ifndef NO_ACP_SCRIPT
	int iInfoType;
	
 
	/* delete sound info sections:*/
	SCR_fn_v_RdL0_DeleteOpenSection("Sif_Type",SCR_CDR_c_RdL0_Contains);
	SCR_fn_v_RdL0_DeleteOpenSection("Sif_Value",SCR_CDR_c_RdL0_Contains);
	
	/* Unregister callbacks:*/
	SCR_fn_v_RdL0_DeleteRegisterCallback("Sif_",SCR_CRC_c_RdL0_ForSection,SCR_CDR_c_RdL0_Contains);
 
	/* close link tables:*/
	for (iInfoType=0;iInfoType<NB_INFO_TYPES;iInfoType++)
	{
		SCR_fn_v_Link_CloseTable(&SIF_ga_stInfoDescr[iInfoType].m_Table);
	}
 
#endif
	return TRUE;
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC 04/06/99 */

 
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
CPA_EXPORT const char *SIF_fn_czGetSoundInfoNameForType(int _iInfoType)
{
	/* make sure _infotype is correct:*/
	if (_iInfoType>=SIF_fn_iGetSoundInfosCount()) return NULL;
 
	return (SIF_fn_pstGetSoundInfosDescriptor(_iInfoType)->szInfoName);
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
