/******************************************************************************
 * 595balAc.cxx : file automaticly generated
 ******************************************************************************/

#ifndef U64
#include "gamedata\world\levels\_common\cfast\595balAc.h"
#endif
void CFast_GlobalActorModel_Cmp_CHG_GlobalActorInit (void) ;
void CFast_GlobalActorModel_Cmp_CHG_GlobalActorLoop (void) ;

long CFast_GlobalActorModel_Macro_0 (void) ;
CFast_EvalFunc CFast_GlobalActorModel_ArrayComport[] = { 
  CFast_GlobalActorModel_Cmp_CHG_GlobalActorInit,
  CFast_GlobalActorModel_Cmp_CHG_GlobalActorLoop
};

void CFast_Dummy_GlobalActorModel(void) ;
char g_GlobalActorModel_StaticTreeInit = 0 ;


void CFast_GlobalActorModel_Main ( HIE_tdxHandleToSuperObject hSuperObjPerso ) {
  register long                lIndex ;
   register AI_tdstMind         *p_stMind = M_pstGetMindOfBrain(M_GetMSHandle(hSuperObjPerso, Brain)) ;

  p_stGlobalMind = p_stMind;
  gp_stRefTree = &M_CFast_GetReferenceNodeN(hSuperObjPerso, 0);
  g_hSuperObjectPerso = hSuperObjPerso;

#ifndef U64
  gp_stPseudoTree = p_stMind->p_stAIModel->CFast_dst_ParamArray;
#else
  gp_stPseudoTree = CFast_gast_ArrayFunctions[p_stMind->p_stAIModel->CFast_lFunction].mp_stPseudoTree;
#endif

#ifdef DEBUG_CFAST
  if ( !g_GlobalActorModel_StaticTreeInit ) {
    g_GlobalActorModel_StaticTreeInit = 1 ;
    CFast_Dummy_GlobalActorModel();
  }
#endif /* DEBUG_CFAST */
  p_cGlobalDsgMemBuffer = p_stMind->p_stDsgMem->p_cDsgMemBuffer;
  p_stGlobalDsgVarInfo = (*(p_stMind->p_stDsgMem->p_p_stDsgVar))->p_stDsgVarInfo;
  AI_M_SetDoingIntel(p_stMind, 1) ;
  CFast_g_bProcessReflex = 0 ;
  lIndex = M_GetCurrentComport(AI_M_p_stGetIntelligence(p_stMind))->CFast_lMyIndex ;
  CFast_GlobalActorModel_ArrayComport[lIndex]();
}
/*
 * Model : GlobalActorModel Comportement CHG_GlobalActorInit
 */
