rnd-20030428-1-src
[rocksndiamonds.git] / src / main.c
index e9817ae3b7e59b8a8dc1cf13b13ad10c8b57f503..4f1b196dea116e6f95b9f656e82692f6ea33fba9 100644 (file)
@@ -92,6 +92,8 @@ struct TapeInfo               tape;
 struct SetupInfo       setup;
 struct GameInfo                game;
 struct GlobalInfo      global;
+struct MenuInfo                menu;
+struct DoorInfo                door;
 struct GraphicInfo     *graphic_info = NULL;
 struct SoundInfo       *sound_info = NULL;
 
@@ -289,45 +291,42 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "blue key"
   },
   {
-    "gate_1_closed",
+    "gate_1",
     "gate",
     "red door"
   },
   {
-    "gate_2_closed",
+    "gate_2",
     "gate",
     "yellow door"
   },
   {
-    "gate_3_closed",
+    "gate_3",
     "gate",
     "green door"
   },
   {
-    "gate_4_closed",
+    "gate_4",
     "gate",
     "blue door"
   },
   {
-    "gate_1_gray_closed",
+    "gate_1_gray",
     "gate",
     "gray door (opened by red key)"
   },
   {
-    "gate_2_gray_closed",
+    "gate_2_gray",
     "gate",
-    "gray door (opened by yellow key)"
-  },
+    "gray door (opened by yellow key)"},
   {
-    "gate_3_gray_closed",
+    "gate_3_gray",
     "gate",
-    "gray door (opened by green key)"
-  },
+    "gray door (opened by green key)"},
   {
-    "gate_4_gray_closed",
+    "gate_4_gray",
     "gate",
-    "gray door (opened by blue key)"
-  },
+    "gray door (opened by blue key)"},
   {
     "dynamite",
     "dynamite",
@@ -1118,22 +1117,22 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "growing wall (any direction)"
   },
   {
-    "em_gate_1_closed",
+    "em_gate_1",
     "gate",
     "red door (EM style)"
   },
   {
-    "em_gate_2_closed",
+    "em_gate_2",
     "gate",
     "yellow door (EM style)"
   },
   {
-    "em_gate_3_closed",
+    "em_gate_3",
     "gate",
     "green door (EM style)"
   },
   {
-    "em_gate_4_closed",
+    "em_gate_4",
     "gate",
     "blue door (EM style)"
   },
@@ -1353,22 +1352,22 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "chip (lower half)"
   },
   {
-    "em_gate_1_gray_closed",
+    "em_gate_1_gray",
     "gate",
     "gray door (EM style, red key)"
   },
   {
-    "em_gate_2_gray_closed",
+    "em_gate_2_gray",
     "gate",
     "gray door (EM style, yellow key)"
   },
   {
-    "em_gate_3_gray_closed",
+    "em_gate_3_gray",
     "gate",
     "gray door (EM style, green key)"
   },
   {
-    "em_gate_4_gray_closed",
+    "em_gate_4_gray",
     "gate",
     "gray door (EM style, blue key)"
   },
@@ -2777,86 +2776,6 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "magic_wall",
     "-"
   },
-  {
-    "gate_1_open",
-    "gate",
-    "red door"
-  },
-  {
-    "gate_2_open",
-    "gate",
-    "yellow door"
-  },
-  {
-    "gate_3_open",
-    "gate",
-    "green door"
-  },
-  {
-    "gate_4_open",
-    "gate",
-    "blue door"
-  },
-  {
-    "gate_1_gray_open",
-    "gate",
-    "gray door (opened by red key)"
-  },
-  {
-    "gate_2_gray_open",
-    "gate",
-    "gray door (opened by yellow key)"
-  },
-  {
-    "gate_3_gray_open",
-    "gate",
-    "gray door (opened by green key)"
-  },
-  {
-    "gate_4_gray_open",
-    "gate",
-    "gray door (opened by blue key)"
-  },
-  {
-    "em_gate_1_open",
-    "gate",
-    "red door (EM style)"
-  },
-  {
-    "em_gate_2_open",
-    "gate",
-    "yellow door (EM style)"
-  },
-  {
-    "em_gate_3_open",
-    "gate",
-    "green door (EM style)"
-  },
-  {
-    "em_gate_4_open",
-    "gate",
-    "blue door (EM style)"
-  },
-  {
-    "em_gate_1_gray_open",
-    "gate",
-    "gray door (EM style, red key)"
-  },
-  {
-    "em_gate_2_gray_open",
-    "gate",
-    "gray door (EM style, yellow key)"
-  },
-  {
-    "em_gate_3_gray_open",
-    "gate",
-    "gray door (EM style, green key)"
-  },
-  {
-    "em_gate_4_gray_open",
-    "gate",
-    "gray door (EM style, blue key)"
-  },
 
   /* ----------------------------------------------------------------------- */
   /* "unreal" (and therefore not drawable) runtime elements                  */
