 
/*SectExt.h*/
 
#ifndef __SECTOREXT
#define __SECTOREXT
 
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
 
/* For DLL using these function :*/
#undef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
 #define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
 #define CPA_EXPORT __declspec(dllexport)
#else
 #define CPA_EXPORT
#endif
 
/*Prototypes*/
 
/*This function is used to know Sector Change History with the number of change (0=no change)*/
extern CPA_EXPORT ACP_tdxIndex SCT_fn_xGetSectorChangeHistory(HIE_tdxHandleToSuperObject **_p_hHistory);
 
/*This function is used when we need to know in each sector where we are*/
extern CPA_EXPORT HIE_tdxHandleToSuperObject SECT_fn_hResearchInWhatSectorIAm(HIE_tdxHandleToSuperObject _SECT_hFatherSector,
																   MTH3D_tdstVector *_p_stAbsolutePosition);
 
/*This function allows the script to read correctly the .sct*/
extern CPA_EXPORT BOOL SECT_fn_bInitSectorLoading(void);
 
extern CPA_EXPORT BOOL SECT_fn_bIsInBorderBox (MTH3D_tdstVector *_p_stPosition, SECT_tdxHandleOfSectorObject _hSector);
 
/*	Binary exports*/
extern	CPA_EXPORT
	unsigned long SCT_fn_ulReadSectorBinaryBloc(
		char *_p_cLoadedBuffer,
		unsigned long _ulLoadedBufferSize);
 
extern	CPA_EXPORT
	void	SCT_fn_vReadAllSectorBinaryBlocs(
		char *_szBinaryFileName);
 
extern	CPA_EXPORT
	unsigned long SCT_fn_ulWriteBinaryBloc(
		unsigned long _ulStructAddress,
		char *_p_cDestBuffer);
 
extern	CPA_EXPORT
	void	SCT_fn_vWriteAllSectorBinaryBlocs(
		char	*_szBinaryFileName);
 
extern	CPA_EXPORT
	void	SCT_fn_vPrepareSaveBinaryBloc(
		void);
 
extern	CPA_EXPORT
	SECT_tdxHandleOfSectorObject	SCT_fn_hLoadSector(
		char	*_szSectionName);
 
extern	CPA_EXPORT
void	SCT_fn_vResolveAllSectorBinaryBlocs(
	void);
extern	CPA_EXPORT void SCT_fn_vReadAllSectorBinaryBlocs2(char *_szBinaryFileName);
extern	CPA_EXPORT void SCT_fn_vResolveSectorBinaryBloc2(unsigned long _ulAddress);
 
 
/*This function is used to display the scene with the use of the graphical interaction */
/* with water effect according position of camera*/
extern CPA_EXPORT void SCT_fn_vSendSectorWhereIAmToViewport(
	MTH3D_tdstVector *_p_stAbsolutePositionOfCamera,
  struct GLD_tdstViewportAttributes_ *_p_stVpt,
  HIE_tdxHandleToSuperObject   _hSprObjSector ,
  long _lDrawMask
);
 
/* Function to optimize mirror search in hierarchy*/
extern CPA_EXPORT void SCT_fn_vInitMirrorFlagForAllSectors(HIE_tdxHandleToSuperObject _hStaticRoot);
 
/*The new function with mirror*/
extern CPA_EXPORT void SCT_fn_vSendSectorWhereIAmToViewportWithMirror(
	MTH3D_tdstVector *_p_stAbsolutePositionOfCamera,
	GLD_tdhDevice _hDevice,
	GLD_tdhViewport _hViewport,
	struct GLD_tdstViewportAttributes_ *_p_stVpt,
	HIE_tdxHandleToSuperObject   _hSprObjSector ,
	long _lDrawMask
);
 
/*From sectdraw*/
extern void SECT_fn_vSendDynamicLightsFromWhereIAmToViewport(
	struct GLD_tdstViewportAttributes_ *_p_stVpt,
	HIE_tdxHandleToSuperObject _hSprObjSector
);
 
/*This function is used to display the scene with the use of the graphical interaction*/
extern CPA_EXPORT void SECT_fn_vSendSectorWhereIAmToViewport ( struct GLD_tdstViewportAttributes_ *p_stVpt ,
													HIE_tdxHandleToSuperObject   hSprObjSector ,
													long lDrawMask
													);
