1 /* 2000-08-10T18:03:54Z
3 * open X11 display and sound
16 char play[SAMPLE_MAX];
17 int play_x[SAMPLE_MAX];
18 int play_y[SAMPLE_MAX];
19 int play_element[SAMPLE_MAX];
21 struct GlobalInfo_EM global_em_info;
22 struct GameInfo_EM game_em;
27 extern void tab_generate();
28 extern void tab_generate_graphics_info_em();
32 Bitmap *emc_bitmaps[2];
34 SetBitmaps_EM(emc_bitmaps);
36 objBitmap = emc_bitmaps[0];
37 sprBitmap = emc_bitmaps[1];
42 void InitGfxBuffers_EM()
44 ReCreateBitmap(&screenBitmap, MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY,
47 global_em_info.screenbuffer = screenBitmap;
52 /* pre-calculate some data */
55 progname = "emerald mine";
58 Error(ERR_EXIT, "em_open_all(): open_all() failed");
60 /* after "open_all()", because we need the graphic bitmaps to be defined */
61 tab_generate_graphics_info_em();
66 void em_close_all(void)
70 /* ---------------------------------------------------------------------- */
75 void play_element_sound(int x, int y, int sample, int element)
77 PlayLevelSound_EM(x, y, element, sample);
80 void play_sound(int x, int y, int sample)
82 play_element_sound(x, y, sample, -1);
89 unsigned int InitEngineRandom_EM(int seed)
91 if (seed == NEW_RANDOMIZE)
93 int simple_rnd = GetSimpleRandom(1000);
96 for (i = 0; i < simple_rnd || RandomEM == NEW_RANDOMIZE; i++)
97 RandomEM = RandomEM * 129 + 1;
104 return (unsigned int) seed;