rnd-20050314-1-src
[rocksndiamonds.git] / src / screens.c
index 5f93823be4ef19aba7c5ca36d33d747a6ffa4bcf..26983cdb22c788c00c9e1534302f07bde8b7de69 100644 (file)
@@ -346,6 +346,7 @@ void DrawMainMenu()
   OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2);
 }
 
+#if 0
 static void gotoTopLevelDir()
 {
   /* move upwards to top level directory */
@@ -374,6 +375,7 @@ static void gotoTopLevelDir()
     leveldir_current = leveldir_current->node_parent;
   }
 }
+#endif
 
 void HandleMainMenu(int mx, int my, int dx, int dy, int button)
 {
@@ -3030,6 +3032,29 @@ void HandleGameActions()
       TimeFrames = 0;
       TapeTime++;
 
+      if (!level.use_step_counter)
+      {
+       TimePlayed++;
+
+       if (TimeLeft > 0)
+       {
+         TimeLeft--;
+
+         if (TimeLeft <= 10 && setup.time_limit)
+           PlaySoundStereo(SND_GAME_RUNNING_OUT_OF_TIME, SOUND_MIDDLE);
+
+         DrawGameValue_Time(TimeLeft);
+
+         if (!TimeLeft && setup.time_limit)
+           level.native_em_level->lev->killed_out_of_time = TRUE;
+       }
+       else if (level.time == 0 && level.native_em_level->lev->home > 0)
+         DrawGameValue_Time(TimePlayed);
+
+       level.native_em_level->lev->time =
+         (level.time == 0 ? TimePlayed : TimeLeft);
+      }
+
       if (tape.recording || tape.playing)
        DrawVideoDisplay(VIDEO_STATE_TIME_ON, TapeTime);
     }