/*This function is used to display all the world*/
extern CPA_EXPORT void SECT_fn_vSendAllSectorsToViewport ( struct GLD_tdstViewportAttributes_ *_p_stVpt ,
                                         HIE_tdxHandleToSuperObject   _hSprObjSectorFather ,
                                         long _lDrawMask
                                       );
 
/*This function is used to notice if we change of sector with a history*/
extern CPA_EXPORT void SCT_fn_vTestChangeSectorWithHistory(
                                                            MTH3D_tdstVector *_p_stBeforeAbsolutePosition,
                                                            MTH3D_tdstVector *_p_stAfterAbsolutePosition,
                                                            HIE_tdxHandleToSuperObject *_p_hSectorSOWhereIWas
                                                          );
 
 
 
/*This function is used to initialyse the light buffer*/
extern CPA_EXPORT void SCT_fn_vComputeAllLightBuffer (GLD_tdhDevice _hDevice,
                                                      GLD_tdhViewport _hViewport ,
                                                      HIE_tdxHandleToSuperObject   _hSprObjFatherOfSector);
 
 
/*This function is used to notice if we change of sector*/
extern CPA_EXPORT void SECT_fn_vTestChangeSector(
										MTH3D_tdstVector *p_stBeforeAbsolutePosition,
										MTH3D_tdstVector *p_stAfterAbsolutePosition,
										HIE_tdxHandleToSuperObject *p_hSectorSOWhereIWas
									 );
 
/*This function is used to correct the break of smoothing*/
extern CPA_EXPORT void fn_vGeneralCoherenceOfSmoothing(HIE_tdxHandleToSuperObject   hSprObjSector);
 
 
/*This function have to be used after any load of map*/
extern CPA_EXPORT void SCT_fn_vInitMaterialForGoThrough(void);
 
 
/*This function is used in order to display all GoThroughs below _hSprObjFatherOfSector*/
extern CPA_EXPORT void SECT_fn_vSendAllGoThroughOfSectorToViewport ( struct GLD_tdstViewportAttributes_ *_p_stVpt ,
																     HIE_tdxHandleToSuperObject   _hSprObjFatherOfSector
																   );
/* Function to know if a sector is virtual or not*/
extern CPA_EXPORT ACP_tdxBool SECT_fn_bIsThisSectorVirtual (HIE_tdxHandleToSuperObject _hSprObjSector);
 
/* Function to know if a sector is virtual or not*/
extern CPA_EXPORT ACP_tdxBool SECT_fn_bIsThisSectorUniverse (HIE_tdxHandleToSuperObject _hSprObjSector);
 
/*Link table*/
#if !defined(U64)
extern CPA_EXPORT SCR_tdst_Link_Table *SECT_fn_pGetLinkTable(void);
#endif /* U64 */
 
extern CPA_EXPORT void SECT_fn_vDisinit(void);
 
/* take pointer in the element*/
 
/* ANNECY AV {*/
 