void CFast_GlobalActorModel_Cmp_CHG_GlobalActorInit (void) {
  MTH3D_tdstVector stVector0;


 register  AI_tdstMind                 *p_stLocalMind0 = p_stGlobalMind;
  register struct tdstNodeInterpret_   *p_stRefTree = gp_stRefTree;
  register struct tdstNodeInterpret_   *p_stPseudoTree = gp_stPseudoTree;
  register tdstIntelligence            *p_stIntelligence = p_stLocalMind0->p_stIntelligence;
  register char                        *p_cLocalDsgMemBuffer = p_cGlobalDsgMemBuffer ;
  register tdstDsgVarInfo              *p_stLocalDsgVarInfo = p_stGlobalDsgVarInfo ;

  register long                        long1, long2 ;
  long                                 long3, long4, long5, long6, long7, long8;
  register AI_tdstMind                 *p_stLocalMind1, *p_stLocalMind2, *p_stLocalMind4, *p_stLocalMind8;

  if (p_stLocalMind0->CFast_lCmpMetaAction) 
    goto label1 ;
  if ( (*((char *)(M_LocalGetDsgVarAddr(p_stLocalMind0, 50)))) ) {

/* [Proc : ACT_FixePointsDeVie] *********** [2, 2, 0]*/
    CFast_CallProcedure_Static( 0 ) ;

/* [Proc : ACT_FixePointsDeVieMax] *********** [2, 2, 0]*/
    CFast_CallProcedure_Static( 3 ) ;

/* [Proc : RAY_FixePointsDair] *********** [1, 1, 0]*/
    CFast_CallProcedure_Static( 6 ) ;

/* [Proc : RAY_FixePointsDairMax] *********** [1, 1, 0]*/
    CFast_CallProcedure_Static( 8 ) ;

/* [Proc : RAY_FixePointsDeMagie] *********** [1, 1, 0]*/
    CFast_CallProcedure_Static( 10 ) ;

/* [Proc : RAY_FixePointsDeMagieMax] *********** [1, 1, 0]*/
    CFast_CallProcedure_Static( 12 ) ;
    CFast_fn_vSetDsgVarIntegerArray(41,p_stLocalMind0,32,12) ;
    CFast_fn_vSetDsgVarIntegerArray(41,p_stLocalMind0,33,12) ;

/* [Proc : Option_ActiveJoystickAnalogique] *********** [0, 0, 0]*/
    CFast_CallProcedure_Static( 14 ) ;

/* [Proc : PAD_JoyAnalogiqueFixeAxes] *********** [2, 2, 0]*/
    CFast_CallProcedure_Static( 15 ) ;
#ifndef U64

/* [Proc : PAD_InitKeyBoardDirections] *********** [5, 5, 0]*/
    CFast_CallProcedure_Static( 18 ) ;
#endif
    LocalCFast_fn_vSetDsgVarBoolean(50, 0) ;
  }
/* [EndTree] ************ [0]*/

/* [Proc : TEXT_SetDefaultFormatCharacter] *********** [3, 3, 0]*/
  CFast_CallProcedure_Static( 24 ) ;

/* [Op : .] ********** [2, 2, 0]*/

/* [Op : .] ********** [5, 2, 0]*/

/* [Op : .] ********** [8, 2, 0]*/

/* [Op : .] ********** [11, 2, 0]*/

/* [Op : .] ********** [14, 2, 0]*/

/* [Op : .] ********** [17, 2, 0]*/

/* [Op : .] ********** [20, 2, 0]*/

/* [Proc : PAD_FixeVariablesDeLecture] *********** [21, 7, 0]*/
  M_eProcedureIdInterpret(&CFast_g_a_stPseudoTree[E_ti_Procedure][0]) = (tdeProcedureId)336 ;

/* [Op : .] ********** [0, 2, 0]*/
  M_SetTypeInterpret(&CFast_g_a_stPseudoTree[4][1], E_ti_Operator);
  M_eOperatorIdInterpret(&CFast_g_a_stPseudoTree[4][1]) = (tdeOperatorId)12 ;
  CFast_memcpy ( 4, 2, 0) ;
  CFast_memcpy ( 4, 3, 8) ;

/* [Op : .] ********** [0, 2, 0]*/
  M_SetTypeInterpret(&CFast_g_a_stPseudoTree[4][4], E_ti_Operator);
  M_eOperatorIdInterpret(&CFast_g_a_stPseudoTree[4][4]) = (tdeOperatorId)12 ;
  CFast_memcpy ( 4, 5, 0) ;
  CFast_memcpy ( 4, 6, 9) ;

/* [Op : .] ********** [0, 2, 0]*/
  M_SetTypeInterpret(&CFast_g_a_stPseudoTree[4][7], E_ti_Operator);
  M_eOperatorIdInterpret(&CFast_g_a_stPseudoTree[4][7]) = (tdeOperatorId)12 ;
  CFast_memcpy ( 4, 8, 0) ;
  CFast_memcpy ( 4, 9, 10) ;

/* [Op : .] ********** [0, 2, 0]*/
  M_SetTypeInterpret(&CFast_g_a_stPseudoTree[4][10], E_ti_Operator);
  M_eOperatorIdInterpret(&CFast_g_a_stPseudoTree[4][10]) = (tdeOperatorId)12 ;
  CFast_memcpy ( 4, 11, 0) ;
  CFast_memcpy ( 4, 12, 11) ;

/* [Op : .] ********** [0, 2, 0]*/
  M_SetTypeInterpret(&CFast_g_a_stPseudoTree[4][13], E_ti_Operator);
  M_eOperatorIdInterpret(&CFast_g_a_stPseudoTree[4][13]) = (tdeOperatorId)12 ;
  CFast_memcpy ( 4, 14, 0) ;
  CFast_memcpy ( 4, 15, 12) ;

/* [Op : .] ********** [0, 2, 0]*/
  M_SetTypeInterpret(&CFast_g_a_stPseudoTree[4][16], E_ti_Operator);
  M_eOperatorIdInterpret(&CFast_g_a_stPseudoTree[4][16]) = (tdeOperatorId)12 ;
  CFast_memcpy ( 4, 17, 0) ;
  CFast_memcpy ( 4, 18, 13) ;

/* [Op : .] ********** [0, 2, 0]*/
  M_SetTypeInterpret(&CFast_g_a_stPseudoTree[4][19], E_ti_Operator);
  M_eOperatorIdInterpret(&CFast_g_a_stPseudoTree[4][19]) = (tdeOperatorId)12 ;
  CFast_memcpy ( 4, 20, 0) ;
  CFast_memcpy ( 4, 21, 14) ;
  CFast_CallProcedure_NoStatic( ) ;

/* [Op : ..] ********** [2, 1, 0]*/

/* [Func : MOD_PositionAbsolueModule] ********** [3, 2, 1]*/
  CFast_fn_vSetUltraOperatorPersoRef(0);
  CFast_CallFunction1_Static( 28 ) ;
  LocalCFast_fn_vSetDsgVarVector(23, &M_GetSetParam_stVectorValue(CFast_g_a_stParam+1)) ;

/* [Func : Temps_Obtenir] ********** [0, 0, 1]*/
  CFast_CallFunction1_Static( 30 ) ;
  LocalCFast_fn_vSetDsgVarInteger(22, M_GetSetParam_ulValue(CFast_g_a_stParam+1)) ;

/* [Proc : Ecran_ChangePos] *********** [3, 3, 0]*/
  CFast_CallProcedure_Static( 31 ) ;

/* [Proc : Ecran_ChangeTaille] *********** [3, 3, 0]*/
  CFast_CallProcedure_Static( 35 ) ;

/* [Proc : Ecran_ChangeClip] *********** [5, 5, 0]*/
  CFast_CallProcedure_Static( 39 ) ;

/* [Proc : ChangeMonComportement] *********** [1, 1, 0]*/
  CFast_CallProcedure_Static( 45 ) ;
label1 :
  return ;
/* [EndTree] ************ [0]*/
}

