3 * set everything up and close everything down
11 struct GlobalInfo_EM global_em_info;
12 struct GameInfo_EM game_em;
14 void InitGfxBuffers_EM(void)
16 ReCreateBitmap(&screenBitmap, MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY);
18 global_em_info.screenbuffer = screenBitmap;
21 void game_init_random(void)
23 game_em.random = 1684108901; /* what a nice seed */
26 void game_init_cave_buffers(void)
30 for (x = 0; x < CAVE_BUFFER_WIDTH; x++)
32 for (y = 0; y < CAVE_BUFFER_HEIGHT; y++)
34 lev.cavebuf[x][y] = Zborder;
35 lev.nextbuf[x][y] = Zborder;
36 lev.drawbuf[x][y] = Zborder;
37 lev.boombuf[x][y] = Xblank;
40 lev.cavecol[x] = lev.cavebuf[x];
41 lev.nextcol[x] = lev.nextbuf[x];
42 lev.drawcol[x] = lev.drawbuf[x];
43 lev.boomcol[x] = lev.boombuf[x];
46 lev.cave = lev.cavecol;
47 lev.next = lev.nextcol;
48 lev.draw = lev.drawcol;
49 lev.boom = lev.boomcol;
52 void em_open_all(void)
57 game_init_cave_buffers();
60 void em_close_all(void)
64 void play_element_sound(int x, int y, int sample, int element)
66 PlayLevelSound_EM(CAVE_POS_X(x), CAVE_POS_Y(y), element, sample);
69 void play_sound(int x, int y, int sample)
71 play_element_sound(x, y, sample, -1);
74 unsigned int InitEngineRandom_EM(int seed)
76 if (seed == NEW_RANDOMIZE)
78 int simple_rnd = GetSimpleRandom(1000);
81 for (i = 0; i < simple_rnd || game_em.random == NEW_RANDOMIZE; i++)
82 game_em.random = game_em.random * 129 + 1;
84 seed = game_em.random;
87 game_em.random = seed;
89 return (unsigned int)seed;