rnd-19981017-2
authorHolger Schemel <info@artsoft.org>
Sat, 17 Oct 1998 10:55:53 +0000 (12:55 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:31:13 +0000 (10:31 +0200)
src/game.c
src/main.c
src/main.h
src/tape.c
src/tape.h

index 4851f4aa7745267c5226d1012c325fba70dcac4f..b12c0f41dd8546b75348dab4c0a00de6dea3a6b8 100644 (file)
@@ -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; 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 */
 
@@ -3025,6 +3004,7 @@ void GameActions(byte player_action)
 
     /* TEST TEST TEST */
 
+
     if (recorded_player_action)
       actual_player_action = recorded_player_action[i];
 
@@ -3038,13 +3018,6 @@ void GameActions(byte player_action)
 
   ScrollScreen(NULL, SCROLL_GO_ON);
 
-  /*
-  if (tape.pausing || (tape.playing && !TapePlayDelay()))
-    return;
-  else if (tape.recording)
-    TapeRecordDelay();
-  */
-
   FrameCounter++;
   TimeFrames++;
 
index 48fcc7c71a96109c0b1dd8bd66d68fd021871aba..ceebfb85afb392fcb65434655ba6d92622bcb757 100644 (file)
@@ -85,7 +85,9 @@ int           lev_fieldx,lev_fieldy, scroll_x,scroll_y;
 int            FX = SX, FY = SY, ScrollStepSize = TILEX/8;
 int            ScreenMovDir = MV_NO_MOVING, ScreenMovPos = 0;
 int            ScreenGfxPos = 0;
-int            GameFrameDelay = GAME_FRAME_DELAY, MoveSpeed = 8;
+int            GameFrameDelay = GAME_FRAME_DELAY;
+int            FfwdFrameDelay = FFWD_FRAME_DELAY;
+int            MoveSpeed = 8;
 int            BX1 = 0, BY1 = 0, BX2 = SCR_FIELDX-1, BY2 = SCR_FIELDY-1;
 int            ZX,ZY, ExitX,ExitY;
 int            AllPlayersGone;
index f1b8671c7b9b1a5e292fefdade0936b3dc72fba0..7b9debaca77f20680ad0c35e467084e8e1bc9056 100644 (file)
@@ -386,7 +386,9 @@ extern int          lev_fieldx,lev_fieldy, scroll_x,scroll_y;
 
 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;
index 01eb1d41737a58d609c2c62bc68488cf5a64609c..9e8e39bc891acd6df9d205afa9844ca8251cabd6 100644 (file)
@@ -35,9 +35,9 @@ 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);
+  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);
   }
 }
 
index 6601aaaa90b67383778796fc3b35f7d8f0c16df4..31151088d2d04681ae011921aff9781824e590d4 100644 (file)
@@ -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);