/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You must do : 
#define TDE_GLOBALS 
in one (and only one) .c file of your Module.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
 
/* To avoid unnecessary includes :  */
#ifndef  __TDE_VALUES_H
#define __TDE_VALUES_H
 
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
 
/* For DLLs who are using this module : */ 
#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
 
/* For Global declaration in C files : */
#ifndef TDE_GLOBALS
 #define __TDE_EXTERN extern
#else /* !TDE_GLOBALS */
 #define __TDE_EXTERN
#endif /* !TDE_GLOBALS */
 
#include "TDE.h"
 
/*
-----------------------------------------------------------------------------
CONSTANT DECLARATION:
-----------------------------------------------------------------------------
*/
 
/*
-----------------------------------------------------------------------------
TYPES DEFINITION : 
-----------------------------------------------------------------------------
*/
typedef long                TDE_tdxErr ;
typedef float               TDE_tdxValue ;
typedef float               TDE_tdxAngle ;
typedef float               TDE_tdxUVValue ;
typedef long                TDE_tdl1616;
typedef unsigned short      TDE_tdxPixel;
typedef LPDIRECTDRAWSURFACE TDE_tdLP_SURF;
typedef char*               TDE_tdLP_SOURCE;
/*
-----------------------------------------------------------------------------
*/
 
/*
-----------------------------------------------------------------------------
FUNCTIONS DECLARATION:
-----------------------------------------------------------------------------
*/
#define TDE_M_FloatToValue(A)   ( ( A ) )
#define TDE_M_1616ToValue(A)    ( ( A ) / 65536.0 )
#define TDE_M_ValueToFloat(A)   ( ( A ) )
#define TDE_M_ValueTo1616(A)    ( ( A ) * 65536.0 )
#define TDE_M_ValueToLong(A)    ( (long) ( A ) )
#define TDE_M_LongToValue(A)    ( (float) ( A ) )
#define TDE_M_Mul(A,B)          (TDE_tdxValue)( ( A ) * ( B ) )
#define TDE_M_Sub(A,B)          (TDE_tdxValue)( ( A ) - ( B ) )
#define TDE_M_Add(A,B)          (TDE_tdxValue)( ( A ) + ( B ) )
#define TDE_M_Div(A,B)          (TDE_tdxValue)( ( A ) / ( B ) )
#define TDE_M_Neg(A)            ( -( A ) )
#define TDE_M_Sgn(A)            ( ( ( A ) < 0.0 ) ? ( -1 ) \
                                  : ( ( ( A ) > 0.0 ) \
                                  ? ( 1 ) : ( 0 ) ) )
#define TDE_M_Inv(A)            ( 1.0 / ( A ) )
#define TDE_M_Abs(A)            ( ( ( A ) > 0.0 ) ? ( A ) : ( -( A ) ) )
#define TDE_M_Sqrt(A)           ( sqrt ( (double) ( A ) ) )
#define TDE_M_Sq(A)             (TDE_tdxValue)( ( A ) * ( A ) )
 
#define TDE_M_AngToValue(A)   (TDE_tdxValue)( ( A ) )
#define TDE_M_ValueToAng(A)   (TDE_tdxValue)( ( A ) )
 
#define TDE_M_DegToAng(A)     (TDE_tdxValue)( ( A ) *(3.1415927/180.0) )
#define TDE_M_RadToAng(A)     (TDE_tdxValue)( ( A ) )
#define TDE_M_AngToDeg(A)     (TDE_tdxValue)( ( A ) *(180.0/3.1415927) )
#define TDE_M_AngToRad(A)     (TDE_tdxValue)( ( A ) )
#define TDE_M_Cos(A)          (TDE_tdxValue)( cos ( (double) ( A ) ) )
#define TDE_M_Sin(A)          (TDE_tdxValue)( sin ( (double) ( A ) ) )
#define TDE_M_Tan(A)          (TDE_tdxValue)( tan ( (double) ( A ) ) )
#define TDE_M_Atan(A)         (TDE_tdxValue)( atan ( (double) ( A ) ) )
#define TDE_M_Cotan(A)        (TDE_tdxValue)( 1.0 / tan ( (double) ( A ) ) )
 
#ifdef __cplusplus
};
#endif /* __cplusplus */
 
 
#endif /* __TDE_VALUES_H  */
 