/* All this functions are now inline function
 
extern CPA_EXPORT GLI_tdxHandleToLight SECT_GetDNMLightsInList(
			SECT_tdxHandleOfElementLstDNMLights hDNMLightsList);
 
extern CPA_EXPORT GLI_tdxHandleToLight SECT_GetStaticLightsInList(
			SECT_tdxHandleOfElementLstStaticLights hStaticLightsList);
 
extern CPA_EXPORT HIE_tdxHandleToSuperObject SECT_GetCharacterInList(
                              SECT_tdxHandleOfElementLstCharacter
                            );
extern CPA_EXPORT HIE_tdxHandleToSuperObject SECT_GetSectorInCollisionList(
                              SECT_tdxHandleOfElementLstCollisionInteraction
                            );
extern CPA_EXPORT HIE_tdxHandleToSuperObject SECT_GetSectorInActivityList(
                              SECT_tdxHandleOfElementLstActivityInteraction
                            );
extern CPA_EXPORT HIE_tdxHandleToSuperObject SECT_GetSectorInGraphicList(
                              SECT_tdxHandleOfElementLstGraphicInteraction
                              );
extern CPA_EXPORT short SCT_fn_wGetLODInGraphicList(SECT_tdxHandleOfElementLstGraphicInteraction hGraphicList);
 
extern CPA_EXPORT HIE_tdxHandleToSuperObject SECT_GetSectorInSoundList(
                              SECT_tdxHandleOfElementLstSoundInteraction
                              );
 
extern CPA_EXPORT long SCT_fn_lGetVolumeInSoundList(SECT_tdxHandleOfElementLstSoundInteraction hSoundList);
 
extern CPA_EXPORT HIE_tdxHandleToSuperObject SCT_fn_hGetSectorInSoundEventList(SCT_tdxHandleOfLstSoundEvent hSoundEventList);
 
extern CPA_EXPORT SND_tdxHandleToSoundEvent SCT_fn_uGetSoundEventInSoundEventList(SCT_tdxHandleOfLstSoundEvent hSoundEventList);
 
// Function to use list
extern CPA_EXPORT SECT_tdxHandleOfElementLstDNMLights SECT_fn_hGetFirstDNMLightsListInSector(
                              HIE_tdxHandleToSuperObject
                            );
extern CPA_EXPORT SECT_tdxHandleOfElementLstDNMLights SECT_fn_hGetNextDNMLightsListInSector(
                              SECT_tdxHandleOfElementLstDNMLights
                            );
extern CPA_EXPORT SECT_tdxHandleOfElementLstStaticLights SECT_fn_hGetFirstStaticLightsListInSector(
                              HIE_tdxHandleToSuperObject
                            );
extern CPA_EXPORT SECT_tdxHandleOfElementLstStaticLights SECT_fn_hGetNextStaticLightsListInSector(
                              SECT_tdxHandleOfElementLstStaticLights
                            );
extern CPA_EXPORT SECT_tdxHandleOfElementLstCharacter SECT_fn_hGetFirstCharListInSector(HIE_tdxHandleToSuperObject);
extern CPA_EXPORT SECT_tdxHandleOfElementLstCharacter SECT_fn_hGetNextCharListInSector(
                              SECT_tdxHandleOfElementLstCharacter
                            );
extern CPA_EXPORT long SECT_fn_lGetNbCharListInSector(HIE_tdxHandleToSuperObject _hSector);
extern CPA_EXPORT SECT_tdxHandleOfElementLstCollisionInteraction SECT_fn_hGetFirstCollisionNodeInCollisionList(
                              HIE_tdxHandleToSuperObject
                            );
extern CPA_EXPORT SECT_tdxHandleOfElementLstCollisionInteraction SECT_fn_hGetNextCollisionNodeInCollisionList(
                              SECT_tdxHandleOfElementLstCollisionInteraction
                            );
extern CPA_EXPORT SECT_tdxHandleOfElementLstActivityInteraction SECT_fn_hGetFirstActivityNodeInActivityList(
                              HIE_tdxHandleToSuperObject
                            );
extern CPA_EXPORT SECT_tdxHandleOfElementLstActivityInteraction SECT_fn_hGetNextActivityNodeInActivityList(
                              SECT_tdxHandleOfElementLstActivityInteraction
                            );
extern CPA_EXPORT SECT_tdxHandleOfElementLstGraphicInteraction SECT_fn_hGetFirstGraphicNodeInGraphicList(
                              HIE_tdxHandleToSuperObject
                            );
extern CPA_EXPORT SECT_tdxHandleOfElementLstGraphicInteraction SECT_fn_hGetNextGraphicNodeInGraphicList(
                              SECT_tdxHandleOfElementLstGraphicInteraction
                            );
extern CPA_EXPORT SECT_tdxHandleOfElementLstSoundInteraction SECT_fn_hGetFirstSoundNodeInSoundList(
                              HIE_tdxHandleToSuperObject
                            );
extern CPA_EXPORT SECT_tdxHandleOfElementLstSoundInteraction SECT_fn_hGetNextSoundNodeInSoundList(
                              SECT_tdxHandleOfElementLstSoundInteraction
                            );
extern CPA_EXPORT SCT_tdxHandleOfLstSoundEvent SCT_fn_hGetFirstSoundEventNodeInSoundEventList(HIE_tdxHandleToSuperObject _hSector);
extern CPA_EXPORT SCT_tdxHandleOfLstSoundEvent SCT_fn_hGetNextSoundEventNodeInSoundEventList(SCT_tdxHandleOfLstSoundEvent _hSoundEventNode);
 
*/
/* END ANNECY AV }*/
 
