/* (c) Ubi Studios 1996*/
/* See Vincent Greco for any comment or question*/
 
 
#ifndef __HIEMTSTK_H__
#define __HIEMTSTK_H__
 
#ifdef  __cplusplus
extern "C" {
#endif
 
/* extern"C" because HieMtStk.cpp include it directely (all the other files inlude it throught HieExt.h ...).*/
 
/* For DLL using these function :*/
#include "cpa_expt.h" 
 
/*typedef struct POS_stCompletePosition * GEO_tdxHandleToMatrix;*/
 
/* Oliv'*/
#if defined(U64)
	#define HIE_C_lMaxMatrixInStack	20
#else
	#define HIE_C_lMaxMatrixInStack	50
#endif
/* EndOfOliv'*/
#define HIE_C_lStackFull 200
#define HIE_C_lStackEmpty 201
 
#define OK 1
#define NOK 0
/*#define C_hInvalid ((void *)0)*/
 
 
/*not for export ?*/
extern GEO_tdxHandleToMatrix HIE_g_a_hMatrixStack[HIE_C_lMaxMatrixInStack];
extern GEO_tdxHandleToMatrix HIE_g_hCurrentMatrix ;
extern long HIE_g_lNbMatrixInStack ;
 
 
extern CPA_EXPORT
void HIE_fn_vCreateMatrixStack(void);
 
extern CPA_EXPORT
void HIE_fn_vDestroyMatrixStack(void);
 
 
extern CPA_EXPORT void
HIE_fn_vInitMatrixStack(void) ; /*marc*/
 
extern CPA_EXPORT ACP_tdxBool
HIE_fn_bLoadIdentity(void); /*new*/
 
extern CPA_EXPORT ACP_tdxBool
HIE_fn_bPopMatrix(void);
 
extern CPA_EXPORT ACP_tdxBool
HIE_fn_bLoadMatrix(GEO_tdxHandleToMatrix _hMatrix);
 
extern CPA_EXPORT void
HIE_fn_vResetMatrixStack(void);
 
extern CPA_EXPORT GEO_tdxHandleToMatrix
GEO_fn_hCreateMatrix(void);
 
extern CPA_EXPORT void
GEO_fn_vDestroyMatrix(GEO_tdxHandleToMatrix _hMatrix);
 
#define GEO_M_vCopyMatrix(a,b) {POS_fn_vCopyMatrix((a),(b));}
 
 
extern CPA_EXPORT ACP_tdxBool
HIE_fn_bStoreMatrix( GEO_tdxHandleToMatrix _hMatrix );
 
/*//////////////////////////////////////////////////////////////////////////////////////////////////////*/
/*//////////////////////////////////////////////////////////////////////////////////////////////////////*/
/* New stack used to push the camera matrix first*/
/*//////////////////////////////////////////////////////////////////////////////////////////////////////*/
/*//////////////////////////////////////////////////////////////////////////////////////////////////////*/
 
extern CPA_EXPORT ACP_tdxBool
HIE_fn_bInitCameraMatrixStack(GLD_tdxHandleToViewportAttributes _hVpt);
 
extern CPA_EXPORT ACP_tdxBool
HIE_fn_bPushOnCameraMatrixStack(GEO_tdxHandleToMatrix _hMatrix);

extern CPA_EXPORT ACP_tdxBool
HIE_fn_bStoreOnCameraMatrixStack(GEO_tdxHandleToMatrix _hMatrix);
 
extern CPA_EXPORT ACP_tdxBool
HIE_fn_bPopOnCameraMatrixStack();
 
extern CPA_EXPORT void HIE_fn_vSetCurrentInCamCoordsMatrix (POS_tdstCompletePosition  *p_stMatrix);
 
extern CPA_EXPORT POS_tdstCompletePosition * HIE_fn_pGetCurrentInCamCoordsMatrix (void);
 
#ifdef  __cplusplus
}/* extern "C" */
#endif
 
#endif /* __HIEMTSTK_H__*/
 
