1 /* $Id: mglobal.c,v 1.5 2004-08-28 23:17:45 schaffner Exp $ */
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
17 * Global variables for main directory
26 static char rcsid[] = "$Id: mglobal.c,v 1.5 2004-08-28 23:17:45 schaffner Exp $";
39 // Global array of vertices, common to one mine.
40 vms_vector Vertices[MAX_VERTICES];
41 g3s_point Segment_points[MAX_VERTICES];
43 fix FrameTime = 0x1000; // Time since last frame, in seconds
44 fix GameTime = 0; // Time in game, in seconds
46 //How many frames we've rendered
49 // This is the global mine which create_new_mine returns.
50 segment Segments[MAX_SEGMENTS];
51 segment2 Segment2s[MAX_SEGMENTS];
52 //lsegment Lsegments[MAX_SEGMENTS];
54 // Number of vertices in current mine (ie, Vertices, pointed to by Vp)
58 int Highest_vertex_index=0;
59 int Highest_segment_index=0;
61 // Translate table to get opposite side of a face on a segment.
62 char Side_opposite[MAX_SIDES_PER_SEGMENT] = {WRIGHT, WBOTTOM, WLEFT, WTOP, WFRONT, WBACK};
64 #define TOLOWER(c) ((((c)>='A') && ((c)<='Z'))?((c)+('a'-'A')):(c))
67 #define encrypt(a,b,c,d) a ^ TOLOWER((((int) PASSWORD)>>24)&255), \
68 b ^ TOLOWER((((int) PASSWORD)>>16)&255), \
69 c ^ TOLOWER((((int) PASSWORD)>>8)&255), \
70 d ^ TOLOWER((((int) PASSWORD))&255)
72 #define encrypt(a,b,c,d) a,b,c,d
75 sbyte Side_to_verts[MAX_SIDES_PER_SEGMENT][4] = {
76 { encrypt(7,6,2,3) }, // left
77 { encrypt(0,4,7,3) }, // top
78 { encrypt(0,1,5,4) }, // right
79 { encrypt(2,6,5,1) }, // bottom
80 { encrypt(4,5,6,7) }, // back
81 { encrypt(3,2,1,0) }, // front
84 // Note, this MUST be the same as Side_to_verts, it is an int for speed reasons.
85 int Side_to_verts_int[MAX_SIDES_PER_SEGMENT][4] = {
86 { encrypt(7,6,2,3) }, // left
87 { encrypt(0,4,7,3) }, // top
88 { encrypt(0,1,5,4) }, // right
89 { encrypt(2,6,5,1) }, // bottom
90 { encrypt(4,5,6,7) }, // back
91 { encrypt(3,2,1,0) }, // front
97 bitmap_index Textures[MAX_TEXTURES]; // All textures.
99 fix Next_laser_fire_time; // Time at which player can next fire his selected laser.
100 fix Next_missile_fire_time; // Time at which player can next fire his selected missile.
101 //--unused-- fix Laser_delay_time = F1_0/6; // Delay between laser fires.
103 #if defined(MACINTOSH) && defined(APPLE_DEMO)
104 #define DEFAULT_DIFFICULTY 0 // trainee for apple demo
106 #define DEFAULT_DIFFICULTY 1
109 int Difficulty_level=DEFAULT_DIFFICULTY; // Difficulty level in 0..NDL-1, 0 = easiest, NDL-1 = hardest
110 int Detail_level=NUM_DETAIL_LEVELS-2; // Detail level in 0..NUM_DETAIL_LEVELS-1, 0 = boringest, NUM_DETAIL_LEVELS = coolest