extern CPA_EXPORT void SECT_fn_vIsolateCharListNode(SECT_tdxHandleOfElementLstCharacter);
extern CPA_EXPORT void SECT_fn_vAddTailCharListNode(HIE_tdxHandleToSuperObject,SECT_tdxHandleOfElementLstCharacter);
extern CPA_EXPORT void SECT_fn_vAddHeadCharListNode(HIE_tdxHandleToSuperObject,SECT_tdxHandleOfElementLstCharacter);
 
extern CPA_EXPORT void SECT_fn_vIsolateDNMLightsListNode(SECT_tdxHandleOfElementLstDNMLights);
extern CPA_EXPORT void SECT_fn_vAddTailDNMLightsListNode(HIE_tdxHandleToSuperObject,SECT_tdxHandleOfElementLstDNMLights);
 
#ifdef ACTIVE_EDITOR
extern CPA_EXPORT void SECT_fn_vIsolateStaticLightsListNode(SECT_tdxHandleOfElementLstStaticLights _hNode);
extern CPA_EXPORT void SECT_fn_vDestructStaticLightsListNode(SECT_tdxHandleOfElementLstStaticLights _hNode);
extern CPA_EXPORT void SECT_fn_vAddTailStaticLightsListNode(HIE_tdxHandleToSuperObject,SECT_tdxHandleOfElementLstStaticLights);
#endif /* ACTIVE_EDITOR */
 
extern CPA_EXPORT SECT_tdxHandleOfElementLstCharacter SECT_fn_hCreateElementLstCharacter(void);
extern CPA_EXPORT SECT_tdxHandleOfElementLstCollisionInteraction SECT_fn_hCreateElementLstCollisionInteraction(void);
extern CPA_EXPORT SECT_tdxHandleOfElementLstActivityInteraction SECT_fn_hCreateElementLstActivityInteraction(void);
extern CPA_EXPORT SECT_tdxHandleOfElementLstGraphicInteraction SECT_fn_hCreateElementLstGraphicInteraction(void);
extern CPA_EXPORT SECT_tdxHandleOfElementLstSoundInteraction SECT_fn_hCreateElementLstSoundInteraction(void);
extern CPA_EXPORT SCT_tdxHandleOfLstSoundEvent SCT_fn_hCreateElementLstSoundEvent(void);
 
extern CPA_EXPORT SECT_tdxHandleOfElementLstDNMLights SECT_fn_hCreateElementLstDNMLights(void);
extern CPA_EXPORT SECT_tdxHandleOfElementLstStaticLights SECT_fn_hCreateElementLstStaticLights(void);
 
/* functions to manage the border*/
extern CPA_EXPORT void SECT_fn_vSetMinPointInBorder (SECT_tdxHandleOfSectorObject _hSector,
													 MTH3D_tdstVector			 *_p_stMinPoint);
 
extern CPA_EXPORT void SECT_fn_vSetMaxPointInBorder (SECT_tdxHandleOfSectorObject _hSector,
													 MTH3D_tdstVector			 *_p_stMaxPoint);
 
extern CPA_EXPORT void SECT_fn_vGetMinPointInBorder (SECT_tdxHandleOfSectorObject _hSector,
													 MTH3D_tdstVector			 *_p_stMinPoint);
 
extern CPA_EXPORT void SECT_fn_vGetMaxPointInBorder (SECT_tdxHandleOfSectorObject _hSector,
													 MTH3D_tdstVector			 *_p_stMaxPoint);
 
MTH3D_tdstVector *SECT_fn_p_stGetMinPointInBorder(SECT_tdxHandleOfSectorObject _hSector);
MTH3D_tdstVector *SECT_fn_p_stGetMaxPointInBorder(SECT_tdxHandleOfSectorObject _hSector);
 
extern CPA_EXPORT void SECT_fn_vGetCenterOfBorder (SECT_tdxHandleOfSectorObject _hSector,
												   MTH3D_tdstVector			   *_p_stCenter);
 
extern CPA_EXPORT void SECT_fn_vComputeBorder (HIE_tdxHandleToSuperObject _hSectorObject);
 
extern CPA_EXPORT void SECT_fn_vInitAllBorders (HIE_tdxHandleToSuperObject _hSectorRoot);
 
