X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftape.c;h=2cc0b39962eba632c9606af412956264e3a64f64;hb=34efaa3925a28cb95ecb05bf2c693c16f6edfe2f;hp=53ce1d9ed3cee0a7f654f7b01486526006670071;hpb=823bddb0d9cc63ddda17a2cd20266aa3b82bde38;p=rocksndiamonds.git diff --git a/src/tape.c b/src/tape.c index 53ce1d9e..2cc0b399 100644 --- a/src/tape.c +++ b/src/tape.c @@ -20,6 +20,7 @@ void TapeStartRecording() { time_t zeit1 = time(NULL); struct tm *zeit2 = localtime(&zeit1); + int i; if (!TAPE_IS_STOPPED(tape)) TapeStop(); @@ -35,9 +36,12 @@ void TapeStartRecording() tape.date = 10000*(zeit2->tm_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); + for(i=0; i=MAX_TAPELEN-1) + if (tape.counter >= MAX_TAPELEN-1) { TapeStopRecording(); return; } for(i=0; i=MAX_TAPELEN) + if (tape.counter >= MAX_TAPELEN) { TapeStopRecording(); return; @@ -96,7 +100,7 @@ void TapeRecordDelay() if (tape.pos[tape.counter].delay >= 255) { for(i=0; i=tape.length) + if (tape.counter >= tape.length) { TapeStop(); return(NULL); @@ -168,27 +173,30 @@ int *TapePlayAction() tape.counter++; for(i=0; i tape.length_seconds - PAUSE_SECONDS_BEFORE_DEATH) @@ -198,7 +206,7 @@ BOOL TapePlayDelay() } } - if (tape.counter>=tape.length) + if (tape.counter >= tape.length) { TapeStop(); return(TRUE); @@ -221,8 +229,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); } } @@ -242,5 +250,5 @@ unsigned int GetTapeLength() for(i=0;i