#include "ldt.h"
 
/*****************************************************************
Name: 
Description: Create callback for LDT
Author: Mircea Petrescu
Date: 8/25/98
Modified: 
*****************************************************************/
int fn_iCreateCollideMaterial( LDT_tdst_Link *pLink )
{
	GMT_tdxHandleToCollideMaterial h_CollideMaterial; 	
 
	h_CollideMaterial = GMT_fn_hCreateCollideMaterial();
  
  pLink->pObject=(void *)h_CollideMaterial;
  return 0;
}
 
 
/*****************************************************************
Name: 
Description: Load callback for LDT
Author: Mircea Petrescu
Date: 8/25/98
Modified: 
*****************************************************************/
int fn_iLoadCollideMaterial( LDT_tdst_Link *pLink )
{
  LDT_tdeParseResult result=ParseResult_BeginSection;
  GMT_tdxHandleToCollideMaterial _h_CollideMaterial=(GMT_tdxHandleToCollideMaterial)pLink->pObject;
  char a255_cLongName[255];
  int iLen;
 
  iLen=LDT_ComputeSectionName(pLink,a255_cLongName);
  SCR_M_v_Link_SetAdditionalLong(SCR_fnp_st_Link_SetValue(&g_stGmtZoneLinkTable,
			a255_cLongName, 
			(unsigned long)_h_CollideMaterial),
    1,iLen); 
 
  while( result!=ParseResult_EndSection ) 
  {
  	result=LDT_GetNextEntry();
  	switch( result )
  	{
  	  case ParseResult_Entry: /* an entry */
  	  {
				short wValue;
  	    char *szEntry=LDT_szGetEntryName();
  			if( strcmp( szEntry, C_EntryCollideMaterial )!=0 )
					break;
				szEntry=LDT_szGetParam(1);
				switch( *(long *)szEntry )
				{
  	      case 'mdZ' : /* Zdm */
						GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDM);
  	      break;
  	      case 'rdZ' : /* Zdr */
						GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDR);
  	      break;
  	      case 'edZ' : /* Zde */
						GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDE);
  	      break;
  	      case 'ddZ' : /* Zdd */
						GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDD);
  	      break;
				}
				wValue=(short)atoi( LDT_szGetParam( 2 ) );
				GMT_fn_hSetCollideMaterialIdentifier(_h_CollideMaterial,wValue);
			}
  	}
  }
  return 0;
}
 