#ifdef ACTIVE_EDITOR
 
extern CPA_EXPORT MTH_tdxReal SECT_fn_xGetZmaxOfBorder (SECT_tdxHandleOfSectorObject _hSector);
 
extern CPA_EXPORT void SECT_fn_vSetZmaxOfBorder (SECT_tdxHandleOfSectorObject _hSector, MTH_tdxReal _xZmaxOfBorder);
 
extern CPA_EXPORT MTH_tdxReal SECT_fn_xGetRealZmax (SECT_tdxHandleOfSectorObject _hSector);
 
extern CPA_EXPORT void SECT_fn_vSetRealZmax (SECT_tdxHandleOfSectorObject _hSector, MTH_tdxReal _xZmaxOfBorder);
 
#endif /*ACTIVE_EDITOR*/
 
/*functions to set objects*/
extern CPA_EXPORT SECT_tdxHandleOfSectorObject SECT_fn_hCreateSector(void);
 
extern CPA_EXPORT void SECT_fn_vSetOnVirtualSector(SECT_tdxHandleOfSectorObject hSector);
 
extern CPA_EXPORT void SECT_fn_vSetOffVirtualSector(SECT_tdxHandleOfSectorObject hSector);
 
extern CPA_EXPORT void SECT_fn_vSetSectorPriority(SECT_tdxHandleOfSectorObject hSector, char cPriority);
 
extern CPA_EXPORT char SECT_fn_cGetSectorPriority(SECT_tdxHandleOfSectorObject hSector);
 
 
extern CPA_EXPORT void SECT_fn_vSetCharacterPointerInCharacterList(
										SECT_tdxHandleOfElementLstCharacter hCharacterElement,
										HIE_tdxHandleToSuperObject hSuperObject);
 
extern CPA_EXPORT void SECT_fn_vSetSectorPointedElementLSTCollisionInt(
								SECT_tdxHandleOfElementLstCollisionInteraction hColElement,
								HIE_tdxHandleToSuperObject hSectorSuperObject);
 
extern CPA_EXPORT void SECT_fn_vSetSectorPointedElementLSTActivityInt(
									SECT_tdxHandleOfElementLstActivityInteraction hActElement,
									HIE_tdxHandleToSuperObject hSectorSuperObject);
 
extern CPA_EXPORT void SECT_fn_vSetSectorPointedElementLSTGraphicInt(
										SECT_tdxHandleOfElementLstGraphicInteraction hGElement,
										HIE_tdxHandleToSuperObject hSectorSuperObject);
 
extern CPA_EXPORT void SECT_fn_vSetLevelElementLSTGraphicInt(SECT_tdxHandleOfElementLstGraphicInteraction hGElement, 
                                                             short wLevelOfDetail);
 
 
/* Begin Shaitan ModeLook*/
extern CPA_EXPORT void SECT_fn_vSetModeElementLSTGraphicInt(SECT_tdxHandleOfElementLstGraphicInteraction hGElement, 
                                                             char cDisplayMode);
/* End Shaitan ModeLook*/
 
extern CPA_EXPORT void SECT_fn_vSetSectorPointedElementLSTSoundInt(
										SECT_tdxHandleOfElementLstSoundInteraction hSndElement,
										HIE_tdxHandleToSuperObject hSectorSuperObject);
 
extern CPA_EXPORT void SCT_fn_vSetVolumeLSTSoundInt(SECT_tdxHandleOfElementLstSoundInteraction hSndElement,long lVolume);
 
extern CPA_EXPORT void SCT_fn_vSetSectorPointedElementLSTSoundEvent(
                                                                    SCT_tdxHandleOfLstSoundEvent hSndEventElement,
                                                                    HIE_tdxHandleToSuperObject hSectorSuperObject);
 
extern CPA_EXPORT void SCT_fn_vSetEventListElementLSTSoundEvent(SCT_tdxHandleOfLstSoundEvent hSndEventElement,SND_tdxHandleToSoundEvent hSoundEvent);
 
 
extern CPA_EXPORT void SECT_fn_vSetHandleOfLightsInDNMLightsList(
												 SECT_tdxHandleOfElementLstDNMLights hDNMLightsElement,
												 GLI_tdxHandleToLight hDNMLights
												);
 