@@ -3071,22 +2990,49 @@ struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS + 1] =
 
 struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1] =
 {
-  { ".MAIN",           0,                              },
-  { ".LEVELS",         0,                              },
-  { ".SCORES",         0,                              },
-  { ".EDITOR",         0,                              },
-  { ".INFO",           0,                              },
-  { ".SETUP",          0,                              },
-  { ".DOOR",           0,                              },
-  { ".PREVIEW",                0,                              },
+  { ".MAIN",           GAME_MODE_MAIN,                 },
+  { ".LEVELS",         GAME_MODE_LEVELS                },
+  { ".SCORES",         GAME_MODE_SCORES,               },
+  { ".EDITOR",         GAME_MODE_EDITOR,               },
+  { ".INFO",           GAME_MODE_INFO,                 },
+  { ".SETUP",          GAME_MODE_SETUP,                },
+  { ".DOOR",           GAME_MODE_PSEUDO_DOOR,          },
+  { ".PREVIEW",                GAME_MODE_PSEUDO_PREVIEW,       },
 
   { NULL,              0,                              }
 };
 
+struct TokenIntPtrInfo image_config_vars[] =
+{
+  { "global.num_toons",                &global.num_toons                          },
+  { "menu.draw_xoffset",       &menu.draw_xoffset_default                 },
+  { "menu.draw_yoffset",       &menu.draw_yoffset_default                 },
+  { "menu.draw_xoffset.MAIN",  &menu.draw_xoffset[GFX_SPECIAL_ARG_MAIN]   },
+  { "menu.draw_yoffset.MAIN",  &menu.draw_yoffset[GFX_SPECIAL_ARG_MAIN]   },
+  { "menu.draw_xoffset.LEVELS",        &menu.draw_xoffset[GFX_SPECIAL_ARG_LEVELS] },
+  { "menu.draw_yoffset.LEVELS",        &menu.draw_yoffset[GFX_SPECIAL_ARG_LEVELS] },
+  { "menu.draw_xoffset.SCORES",        &menu.draw_xoffset[GFX_SPECIAL_ARG_SCORES] },
+  { "menu.draw_yoffset.SCORES",        &menu.draw_yoffset[GFX_SPECIAL_ARG_SCORES] },
+  { "menu.draw_xoffset.EDITOR",        &menu.draw_xoffset[GFX_SPECIAL_ARG_EDITOR] },
+  { "menu.draw_yoffset.EDITOR",        &menu.draw_yoffset[GFX_SPECIAL_ARG_EDITOR] },
+  { "menu.draw_xoffset.INFO",  &menu.draw_xoffset[GFX_SPECIAL_ARG_INFO]   },
+  { "menu.draw_yoffset.INFO",  &menu.draw_yoffset[GFX_SPECIAL_ARG_INFO]   },
+  { "menu.draw_xoffset.SETUP", &menu.draw_xoffset[GFX_SPECIAL_ARG_SETUP]  },
+  { "menu.draw_yoffset.SETUP", &menu.draw_yoffset[GFX_SPECIAL_ARG_SETUP]  },
+  { "door.step_offset",                &door.step_offset                          },
+  { "door.step_delay",         &door.step_delay                           },
+
+  { NULL,                      NULL,                                      }
+};
+
+
 /* ------------------------------------------------------------------------- */
 /* font definitions                                                          */
 /* ------------------------------------------------------------------------- */
 
+/* Important: When one entry is a prefix of another entry, the longer entry
+   must come first, because the dynamic configuration does prefix matching! */
+
 struct FontInfo font_info[NUM_FONTS + 1] =
 {
   { "font.initial_1"           },
@@ -3097,19 +3043,26 @@ struct FontInfo font_info[NUM_FONTS + 1] =
   { "font.title_2"             },
   { "font.menu_1"              },
   { "font.menu_2"              },
+  { "font.text_1.active"       },
+  { "font.text_2.active"       },
+  { "font.text_3.active"       },
+  { "font.text_4.active"       },
   { "font.text_1"              },
   { "font.text_2"              },
   { "font.text_3"              },
   { "font.text_4"              },
-  { "font.input"               },
-  { "font.input.active"                },
+  { "font.input_1.active"      },
+  { "font.input_2.active"      },
+  { "font.input_1"             },
+  { "font.input_2"             },
   { "font.option_off"          },
   { "font.option_on"           },
   { "font.value_1"             },
   { "font.value_2"             },
   { "font.value_old"           },
-  { "font.tape_recorder"       },
   { "font.level_number"                },
+  { "font.tape_recorder"       },
+  { "font.game_info"           },
 };