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);
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; i<MAX_PLAYERS; i++)
{
- /*
- int actual_player_action =
- (options.network ? network_player_action[i] : player_action);
- */
-
int actual_player_action =
(network_playing ? network_player_action[i] : player_action);
- /*
- int actual_player_action = network_player_action[i];
- */
-
- /*
- int actual_player_action = player_action;
- */
/* TEST TEST TEST */
/* TEST TEST TEST */
+
if (recorded_player_action)
actual_player_action = recorded_player_action[i];
ScrollScreen(NULL, SCROLL_GO_ON);
- /*
- if (tape.pausing || (tape.playing && !TapePlayDelay()))
- return;
- else if (tape.recording)
- TapeRecordDelay();
- */
-
FrameCounter++;
TimeFrames++;
extern int FX,FY, ScrollStepSize;
extern int ScreenMovDir, ScreenMovPos, ScreenGfxPos;
-extern int GameFrameDelay, MoveSpeed;
+extern int GameFrameDelay;
+extern int FfwdFrameDelay;
+extern int MoveSpeed;
extern int BX1,BY1, BX2,BY2;
extern int ZX,ZY, ExitX,ExitY;
extern int AllPlayersGone;
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);
+ 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),
+ 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);
}
}
- 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);
}
}