rnd-20060506-2-src
authorHolger Schemel <info@artsoft.org>
Sat, 6 May 2006 19:16:31 +0000 (21:16 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:51:45 +0000 (10:51 +0200)
* added down position of switchgate switch to the level editor
  and allowed the use of both switch positions at the same time
* changed use of "Insert" and "Delete" keys to navigate element list in
  level editor to start of previous or next cascading block of elements

ChangeLog
src/conftime.h
src/editor.c
src/game.c
src/screens.c

index ea35d755ad189a2b7ca5795fe707418ca63297ad..2413f1612d277433be735c36ca8d5c4f4d1a6f56 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-05-06
        * added some missing element descriptions to the level editor
+       * added down position of switchgate switch to the level editor
+         and allowed the use of both switch positions at the same time
+       * changed use of "Insert" and "Delete" keys to navigate element list in
+         level editor to start of previous or next cascading block of elements
 
 2006-05-05
        * added the possibility to view the title screen to the info screen menu
index 9d39b8fcb75a749f7d06cebd41e4bf725d323688..3cbd88e28554cb639cd3f678ac13c18610de69f6 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-05-06 16:04]"
+#define COMPILE_DATE_STRING "[2006-05-06 21:11]"
index 7ac0d1daff97860cf80639995122518b017abaae..0ac44626cfb3b3d717bf1ab42706f8656634f186 100644 (file)
@@ -3671,7 +3671,7 @@ static int editor_el_diamond_caves[] =
   EL_SWITCHGATE_OPEN,
   EL_SWITCHGATE_CLOSED,
   EL_SWITCHGATE_SWITCH_UP,
-  EL_EMPTY,
+  EL_SWITCHGATE_SWITCH_DOWN,
 
   EL_ENVELOPE_1,
   EL_ENVELOPE_2,