extern CPA_EXPORT void SECT_fn_vSetHandleOfLightsInStaticLightsList(
												 SECT_tdxHandleOfElementLstStaticLights hStaticLightsElement,
												 GLI_tdxHandleToLight hStaticLights
												);
 
#if (defined(_DEBUG) || defined(USE_PROFILER))
extern CPA_EXPORT char * fn_szGetSectorName(
	HIE_tdxHandleToSuperObject _hSector);
#endif /* _DEBUG || USE_PROFILER */
 
extern CPA_EXPORT char fn_cGetSectorCameraType(HIE_tdxHandleToSuperObject _hSector);
extern CPA_EXPORT void fn_vSetSectorCameraType(HIE_tdxHandleToSuperObject _hSector, char cType);
 
/*
 * Access function for ZFar
 */
extern CPA_EXPORT MTH_tdxReal fn_xGetSectorZFar(HIE_tdxHandleToSuperObject _hSprObjSector);
extern CPA_EXPORT void fn_vSetSectorZFar(HIE_tdxHandleToSuperObject _hSprObjSector, MTH_tdxReal _xZFar);
 
 
extern CPA_EXPORT void SCT_fn_vClearCharacterSectorLink(SECT_tdxHandleOfElementLstCharacter hLstChar);
extern CPA_EXPORT void SCT_fn_vClearLightSectorLink(SECT_tdxHandleOfElementLstDNMLights hLstLight);
 
 
#ifdef __cplusplus
};
#endif /* __cplusplus */
 
/*AR 9808 Function for the "static list" macros*/
/*static __inline SECT_tdxHandleOfElementLstStaticLights SECT_fn_hGetFirstStaticLightsListInSector(HIE_tdxHandleToSuperObject _hSector)
{
  return(LST2_M_StaticGetFirstElement( &((SECT_tdxHandleOfSectorObject)HIE_fn_hGetSuperObjectObject(_hSector))->stListOfStaticLights));
}
 
static __inline SECT_tdxHandleOfElementLstCollisionInteraction SECT_fn_hGetFirstCollisionNodeInCollisionList(HIE_tdxHandleToSuperObject _hSector)
{
  return(LST2_M_StaticGetFirstElement( &((SECT_tdxHandleOfSectorObject)HIE_fn_hGetSuperObjectObject(_hSector))->stListOfSectorsInCollisionInteraction));
}
 
static __inline SECT_tdxHandleOfElementLstActivityInteraction SECT_fn_hGetFirstActivityNodeInActivityList(HIE_tdxHandleToSuperObject _hSector)
{
  return(LST2_M_StaticGetFirstElement( &((SECT_tdxHandleOfSectorObject)HIE_fn_hGetSuperObjectObject(_hSector))->stListOfSectorsInActivityInteraction));
}
 
static __inline SECT_tdxHandleOfElementLstGraphicInteraction SECT_fn_hGetFirstGraphicNodeInGraphicList(HIE_tdxHandleToSuperObject _hSector)
{
  return(LST2_M_StaticGetFirstElement( &((SECT_tdxHandleOfSectorObject)HIE_fn_hGetSuperObjectObject(_hSector))->stListOfSectorsInGraphicInteraction));
}
 
static __inline SECT_tdxHandleOfElementLstSoundInteraction SECT_fn_hGetFirstSoundNodeInSoundList(HIE_tdxHandleToSuperObject _hSector)
{
  return(LST2_M_StaticGetFirstElement( &((SECT_tdxHandleOfSectorObject)HIE_fn_hGetSuperObjectObject(_hSector))->stListOfSectorsInSoundInteraction));
}
 
static __inline SCT_tdxHandleOfLstSoundEvent SCT_fn_hGetFirstSoundEventNodeInSoundEventList(HIE_tdxHandleToSuperObject _hSector)
{
  return(LST2_M_StaticGetFirstElement( &((SECT_tdxHandleOfSectorObject)HIE_fn_hGetSuperObjectObject(_hSector))->stListOfSoundEvent));
}
 
static __inline SECT_tdxHandleOfElementLstStaticLights SECT_fn_hGetNextStaticLightsListInSector(SECT_tdxHandleOfElementLstStaticLights _hStaticLightsList)
{
  return(LST2_M_StaticGetNextElement( _hStaticLightsList));
}
 
static __inline SECT_tdxHandleOfElementLstCollisionInteraction SECT_fn_hGetNextCollisionNodeInCollisionList(SECT_tdxHandleOfElementLstCollisionInteraction _hCollNode)
{
  return(LST2_M_StaticGetNextElement( _hCollNode));
}
 
static __inline SECT_tdxHandleOfElementLstActivityInteraction SECT_fn_hGetNextActivityNodeInActivityList(SECT_tdxHandleOfElementLstActivityInteraction _hActNode)
{
  return(LST2_M_StaticGetNextElement( _hActNode));
}
 
static __inline SECT_tdxHandleOfElementLstGraphicInteraction SECT_fn_hGetNextGraphicNodeInGraphicList(SECT_tdxHandleOfElementLstGraphicInteraction _GraphicNode)
{
  return(LST2_M_StaticGetNextElement( _GraphicNode));
}
 
static __inline SECT_tdxHandleOfElementLstSoundInteraction SECT_fn_hGetNextSoundNodeInSoundList(SECT_tdxHandleOfElementLstSoundInteraction _hSoundNode)
{
  return(LST2_M_StaticGetNextElement( _hSoundNode));
}
 
static __inline SCT_tdxHandleOfLstSoundEvent SCT_fn_hGetNextSoundEventNodeInSoundEventList(SCT_tdxHandleOfLstSoundEvent _hSoundEventNode)
{
  return(LST2_M_StaticGetNextElement( _hSoundEventNode));
}
*/
#ifndef CODEWARRIOR
static
#endif
__inline int SECT_fn_iGetNumberOfNodesInStaticLightsList(HIE_tdxHandleToSuperObject hSector)
{
	return LST2_M_StaticGetNumberOfElements(&((SECT_tdxHandleOfSectorObject)HIE_fn_hGetSuperObjectObject(hSector))->stListOfStaticLights);
}
 
