/*=========================================================================
* Micro.h : Micro's functions
*
*
*         Micro MUST BE REPLACE BY THE HEADER FILENAME
*
*
* Version              1.0
* Creation date        01/10/96
* Revision date
*
* That file needs to be compatible for all platforms.
*
* (c) Ubi Studios 1996
*=======================================================================*/
 
#if !defined(__MS_Micro_H__)
#define __MS_Micro_H__
 
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000 */
/******************************************/
 
#include "GAM/Header.h"
 
#undef EXTERN
#undef extern
#if !defined(D_Micro_VariableDefine)
#define EXTERN extern
#else
#define EXTERN
#endif /* D_Micro_VariableDefine */
 
#if defined(__cplusplus)
extern "C"
{
#endif /* __cplusplus */
 
typedef struct tdstIndexMicros_ * MIC_tdxHandleToMicro;
 
#if defined(D_Micro_StructureDefine)
 
LST2_M_DynamicUseListOf(MIC_tdxHandleToMicro);
 
struct tdstMicro_
{
   GEO_tdxHandleToMatrix hMicroMatrix;
   ACP_tdxBool bIsActive;
};
 
typedef struct tdstIndexMicrosList_ 
{
 LST2_M_DynamicAnchorDeclaration(MIC_tdxHandleToMicro) hMicrosList;
} tdstIndexMicrosList;
 
typedef struct tdstIndexMicros_ 
{
 LST2_M_DynamicElementDeclaration(MIC_tdxHandleToMicro)
 long lIndex;
 struct tdstEngineObject_ * hMicroObj;
} tdstIndexMicros;
 
#endif /* D_Micro_StructureDefine */
 
/***********************/
/**** Handle define ****/
/***********************/
typedef struct tdstMicro_ * MS_tdxHandleToMicro;
 
/**** Micro scripts ****/
#define C_SectionMicroDescription                "Micro"
#define C_EntryMicroRotationMatrix               "MatrixRotation"
#define C_EntryMicroTranslationMatrix            "MatrixTranslation"
#define C_EntryMicroActivation                   "MicroIsActive"
#define C_EntryMicroUnactivation                 "MicroIsInactive"
 
/*** Sound Volume ***/
#define C_MSMicro_MinVolume   0
#define C_MSMicro_MaxVolume   127
 
/**** Put here all globals variables : ****/
/****    EXTERN typeofvar  variable;   ****/
 
EXTERN struct tdstIndexMicrosList_ g_stIndexMicrosList;
 
/*******************************/
/**** Base functions define ****/
/*******************************/
#if !defined(U64)
extern CPA_EXPORT SCR_tde_Anl_ReturnValue fn_eMicroScriptCallback(SCR_tdst_File_Description *_p_stFile,char *_p_szName,char *_ap_szParams[],SCR_tde_Anl_Action	_eAction);
#endif /* U64 */
/*extern CPA_EXPORT void fn_vMicroSaveMiniStructure(SCR_tdst_File_Description *p_stFile,struct tdstEngineObject_ *p_stObject);*/
extern CPA_EXPORT unsigned long fn_ulMicroSizeOf();
extern CPA_EXPORT void fn_vMicroAlloc(struct tdstEngineObject_ *p_stObject);
extern CPA_EXPORT MS_tdxHandleToMicro fn_h_MicroRealAlloc();
extern CPA_EXPORT void fn_vMicroFree(struct tdstEngineObject_ *p_stObject);
extern CPA_EXPORT void fn_vMicroInit(struct tdstEngineObject_ *p_stObject,enum tdeObjectTreeInit_ eObjectInit);
extern CPA_EXPORT void fn_vMicroDesinit(struct tdstEngineObject_ *p_stObject,enum tdeObjectTreeInit_ eObjectInit);
extern CPA_EXPORT void fn_vMicroCopyClone(struct tdstEngineObject_ * _p_stObjectDest,struct tdstEngineObject_ * _p_stObjectSrc);
 
/*********************************/
/**** Access functions define ****/
/*********************************/
extern CPA_EXPORT GEO_tdxHandleToMatrix fn_xMicroGetMatrix(MS_tdxHandleToMicro);
extern CPA_EXPORT void fn_vMicroSetMatrix(MS_tdxHandleToMicro,GEO_tdxHandleToMatrix);
extern CPA_EXPORT ACP_tdxBool fn_bMicroGetActivationFlag(MS_tdxHandleToMicro);
extern CPA_EXPORT void fn_vMicroSetActivationFlag(MS_tdxHandleToMicro,ACP_tdxBool);
 
/**********************************/
/**** Special functions define ****/
/**********************************/
extern CPA_EXPORT void fn_vAddMicro(struct tdstEngineObject_ *);
extern CPA_EXPORT void fn_vInitMicrosFunction();
extern CPA_EXPORT void fn_vActivateMicroForObject(struct tdstEngineObject_ *);
extern CPA_EXPORT void fn_vUnactivateMicroForObject(struct tdstEngineObject_ *);
extern CPA_EXPORT void fn_vRemoveMicro(struct tdstEngineObject_ * hEngObj);
extern CPA_EXPORT void fn_vRemoveAllMicros();
extern CPA_EXPORT long fn_lRetObjectSoundLinkVolumeWithMicro(long objet,long micro);
extern CPA_EXPORT BOOL td_fn_bRetObjetSoundLinkWithMicro(long objet,long micro);
 
/*************************************/
/**** Micro List access functions ****/
/*************************************/
extern CPA_EXPORT long fn_lGetMicroIndiceInMicroListElement(MIC_tdxHandleToMicro _hMicroListElement);
extern CPA_EXPORT struct tdstEngineObject_ * fn_p_stGetEngineObjectInMicroListElement(MIC_tdxHandleToMicro _hMicroListElement);
/*------------------------------------------------------------------
 *------------------------------------------------------------------
 * WARNING :  these functions are to use only with the ONE micro
 *            version of the GamLib
 *------------------------------------------------------------------
 *-----------------------------------------------------------------*/
extern CPA_EXPORT void fn_vChangeCharacterForMicro(struct tdstEngineObject_ *);
extern CPA_EXPORT void GAM_fn_vChangeCharacterForMicro(HIE_tdxHandleToSuperObject);
extern CPA_EXPORT struct tdstEngineObject_ * fn_p_stGetFirstEngineObjectInMicroList(void);
/*------------------------------------------------------------------
 *------------------------------------------------------------------
 * End of functions for the ONE micro specific version of the GamLib
 *------------------------------------------------------------------
 *-----------------------------------------------------------------*/
 
extern CPA_EXPORT struct tdstEngineObject_ * fn_hReturnHandleMicroFromIndex(long lIndex);
 
/*NZO 25/09/97*/
#ifdef BIN_SaveBin
extern CPA_EXPORT unsigned long MSMicro_fn_ulWriteBinaryBloc(unsigned long _ulStructAddress, char* _p_cDestBuffer, struct tdstEngineObject_ * p_stCharac);
#endif
/*No read function necessary.*/
 
#if defined(__cplusplus)
}
#endif /* __cplusplus */
 
#endif /* __MS_Micro_H__ */
 
