File: world.bitmaps

package info (click to toggle)
xevil 2.02r2-10
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 7,992 kB
  • ctags: 8,006
  • sloc: cpp: 47,789; makefile: 228; csh: 4
file content (381 lines) | stat: -rw-r--r-- 12,079 bytes parent folder | download | duplicates (10)
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
/* 
 * XEvil(TM) Copyright (C) 1994,2000 Steve Hardt and Michael Judge
 * http://www.xevil.com
 * satan@xevil.com
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program, the file "gpl.txt"; if not, write to the Free
 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA, or visit http://www.gnu.org.
 */

// "world.bitmaps"
// NOTE:  WSQUARE_WIDTH and WSQUARE_HEIGHT in utils.h.

#include "utils.h"
#include "world.h"

#if X11
#include "gen_xpm/world/block_0.xpm"
#include "gen_xpm/world/block_1.xpm"
#include "gen_xpm/world/block_2.xpm"
#include "gen_xpm/world/block_3.xpm"
#include "gen_xpm/world/block_4.xpm"
#include "gen_xpm/world/block_5.xpm"
#include "gen_xpm/world/block_6.xpm"
#include "gen_xpm/world/block_7.xpm"
#include "gen_xpm/world/block_8.xpm"
#include "gen_xpm/world/block_9.xpm"
#include "gen_xpm/world/block_10.xpm"
#include "gen_xpm/world/block_11.xpm"
#include "gen_xpm/world/block_12.xpm"
#include "gen_xpm/world/block_13.xpm"
#include "gen_xpm/world/block_14.xpm"
#include "gen_xpm/world/block_15.xpm"
#include "gen_xpm/world/block_16.xpm"
#include "gen_xpm/world/block_17.xpm"
#include "gen_xpm/world/block_18.xpm"
#include "gen_xpm/world/block_19.xpm"
#include "gen_xpm/world/block_20.xpm"
#include "gen_xpm/world/block_21.xpm"

#include "gen_xpm/world/background_0.xpm"
#include "gen_xpm/world/background_1.xpm"
#include "gen_xpm/world/background_2.xpm"
#include "gen_xpm/world/background_3.xpm"
#include "gen_xpm/world/background_4.xpm"
#include "gen_xpm/world/background_5.xpm"
#include "gen_xpm/world/background_6.xpm"
#include "gen_xpm/world/background_7.xpm"
#include "gen_xpm/world/background_8.xpm"
#include "gen_xpm/world/background_9.xpm"
#include "gen_xpm/world/background_10.xpm"
#include "gen_xpm/world/background_11.xpm"
#include "gen_xpm/world/background_12.xpm"
#include "gen_xpm/world/background_13.xpm"

#include "gen_xpm/world/outside_0.xpm"
#include "gen_xpm/world/outside_1.xpm"
#include "gen_xpm/world/outside_2.xpm"
#include "gen_xpm/world/outside_3.xpm"
#include "gen_xpm/world/outside_4.xpm"
#include "gen_xpm/world/outside_5.xpm"

#include "gen_xpm/world/door_0.xpm"
#include "gen_xpm/world/door_1.xpm"
#include "gen_xpm/world/door_2.xpm"
#include "gen_xpm/world/door_3.xpm"
#include "gen_xpm/world/door_4.xpm"
#include "gen_xpm/world/door_5.xpm"
#include "gen_xpm/world/door_6.xpm"
#include "gen_xpm/world/door_7.xpm"
#include "gen_xpm/world/door_8.xpm"
#include "gen_xpm/world/door_9.xpm"

#include "gen_xpm/world/mover_square_0.xpm"
#include "gen_xpm/world/mover_square_1.xpm"
#include "gen_xpm/world/mover_square_2.xpm"
#include "gen_xpm/world/mover_square_3.xpm"
#include "gen_xpm/world/mover_square_4.xpm"
#include "gen_xpm/world/mover_square_5.xpm"
#include "gen_xpm/world/mover_square_6.xpm"
#include "gen_xpm/world/mover_square_7.xpm"
#include "gen_xpm/world/mover_square_8.xpm"
#include "gen_xpm/world/mover_square_9.xpm"

