home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 21
/
CD_ASCQ_21_040595.iso
/
dos
/
graphic
/
font3d11
/
f3d_src
/
config.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-09-29
|
5KB
|
101 lines
//=================================================================================================
// Config.H
//
// Copyright (c) 1994 by Todd A. Prater.
// All rights reserved.
//
//-------------------------------------------------------------------------------------------------
//
// Type definitions and enumerations. Hopefully, anything that is platform-specific can be put
// in here.
//
//=================================================================================================
#ifndef __Config_H__
#define __Config_H__
// ____ Data Types: ____
// ____ ____
// ____ BYTE......... An unsigned 8-bit integer data type. ____
// ____ CHAR......... A signed 8-bit integer data type. ____
// ____ USHORT....... An unsigned 16-bit integer data type. ____
// ____ SHORT........ A signed 16-bit integer data type. ____
// ____ ULONG........ An unsigned 32-bit integer data type. ____
// ____ LONG......... A signed 32-bit integer data type. ____
// ____ DOUBLE....... A double precision floating point data type. ____
#ifdef __MSDOS__
typedef unsigned char BYTE; // Unsigned 8-bit integer data type
typedef char CHAR; // Signed 8-bit integer data type
typedef unsigned short int USHORT; // Unsigned 16-bit integer data type
typedef signed short int SHORT; // Signed 16-bit integer data type
typedef unsigned long int ULONG; // Unsigned 32-bit integer data type
typedef signed long int LONG; // Signed 32-bit integer data type
typedef double DOUBLE; // Double precision floating point.
#else
typedef unsigned char BYTE;
typedef signed char CHAR;
typedef unsigned short int USHORT;
typedef signed short int SHORT;
typedef unsigned long int ULONG;
typedef signed long int LONG;
typedef double DOUBLE;
#endif
typedef BYTE *BYTEPTR;
typedef CHAR *CHARPTR;
typedef USHORT *USHORTPTR;
typedef SHORT *SHORTPTR;
typedef ULONG *ULONGPTR;
typedef LONG *LONGPTR;
typedef DOUBLE *DOUBLEPTR;
typedef LONG INT;
typedef USHORT uFWord;
typedef SHORT FWord;
typedef ULONG Fixed;
typedef USHORT F2Dot14;
enum BOOLEAN { FALSE, TRUE };
enum POINTTYPE { NO_POINT, OFF_CURVE, ON_CURVE };
enum CONTOURTYPE { IGNORE, OUTSIDE, INSIDE };
enum ORIENTATIONTYPE { CLOCKWISE, COUNTER_CLOCKWISE };
enum EFFECTSTYPE { NONE, BEVEL, ROUND };
enum FORMATTYPE { POV_FLAT, POV_SMOOTH, RAW };
// ____ Conversion Macros: ____
// ____ ____
// ____ toDOUBLE(x)...........Converts a 'Fixed' data object to a DOUBLE ____
// ____ toUSHORT(b1,b2).......Combines two bytes 'b1' and 'b2' ('b1' is MSB) into a ____
// ____ 'USHORT' data object. ____
// ____ toSHORT (b1,b2).......Combines two bytes 'b1' and 'b2' ('b1' is MSB) into a ____
// ____ 'SHORT' data object. ____
// ____ toULONG (b1,b2,b3,b4).Combines four bytes 'b1', 'b2', 'b3', and 'b4' ('b1' is ____
// ____ MSB, 'b4' is LSB) into a 'ULONG' data object. ____
#define toDOUBLE(x) ( (((SHORT)(x>>16))>0)\
? ( ((SHORT)(x>>16))\
+(((DOUBLE)(0x0000ffff&x))/(0xffffffff)))\
: ( ((SHORT)(x>>16))\
-(((DOUBLE)(0x0000ffff&x))/(0xffffffff))))
#define toUSHORT(b1,b2) (((USHORT)b1<<8)+((USHORT)b2))
#define toSHORT(b1,b2) ((SHORT)((USHORT)b1<<8)+((USHORT)b2))
#define toULONG(b1,b2,b3,b4) (((ULONG)b1<<24)+((ULONG)b2<<16)+((ULONG)b3<<8)+((ULONG)b4))
// ____ A Macro that evaluates to 1 if a bit position is set in a byte, 0 otherwise. ____
#define isBitSet(byte,bit) ((0x01<<bit)&byte)
#ifdef __GNUC__
#define NO_BINARY_FILES
#endif
#endif