1 | /**********************************************************************
|
---|
2 | *<
|
---|
3 | FILE: jagtypes.h
|
---|
4 |
|
---|
5 | DESCRIPTION: Typedefs for general jaguar types.
|
---|
6 |
|
---|
7 | CREATED BY: Rolf Berteig
|
---|
8 |
|
---|
9 | HISTORY: created 19 November 1994
|
---|
10 |
|
---|
11 | *> Copyright (c) 1994, All Rights Reserved.
|
---|
12 | **********************************************************************/
|
---|
13 |
|
---|
14 | #ifndef __JAGTYPES__
|
---|
15 | #define __JAGTYPES__
|
---|
16 |
|
---|
17 | typedef unsigned long ulong;
|
---|
18 | typedef unsigned char uchar;
|
---|
19 | typedef uchar UBYTE;
|
---|
20 | typedef unsigned short USHORT;
|
---|
21 | typedef unsigned short UWORD;
|
---|
22 |
|
---|
23 | struct Color24 {
|
---|
24 | uchar r,g,b;
|
---|
25 | };
|
---|
26 |
|
---|
27 | struct Color48 {
|
---|
28 | UWORD r,g,b;
|
---|
29 | };
|
---|
30 |
|
---|
31 | struct Color64 {
|
---|
32 | UWORD r,g,b,a;
|
---|
33 | };
|
---|
34 |
|
---|
35 | /* Time:
|
---|
36 | */
|
---|
37 | typedef int TimeValue;
|
---|
38 |
|
---|
39 | #define TIME_TICKSPERSEC 4800
|
---|
40 |
|
---|
41 | #define TicksToSec( ticks ) ((float)(ticks)/(float)TIME_TICKSPERSEC)
|
---|
42 | #define SecToTicks( secs ) ((TimeValue)(secs*TIME_TICKSPERSEC))
|
---|
43 | #define TicksSecToTime( ticks, secs ) ( (TimeValue)(ticks)+SecToTicks(secs) )
|
---|
44 | #define TimeToTicksSec( time, ticks, secs ) { (ticks) = (time)%TIME_TICKSPERSEC; (secs) = (time)/TIME_TICKSPERSEC ; }
|
---|
45 |
|
---|
46 | #define TIME_PosInfinity TimeValue(0x7fffffff)
|
---|
47 | #define TIME_NegInfinity TimeValue(0x80000000)
|
---|
48 |
|
---|
49 |
|
---|
50 | //-----------------------------------------------------
|
---|
51 | // Class_ID
|
---|
52 | //-----------------------------------------------------
|
---|
53 | class Class_ID {
|
---|
54 | ULONG a,b;
|
---|
55 | public:
|
---|
56 | Class_ID() { a = b = 0xffffffff; }
|
---|
57 | Class_ID(const Class_ID& cid) { a = cid.a; b = cid.b; }
|
---|
58 | Class_ID(ulong aa, ulong bb) { a = aa; b = bb; }
|
---|
59 | ULONG PartA() { return a; }
|
---|
60 | ULONG PartB() { return b; }
|
---|
61 | int operator==(const Class_ID& cid) const { return (a==cid.a&&b==cid.b); }
|
---|
62 | int operator!=(const Class_ID& cid) const { return (a!=cid.a||b!=cid.b); }
|
---|
63 | Class_ID& operator=(const Class_ID& cid) { a=cid.a; b = cid.b; return (*this); }
|
---|
64 | };
|
---|
65 |
|
---|
66 | // SuperClass ID
|
---|
67 | typedef ulong SClass_ID;
|
---|
68 |
|
---|
69 |
|
---|
70 |
|
---|
71 | #endif // __JAGTYPES__
|
---|
72 |
|
---|