home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Learn 3D Graphics Programming on the PC
/
Learn_3D_Graphics_Programming_on_the_PC_Ferraro.iso
/
rwdos
/
rwmacros.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-15
|
2KB
|
88 lines
/****************************************/
/* */
/* RenderWare(TM) Graphics Library */
/* */
/****************************************/
/*
* This file is a product of Criterion Software Ltd.
*
* This file is provided as is with no warranties of any kind and is
* provided without any obligiation on Criterion Software Ltd.
* or Canon Inc. to assist in its use or modifiation.
*
* Criterion Software Ltd. and Canon Inc. will not, under any
* circumstances, be liable for any lost revenue or other damages
* arising from the use of this file.
*
* Copyright (c) 1991, 1992, 1993, 1994. Canon Inc.
* All Rights Reserved.
*/
#ifndef _RW_MACROS_
#define _RW_MACROS_
#ifdef RWFIXED
#undef RWFIXED
#define RWFIXED
#endif
#ifdef RWFLOAT
#undef RWFLOAT
#define RWFLOAT
#endif
#if (defined RWFLOAT) && (defined RWFIXED)
#error "Inconsistent definitions of REAL type."
#endif
#ifndef RWFIXED
#define RwReal float
#define CREAL(a) ((RwReal)(a))
#define INT2REAL(a) ((RwReal)(a))
#define REAL2INT(a) ((long)(a))
#define REAL2FL(a) ((float)(a))
#define FL2REAL(a) ((RwReal)(a))
#define RMul(a, b) ((a) * (b))
#define RAdd(a, b) ((a) + (b))
#define RDiv(a, b) ((a) / (b))
#define RSub(a, b) ((a) - (b))
#define RSqrt(a) (sqrt(a))
#else /* RWFIXED */
#define RwReal long
#define CREAL(a) ((RwReal)((a) * 65536L))
#define INT2REAL(a) ((RwReal)(((long)(a))<<16))
#define REAL2INT(a) ((a)>>16)
#define REAL2FL(a) (((float)(a))/65536.0f)
#define FL2REAL(a) ((RwReal)((a)*65536.0f))
#define RMul(a, b) (_rwFixMul((a),(b)))
#define RAdd(a, b) ((a) + (b))
#define RDiv(a, b) (_rwFixDiv((a),(b)))
#define RSub(a, b) ((a) - (b))
extern RwReal _rwFixMul ARGS((RwReal a, RwReal b));
extern RwReal _rwFixDiv ARGS((RwReal a, RwReal b));
#define RSqrt(a) (_rwlsqrt(a))
extern RwReal _rwlsqrt ARGS((RwReal a));
#endif
#if (!defined FALSE) && (!defined TRUE)
#define FALSE 0
#define TRUE !FALSE
#endif
#define RAbs(a) (((a)<CREAL(0.0))?-(a):(a))
/* Provided for backwards compatibility */
#define Rabs(a) (((a)<CREAL(0.0))?-(a):(a))
#endif /* _RW_MACROS_ */