#ifndef CODEWARRIOR
static
#endif
__inline int SECT_fn_iGetNumberOfNodesInCollisionList(HIE_tdxHandleToSuperObject hSector)
{
	return LST2_M_StaticGetNumberOfElements(&((SECT_tdxHandleOfSectorObject)HIE_fn_hGetSuperObjectObject(hSector))->stListOfSectorsInCollisionInteraction);
}
 
#ifndef CODEWARRIOR
static
#endif
__inline int SECT_fn_iGetNumberOfNodesInActivityInteractionList(HIE_tdxHandleToSuperObject hSector)
{
	return LST2_M_StaticGetNumberOfElements(&((SECT_tdxHandleOfSectorObject)HIE_fn_hGetSuperObjectObject(hSector))->stListOfSectorsInActivityInteraction);
}
 
#ifndef CODEWARRIOR
static
#endif
__inline int SECT_fn_iGetNumberOfNodesInGraphicInteractionList(HIE_tdxHandleToSuperObject hSector)
{
	return LST2_M_StaticGetNumberOfElements(&((SECT_tdxHandleOfSectorObject)HIE_fn_hGetSuperObjectObject(hSector))->stListOfSectorsInGraphicInteraction);
}
 
#ifndef CODEWARRIOR
static
#endif
__inline int SECT_fn_iGetNumberOfNodesInSoundInteractionList(HIE_tdxHandleToSuperObject hSector)
{
	return LST2_M_StaticGetNumberOfElements(&((SECT_tdxHandleOfSectorObject)HIE_fn_hGetSuperObjectObject(hSector))->stListOfSectorsInSoundInteraction);
}
 
#ifndef CODEWARRIOR
static
#endif
__inline int SECT_fn_iGetNumberOfNodesInSoundEventList(HIE_tdxHandleToSuperObject hSector)
{
	return LST2_M_StaticGetNumberOfElements(&((SECT_tdxHandleOfSectorObject)HIE_fn_hGetSuperObjectObject(hSector))->stListOfSoundEvent);
}
/* end AR 9808 Function for the "static list" macros*/
 
#define SECT_M_ForEachCharListInSector(_hSector,_hCharList,_i) \
for														\
(														\
	_i=0,(_hCharList)=SECT_fn_hGetFirstCharListInSector(_hSector);		\
	_hCharList;									\
	_i++,_hCharList=SECT_fn_hGetNextCharListInSector(_hCharList)			\
)
 
