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);
46 global_em_info.screenbuffer = screenBitmap;
51 /* pre-calculate some data */
54 progname = "emerald mine";
57 Error(ERR_EXIT, "em_open_all(): open_all() failed");
59 /* after "open_all()", because we need the graphic bitmaps to be defined */
60 tab_generate_graphics_info_em();
65 void em_close_all(void)
69 /* ---------------------------------------------------------------------- */
74 void play_element_sound(int x, int y, int sample, int element)
76 PlayLevelSound_EM(x, y, element, sample);
79 void play_sound(int x, int y, int sample)
81 play_element_sound(x, y, sample, -1);
88 unsigned int InitEngineRandom_EM(int seed)
90 if (seed == NEW_RANDOMIZE)
92 int simple_rnd = GetSimpleRandom(1000);
95 for (i = 0; i < simple_rnd || RandomEM == NEW_RANDOMIZE; i++)
96 RandomEM = RandomEM * 129 + 1;
103 return (unsigned int) seed;