1 | /* bubbles_default.c - pick images for bubbles.c |
---|
2 | * By Jamie Zawinski <jwz@jwz.org>, 20-Jan-98. |
---|
3 | * |
---|
4 | * Permission to use, copy, modify, distribute, and sell this software and its |
---|
5 | * documentation for any purpose is hereby granted without fee, provided that |
---|
6 | * the above copyright notice appear in all copies and that both that |
---|
7 | * copyright notice and this permission notice appear in supporting |
---|
8 | * documentation. No representations are made about the suitability of this |
---|
9 | * software for any purpose. It is provided "as is" without express or |
---|
10 | * implied warranty. |
---|
11 | */ |
---|
12 | |
---|
13 | #ifdef HAVE_CONFIG_H |
---|
14 | # include "config.h" |
---|
15 | #endif |
---|
16 | |
---|
17 | #include <X11/Xlib.h> |
---|
18 | |
---|
19 | #include <stdio.h> |
---|
20 | #include <stdlib.h> |
---|
21 | #include "bubbles.h" |
---|
22 | #include "yarandom.h" |
---|
23 | |
---|
24 | #ifndef NO_DEFAULT_BUBBLE |
---|
25 | |
---|
26 | # define BLOOD 0 |
---|
27 | # include "images/bubbles/blood1.xpm" |
---|
28 | # include "images/bubbles/blood2.xpm" |
---|
29 | # include "images/bubbles/blood3.xpm" |
---|
30 | # include "images/bubbles/blood4.xpm" |
---|
31 | # include "images/bubbles/blood5.xpm" |
---|
32 | # include "images/bubbles/blood6.xpm" |
---|
33 | # include "images/bubbles/blood7.xpm" |
---|
34 | # include "images/bubbles/blood8.xpm" |
---|
35 | # include "images/bubbles/blood9.xpm" |
---|
36 | # include "images/bubbles/blood10.xpm" |
---|
37 | # include "images/bubbles/blood11.xpm" |
---|
38 | |
---|
39 | # define BLUE 1 |
---|
40 | # include "images/bubbles/blue1.xpm" |
---|
41 | # include "images/bubbles/blue2.xpm" |
---|
42 | # include "images/bubbles/blue3.xpm" |
---|
43 | # include "images/bubbles/blue4.xpm" |
---|
44 | # include "images/bubbles/blue5.xpm" |
---|
45 | # include "images/bubbles/blue6.xpm" |
---|
46 | # include "images/bubbles/blue7.xpm" |
---|
47 | # include "images/bubbles/blue8.xpm" |
---|
48 | # include "images/bubbles/blue9.xpm" |
---|
49 | # include "images/bubbles/blue10.xpm" |
---|
50 | # include "images/bubbles/blue11.xpm" |
---|
51 | |
---|
52 | # define GLASS 2 |
---|
53 | # include "images/bubbles/glass1.xpm" |
---|
54 | # include "images/bubbles/glass2.xpm" |
---|
55 | # include "images/bubbles/glass3.xpm" |
---|
56 | # include "images/bubbles/glass4.xpm" |
---|
57 | # include "images/bubbles/glass5.xpm" |
---|
58 | # include "images/bubbles/glass6.xpm" |
---|
59 | # include "images/bubbles/glass7.xpm" |
---|
60 | # include "images/bubbles/glass8.xpm" |
---|
61 | # include "images/bubbles/glass9.xpm" |
---|
62 | # include "images/bubbles/glass10.xpm" |
---|
63 | # include "images/bubbles/glass11.xpm" |
---|
64 | |
---|
65 | # define JADE 3 |
---|
66 | # include "images/bubbles/jade1.xpm" |
---|
67 | # include "images/bubbles/jade2.xpm" |
---|
68 | # include "images/bubbles/jade3.xpm" |
---|
69 | # include "images/bubbles/jade4.xpm" |
---|
70 | # include "images/bubbles/jade5.xpm" |
---|
71 | # include "images/bubbles/jade6.xpm" |
---|
72 | # include "images/bubbles/jade7.xpm" |
---|
73 | # include "images/bubbles/jade8.xpm" |
---|
74 | # include "images/bubbles/jade9.xpm" |
---|
75 | # include "images/bubbles/jade10.xpm" |
---|
76 | # include "images/bubbles/jade11.xpm" |
---|
77 | |
---|
78 | # define END 4 |
---|
79 | |
---|
80 | |
---|
81 | char **default_bubbles[50]; |
---|
82 | int num_default_bubbles; |
---|
83 | |
---|
84 | void init_default_bubbles(void) |
---|
85 | { |
---|
86 | int i = 0; |
---|
87 | switch (random() % END) { |
---|
88 | case BLOOD: |
---|
89 | default_bubbles[i++] = blood1; |
---|
90 | default_bubbles[i++] = blood2; |
---|
91 | default_bubbles[i++] = blood3; |
---|
92 | default_bubbles[i++] = blood4; |
---|
93 | default_bubbles[i++] = blood5; |
---|
94 | default_bubbles[i++] = blood6; |
---|
95 | default_bubbles[i++] = blood7; |
---|
96 | default_bubbles[i++] = blood8; |
---|
97 | default_bubbles[i++] = blood9; |
---|
98 | default_bubbles[i++] = blood10; |
---|
99 | default_bubbles[i++] = blood11; |
---|
100 | break; |
---|
101 | |
---|
102 | case BLUE: |
---|
103 | default_bubbles[i++] = blue1; |
---|
104 | default_bubbles[i++] = blue2; |
---|
105 | default_bubbles[i++] = blue3; |
---|
106 | default_bubbles[i++] = blue4; |
---|
107 | default_bubbles[i++] = blue5; |
---|
108 | default_bubbles[i++] = blue6; |
---|
109 | default_bubbles[i++] = blue7; |
---|
110 | default_bubbles[i++] = blue8; |
---|
111 | default_bubbles[i++] = blue9; |
---|
112 | default_bubbles[i++] = blue10; |
---|
113 | default_bubbles[i++] = blue11; |
---|
114 | break; |
---|
115 | |
---|
116 | case GLASS: |
---|
117 | default_bubbles[i++] = glass1; |
---|
118 | default_bubbles[i++] = glass2; |
---|
119 | default_bubbles[i++] = glass3; |
---|
120 | default_bubbles[i++] = glass4; |
---|
121 | default_bubbles[i++] = glass5; |
---|
122 | default_bubbles[i++] = glass6; |
---|
123 | default_bubbles[i++] = glass7; |
---|
124 | default_bubbles[i++] = glass8; |
---|
125 | default_bubbles[i++] = glass9; |
---|
126 | default_bubbles[i++] = glass10; |
---|
127 | default_bubbles[i++] = glass11; |
---|
128 | break; |
---|
129 | |
---|
130 | case JADE: |
---|
131 | default_bubbles[i++] = jade1; |
---|
132 | default_bubbles[i++] = jade2; |
---|
133 | default_bubbles[i++] = jade3; |
---|
134 | default_bubbles[i++] = jade4; |
---|
135 | default_bubbles[i++] = jade5; |
---|
136 | default_bubbles[i++] = jade6; |
---|
137 | default_bubbles[i++] = jade7; |
---|
138 | default_bubbles[i++] = jade8; |
---|
139 | default_bubbles[i++] = jade9; |
---|
140 | default_bubbles[i++] = jade10; |
---|
141 | default_bubbles[i++] = jade11; |
---|
142 | break; |
---|
143 | |
---|
144 | default: |
---|
145 | abort(); |
---|
146 | break; |
---|
147 | } |
---|
148 | |
---|
149 | default_bubbles[i] = 0; |
---|
150 | num_default_bubbles = i; |
---|
151 | } |
---|
152 | |
---|
153 | #endif /* NO_DEFAULT_BUBBLE */ |
---|