@@ -9933,7 +9933,9 @@ void HandleLevelEditorKeyInput(Key key)
   }
   else if (button_status == MB_RELEASED)
   {
-    int i, id = GADGET_ID_NONE;
+    int id = GADGET_ID_NONE;
+    int new_element_shift = element_shift;
+    int i;
 
     switch (key)
     {
@@ -9973,6 +9975,32 @@ void HandleLevelEditorKeyInput(Key key)
 
       case KSYM_Insert:
       case KSYM_Delete:
+#if 1
+       /* IS_EDITOR_CASCADE */
+       for (i = 0; i < num_editor_elements; i++)
+       {
+         if ((key == KSYM_Insert && i == element_shift) ||
+             (key == KSYM_Delete && new_element_shift > element_shift))
+           break;
+
+         if (IS_EDITOR_CASCADE(editor_elements[i]))
+           new_element_shift = i;
+       }
+
+       if (i < num_editor_elements)
+         element_shift = new_element_shift;
+
+       if (element_shift > num_editor_elements - ED_NUM_ELEMENTLIST_BUTTONS)
+         element_shift = num_editor_elements - ED_NUM_ELEMENTLIST_BUTTONS;
+
+       ModifyGadget(level_editor_gadget[GADGET_ID_SCROLL_LIST_VERTICAL],
+                    GDI_SCROLLBAR_ITEM_POSITION,
+                    element_shift / ED_ELEMENTLIST_BUTTONS_HORIZ, GDI_END);
+
+       ModifyEditorElementList();
+
+#else
+
        for (i = 0; i < num_editor_elements; i++)
        {
          int e = editor_elements[i];
@@ -9999,6 +10027,7 @@ void HandleLevelEditorKeyInput(Key key)
 
          ModifyEditorElementList();
        }
+#endif
 
        break;
 
index 5d1f08f90516fbf347f65246e676f1c2fce9b631..e3d3fb1936ba1a93257bd68df031853c40f50047 100644 (file)
@@ -42,6 +42,7 @@
 #define USE_ELEMENT_TOUCHING_BUGFIX    (USE_NEW_STUFF          * 1)
 #define USE_NEW_CONTINUOUS_SNAPPING    (USE_NEW_STUFF          * 1)
 #define USE_GFX_RESET_GFX_ANIMATION    (USE_NEW_STUFF          * 1)
+#define USE_BOTH_SWITCHGATE_SWITCHES   (USE_NEW_STUFF          * 1)
 
 #define USE_QUICKSAND_IMPACT_BUGFIX    (USE_NEW_STUFF          * 0)
 
@@ -1119,10 +1120,12 @@ static void InitField(int x, int y, boolean init_game)
       }
       break;
 
+#if !USE_BOTH_SWITCHGATE_SWITCHES
     case EL_SWITCHGATE_SWITCH_DOWN:    /* always start with same switch pos */
       if (init_game)
        Feld[x][y] = EL_SWITCHGATE_SWITCH_UP;
       break;
+#endif
 
     case EL_LIGHT_SWITCH_ACTIVE:
       if (init_game)
@@ -4419,12 +4422,25 @@ static void ToggleSwitchgateSwitch(int x, int y)
   {
     int element = Feld[xx][yy];
 
+#if !USE_BOTH_SWITCHGATE_SWITCHES
     if (element == EL_SWITCHGATE_SWITCH_UP ||
        element == EL_SWITCHGATE_SWITCH_DOWN)
     {
       Feld[xx][yy] = EL_SWITCHGATE_SWITCH_UP + game.switchgate_pos;
       DrawLevelField(xx, yy);
     }
+#else
+    if (element == EL_SWITCHGATE_SWITCH_UP)
+    {
+      Feld[xx][yy] = EL_SWITCHGATE_SWITCH_DOWN;
+      DrawLevelField(xx, yy);
+    }
+    else if (element == EL_SWITCHGATE_SWITCH_DOWN)
+    {
+      Feld[xx][yy] = EL_SWITCHGATE_SWITCH_UP;
+      DrawLevelField(xx, yy);
+    }
+#endif
     else if (element == EL_SWITCHGATE_OPEN ||
             element == EL_SWITCHGATE_OPENING)
     {
index 031d7f6e09b658997fe99e4cbf076f84f222d564..9dcf4dd7cd19a985c675eaee4d6649282e0e6bea 100644 (file)
@@ -1413,49 +1413,213 @@ void HandleInfoScreen_Music(int button)
     PlaySoundLoop(list->music);
 }
 
-void DrawInfoScreen_Credits()
+static boolean DrawInfoScreen_CreditsScreen(int screen_nr)
 {
   int ystart = 150, ystep = 30;
   int ybottom = SYSIZE - 20;
 
-  SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_CREDITS);
-
-  FadeSoundsAndMusic();
-
   ClearWindow();
   DrawHeadline();
 
   DrawTextSCentered(100, FONT_TEXT_1, "Credits:");
-  DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, "DOS port of the game:");
-  DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, "Guido Schulz");
-  DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, "Additional toons:");
-  DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, "Karl Hörnell");
-  DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_2,
-                   "...and many thanks to all contributors");
-  DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2, "of new levels!");
+
+  if (screen_nr == 0)
+  {
+    DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2,
+                     "Special thanks to");
+    DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3,
+                     "Peter Liepa");
+    DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2,
+                     "for creating");
+    DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3,
+                     "\"Boulder Dash\"");
+    DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2,
+                     "in the year");
+    DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_3,
+                     "1984");
+    DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2,
+                     "published by");
+    DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_3,
+                     "First Star Software");
+  }
+  else if (screen_nr == 1)
+  {
+    DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2,
+                     "Special thanks to");
+    DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3,
+                     "Klaus Heinz & Volker Wertich");
+    DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2,
+                     "for creating");
+    DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3,
+                     "\"Emerald Mine\"");
+    DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2,
+                     "in the year");
+    DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_3,
+                     "1987");
+    DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2,
+                     "published by");
+    DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_3,
+                     "Kingsoft");
+  }
+  else if (screen_nr == 2)
+  {
+    DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2,
+                     "Special thanks to");
+    DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3,
+                     "Michael Stopp & Philip Jespersen");
+    DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2,
+                     "for creating");
+    DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3,
+                     "\"Supaplex\"");
+    DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2,
+                     "in the year");
+    DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_3,
+                     "1991");
+    DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2,
+                     "published by");
+    DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_3,
+                     "Digital Integration");
+  }
+  else if (screen_nr == 3)
+  {
+    DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2,
+                     "Special thanks to");
+    DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3,
+                     "Hiroyuki Imabayashi");
+    DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2,
+                     "for creating");
+    DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3,
+                     "\"Sokoban\"");
+    DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2,
+                     "in the year");
+    DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_3,
+                     "1982");
+    DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2,
+                     "published by");
+    DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_3,
+                     "Thinking Rabbit");
+  }
+  else if (screen_nr == 4)
+  {
+    DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2,
+                     "Special thanks to");
+    DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3,
+                     "Alan Bond");
+    DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2,
+                     "and");
+    DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3,
+                     "Jürgen Bonhagen");
+    DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2,
+                     "for the continuous creation");
+    DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_2,
+                     "of outstanding level sets");
+  }
+  else if (screen_nr == 5)
+  {
+    DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2,
+                     "Thanks to");
+    DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3,
+                     "Peter Elzner");
+    DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2,
+                     "for ideas and inspiration by");
+    DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3,
+                     "Diamond Caves");
+
+    DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_2,
+                     "Thanks to");
+    DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_3,
+                     "Steffest");
+    DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_2,
+                     "for ideas and inspiration by");
+    DrawTextSCentered(ystart + 8 * ystep, FONT_TEXT_3,
+                     "DX-Boulderdash");
+  }
+  else if (screen_nr == 6)
+  {
+    DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2,
+                     "Thanks to");
+    DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3,
+                     "David Tritscher");
+    DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2,
+                     "for the new Emerald Mine engine");
+  }
+  else if (screen_nr == 7)
+  {
+    DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2,
+                     "Thanks to");
+    DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3,
+                     "Guido Schulz");
+    DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2,
+                     "for the initial DOS port");
+
+    DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2,
+                     "Thanks to");
+    DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_3,
+                     "Karl Hörnell");
+    DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2,
+                     "for some additional toons");
+  }
+  else if (screen_nr == 8)
+  {
+    DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2,
+                     "And not to forget:");
+    DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_2,
+                     "Many thanks to");
+    DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_3,
+                     "All those who contributed");
+    DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3,
+                     "levels to this game");
+    DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_3,
+                     "since 1995");
+  }
+  else
+  {
+    return FALSE;
+  }
 
   DrawTextSCentered(ybottom, FONT_TEXT_4,
-                   "Press any key or button for info menu");
+                   "Press any key or button for next page");
+
+  return TRUE;
+}
+
+void DrawInfoScreen_Credits()
+{
+  SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_CREDITS);
+
+  FadeSoundsAndMusic();
+
+  HandleInfoScreen_Credits(MB_MENU_INITIALIZE);
 }
 
 void HandleInfoScreen_Credits(int button)
 {
-  int button_released = !button;
+  static int screen_nr = 0;
 
-  if (button == MB_MENU_LEAVE)
+  if (button == MB_MENU_INITIALIZE)
+  {
+    screen_nr = 0;
+
+    DrawInfoScreen_CreditsScreen(screen_nr);
+  }
+  else if (button == MB_MENU_LEAVE)
   {
     info_mode = INFO_MODE_MAIN;
     DrawInfoScreen();
 
     return;
   }
-
-  if (button_released)
+  else if (button == MB_MENU_CHOICE)
   {
-    FadeSoundsAndMusic();
+    screen_nr++;
 
-    info_mode = INFO_MODE_MAIN;
-    DrawInfoScreen();
+    if (!DrawInfoScreen_CreditsScreen(screen_nr))
+    {
+      FadeSoundsAndMusic();
+
+      info_mode = INFO_MODE_MAIN;
+      DrawInfoScreen();
+    }
   }
   else
   {