/*
 * Model : GlobalActorModel Comportement CHG_GlobalActorLoop
 */
void CFast_GlobalActorModel_Cmp_CHG_GlobalActorLoop (void) {
  MTH3D_tdstVector stVector0;


 register  AI_tdstMind                 *p_stLocalMind0 = p_stGlobalMind;
  register struct tdstNodeInterpret_   *p_stRefTree = gp_stRefTree;
  register struct tdstNodeInterpret_   *p_stPseudoTree = gp_stPseudoTree;
  register char                        *p_cLocalDsgMemBuffer = p_cGlobalDsgMemBuffer ;
  register tdstDsgVarInfo              *p_stLocalDsgVarInfo = p_stGlobalDsgVarInfo ;

  register long                        long1, long2 ;
  long                                 long3, long4, long5, long6, long7, long8;
  register AI_tdstMind                 *p_stLocalMind1, *p_stLocalMind2, *p_stLocalMind4, *p_stLocalMind8;

#ifndef U64

/* [Cond : BoutonAppuye] ********** [1, 1, 1]*/
  if ( (long)IPT_fn_bIsValidated((IPT_tdxHandleToEntryElement) M_lValueInterpret(p_stRefTree+17)) ) {
    CFast_GlobalActorModel_Macro_0 () ;
/* [BeginMacro : 1] ********** [0]*/

/* [Proc : ACT_FixePointsDeVie] *********** [2, 2, 0]*/
    CFast_CallProcedure_Static( 0 ) ;
  }
#endif
/* [EndTree] ************ [0]*/
  if ( (*((char *)(M_LocalGetDsgVarAddr(p_stLocalMind0, 63)))) ) {

/* [Cond : <] ********** [2, 2, 1]*/
    if ( MTH_M_bLess(MTH_M_xLongToReal((*((char *)(M_LocalGetDsgVarAddr(p_stLocalMind0, 65))))), MTH_M_xFloatToReal(12.000000f)) ) {
      LocalCFast_fn_vSetDsgVar0To255(65, (LocalCFast_fn_lGetDsgVar0To255(65)+1)) ;
      M_Full_GetSetParam_Integer(&CFast_g_a_stParam[1], 100 - (*((char *)(M_LocalGetDsgVarAddr(p_stLocalMind0, 65)))));

/* [Proc : Ecran_ChangeClip] *********** [5, 5, 0]*/
        M_lValueInterpret(p_stPseudoTree+51) = M_GetSetParam_lValue(CFast_g_a_stParam+1);
      CFast_CallProcedure_Static( 47 ) ;
      M_Full_GetSetParam_Integer(&CFast_g_a_stParam[1], -3 * (*((char *)(M_LocalGetDsgVarAddr(p_stLocalMind0, 65)))));

/* [Proc : Ecran_ChangePos] *********** [3, 3, 0]*/
        M_lValueInterpret(p_stPseudoTree+56) = M_GetSetParam_lValue(CFast_g_a_stParam+1);
      CFast_CallProcedure_Static( 53 ) ;
    }
    else {
      LocalCFast_fn_vSetDsgVarBoolean(63, 0) ;
    }
  }
/* [EndTree] ************ [0]*/
  if ( (*((char *)(M_LocalGetDsgVarAddr(p_stLocalMind0, 62)))) ) {

/* [Cond : <] ********** [2, 2, 1]*/
    if ( MTH_M_bLess(MTH_M_xLongToReal((*((char *)(M_LocalGetDsgVarAddr(p_stLocalMind0, 65))))), MTH_M_xFloatToReal(20.000000f)) ) {
      LocalCFast_fn_vSetDsgVar0To255(65, (LocalCFast_fn_lGetDsgVar0To255(65)+1)) ;
      M_Full_GetSetParam_Integer(&CFast_g_a_stParam[1], 100 - (*((char *)(M_LocalGetDsgVarAddr(p_stLocalMind0, 65)))));

/* [Proc : Ecran_ChangeClip] *********** [5, 5, 0]*/
        M_lValueInterpret(p_stPseudoTree+51) = M_GetSetParam_lValue(CFast_g_a_stParam+1);
      CFast_CallProcedure_Static( 47 ) ;
      M_Full_GetSetParam_Integer(&CFast_g_a_stParam[1], -3 * (*((char *)(M_LocalGetDsgVarAddr(p_stLocalMind0, 65)))));

/* [Proc : Ecran_ChangePos] *********** [3, 3, 0]*/
        M_lValueInterpret(p_stPseudoTree+56) = M_GetSetParam_lValue(CFast_g_a_stParam+1);
      CFast_CallProcedure_Static( 53 ) ;
    }
    else {
      LocalCFast_fn_vSetDsgVarBoolean(62, 0) ;
    }
  }
/* [EndTree] ************ [0]*/
  if ( (*((char *)(M_LocalGetDsgVarAddr(p_stLocalMind0, 64)))) ) {

/* [Cond : >] ********** [2, 2, 1]*/
    if ( MTH_M_bGreater(MTH_M_xLongToReal((*((char *)(M_LocalGetDsgVarAddr(p_stLocalMind0, 65))))), MTH_M_xFloatToReal(0.000000f)) ) {
      LocalCFast_fn_vSetDsgVar0To255(65, (LocalCFast_fn_lGetDsgVar0To255(65)-1)) ;
      M_Full_GetSetParam_Integer(&CFast_g_a_stParam[1], 100 - (*((char *)(M_LocalGetDsgVarAddr(p_stLocalMind0, 65)))));

/* [Proc : Ecran_ChangeClip] *********** [5, 5, 0]*/
        M_lValueInterpret(p_stPseudoTree+51) = M_GetSetParam_lValue(CFast_g_a_stParam+1);
      CFast_CallProcedure_Static( 47 ) ;
      M_Full_GetSetParam_Integer(&CFast_g_a_stParam[1], -3 * (*((char *)(M_LocalGetDsgVarAddr(p_stLocalMind0, 65)))));

/* [Proc : Ecran_ChangePos] *********** [3, 3, 0]*/
        M_lValueInterpret(p_stPseudoTree+56) = M_GetSetParam_lValue(CFast_g_a_stParam+1);
      CFast_CallProcedure_Static( 53 ) ;
    }
    else {
      LocalCFast_fn_vSetDsgVarBoolean(64, 0) ;
      LocalCFast_fn_vSetDsgVar0To255(65, 0) ;
    }
  }
/* [EndTree] ************ [0]*/
}

