/*=========================================================================
* MSMagnet.h : MSMagnet's functions
*
*
*
*
* Version              0.9
* Creation date        11/25/97
* Revision date
*
* That file needs to be compatible for all platforms.
*
* (c) Ubi Studios 1997(Shanghai)
*=======================================================================*/
 
#if !defined(__MSMagnet_H__)
#define __MSMagnet_H__
 
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000*/
/******************************************/
 
#include "GAM/Header.h"
 
#undef EXTERN
#undef extern
#if !defined(D_MSMagnet_VariableDefine)
#define EXTERN extern
#else
#define EXTERN
#endif /* D_MSMagnet_VariableDefine */
 
#if defined(__cplusplus)
extern "C"
{
#endif /* __cplusplus */
#include "MGT.h"
 
#define MAGNETOFF			0
#define MAGNETON			1
#define MAGNETGROWING		2
#define MAGNETRECOVERING	3
 
#define MAGNET_STRENGTH_MODIFIED	1
#define MAGNET_NEARFAR_MODIFIED		2
#define MAGNET_POSITION_MODIFIED	4
 
#if defined(D_MSMagnet_StructureDefine)
struct tdstMSMagnet_
{
	MTH_tdxReal					xFar;
	MTH_tdxReal					xNear;
	MTH_tdxReal					xStrength;
	unsigned char				status;
 
	MTH3D_tdstVector			stPosition;
	unsigned long				ulDuration;		/*total duration in milliseconds*/
 
	ACP_tdxIndex						xMaxIndexOfMagnetModification;
	MGT_tdxHandleToMagnetModification	d_hMagnetModification[MGT_MAX_NUMBEROF_MODIFIEDOBJECTS];
 
	unsigned char				ucModifiedFlags;
};
#endif /* D_MSMagnet_StructureDefine */
 
/***********************/
/**** Handle define ****/
/***********************/
typedef struct tdstMSMagnet_ * MS_tdxHandleToMSMagnet;
 
/**** MSMagnet scripts ****/
#define C_SectionMSMagnetDescription	"MSMagnet"
#define C_EntryMSMagnetChamp            "Champ"
#define C_EntryMagnetStatus             "Status"
#define C_EntryMagnetFar                "Far"
#define C_EntryMagnetNear               "Near"
#define C_EntryMagnetStrength           "Strength"
#define C_EntryMagnetDuration           "Duration"
 
/**** Put here all globals variables : ****/
/****    EXTERN typeofvar  variable;   ****/
 
/*******************************/
/**** Base functions define ****/
/*******************************/
#ifndef U64
extern CPA_EXPORT SCR_tde_Anl_ReturnValue fn_eMSMagnetScriptCallback(SCR_tdst_File_Description *_p_stFile,char *_p_szName,char *_ap_szParams[],SCR_tde_Anl_Action	_eAction);
#endif /*U64 AR980316*/
extern CPA_EXPORT unsigned long fn_ulMSMagnetSizeOf();
extern CPA_EXPORT void fn_vMSMagnetAlloc(struct tdstEngineObject_ *p_stObject);
extern CPA_EXPORT MS_tdxHandleToMSMagnet fn_h_MSMagnetRealAlloc();
extern CPA_EXPORT void fn_vMSMagnetFree(struct tdstEngineObject_ *p_stObject);
extern CPA_EXPORT void fn_vMSMagnetInit(struct tdstEngineObject_ *p_stObject,enum tdeObjectTreeInit_ eObjectInit);
extern CPA_EXPORT void fn_vMSMagnetDesinit(struct tdstEngineObject_ *p_stObject,enum tdeObjectTreeInit_ eObjectInit);
extern CPA_EXPORT void fn_vMSMagnetCopyClone(struct tdstEngineObject_ * _p_stObjectDest,struct tdstEngineObject_ * _p_stObjectSrc);
 
/*********************************/
/**** Access functions define ****/
/*********************************/
extern CPA_EXPORT MTH_tdxReal	fn_xMSMagnetGetFar(MS_tdxHandleToMSMagnet h_MSMagnet);
extern CPA_EXPORT void			fn_vMSMagnetSetFar(MS_tdxHandleToMSMagnet h_MSMagnet,MTH_tdxReal xValue);
 
extern CPA_EXPORT MTH_tdxReal	fn_xMSMagnetGetNear(MS_tdxHandleToMSMagnet h_MSMagnet);
extern CPA_EXPORT void			fn_vMSMagnetSetNear(MS_tdxHandleToMSMagnet h_MSMagnet,MTH_tdxReal xValue);
 
extern CPA_EXPORT MTH_tdxReal	fn_xMSMagnetGetStrength(MS_tdxHandleToMSMagnet h_MSMagnet);
extern CPA_EXPORT void			fn_vMSMagnetSetStrength(MS_tdxHandleToMSMagnet h_MSMagnet,MTH_tdxReal xValue);
 
extern CPA_EXPORT unsigned char fn_lMSMagnetGetStatus(MS_tdxHandleToMSMagnet h_MSMagnet);
extern CPA_EXPORT void			fn_vMSMagnetSetStatus(MS_tdxHandleToMSMagnet h_MSMagnet,unsigned char xValue);
 
extern CPA_EXPORT void			fn_vMSMagnetAddMagnetModification(MS_tdxHandleToMSMagnet h_MSMagnet, MGT_tdxHandleToMagnetModification h_MagnetModif );
extern CPA_EXPORT void			fn_vMSMagnetDeleteMagnetModification(MS_tdxHandleToMSMagnet h_MSMagnet, MGT_tdxHandleToMagnetModification h_MagnetModif );
extern CPA_EXPORT MGT_tdxHandleToMagnetModification fn_hMSMagnetGetMagnetModification(MS_tdxHandleToMSMagnet h_MSMagnet, ACP_tdxIndex xIndex );
extern CPA_EXPORT ACP_tdxIndex	fn_xMSMagnetGetMaxIndexOfMagnetModification(MS_tdxHandleToMSMagnet h_MSMagnet);
 
extern CPA_EXPORT MTH3D_tdstVector *fn_hMSMagnetGetPosition(MS_tdxHandleToMSMagnet h_MSMagnet);
extern CPA_EXPORT void fn_vMSMagnetSetPosition(MS_tdxHandleToMSMagnet h_MSMagnet,MTH3D_tdstVector *stPosition);
 
extern CPA_EXPORT unsigned long		fn_ulMSMagnetGetDuration(MS_tdxHandleToMSMagnet h_MSMagnet);
extern CPA_EXPORT void				fn_vMSMagnetSetDuration(MS_tdxHandleToMSMagnet h_MSMagnet,unsigned long ulDuration);
extern CPA_EXPORT void				fn_vMSMagnetSetNearFarModification(MS_tdxHandleToMSMagnet h_MSMagnet,ACP_tdxBool _bModified);
extern CPA_EXPORT ACP_tdxBool		fn_bMSMagnetIsNearFarModified(MS_tdxHandleToMSMagnet h_MSMagnet);
extern CPA_EXPORT void				fn_vMSMagnetSetStrengthModification(MS_tdxHandleToMSMagnet h_MSMagnet,ACP_tdxBool _bModified);
extern CPA_EXPORT ACP_tdxBool		fn_bMSMagnetIsStrengthModified(MS_tdxHandleToMSMagnet h_MSMagnet);
extern CPA_EXPORT void				fn_vMSMagnetSetPositionModification(MS_tdxHandleToMSMagnet h_MSMagnet,ACP_tdxBool _bModified);
extern CPA_EXPORT ACP_tdxBool		fn_bMSMagnetIsPositionModified(MS_tdxHandleToMSMagnet h_MSMagnet);
/**********************************/
/**** Special functions define ****/
/**********************************/
 
/**********************/
/**** SAI function ****/
/**********************/
extern CPA_EXPORT void fn_vMSMagnetInitValueSAI(MS_tdxHandleToMSMagnet h_MSMagnet);
extern CPA_EXPORT void fn_vMSMagnetSavedValueSAI(MS_tdxHandleToMSMagnet h_MSMagnet);
extern CPA_EXPORT void fn_vMSMagnetFreeInitValueSAI(MS_tdxHandleToMSMagnet h_MSMagnet);
 
/*************************************/
/**** Access functions for Editor ****/
/*************************************/
#if defined(ACTIVE_EDITOR)
extern CPA_EXPORT MTH_tdxReal	*fn_p_xMSMagnetGetFarInit		(MS_tdxHandleToMSMagnet _hMSMagnet);
extern CPA_EXPORT MTH_tdxReal	*fn_p_xMSMagnetGetNearInit		(MS_tdxHandleToMSMagnet _hMSMagnet);
extern CPA_EXPORT MTH_tdxReal	*fn_p_xMSMagnetGetStrengthInit	(MS_tdxHandleToMSMagnet _hMSMagnet);
extern CPA_EXPORT unsigned long *fn_p_ulMSMagnetGetDurationInit	(MS_tdxHandleToMSMagnet _hMSMagnet);
#endif /* ACTIVE_EDITOR */
 
#if defined(__cplusplus)
}
#endif /* __cplusplus */
 
#endif /* __MSMagnet_H__ */
 