#include "gen_xpm/world/mover_0.xpm"
#include "gen_xpm/world/mover_1.xpm"
#include "gen_xpm/world/mover_2.xpm"
#include "gen_xpm/world/mover_3.xpm"
#include "gen_xpm/world/mover_4.xpm"

#include "gen_xpm/world/poster_0.xpm"
#include "gen_xpm/world/poster_1.xpm"
#include "gen_xpm/world/poster_2.xpm"
#include "gen_xpm/world/poster_3.xpm"
#include "gen_xpm/world/poster_4.xpm"
#include "gen_xpm/world/poster_5.xpm"
#include "gen_xpm/world/poster_6.xpm"
#include "gen_xpm/world/poster_7.xpm"
#include "gen_xpm/world/poster_8.xpm"
#include "gen_xpm/world/poster_9.xpm"
#include "gen_xpm/world/poster_10.xpm"
#include "gen_xpm/world/poster_11.xpm"
#include "gen_xpm/world/poster_12.xpm"
#include "gen_xpm/world/poster_13.xpm"
#endif



// background color defined in utils.h Xvars_BACKGROUND



// Wempty and Woutside aren't directly used on Windows.  But they still 
// need to be in the Windows build so they can generate XPM files for UNIX.
static CMN_BITS_ID World_blocksBits[W_ALL_BLOCKS_NUM] = {
  CMN_ID(block_0,IDB_EMPTY),
  CMN_ID(block_1,IDB_HIWALL2),
  CMN_ID(block_2,IDB_HILADDER2),
  CMN_ID(block_3,IDB_OUTSIDE), 
  CMN_ID(block_4,IDB_HISQUANCH),
  CMN_ID(block_5,IDB_HIUPDOWN),
  CMN_ID(block_6,IDB_HITEXTSQUARE), 
  CMN_ID(block_7,IDB_HIERBLOK2),
  CMN_ID(block_8,IDB_HILADDER),
  CMN_ID(block_9,IDB_HIERUPDOWN),
  CMN_ID(block_10,IDB_MD1WALL),
  CMN_ID(block_11,IDB_MD1LADDER),
  CMN_ID(block_12,IDB_MD1UPDOWN),
  CMN_ID(block_13,IDB_MD2WALL),
  CMN_ID(block_14,IDB_MD2LADDER),
  CMN_ID(block_15,IDB_MD2UPDOWN),
  CMN_ID(block_16,IDB_MD3WALL),
  CMN_ID(block_17,IDB_MD3LADDER),
  CMN_ID(block_18,IDB_MD3UPDOWN),
  CMN_ID(block_19,IDB_MD4WALL),
  CMN_ID(block_20,IDB_MD4LADDER),
  CMN_ID(block_21,IDB_MD4UPDOWN),
};
CMN_BITS_ID *World::blocksBits = World_blocksBits;



static BitmapSpec World_backgrounds[W_ALL_BACKGROUNDS_NUM] = {
  {CMN_ID(background_0,IDB_BGHELL1),{100,100}},
  {CMN_ID(background_1,IDB_BGHELL2),{100,100}},
  {CMN_ID(background_2,IDB_BGINDUSTRIAL),{100,100}},
  {CMN_ID(background_3,IDB_BGIND1),{100,100}},
  {CMN_ID(background_4,IDB_BGALIENNU),{100,100}},
  {CMN_ID(background_5,IDB_HIER1),{100,100}},
  {CMN_ID(background_6,IDB_MD1BACKGROUND),{64,64}},
  {CMN_ID(background_7,IDB_MD2BACKGROUND),{94,94}},
  {CMN_ID(background_8,IDB_MD3BACKGROUND),{128,128}},
  {CMN_ID(background_9,IDB_MD4BACKGROUND),{128,128}},
  {CMN_ID(background_10,IDB_FWBACKGROUND1),{128,128}},
  {CMN_ID(background_11,IDB_FWBACKGROUND2),{128,128}},
  {CMN_ID(background_12,IDB_FWBACKGROUND3),{128,128}},
  {CMN_ID(background_13,IDB_FWBACKGROUND4),{128,128}},
};
BitmapSpec *World::backgrounds = World_backgrounds;



