1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
--- vaders.h.orig 2000-09-10 22:32:40 UTC
+++ vaders.h
@@ -90,15 +90,82 @@ typedef struct _VadersRec {
+/*
+ * Application resources
+ */
+typedef struct {
+ int width, height; /* Size of window. */
+ int scale;
+ Boolean debug;
+
+ /* Base info: */
+ int basewait; /* Number of milliseconds to wait between */
+ /* moving base. */
+ Pixel basepixel;
+ Pixel buildingpixel;
+
+ /* Vader info */
+ Pixel vader1pixel;
+ Pixel vader2pixel;
+ Pixel vader3pixel;
+ int vaderwait; /* Number of milliseconds to wait between */
+ /* moving vaders. */
+
+ /* Spacer info */
+ Pixel spacerpixel;
+ int spacerwait; /* Number of milliseconds to wait between */
+ /* moving spacers. */
+
+ /* Shot info */
+ Pixel shotpixel;
+ Pixel vshotpixel;
+ int shotwait;
+ int vshotwait;
+ int maxshots; /* How many shots are allowed to exist at */
+ /* once. */
+ int maxvshots; /* How many shots are allowed to exist at */
+ /* once. */
+
+ /* Score info */
+ Pixel scorepixel;
+
+ Pixel defaultfore, defaultback;
+
+ char *vaderfont;
+} AppData;
+
+ext AppData app_data;
+
+#ifndef MAIN
+#define scale app_data.scale
+#define debug app_data.debug
+#define basewait app_data.basewait
+#define basepixel app_data.basepixel
+#define buildingpixel app_data.buildingpixel
+#define vader1pixel app_data.vader1pixel
+#define vader2pixel app_data.vader2pixel
+#define vader3pixel app_data.vader3pixel
+#define vaderwait app_data.vaderwait
+#define spacerpixel app_data.spacerpixel
+#define spacerwait app_data.spacerwait
+#define shotpixel app_data.shotpixel
+#define vshotpixel app_data.vshotpixel
+#define shotwait app_data.shotwait
+#define vshotwait app_data.vshotwait
+#define maxshots app_data.maxshots
+#define maxvshots app_data.maxvshots
+#define scorepixel app_data.scorepixel
+#define defaultfore app_data.defaultfore
+#define defaultback app_data.defaultback
+#define vaderfont app_data.vaderfont
+#endif
/*
* Actual vaders definitions.
*/
ext Widget pausebutton, infobutton;
-ext int scale;
-ext Boolean debug;
ext int level;
ext Display *dpy;
@@ -111,30 +178,17 @@ ext int basesleft;
/* Base info: */
-ext int basewait; /* Number of milleseconds to wait between */
- /* moving base. */
-
ext XtIntervalId basetimerid;
-ext Pixel basepixel;
-ext Pixel buildingpixel;
ext Boolean basedestroyed; /* TRUE if the base is non-existant */
/* Vader info: */
ext XtIntervalId vadertimerid;
-ext Pixel vader1pixel;
-ext Pixel vader2pixel;
-ext Pixel vader3pixel;
-ext int vaderwait; /* Number of milleseconds to wait between */
- /* moving vaders. */
/* Spacer info */
-ext Pixel spacerpixel;
ext XtIntervalId spacertimerid;
-ext int spacerwait; /* Number of milliseconds to wait between */
- /* moving spacers. */
ext int spacerappear; /* same, but for the interval between appearances */
ext Boolean spacer_shown; /* Currnet_Spacer is something */
@@ -144,21 +198,11 @@ ext int spacer_counter; /* number of cy
ext XtIntervalId shottimerid;
ext XtIntervalId vshottimerid;
-ext Pixel shotpixel;
-ext Pixel vshotpixel;
-ext int shotwait;
-ext int vshotwait;
-ext int maxshots; /* How many shots are allowed to exist at */
- /* once. */
-ext int maxvshots; /* How many shots are allowed to exist at */
- /* once. */
ext int numshots; /* how many shots (from the base) there are right now. */
ext int numvshots; /* how many shots (from vaders) there are right now. */
/* Score info */
-ext Pixel scorepixel;
-
ext int bases, nextbonus, lastscore;
extern int hiscore;
@@ -227,8 +271,5 @@ void InitShot();
void MoveShots();
void MoveVshots();
void PaintAllShots();
-ext Pixel defaultfore, defaultback;
-
-ext char *vaderfont;
#endif _vaders_h
|