X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=ed616df1d60504fc5a5245d0951484ae2d6afec8;hb=c42862bb754d7a8b1ff476887669650845f7570e;hp=9211c573411b2121b8897fa377786898cdfc180d;hpb=9c43bda51b4cc085fe9c2770c1e45fbce104412a;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index 9211c573..ed616df1 100644 --- a/src/screens.c +++ b/src/screens.c @@ -501,13 +501,9 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) else #endif { -#if 1 - em_main(); -#else game_status = GAME_MODE_PLAYING; StopAnimation(); InitGame(); -#endif } } else if (y == 6) @@ -1961,6 +1957,7 @@ static struct TokenInfo setup_info_editor[] = #endif { TYPE_SWITCH, &setup.editor.el_boulderdash, "BoulderDash:" }, { TYPE_SWITCH, &setup.editor.el_emerald_mine, "Emerald Mine:" }, + { TYPE_SWITCH, &setup.editor.el_emerald_mine_club,"E.M. Club:" }, { TYPE_SWITCH, &setup.editor.el_more, "More:" }, { TYPE_SWITCH, &setup.editor.el_sokoban, "Sokoban:" }, { TYPE_SWITCH, &setup.editor.el_supaplex, "Supaplex:" }, @@ -2948,17 +2945,76 @@ void HandleGameActions() if (game_status != GAME_MODE_PLAYING) return; - if (local_player->LevelSolved) - GameWon(); + /* !!! FIX THIS (START) !!! */ + if (level.game_engine_type == GAME_ENGINE_TYPE_EM) + { + byte *recorded_player_action; + byte summarized_player_action = 0; + byte tape_action[MAX_PLAYERS]; + int i; + + if (tape.pausing) + return; - if (AllPlayersGone && !TAPE_IS_STOPPED(tape)) - TapeStop(); + recorded_player_action = (tape.playing ? TapePlayAction() : NULL); - GameActions(); - BackToFront(); + for (i = 0; i < MAX_PLAYERS; i++) + { + summarized_player_action |= stored_player[i].action; + + if (!network_playing) + stored_player[i].effective_action = stored_player[i].action; + } + + if (!options.network && !setup.team_mode) + local_player->effective_action = summarized_player_action; + + if (recorded_player_action != NULL) + for (i = 0; i < MAX_PLAYERS; i++) + stored_player[i].effective_action = recorded_player_action[i]; + + for (i = 0; i < MAX_PLAYERS; i++) + { + tape_action[i] = stored_player[i].effective_action; + + /* !!! (this does not happen in the EM engine) !!! */ + if (tape.recording && tape_action[i] && !tape.player_participates[i]) + tape.player_participates[i] = TRUE; /* player just appeared from CE */ + } - if (tape.auto_play && !tape.playing) - AutoPlayTape(); /* continue automatically playing next tape */ + /* only save actions from input devices, but not programmed actions */ + if (tape.recording) + TapeRecordAction(tape_action); + + GameActions_EM(local_player->effective_action); + + if (TimeFrames >= FRAMES_PER_SECOND) + { + TimeFrames = 0; + TapeTime++; + + if (tape.recording || tape.playing) + DrawVideoDisplay(VIDEO_STATE_TIME_ON, TapeTime); + } + + TimeFrames++; + + BackToFront(); + } + else + { + if (local_player->LevelSolved) + GameWon(); + + if (AllPlayersGone && !TAPE_IS_STOPPED(tape)) + TapeStop(); + + GameActions(); + BackToFront(); + + if (tape.auto_play && !tape.playing) + AutoPlayTape(); /* continue automatically playing next tape */ + } } /* ---------- new screen button stuff -------------------------------------- */