static BitmapSpec World_outsides[W_ALL_OUTSIDES_NUM] = {
  {CMN_ID(outside_0,IDB_HIOUTSIDE),{100,100}},
  {CMN_ID(outside_1,IDB_HIOUTSIDE1),{100,100}},
  {CMN_ID(outside_2,IDB_HIOUTSIDE2),{100,100}},
  {CMN_ID(outside_3,IDB_MD1OUTSIDE),{128,128}},
  {CMN_ID(outside_4,IDB_MD3OUTSIDE),{128,128}},
  {CMN_ID(outside_5,IDB_MD4OUTSIDE),{96,96}},
};
BitmapSpec *World::outsides = World_outsides;



static CMN_BITS_ID World_doorPixmapBits[W_ALL_DOORS_NUM] = {
  CMN_ID(door_0,IDB_HIDOOR1),
  CMN_ID(door_1,IDB_HIDOOR2),
  CMN_ID(door_2,IDB_MD1DOOR1),
  CMN_ID(door_3,IDB_MD1DOOR2),
  CMN_ID(door_4,IDB_MD2DOOR1),
  CMN_ID(door_5,IDB_MD2DOOR2),
  CMN_ID(door_6,IDB_MD3DOOR1),
  CMN_ID(door_7,IDB_MD3DOOR2),
  CMN_ID(door_8,IDB_MD4DOOR1),
  CMN_ID(door_9,IDB_MD4DOOR2),
};
CMN_BITS_ID *World::doorPixmapBits = World_doorPixmapBits;



static CMN_BITS_ID World_moverSquarePixmapBits[W_ALL_MOVER_SQUARES_NUM] = {
  CMN_ID(mover_square_0,IDB_HORIZMOVERSQUARE),
  CMN_ID(mover_square_1,IDB_VERTMOVERSQUARE),
  CMN_ID(mover_square_2,IDB_MD1HORIZMOVERSQUARE),
  CMN_ID(mover_square_3,IDB_MD1VERTMOVERSQUARE),
  CMN_ID(mover_square_4,IDB_MD2HORIZMOVERSQUARE),
  CMN_ID(mover_square_5,IDB_MD2VERTMOVERSQUARE),
  CMN_ID(mover_square_6,IDB_MD3HORIZMOVERSQUARE),
  CMN_ID(mover_square_7,IDB_MD3VERTMOVERSQUARE),
  CMN_ID(mover_square_8,IDB_MD4HORIZMOVERSQUARE),
  CMN_ID(mover_square_9,IDB_MD4VERTMOVERSQUARE),
};
CMN_BITS_ID *World::moverSquarePixmapBits = World_moverSquarePixmapBits;



static CMN_BITS_ID World_moverPixmapBits[W_ALL_MOVERS_NUM] = {
  CMN_ID(mover_0,IDB_MOVER),
  CMN_ID(mover_1,IDB_MD1MOVER),
  CMN_ID(mover_2,IDB_MD2MOVER),
  CMN_ID(mover_3,IDB_MD3MOVER),
  CMN_ID(mover_4,IDB_MD4MOVER),
};
CMN_BITS_ID *World::moverPixmapBits = World_moverPixmapBits;



// Must be multiples of 32, for absolutely no good reason.  hardts
static BitmapSpec World_posterPixmapBits[W_ALL_POSTERS_NUM] = {
  {CMN_ID(poster_0,IDB_SQUANCH_BIG),{160,96}},
  {CMN_ID(poster_1,IDB_KILL_PARENTS),{64,64}},
  {CMN_ID(poster_2,IDB_PENT),{32,32}},
  {CMN_ID(poster_3,IDB_DROP_SCHOOL),{96,96}},
  {CMN_ID(poster_4,IDB_WINNERS_DRUGS),{64,32}},
  {CMN_ID(poster_5,IDB_SKULL),{64,64}},
  {CMN_ID(poster_6,IDB_PYRAMID),{64,64}},
  {CMN_ID(poster_7,IDB_VEGETABLES),{64,64}},
  {CMN_ID(poster_8,IDB_NICE_DAY),{32,32}},
  {CMN_ID(poster_9,IDB_BEAT_DOG),{128,32}},
  {CMN_ID(poster_10,IDB_STRANGLE_CAT),{96,96}},
  {CMN_ID(poster_11,IDB_TAKE_CANDY),{128,64}},
  {CMN_ID(poster_12,IDB_BCEAGLE),{32,32}},
  // The XEvil title screen, must be last.
  {CMN_ID(poster_13,IDB_TITLE),{352,160}},  
};
BitmapSpec *World::posters = World_posterPixmapBits;