#define SECT_M_ForEachXMovingCharListInSector(_hSector,_hCharList,_hNextCharList,_i) \
for														\
(														\
	_i=SECT_fn_lGetNbCharListInSector(_hSector),(_hCharList)=SECT_fn_hGetFirstCharListInSector(_hSector),\
	(_hNextCharList)=(_hCharList)?SECT_fn_hGetNextCharListInSector(_hCharList):NULL;		\
	_hCharList&&_i;									\
	_i--,_hCharList=_hNextCharList,_hNextCharList?_hNextCharList=SECT_fn_hGetNextCharListInSector(_hNextCharList):NULL		\
)
 
#define SECT_M_ForEachCollisionNodeInCollisionInteractionList(_hSector,_hCollList,_i) \
for														\
(														\
	_i=SECT_fn_iGetNumberOfNodesInCollisionList(_hSector), \
	(_hCollList)=SECT_fn_hGetFirstCollisionNodeInCollisionList(_hSector);		\
	_i>0;/*_hCollList;*/									\
	_i--,(_hCollList)=SECT_fn_hGetNextCollisionNodeInCollisionList(_hCollList)			\
)
 
#define SECT_M_ForEachActivityNodeInActivityInteractionList(_hSector,_hActList,_i) \
for														\
(														\
	_i=SECT_fn_iGetNumberOfNodesInActivityInteractionList(_hSector), \
	(_hActList)=SECT_fn_hGetFirstActivityNodeInActivityList(_hSector);		\
	_i>0;/*_hActList;*/									\
	_i--,(_hActList)=SECT_fn_hGetNextActivityNodeInActivityList(_hActList)			\
)
 
#define SECT_M_ForEachGraphicNodeInGraphicInteractionList(_hSector,_hGraList,_i) \
for														\
(														\
	_i=SECT_fn_iGetNumberOfNodesInGraphicInteractionList(_hSector), \
	(_hGraList)=SECT_fn_hGetFirstGraphicNodeInGraphicList(_hSector);		\
	_i>0;/*_hGraList;*/									\
	_i--,(_hGraList)=SECT_fn_hGetNextGraphicNodeInGraphicList(_hGraList)			\
)
 
#define SECT_M_ForEachSoundNodeInSoundInteractionList(_hSector,_hSoundList,_i) \
for														\
(														\
	_i=SECT_fn_iGetNumberOfNodesInSoundInteractionList(_hSector), \
	(_hSoundList)=SECT_fn_hGetFirstSoundNodeInSoundList(_hSector);		\
	_i>0;/*_hSoundList;*/									\
	_i--,(_hSoundList)=SECT_fn_hGetNextSoundNodeInSoundList(_hSoundList)			\
)
 
#define SCT_M_ForEachSoundEventNodeInSoundEventList(_hSector,_hSoundEventList,_i) \
for														\
(														\
	_i=SECT_fn_iGetNumberOfNodesInSoundEventList(_hSector), \
	(_hSoundEventList)=SCT_fn_hGetFirstSoundEventNodeInSoundEventList(_hSector);		\
	_i>0;/*_hSoundEventList;*/									\
	_i--,(_hSoundEventList)=SCT_fn_hGetNextSoundEventNodeInSoundEventList(_hSoundEventList)			\
)
 
#define SECT_M_ForEachDNMLightsListInSector(_hSector,_hDNMLightsList,_i) \
for														\
(														\
	_i=0,(_hDNMLightsList)=SECT_fn_hGetFirstDNMLightsListInSector(_hSector);		\
	_hDNMLightsList;									\
	_i++,_hDNMLightsList=SECT_fn_hGetNextDNMLightsListInSector(_hDNMLightsList)			\
)
 
#define SECT_M_ForEachStaticLightsListInSector(_hSector,_hStaticLightsList,_i) \
for														\
(														\
	_i=SECT_fn_iGetNumberOfNodesInStaticLightsList(_hSector), \
	(_hStaticLightsList)=SECT_fn_hGetFirstStaticLightsListInSector(_hSector);		\
	_i>0;/*_hStaticLightsList;*/									\
	_i--,_hStaticLightsList=SECT_fn_hGetNextStaticLightsListInSector(_hStaticLightsList)			\
)
 
 
 
 
 
#endif	/*__SECTOREXT*/
