X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_em%2Finit.c;h=2033b2dbd49f3873384f61daa7527e29fb77e02f;hb=61c3da024802ecc0268bab42d7499fc0346e4fd3;hp=a756d24a1974aaf99b3353141f3704fc2f036622;hpb=1fcb3ddbb8404effdcfa5ebbd53d3ff5009260f6;p=rocksndiamonds.git diff --git a/src/game_em/init.c b/src/game_em/init.c index a756d24a..2033b2db 100644 --- a/src/game_em/init.c +++ b/src/game_em/init.c @@ -46,7 +46,7 @@ struct GameInfo_EM game_em; static int sound_pid = -1; int sound_pipe[2] = { -1, -1 }; /* for communication */ short *sound_data[SAMPLE_MAX]; /* pointer to sound data */ -long sound_length[SAMPLE_MAX]; /* length of sound data */ +int sound_length[SAMPLE_MAX]; /* length of sound data */ static const char *sound_names[SAMPLE_MAX] = { @@ -154,10 +154,15 @@ int open_all(void) sprmaskBitmap = emc_bitmaps[1]->clip_mask; #endif +#if 0 + printf("::: CreateBitmap: %d, %d => %d\n", + MAX_BUF_XSIZE, TILEX, MAX_BUF_XSIZE * TILEX); + screenBitmap = CreateBitmap(MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY, DEFAULT_DEPTH); global_em_info.screenbuffer = screenBitmap; +#endif #endif @@ -245,6 +250,33 @@ int open_all(void) return(0); } +void InitGfxBuffers_EM() +{ + +#if 1 + +#if 0 + printf("::: InitGfxBuffers_EM: %d, %d => %d\n", + MAX_BUF_XSIZE, TILEX, MAX_BUF_XSIZE * TILEX); +#endif + + ReCreateBitmap(&screenBitmap, MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY, + DEFAULT_DEPTH); + + global_em_info.screenbuffer = screenBitmap; + +#else + + printf("::: CreateBitmap: %d, %d => %d\n", + MAX_BUF_XSIZE, TILEX, MAX_BUF_XSIZE * TILEX); + + screenBitmap = CreateBitmap(MAX_BUF_XSIZE * TILEX, MAX_BUF_YSIZE * TILEY, + DEFAULT_DEPTH); + + global_em_info.screenbuffer = screenBitmap; +#endif +} + void em_open_all() { /* pre-calculate some data */ @@ -366,14 +398,14 @@ void sound_play(void) #endif - memset(play, 0, sizeof(play)); + clear_mem(play, sizeof(play)); } -unsigned int InitEngineRND_EM(long seed) +unsigned int InitEngineRandom_EM(int seed) { if (seed == NEW_RANDOMIZE) { - int simple_rnd = SimpleRND(1000); + int simple_rnd = GetSimpleRandom(1000); int i; for (i = 0; i < simple_rnd || RandomEM == NEW_RANDOMIZE; i++)