{
time_t zeit1 = time(NULL);
struct tm *zeit2 = localtime(&zeit1);
+ int i;
if (!TAPE_IS_STOPPED(tape))
TapeStop();
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_PLAYERS; i++)
+ tape.player_participates[i] = FALSE;
+
+ DrawVideoDisplay(VIDEO_STATE_REC_ON, 0);
+ DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
+ DrawVideoDisplay(VIDEO_STATE_TIME_ON, 0);
}
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])
if (!tape.recording || tape.pausing)
return;
- if (tape.counter>=MAX_TAPELEN-1)
+ if (tape.counter >= MAX_TAPELEN-1)
{
TapeStopRecording();
return;
if (!tape.recording || tape.pausing)
return;
- if (tape.counter>=MAX_TAPELEN)
+ if (tape.counter >= MAX_TAPELEN)
{
TapeStopRecording();
return;
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) | VIDEO_STATE_PBEND_OFF,
+ 0);
}
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()
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);
for(i=0; i<MAX_PLAYERS; i++)
joy[i] = tape.pos[tape.counter-1].action[i];
-
- return(joy);
+ }
+ else
+ {
+ for(i=0; i<MAX_PLAYERS; i++)
+ joy[i] = 0;
}
- return(NULL);
+ return(joy);
}
boolean TapePlayDelay()
if (tape.pause_before_death) /* STOP 10s BEFORE PLAYER GETS KILLED... */
{
- if (!(FrameCounter % 5))
+ if (!(FrameCounter % 20))
{
- if (2*(FrameCounter/10) == FrameCounter/5)
- DrawVideoDisplay(VIDEO_STATE_PAUSE_ON, VIDEO_DISPLAY_LABEL_ONLY);
+ if ((FrameCounter / 20) % 2)
+ DrawVideoDisplay(VIDEO_STATE_PBEND_ON, VIDEO_DISPLAY_LABEL_ONLY);
else
- DrawVideoDisplay(VIDEO_STATE_PAUSE_OFF, VIDEO_DISPLAY_LABEL_ONLY);
+ DrawVideoDisplay(VIDEO_STATE_PBEND_OFF, VIDEO_DISPLAY_LABEL_ONLY);
}
if (level.time-TimeLeft > tape.length_seconds - PAUSE_SECONDS_BEFORE_DEATH)
}
}
- if (tape.counter>=tape.length)
+ if (tape.counter >= tape.length)
{
TapeStop();
return(TRUE);
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);
}
}