X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fscreens.c;h=b1b57242660171d5c6df975fa3b35a667699f624;hb=f47cd4b09952aaf95d16542f6b53f2d8bf9e1d7d;hp=c4aa62dfb8e1d26538c7668a818a0298c83817ca;hpb=bf1e4db1ffa9a313b8d1b68e55633ace682fef96;p=rocksndiamonds.git diff --git a/src/screens.c b/src/screens.c index c4aa62df..b1b57242 100644 --- a/src/screens.c +++ b/src/screens.c @@ -270,7 +270,7 @@ void DrawMainMenu() leveldir_last_valid = leveldir_current; /* needed if last screen (level choice) changed graphics, sounds or music */ - ReloadCustomArtwork(); + ReloadCustomArtwork(0); #ifdef TARGET_SDL SetDrawtoField(DRAW_BACKBUFFER); @@ -495,7 +495,7 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) if (setup.autorecord) TapeStartRecording(); -#if defined(PLATFORM_UNIX) +#if defined(NETWORK_AVALIABLE) if (options.network) SendToServer_StartPlaying(); else @@ -1869,7 +1869,7 @@ static void execSetupArtwork() setup.music_set = artwork.mus_current->identifier; /* needed if last screen (setup choice) changed graphics, sounds or music */ - ReloadCustomArtwork(); + ReloadCustomArtwork(0); /* needed for displaying artwork name instead of artwork identifier */ graphics_set_name = artwork.gfx_current->name; @@ -2409,6 +2409,8 @@ static void drawPlayerSetupInputInfo(int player_nr) DrawText(mSX+11*32, mSY+2*32, int2str(player_nr +1, 1), FONT_INPUT_1_ACTIVE); #if 1 + ClearRectangleOnBackground(drawto, mSX + 8 * TILEX, mSY + 2 * TILEY, + TILEX, TILEY); DrawGraphicThruMaskExt(drawto, mSX + 8 * TILEX, mSY + 2 * TILEY, PLAYER_NR_GFX(IMG_PLAYER_1, player_nr), 0); #else @@ -2942,17 +2944,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 */ + } + + /* only save actions from input devices, but not programmed actions */ + if (tape.recording) + TapeRecordAction(tape_action); + + GameActions_EM(local_player->effective_action); - if (tape.auto_play && !tape.playing) - AutoPlayTape(); /* continue automatically playing next tape */ + 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 -------------------------------------- */