source: golgotha/src/maxtool/sdk_inc/maxtypes.h @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 11 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
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
17typedef unsigned long ulong;
18typedef unsigned char uchar;
19typedef uchar UBYTE;
20typedef unsigned short USHORT;
21typedef unsigned short UWORD;
22                                                                                                                 
23struct Color24 {
24        uchar r,g,b;
25        };
26
27struct Color48 {
28        UWORD r,g,b;
29        };
30
31struct Color64 {
32        UWORD r,g,b,a;
33        };
34
35/* Time:
36 */
37typedef 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//-----------------------------------------------------
53class 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
67typedef ulong SClass_ID; 
68
69
70
71#endif // __JAGTYPES__
72
Note: See TracBrowser for help on using the repository browser.