X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=inline;f=src%2Fgame_em%2Finit.c;h=c99cb8e746384745e54f5f3c15ad22d4d29f03bf;hb=d1c8da9714013049b3bc9d0ddb29a705ac9a61d2;hp=d0ccc09442237c90d84769f8b5433924844ca717;hpb=3ff2e8a0b5c27b99a9920bdf5ed82bc41bf40181;p=rocksndiamonds.git diff --git a/src/game_em/init.c b/src/game_em/init.c index d0ccc094..c99cb8e7 100644 --- a/src/game_em/init.c +++ b/src/game_em/init.c @@ -5,65 +5,25 @@ #include "main_em.h" -#include - - -Bitmap *objBitmap; -Bitmap *sprBitmap; Bitmap *screenBitmap; -Pixmap objPixmap; -Pixmap sprPixmap; - -char play[SAMPLE_MAX]; -int play_x[SAMPLE_MAX]; -int play_y[SAMPLE_MAX]; -int play_element[SAMPLE_MAX]; - struct GlobalInfo_EM global_em_info; struct GameInfo_EM game_em; -char *progname; -char *arg_basedir; - -extern void tab_generate(); -extern void tab_generate_graphics_info_em(); - -int open_all(void) +void InitGfxBuffers_EM(void) { - Bitmap *emc_bitmaps[2]; - - SetBitmaps_EM(emc_bitmaps); - - objBitmap = emc_bitmaps[0]; - sprBitmap = emc_bitmaps[1]; - - return 0; -} - -void InitGfxBuffers_EM() -{ - ReCreateBitmap(&screenBitmap, MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY, - DEFAULT_DEPTH); + ReCreateBitmap(&screenBitmap, MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY); global_em_info.screenbuffer = screenBitmap; } -void em_open_all() +void em_open_all(void) { - /* pre-calculate some data */ - tab_generate(); - - progname = "emerald mine"; - - if (open_all() != 0) - Error(ERR_EXIT, "em_open_all(): open_all() failed"); - - /* after "open_all()", because we need the graphic bitmaps to be defined */ - tab_generate_graphics_info_em(); + InitGraphicInfo_EM(); - game_init_vars(); + game_init_random(); + game_init_cave_buffers(); } void em_close_all(void) @@ -72,9 +32,6 @@ void em_close_all(void) /* ---------------------------------------------------------------------- */ -extern int screen_x; -extern int screen_y; - void play_element_sound(int x, int y, int sample, int element) { PlayLevelSound_EM(x, y, element, sample); @@ -85,10 +42,6 @@ void play_sound(int x, int y, int sample) play_element_sound(x, y, sample, -1); } -void sound_play(void) -{ -} - unsigned int InitEngineRandom_EM(int seed) { if (seed == NEW_RANDOMIZE)