rnd-19990205-1
[rocksndiamonds.git] / src / screens.c
index 109b1283b9cadc833b9d5bc21d37f71a8ceb85c7..a27dcba819af1910a6d8a9afc81a167fb7d6059b 100644 (file)
@@ -58,6 +58,8 @@ void DrawMainMenu()
   int i;
   char *name_text = (!options.network && setup.team_mode ? "Team:" : "Name:");
 
+  UnmapAllGadgets();
+  FadeSounds();
   XAutoRepeatOn(display);
 
   /* needed if last screen was the playing screen, invoked from level editor */
@@ -68,10 +70,9 @@ void DrawMainMenu()
     return;
   }
 
-  /* needed if last screen was the level editor */
-  UnmapLevelEditorGadgets();
+  /* map gadgets for main menu screen */
+  MapTapeButtons();
 
-  FadeSounds();
   GetPlayerConfig();
   LoadLevel(level_nr);
 
@@ -675,6 +676,7 @@ void DrawHelpScreen()
 {
   int i;
 
+  UnmapAllGadgets();
   CloseDoor(DOOR_CLOSE_2);
 
   for(i=0;i<MAX_HELPSCREEN_ELS;i++)
@@ -794,6 +796,7 @@ void HandleTypeName(int newxpos, KeySym key)
 
 void DrawChooseLevel()
 {
+  UnmapAllGadgets();
   CloseDoor(DOOR_CLOSE_2);
 
   FadeToFront();
@@ -813,7 +816,8 @@ static void drawChooseLevelList(int first_entry, int num_page_entries)
   {
     strncpy(buffer, leveldir[first_entry + i].name , SCR_FIELDX - 1);
     buffer[SCR_FIELDX - 1] = '\0';
-    DrawText(SX + 32, SY + (i + 2) * 32, buffer, FS_BIG, FC_YELLOW);
+    DrawText(SX + 32, SY + (i + 2) * 32, buffer,
+            FS_BIG, leveldir[first_entry + i].color);
     DrawGraphic(0, i + 2, GFX_KUGEL_BLAU);
   }
 
@@ -826,10 +830,17 @@ static void drawChooseLevelList(int first_entry, int num_page_entries)
 
 static void drawChooseLevelInfo(int leveldir_nr)
 {
+  int x, last_redraw_mask = redraw_mask;
+
   XFillRectangle(display, drawto, gc, SX + 32, SY + 32, SXSIZE - 32, 32);
   DrawTextFCentered(40, FC_RED, "%3d levels (%s)",
                    leveldir[leveldir_nr].levels,
                    leveldir[leveldir_nr].readonly ? "readonly" : "writable");
+
+  /* let BackToFront() redraw only what is needed */
+  redraw_mask = last_redraw_mask | REDRAW_TILES;
+  for (x=0; x<SCR_FIELDX; x++)
+    MarkTileDirty(x, 1);
 }
 
 void HandleChooseLevel(int mx, int my, int dx, int dy, int button)
@@ -962,6 +973,7 @@ void DrawHallOfFame(int highlight_position)
 {
   int i;
 
+  UnmapAllGadgets();
   CloseDoor(DOOR_CLOSE_2);
 
   if (highlight_position < 0) 
@@ -1029,9 +1041,11 @@ void DrawSetupScreen()
     { NULL,                    "Save and exit" }
   };
 
+  UnmapAllGadgets();
   CloseDoor(DOOR_CLOSE_2);
   ClearWindow();
-  DrawText(SX+16, SY+16, "SETUP",FS_BIG,FC_YELLOW);
+
+  DrawText(SX + 16, SY + 16, "SETUP",FS_BIG,FC_YELLOW);
 
   for(i=SETUP_SCREEN_POS_START;i<=SETUP_SCREEN_POS_END;i++)
   {
@@ -2112,6 +2126,11 @@ void HandleGameActions()
 
 void HandleVideoButtons(int mx, int my, int button)
 {
+  return;
+
+
+
+
   if (game_status != MAINMENU && game_status != PLAYING)
     return;
 
@@ -2216,6 +2235,13 @@ void HandleVideoButtons(int mx, int my, int button)
 
 void HandleSoundButtons(int mx, int my, int button)
 {
+
+
+
+  return;
+
+
+
   if (game_status != PLAYING)
     return;
 
@@ -2277,6 +2303,13 @@ void HandleSoundButtons(int mx, int my, int button)
 
 void HandleGameButtons(int mx, int my, int button)
 {
+
+
+
+  return;
+
+
+
   if (game_status != PLAYING)
     return;