X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_em%2Fsynchro_3.c;h=bafc581f8f458d5174084b7bd7f0423f1b43a31c;hb=c0c5862d9ee59c70412b1c35e558101b109a8ec9;hp=d47741f9a7a53cc1078ba3eceaccb6d2afae930f;hpb=08cbfb7b24ed1170a91e5e9d6d683d6162f120f9;p=rocksndiamonds.git diff --git a/src/game_em/synchro_3.c b/src/game_em/synchro_3.c index d47741f9..bafc581f 100644 --- a/src/game_em/synchro_3.c +++ b/src/game_em/synchro_3.c @@ -5,27 +5,33 @@ * this should be spread over the frames for reduced cpu load. */ -#include "tile.h" -#include "level.h" -#include "sample.h" +#include "main_em.h" -#if defined(TARGET_X11) - void synchro_3(void) { - register unsigned int x; - register unsigned int y; - register unsigned int count; - register unsigned long random; + int x; + int y; + int count; + unsigned long random; /* update variables */ if (lev.score > 9999) lev.score = 9999; +#if 0 +#if 1 + if (lev.time_initial == 0) + lev.time++; + else if (lev.time > 0) + lev.time--; +#else if (lev.time) lev.time--; +#endif +#endif + if (lev.android_move_cnt-- == 0) lev.android_move_cnt = lev.android_move_time; if (lev.android_clone_cnt-- == 0) @@ -44,17 +50,20 @@ void synchro_3(void) if (lev.wonderwall_time && lev.wonderwall_state) lev.wonderwall_time--; - if (lev.time > 0 && lev.time <= 50 && lev.time % 5 == 0) - play[SAMPLE_time] = 1; +#if 0 + if (lev.time_initial > 0 && + lev.time > 0 && lev.time <= 50 && lev.time % 5 == 0 && setup.time_limit) + play_sound(-1, -1, SAMPLE_time); +#endif if (lev.wheel_cnt) - play[SAMPLE_wheel] = 1; + play_element_sound(lev.wheel_x, lev.wheel_y, SAMPLE_wheel, Xwheel); - /* grow ameuba */ + /* grow amoeba */ - random = Random; + random = RandomEM; - for (count = lev.ameuba_time; count--;) + for (count = lev.amoeba_time; count--;) { x = (random >> 10) % (WIDTH - 2); y = (random >> 20) % (HEIGHT - 2); @@ -68,17 +77,17 @@ void synchro_3(void) case Xsand: case Xplant: case Yplant: - if (tab_ameuba[Cave[y-1][x]] || - tab_ameuba[Cave[y][x+1]] || - tab_ameuba[Cave[y+1][x]] || - tab_ameuba[Cave[y][x-1]]) + if (tab_amoeba[Cave[y-1][x]] || + tab_amoeba[Cave[y][x+1]] || + tab_amoeba[Cave[y+1][x]] || + tab_amoeba[Cave[y][x-1]]) Cave[y][x] = Xdrip_eat; } random = random * 129 + 1; } - Random = random; + RandomEM = random; /* handle explosions */ @@ -119,5 +128,3 @@ void synchro_3(void) for (x = 0; x < WIDTH; x++) Next[y][x] = Cave[y][x]; } - -#endif