// Although these values are not used directly by X11, we still need them
// for acting as a server.
static int default_backgroundIndices[] = {0,1,2,3,4,10,11,12,13};
static int default_outsideIndices[] = {0,1,2};
static int default_posterIndices[] = {0,1,2,3,4,5,6,7,8,9,10,11,12};

static int mayan_backgroundIndices[] = {5};
static int md1_backgroundIndices[] = {6};
static int md1_outsideIndices[] = {3};

static int md2_backgroundIndices[] = {7};
static int md2_outsideIndices[] = {4};  // reuse md4's outside

static int md3_backgroundIndices[] = {8};
static int md3_outsideIndices[] = {4};

static int md4_backgroundIndices[] = {9};
static int md4_outsideIndices[] = {5};

static Theme World_themes[W_THEME_NUM] = {
  /** default theme */
  {
    // Indices 0-6 MUST be here, in order, for the default theme.
    // Necessary to generate XPM files for UNIX correctly.
    {0,1,2,3,4,5,6}, /* blockIndices */
    default_backgroundIndices, 
    9, /* backgroundsNum */
    default_outsideIndices, 
    3, /* outsidesNum */
    // doorBase MUST be 0 for default theme.
    0, /* doorBase */
    // moverSquareBase MUST be 0 for default theme.
    0, /* moverSquareBase */
    // moverIndex MUST be 0 for default theme.
    0, /* moverIndex */
    default_posterIndices, /* posterIndices */
    14, /* postersNum */
  },

  /** Mayan **/
  {
    {0,7,8,3,4,9,6}, /* blockIndices */
    mayan_backgroundIndices,
    1, /* backgroundsNum */
    default_outsideIndices,
    3, /* outsidesNum */
    0, /* doorBase */
    0, /* moverSquareBase */
    0, /* moverIndex */
    default_posterIndices, /* posterIndices */
    14, /* postersNum */
  },

  /** MD 1 **/
  {
    {0,10,11,3,4,12,6}, /* blockIndices */
    md1_backgroundIndices, 
    1, /* backgroundsNum */
    md1_outsideIndices, 
    1, /* outsidesNum */
    2, /* doorBase */
    2, /* moverSquareBase */
    1, /* moverIndex */
    default_posterIndices, /* posterIndices */
    14, /* postersNum */
  },

  /** MD 2 **/
  {
    {0,13,14,3,4,15,6}, /* blockIndices */
    md2_backgroundIndices, 
    1, /* backgroundsNum */
    md2_outsideIndices, 
    1, /* outsidesNum */
    4, /* doorBase */
    4, /* moverSquareBase */
    2, /* moverIndex */
    default_posterIndices, /* posterIndices */
    14, /* postersNum */
  },

  /** MD 3 **/
  {
    {0,16,17,3,4,18,6}, /* blockIndices */
    md3_backgroundIndices, 
    1, /* backgroundsNum */
    md3_outsideIndices, 
    1, /* outsidesNum */
    6, /* doorBase */
    6, /* moverSquareBase */
    3, /* moverIndex */
    default_posterIndices, /* posterIndices */
    14, /* postersNum */
  },

  /** MD 4 **/
  {
    {0,19,20,3,4,21,6}, /* blockIndices */
    md4_backgroundIndices, 
    1, /* backgroundsNum */
    md4_outsideIndices, 
    1, /* outsidesNum */
    8, /* doorBase */
    8, /* moverSquareBase */
    4, /* moverIndex */
    default_posterIndices, /* posterIndices */
    14, /* postersNum */
  },
};



// Also in phys_mover.bitmaps, PhysMover::context.sizeMax
#define W_MOVER_SPEED 5
#define W_MOVER_PAUSE_TIME 30


// Doesn't change, always two wsquares.
const Size World::moverSize = {(2 * WSQUARE_WIDTH),WSQUARE_HEIGHT}; 



Boolean World::blockUseTransparent[W_BLOCKS_NUM] = {
  False,  // Wempty
  False,  // Wwall
  True,   // Wladder
  False,  // Woutside
  False,  // Wsquanch
  False,  // WupDown
  False,  // WtextSquare
};