X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=62c70419496359931596b6111216080ebed8c4db;hb=7d171d862abdecced79f60535b49a686386cefe1;hp=1d2396b025837c2238432b4b4c30261876cec9e3;hpb=8f52363344f59d3bbe17c941b1f84fb41fd105ce;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index 1d2396b0..62c70419 100644 --- a/src/game.c +++ b/src/game.c @@ -2060,32 +2060,27 @@ void InitGame() CloseDoor(DOOR_CLOSE_1); -#if 1 - - if (em_main_init_game(level_nr) != 0) + /* !!! FIX THIS (START) !!! */ + if (level.game_engine_type == GAME_ENGINE_TYPE_EM) { - game_status = GAME_MODE_MAIN; - DrawMainMenu(); - - return; + InitGameEngine_EM(); } + else + { + DrawLevel(); + DrawAllPlayers(); -#else - - DrawLevel(); - DrawAllPlayers(); - - /* after drawing the level, correct some elements */ - if (game.timegate_time_left == 0) - CloseAllOpenTimegates(); - - if (setup.soft_scrolling) - BlitBitmap(fieldbuffer, backbuffer, FX, FY, SXSIZE, SYSIZE, SX, SY); + /* after drawing the level, correct some elements */ + if (game.timegate_time_left == 0) + CloseAllOpenTimegates(); - redraw_mask |= REDRAW_FROM_BACKBUFFER; - FadeToFront(); + if (setup.soft_scrolling) + BlitBitmap(fieldbuffer, backbuffer, FX, FY, SXSIZE, SYSIZE, SX, SY); -#endif + redraw_mask |= REDRAW_FROM_BACKBUFFER; + FadeToFront(); + } + /* !!! FIX THIS (END) !!! */ /* copy default game door content to main double buffer */ BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto, @@ -8534,8 +8529,8 @@ void AdvanceFrameAndPlayerCounters(int player_nr) void GameActions() { - static unsigned long action_delay = 0; - unsigned long action_delay_value; + static unsigned long game_frame_delay = 0; + unsigned long game_frame_delay_value; int magic_wall_x = 0, magic_wall_y = 0; int i, x, y, element, graphic; byte *recorded_player_action; @@ -8547,15 +8542,15 @@ void GameActions() if (game_status != GAME_MODE_PLAYING) return; - action_delay_value = + game_frame_delay_value = (tape.playing && tape.fast_forward ? FfwdFrameDelay : GameFrameDelay); if (tape.playing && tape.warp_forward && !tape.pausing) - action_delay_value = 0; + game_frame_delay_value = 0; /* ---------- main game synchronization point ---------- */ - WaitUntilDelayReached(&action_delay, action_delay_value); + WaitUntilDelayReached(&game_frame_delay, game_frame_delay_value); if (network_playing && !network_player_action_received) { @@ -8594,6 +8589,7 @@ void GameActions() recorded_player_action = (tape.playing ? TapePlayAction() : NULL); #if 1 + /* !!! CHECK THIS (tape.pausing is always FALSE here!) !!! */ if (recorded_player_action == NULL && tape.pausing) return; #endif @@ -12398,6 +12394,11 @@ static void PlayLevelMusic() PlayMusic(MAP_NOCONF_MUSIC(level_nr)); /* from music dir */ } +void PlayLevelSound_EM(int x, int y, int element, int action) +{ + PlayLevelSoundElementAction(x, y, element, action); +} + void RaiseScore(int value) { local_player->score += value;