http://www.jwz.org/xscreensaver/xscreensaver-5.10.tar.gz
[xscreensaver] / hacks / bubbles-default.c
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 <stdio.h>
18 #include <stdlib.h>
19 #include "bubbles.h"
20 #include "yarandom.h"
21
22 #ifndef NO_DEFAULT_BUBBLE
23
24 # define BLOOD 0
25 # include "images/bubbles/blood1.xpm"
26 # include "images/bubbles/blood2.xpm"
27 # include "images/bubbles/blood3.xpm"
28 # include "images/bubbles/blood4.xpm"
29 # include "images/bubbles/blood5.xpm"
30 # include "images/bubbles/blood6.xpm"
31 # include "images/bubbles/blood7.xpm"
32 # include "images/bubbles/blood8.xpm"
33 # include "images/bubbles/blood9.xpm"
34 # include "images/bubbles/blood10.xpm"
35 # include "images/bubbles/blood11.xpm"
36
37 # define BLUE 1
38 # include "images/bubbles/blue1.xpm"
39 # include "images/bubbles/blue2.xpm"
40 # include "images/bubbles/blue3.xpm"
41 # include "images/bubbles/blue4.xpm"
42 # include "images/bubbles/blue5.xpm"
43 # include "images/bubbles/blue6.xpm"
44 # include "images/bubbles/blue7.xpm"
45 # include "images/bubbles/blue8.xpm"
46 # include "images/bubbles/blue9.xpm"
47 # include "images/bubbles/blue10.xpm"
48 # include "images/bubbles/blue11.xpm"
49
50 # define GLASS 2
51 # include "images/bubbles/glass1.xpm"
52 # include "images/bubbles/glass2.xpm"
53 # include "images/bubbles/glass3.xpm"
54 # include "images/bubbles/glass4.xpm"
55 # include "images/bubbles/glass5.xpm"
56 # include "images/bubbles/glass6.xpm"
57 # include "images/bubbles/glass7.xpm"
58 # include "images/bubbles/glass8.xpm"
59 # include "images/bubbles/glass9.xpm"
60 # include "images/bubbles/glass10.xpm"
61 # include "images/bubbles/glass11.xpm"
62
63 # define JADE 3
64 # include "images/bubbles/jade1.xpm"
65 # include "images/bubbles/jade2.xpm"
66 # include "images/bubbles/jade3.xpm"
67 # include "images/bubbles/jade4.xpm"
68 # include "images/bubbles/jade5.xpm"
69 # include "images/bubbles/jade6.xpm"
70 # include "images/bubbles/jade7.xpm"
71 # include "images/bubbles/jade8.xpm"
72 # include "images/bubbles/jade9.xpm"
73 # include "images/bubbles/jade10.xpm"
74 # include "images/bubbles/jade11.xpm"
75
76 # define END 4
77
78
79 char **default_bubbles[50];
80 int num_default_bubbles;
81
82 void init_default_bubbles(void)
83 {
84   int i = 0;
85   switch (random() % END) {
86   case BLOOD:
87     default_bubbles[i++] = blood1;
88     default_bubbles[i++] = blood2;
89     default_bubbles[i++] = blood3;
90     default_bubbles[i++] = blood4;
91     default_bubbles[i++] = blood5;
92     default_bubbles[i++] = blood6;
93     default_bubbles[i++] = blood7;
94     default_bubbles[i++] = blood8;
95     default_bubbles[i++] = blood9;
96     default_bubbles[i++] = blood10;
97     default_bubbles[i++] = blood11;
98     break;
99
100   case BLUE:
101     default_bubbles[i++] = blue1;
102     default_bubbles[i++] = blue2;
103     default_bubbles[i++] = blue3;
104     default_bubbles[i++] = blue4;
105     default_bubbles[i++] = blue5;
106     default_bubbles[i++] = blue6;
107     default_bubbles[i++] = blue7;
108     default_bubbles[i++] = blue8;
109     default_bubbles[i++] = blue9;
110     default_bubbles[i++] = blue10;
111     default_bubbles[i++] = blue11;
112     break;
113
114   case GLASS:
115     default_bubbles[i++] = glass1;
116     default_bubbles[i++] = glass2;
117     default_bubbles[i++] = glass3;
118     default_bubbles[i++] = glass4;
119     default_bubbles[i++] = glass5;
120     default_bubbles[i++] = glass6;
121     default_bubbles[i++] = glass7;
122     default_bubbles[i++] = glass8;
123     default_bubbles[i++] = glass9;
124     default_bubbles[i++] = glass10;
125     default_bubbles[i++] = glass11;
126     break;
127
128   case JADE:
129     default_bubbles[i++] = jade1;
130     default_bubbles[i++] = jade2;
131     default_bubbles[i++] = jade3;
132     default_bubbles[i++] = jade4;
133     default_bubbles[i++] = jade5;
134     default_bubbles[i++] = jade6;
135     default_bubbles[i++] = jade7;
136     default_bubbles[i++] = jade8;
137     default_bubbles[i++] = jade9;
138     default_bubbles[i++] = jade10;
139     default_bubbles[i++] = jade11;
140     break;
141
142   default:
143     abort();
144     break;
145   }
146
147   default_bubbles[i] = 0;
148   num_default_bubbles = i;
149 }
150
151 #endif /* NO_DEFAULT_BUBBLE */