#if !defined(__VIG_ERR_H_)
#define __VIG_ERR_H_
 
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000 */
/******************************************/
 
#include "VIG_Ver.h"
 
/***************************************/
/**** Error macros (using ACPerror) ****/
/***************************************/
#define M_VIGFatalError(ErrorNum) \
{ \
 if (ErrorNum>E_uwVIGFatalErr&&ErrorNum<E_uwVIGStartOfWarning) \
 { \
  Erm_M_ClearLastError(C_ucErmDefaultChannel);\
  Erm_M_UpdateLastError(VIG,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
 } \
 else \
 { \
  Erm_M_ClearLastError(C_ucErmDefaultChannel);\
  Erm_M_UpdateLastError(VIG,C_ucErmDefaultChannel,E_uwVIGFatalErrorNotAFatalError,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
 } \
}
 
#define M_VIGInformationError(ErrorNum) \
{ \
 if (ErrorNum>E_uwVIGStartOfInformationWarning&&ErrorNum<E_uwVIGErrNumber) \
 { \
  Erm_M_UpdateLastError(VIG,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmNoOpenInfoWindow,C_ucNeverStopForDebug, NULL);\
  Erm_M_ClearLastError(C_ucErmDefaultChannel);\
 } \
 else \
 { \
  M_VIGFatalError(E_uwVIGInformationErrorIsNotAInformationError); \
 } \
}
 
#define M_VIGWarningError(ErrorNum) \
{ \
 if (ErrorNum>E_uwVIGStartOfWarning&&ErrorNum<E_uwVIGStartOfInformationWarning) \
 { \
  Erm_M_UpdateLastError(VIG,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
 } \
 else \
 { \
  M_VIGFatalError(E_uwVIGWarningErrorIsNotAWarningError); \
 } \
}
 
#define __FATAL_ERR_INPUT__
#define __INFORMATION_ERR_INPUT__ /**** Treat as a level 1 warning ****/
#define __WARNING_ERR_INPUT__     /**** Treat as a level 2 warning ****/
 
enum e_uwVIGErrNumber
{
 E_uwVIGFatalErr,
 #if defined(__FATAL_ERR_INPUT__)
 /**** Error's errors ****/
 E_uwVIGFatalErrorNotAFatalError,
 E_uwVIGInformationErrorIsNotAInformationError,
 E_uwVIGWarningErrorIsNotAWarningError,
 /**** Vignettes error ****/
 E_uwVIGCantLoadBmp,
 E_uwVIGBadFormatBmp,
 E_uwVIGBadConvertFormat,
 E_uwVIGBufferSizeTooLow,
 /**** Script errors ****/
 E_uwVIGScriptBadNumberOfArg,
 #endif /*__FATAL_ERR_INPUT__*/
 
 E_uwVIGStartOfWarning,
 
 #if defined(__WARNING_ERR_INPUT__)
 #endif /*__WARNING_ERR_INPUT__*/
 
 E_uwVIGStartOfInformationWarning,
 
 #if defined(__INFORMATION_ERR_INPUT__)
 #endif /*__INFORMATION_ERR_INPUT__*/
 
	E_uwVIGErrNumber,
};
 
/*------------------*/
/* Global Variables*/
/*------------------*/
#undef EXTERN
#undef extern
#undef LOCAL
#if !defined(D_VIG_Input_VariableDefine)
#define EXTERN extern /*external declaration*/
#define LOCAL /*replace by nothing : we have to declare*/
#else /* D_VIG_Input_VariableDefine */
#define EXTERN /*replace by nothing : we have to declare*/
#define LOCAL /*replace by nothing : we have to declare*/
#endif /* D_VIG_Input_VariableDefine */
 
EXTERN unsigned char g_ucVIGModuleId /* number of identification of the Game module*/
#if defined(D_VIG_Input_VariableDefine)
= C_ucModuleNotInitialized
#endif /* D_VIG_Input_VariableDefine */
;
 
#if defined(__ERROR_STRINGS__)
EXTERN CPA_EXPORT char * g_a_szVIGInformationModule []
#if defined(D_VIG_Input_VariableDefine) && !defined(CPA_WANTS_IMPORT)
= {C_szVIGVersion, C_szVIGFullName, C_szVIGDate}
#endif /* D_VIG_Input_VariableDefine &&  CPA_WANTS_IMPORT */
;
 
EXTERN char * g_szVIGModuleName /* Obliged syntax 'sz'+[Abbreviation of ModuleName]+'ModuleName'*/
#if defined(D_VIG_Input_VariableDefine)
= {"Input"}
#endif /* D_VIG_Input_VariableDefine */
;
 
EXTERN tdstErrorMsg g_a_stVIGTabErr[] /* Obliged syntax 'a_sz'+[Abbreviation of ModuleName]+'TabErr'*/
#if defined(D_VIG_Input_VariableDefine)
=
{
 #if defined(__FATAL_ERR_INPUT__)
 /**** Error's errors ****/
 E_uwVIGFatalErrorNotAFatalError,"M_VIGFatalError : Try to raise a warning or an information",
 E_uwVIGInformationErrorIsNotAInformationError,"M_VIGInformationError : Try to raise a fatal or a warning",
 E_uwVIGWarningErrorIsNotAWarningError,"M_VIGWarningError : Try to raise a fatal or a information",
 /**** Vignettes error ****/
 E_uwVIGCantLoadBmp,"fn_vLoadBMPVignette : Can not open file.",
 E_uwVIGBadFormatBmp,"fn_vLoadBMPVignette : Bad file format (must be 640*480, 24 bits, not compressed).",
 E_uwVIGBadConvertFormat,"VIG_fn_vLoadBMPVignette : Can convert only in 16 or 32 bits.",
 E_uwVIGBufferSizeTooLow,"VIG_fn_vLoadBMPVignette : Buffer size too low.",
 /**** Script errors ****/
 E_uwVIGScriptBadNumberOfArg,"Script callback : bad number of arguments",
 #endif /*__FATAL_ERR_INPUT__*/
 
 #ifdef __WARNING_ERR_INPUT__
 #endif /*__WARNING_ERR_INPUT__*/
 
 #ifdef __INFORMATION_ERR_INPUT__
 #endif /*__INFORMATION_ERR_INPUT__*/
 
	0xffff,"\0"/*fin*/
}
#endif /* D_VIG_Input_VariableDefine */
;
#endif /* __ERROR_STRINGS__ */
 
#undef EXTERN
#undef extern
 
#endif /* !__VIG_ERR_H_ */