long CFast_GlobalActorModel_Macro_0 (void) {
  MTH3D_tdstVector stVector0;


 register  AI_tdstMind                 *p_stLocalMind0 = p_stGlobalMind;
  register struct tdstNodeInterpret_   *p_stPseudoTree = gp_stPseudoTree;

  register long                        long1, long2 ;
  long                                 long3, long4, long5, long6, long7, long8;
  register AI_tdstMind                 *p_stLocalMind1, *p_stLocalMind2, *p_stLocalMind4, *p_stLocalMind8;


/* [Proc : PAD_ChangeCalibration] *********** [2, 2, 0]*/
  CFast_CallProcedure_Static( 57 ) ;

/* [Proc : PAD_SetCenterPosition] *********** [0, 0, 0]*/
  CFast_CallProcedure_Static( 60 ) ;
  return (0) ;
}
void CFast_Dummy_GlobalActorModel(void) {
#ifdef DEBUG_CFAST
  long lSize ;
  FILE *fd = fopen ( "CfastAISize.log", "a") ;

  lSize = (long)CFast_Dummy_GlobalActorModel - (long)CFast_GlobalActorModel_Main ;
  lSize += sizeof ( CFast_GlobalActorModel_ArrayComport ) ;
  lSize += 488;
  fprintf ( fd, "GlobalActorModel : 	AI = 1648\tC = %d\tDiff = %+d\n", lSize, 1648-lSize ) ;
  fclose (fd) ;
#endif /* DEBUG_CFAST */
}
