From 684ddd785539f8e049791894a3246db5dc020766 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 17 Oct 1998 12:55:53 +0200 Subject: [PATCH] rnd-19981017-2 --- src/game.c | 35 ++++------------------------------- src/main.c | 4 +++- src/main.h | 4 +++- src/tape.c | 39 ++++++++++++++++++++------------------- src/tape.h | 2 +- 5 files changed, 31 insertions(+), 53 deletions(-) diff --git a/src/game.c b/src/game.c index 4851f4aa..b12c0f41 100644 --- a/src/game.c +++ b/src/game.c @@ -2939,18 +2939,13 @@ void GameActions(byte player_action) long action_delay_value; int sieb_x = 0, sieb_y = 0; int i, x,y, element; - int *recorded_player_action; + byte *recorded_player_action; if (game_status != PLAYING) return; -#ifdef DEBUG - action_delay_value = - (tape.playing && tape.fast_forward ? FFWD_FRAME_DELAY : GameFrameDelay); -#else action_delay_value = - (tape.playing && tape.fast_forward ? FFWD_FRAME_DELAY : GAME_FRAME_DELAY); -#endif + (tape.playing && tape.fast_forward ? FfwdFrameDelay : GameFrameDelay); /* main game synchronization point */ WaitUntilDelayReached(&action_delay, action_delay_value); @@ -2986,32 +2981,16 @@ void GameActions(byte player_action) else if (tape.recording) TapeRecordDelay(); - - if (tape.playing) - recorded_player_action = TapePlayAction(); - else - recorded_player_action = NULL; + recorded_player_action = (tape.playing ? TapePlayAction() : NULL); if (network_playing) SendToServer_MovePlayer(player_action); for(i=0; itm_year%100) + 100*zeit2->tm_mon + zeit2->tm_mday; tape.random_seed = InitRND(NEW_RANDOMIZE); - DrawVideoDisplay(VIDEO_STATE_REC_ON,0); - DrawVideoDisplay(VIDEO_STATE_DATE_ON,tape.date); - DrawVideoDisplay(VIDEO_STATE_TIME_ON,0); + DrawVideoDisplay(VIDEO_STATE_REC_ON, 0); + DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date); + DrawVideoDisplay(VIDEO_STATE_TIME_ON, 0); } void TapeStopRecording() @@ -55,7 +55,7 @@ void TapeStopRecording() tape.length_seconds = GetTapeLength(); tape.recording = FALSE; tape.pausing = FALSE; - DrawVideoDisplay(VIDEO_STATE_REC_OFF,0); + DrawVideoDisplay(VIDEO_STATE_REC_OFF, 0); } void TapeRecordAction(byte joy[MAX_PLAYERS]) @@ -65,7 +65,7 @@ void TapeRecordAction(byte joy[MAX_PLAYERS]) if (!tape.recording || tape.pausing) return; - if (tape.counter>=MAX_TAPELEN-1) + if (tape.counter >= MAX_TAPELEN-1) { TapeStopRecording(); return; @@ -85,7 +85,7 @@ void TapeRecordDelay() if (!tape.recording || tape.pausing) return; - if (tape.counter>=MAX_TAPELEN) + if (tape.counter >= MAX_TAPELEN) { TapeStopRecording(); return; @@ -111,9 +111,10 @@ void TapeTogglePause() tape.pausing = !tape.pausing; tape.fast_forward = FALSE; tape.pause_before_death = FALSE; - DrawVideoDisplay(tape.pausing ? - VIDEO_STATE_PAUSE_ON : - VIDEO_STATE_PAUSE_OFF,0); + DrawVideoDisplay((tape.pausing ? + VIDEO_STATE_PAUSE_ON : + VIDEO_STATE_PAUSE_OFF), + 0); } void TapeStartPlaying() @@ -133,9 +134,9 @@ void TapeStartPlaying() tape.fast_forward = FALSE; InitRND(tape.random_seed); - DrawVideoDisplay(VIDEO_STATE_PLAY_ON,0); - DrawVideoDisplay(VIDEO_STATE_DATE_ON,tape.date); - DrawVideoDisplay(VIDEO_STATE_TIME_ON,0); + DrawVideoDisplay(VIDEO_STATE_PLAY_ON, 0); + DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date); + DrawVideoDisplay(VIDEO_STATE_TIME_ON, 0); } void TapeStopPlaying() @@ -145,18 +146,18 @@ void TapeStopPlaying() tape.playing = FALSE; tape.pausing = FALSE; - DrawVideoDisplay(VIDEO_STATE_PLAY_OFF,0); + DrawVideoDisplay(VIDEO_STATE_PLAY_OFF, 0); } -int *TapePlayAction() +byte *TapePlayAction() { - static int joy[MAX_PLAYERS]; + static byte joy[MAX_PLAYERS]; int i; if (!tape.playing || tape.pausing) return(NULL); - if (tape.counter>=tape.length) + if (tape.counter >= tape.length) { TapeStop(); return(NULL); @@ -198,7 +199,7 @@ boolean TapePlayDelay() } } - if (tape.counter>=tape.length) + if (tape.counter >= tape.length) { TapeStop(); return(TRUE); @@ -221,8 +222,8 @@ void TapeStop() DrawVideoDisplay(VIDEO_STATE_PAUSE_OFF,0); if (tape.date && tape.length) { - DrawVideoDisplay(VIDEO_STATE_DATE_ON,tape.date); - DrawVideoDisplay(VIDEO_STATE_TIME_ON,tape.length_seconds); + DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date); + DrawVideoDisplay(VIDEO_STATE_TIME_ON, tape.length_seconds); } } diff --git a/src/tape.h b/src/tape.h index 6601aaaa..31151088 100644 --- a/src/tape.h +++ b/src/tape.h @@ -25,7 +25,7 @@ void TapeRecordDelay(void); void TapeTogglePause(void); void TapeStartPlaying(void); void TapeStopPlaying(void); -int *TapePlayAction(void); +byte *TapePlayAction(void); boolean TapePlayDelay(void); void TapeStop(void); void TapeErase(void); -- 2.34.1