X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Ftape.c;h=2cc0b39962eba632c9606af412956264e3a64f64;hp=33713069c4da4302fe7bddfe685a2ef27612b0ac;hb=50c422d96b6da2c0412b6bd3763e9d1a029a6014;hpb=b7d31643c9c84104fb3ebef778e545928610ff65 diff --git a/src/tape.c b/src/tape.c index 33713069..2cc0b399 100644 --- a/src/tape.c +++ b/src/tape.c @@ -1,12 +1,12 @@ /*********************************************************** * Rocks'n'Diamonds -- McDuffin Strikes Back! * *----------------------------------------------------------* -* ©1997 Artsoft Development * -* Holger Schemel * -* 33604 Bielefeld * -* Telefon: (0521) 290471 * -* eMail: aeglos@valinor.owl.de * -* aeglos@uni-paderborn.de * +* (c) 1995-98 Artsoft Entertainment * +* Holger Schemel * +* Oststrasse 11a * +* 33604 Bielefeld * +* phone: ++49 +521 290471 * +* email: aeglos@valinor.owl.de * *----------------------------------------------------------* * 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,50 +36,60 @@ 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; } - if (joy) - { - tape.pos[tape.counter].joystickdata = joy; - tape.counter++; - tape.pos[tape.counter].delay = 0; - } + for(i=0; i=MAX_TAPELEN) + if (tape.counter >= MAX_TAPELEN) { TapeStopRecording(); return; @@ -86,9 +97,11 @@ void TapeRecordDelay() tape.pos[tape.counter].delay++; - if (tape.pos[tape.counter].delay>=255) + if (tape.pos[tape.counter].delay >= 255) { - tape.pos[tape.counter].joystickdata = 0; + for(i=0; i=tape.length) + if (tape.counter >= tape.length) { TapeStop(); - return(0); + return(NULL); } if (tape.delay_played == tape.pos[tape.counter].delay) { tape.delay_played = 0; tape.counter++; - return(tape.pos[tape.counter-1].joystickdata); + + for(i=0; i tape.length_seconds - PAUSE_SECONDS_BEFORE_DEATH) @@ -182,7 +206,7 @@ BOOL TapePlayDelay() } } - if (tape.counter>=tape.length) + if (tape.counter >= tape.length) { TapeStop(); return(TRUE); @@ -205,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); } } @@ -226,5 +250,5 @@ unsigned int GetTapeLength() for(i=0;i