1 /*- 2 # X-BASED DINOSAUR CUBE 3 # 4 # Dino2dP.h 5 # 6 ### 7 # 8 # Copyright (c) 1995 - 99 David Albert Bagley, bagleyd@tux.org 9 # 10 # All Rights Reserved 11 # 12 # Permission to use, copy, modify, and distribute this software and 13 # its documentation for any purpose and without fee is hereby granted, 14 # provided that the above copyright notice appear in all copies and 15 # that both that copyright notice and this permission notice appear in 16 # supporting documentation, and that the name of the author not be 17 # used in advertising or publicity pertaining to distribution of the 18 # software without specific, written prior permission. 19 # 20 # This program is distributed in the hope that it will be "playable", 21 # but WITHOUT ANY WARRANTY; without even the implied warranty of 22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 23 # 24 */ 25 26 /* Private header file for Dino2d */ 27 28 #ifndef _Dino2dP_h 29 #define _Dino2dP_h 30 31 #include "Dino2d.h" 32 33 #define FRONTLOC 0 34 #define BACKLOC 11 35 #define COORD2D 8 36 #define MAXX 3 37 #define MAXY 4 38 #define MAXXY 4 /* (MAX(MAXX,MAXY)) */ 39 #define MAXRECT (MAXX*MAXY) 40 41 typedef struct _Dino2DPart { 42 Position diamondLength, triangleLength, triangleWidth; 43 Position faceLength; 44 Position viewLength; 45 } Dino2DPart; 46 47 typedef struct _Dino2DRec { 48 CorePart core; 49 DinoPart dino; 50 Dino2DPart dino2d; 51 } Dino2DRec; 52 53 /* This gets around C's inability to do inheritance */ 54 typedef struct _Dino2DClassPart { 55 int ignore; 56 } Dino2DClassPart; 57 58 typedef struct _Dino2DClassRec { 59 CoreClassPart coreClass; 60 DinoClassPart dinoClass; 61 Dino2DClassPart dino2dClass; 62 } Dino2DClassRec; 63 64 extern Dino2DClassRec dino2dClassRec; 65 66 extern Boolean SelectPolyhedrons2D(Dino2DWidget w, int x, int y, int *face, int *position); 67 extern Boolean NarrowSelection2D(Dino2DWidget w, int *face, int *direction); 68 extern void DrawTriangle2D(Dino2DWidget w, int face, int position, int offset); 69 70 #endif /* _Dino2dP_h */ 71