rnd-20070407-2-src
authorHolger Schemel <info@artsoft.org>
Sat, 7 Apr 2007 15:24:57 +0000 (17:24 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:55:27 +0000 (10:55 +0200)
src/conf_gfx.c
src/conf_var.c
src/conftime.h
src/files.c
src/game.c
src/game.h
src/libgame/misc.c
src/libgame/misc.h
src/libgame/system.h
src/main.h

index 1da4c96d663b5cc861c746ebd2f8a234a86bca8f..c5d055c9ca2f18675adb3eb07445dbb22ecb722b 100644 (file)
@@ -5787,6 +5787,95 @@ struct ConfigInfo image_config[] =
   { "game.panel.gravity_state.font",           "font.text_1"           },
   { "game.panel.gravity_state.font_active",    "font.text_2"           },
 
+  { "game.panel.ce_score_1.x",                 "-1"                    },
+  { "game.panel.ce_score_1.y",                 "-1"                    },
+  { "game.panel.ce_score_1.align",             "left"                  },
+  { "game.panel.ce_score_1.valign",            "top"                   },
+  { "game.panel.ce_score_1.digits",            "-1"                    },
+  { "game.panel.ce_score_1.font",              "font.text_2"           },
+  { "game.panel.ce_score_1.element",           "custom_1"              },
+  { "game.panel.ce_score_1_element.x",         "-1"                    },
+  { "game.panel.ce_score_1_element.y",         "-1"                    },
+  { "game.panel.ce_score_1_element.tile_size", "16"                    },
+  { "game.panel.ce_score_1_element.element",   "custom_1"              },
+  { "game.panel.ce_score_2.x",                 "-1"                    },
+  { "game.panel.ce_score_2.y",                 "-1"                    },
+  { "game.panel.ce_score_2.align",             "left"                  },
+  { "game.panel.ce_score_2.valign",            "top"                   },
+  { "game.panel.ce_score_2.digits",            "-1"                    },
+  { "game.panel.ce_score_2.font",              "font.text_2"           },
+  { "game.panel.ce_score_2.element",           "custom_1"              },
+  { "game.panel.ce_score_2_element.x",         "-1"                    },
+  { "game.panel.ce_score_2_element.y",         "-1"                    },
+  { "game.panel.ce_score_2_element.tile_size", "16"                    },
+  { "game.panel.ce_score_2_element.element",   "custom_1"              },
+  { "game.panel.ce_score_3.x",                 "-1"                    },
+  { "game.panel.ce_score_3.y",                 "-1"                    },
+  { "game.panel.ce_score_3.align",             "left"                  },
+  { "game.panel.ce_score_3.valign",            "top"                   },
+  { "game.panel.ce_score_3.digits",            "-1"                    },
+  { "game.panel.ce_score_3.font",              "font.text_2"           },
+  { "game.panel.ce_score_3.element",           "custom_1"              },
+  { "game.panel.ce_score_3_element.x",         "-1"                    },
+  { "game.panel.ce_score_3_element.y",         "-1"                    },
+  { "game.panel.ce_score_3_element.tile_size", "16"                    },
+  { "game.panel.ce_score_3_element.element",   "custom_1"              },
+  { "game.panel.ce_score_4.x",                 "-1"                    },
+  { "game.panel.ce_score_4.y",                 "-1"                    },
+  { "game.panel.ce_score_4.align",             "left"                  },
+  { "game.panel.ce_score_4.valign",            "top"                   },
+  { "game.panel.ce_score_4.digits",            "-1"                    },
+  { "game.panel.ce_score_4.font",              "font.text_2"           },
+  { "game.panel.ce_score_4.element",           "custom_1"              },
+  { "game.panel.ce_score_4_element.x",         "-1"                    },
+  { "game.panel.ce_score_4_element.y",         "-1"                    },
+  { "game.panel.ce_score_4_element.tile_size", "16"                    },
+  { "game.panel.ce_score_4_element.element",   "custom_1"              },
+  { "game.panel.ce_score_5.x",                 "-1"                    },
+  { "game.panel.ce_score_5.y",                 "-1"                    },
+  { "game.panel.ce_score_5.align",             "left"                  },
+  { "game.panel.ce_score_5.valign",            "top"                   },
+  { "game.panel.ce_score_5.digits",            "-1"                    },
+  { "game.panel.ce_score_5.font",              "font.text_2"           },
+  { "game.panel.ce_score_5.element",           "custom_1"              },
+  { "game.panel.ce_score_5_element.x",         "-1"                    },
+  { "game.panel.ce_score_5_element.y",         "-1"                    },
+  { "game.panel.ce_score_5_element.tile_size", "16"                    },
+  { "game.panel.ce_score_5_element.element",   "custom_1"              },
+  { "game.panel.ce_score_6.x",                 "-1"                    },
+  { "game.panel.ce_score_6.y",                 "-1"                    },
+  { "game.panel.ce_score_6.align",             "left"                  },
+  { "game.panel.ce_score_6.valign",            "top"                   },
+  { "game.panel.ce_score_6.digits",            "-1"                    },
+  { "game.panel.ce_score_6.font",              "font.text_2"           },
+  { "game.panel.ce_score_6.element",           "custom_1"              },
+  { "game.panel.ce_score_6_element.x",         "-1"                    },
+  { "game.panel.ce_score_6_element.y",         "-1"                    },
+  { "game.panel.ce_score_6_element.tile_size", "16"                    },
+  { "game.panel.ce_score_6_element.element",   "custom_1"              },
+  { "game.panel.ce_score_7.x",                 "-1"                    },
+  { "game.panel.ce_score_7.y",                 "-1"                    },
+  { "game.panel.ce_score_7.align",             "left"                  },
+  { "game.panel.ce_score_7.valign",            "top"                   },
+  { "game.panel.ce_score_7.digits",            "-1"                    },
+  { "game.panel.ce_score_7.font",              "font.text_2"           },
+  { "game.panel.ce_score_7.element",           "custom_1"              },
+  { "game.panel.ce_score_7_element.x",         "-1"                    },
+  { "game.panel.ce_score_7_element.y",         "-1"                    },
+  { "game.panel.ce_score_7_element.tile_size", "16"                    },
+  { "game.panel.ce_score_7_element.element",   "custom_1"              },
+  { "game.panel.ce_score_8.x",                 "-1"                    },
+  { "game.panel.ce_score_8.y",                 "-1"                    },
+  { "game.panel.ce_score_8.align",             "left"                  },
+  { "game.panel.ce_score_8.valign",            "top"                   },
+  { "game.panel.ce_score_8.digits",            "-1"                    },
+  { "game.panel.ce_score_8.font",              "font.text_2"           },
+  { "game.panel.ce_score_8.element",           "custom_1"              },
+  { "game.panel.ce_score_8_element.x",         "-1"                    },
+  { "game.panel.ce_score_8_element.y",         "-1"                    },
+  { "game.panel.ce_score_8_element.tile_size", "16"                    },
+  { "game.panel.ce_score_8_element.element",   "custom_1"              },
+
   { "game.panel.player_name.x",                        "-1"                    },
   { "game.panel.player_name.y",                        "-1"                    },
   { "game.panel.player_name.align",            "left"                  },
index bf4e4a1095c9512c5436ef7c497b3139d624bc92..c8cd2f663c87928963a1b9b270f281d26a6e069e 100644 (file)
@@ -2046,195 +2046,195 @@ struct TokenIntPtrInfo image_config_vars[] =
   },
   {
     "game.panel.inventory_first_1.x",
-    &game.panel.inventory_first_1.x
+    &game.panel.inventory_first[0].x
   },
   {
     "game.panel.inventory_first_1.y",
-    &game.panel.inventory_first_1.y
+    &game.panel.inventory_first[0].y
   },
   {
     "game.panel.inventory_first_1.tile_size",
-    &game.panel.inventory_first_1.size
+    &game.panel.inventory_first[0].size
   },
   {
     "game.panel.inventory_first_2.x",
-    &game.panel.inventory_first_2.x
+    &game.panel.inventory_first[1].x
   },
   {
     "game.panel.inventory_first_2.y",
-    &game.panel.inventory_first_2.y
+    &game.panel.inventory_first[1].y
   },
   {
     "game.panel.inventory_first_2.tile_size",
-    &game.panel.inventory_first_2.size
+    &game.panel.inventory_first[1].size
   },
   {
     "game.panel.inventory_first_3.x",
-    &game.panel.inventory_first_3.x
+    &game.panel.inventory_first[2].x
   },
   {
     "game.panel.inventory_first_3.y",
-    &game.panel.inventory_first_3.y
+    &game.panel.inventory_first[2].y
   },
   {
     "game.panel.inventory_first_3.tile_size",
-    &game.panel.inventory_first_3.size
+    &game.panel.inventory_first[2].size
   },
   {
     "game.panel.inventory_first_4.x",
-    &game.panel.inventory_first_4.x
+    &game.panel.inventory_first[3].x
   },
   {
     "game.panel.inventory_first_4.y",
-    &game.panel.inventory_first_4.y
+    &game.panel.inventory_first[3].y
   },
   {
     "game.panel.inventory_first_4.tile_size",
-    &game.panel.inventory_first_4.size
+    &game.panel.inventory_first[3].size
   },
   {
     "game.panel.inventory_first_5.x",
-    &game.panel.inventory_first_5.x
+    &game.panel.inventory_first[4].x
   },
   {
     "game.panel.inventory_first_5.y",
-    &game.panel.inventory_first_5.y
+    &game.panel.inventory_first[4].y
   },
   {
     "game.panel.inventory_first_5.tile_size",
-    &game.panel.inventory_first_5.size
+    &game.panel.inventory_first[4].size
   },
   {
     "game.panel.inventory_first_6.x",
-    &game.panel.inventory_first_6.x
+    &game.panel.inventory_first[5].x
   },
   {
     "game.panel.inventory_first_6.y",
-    &game.panel.inventory_first_6.y
+    &game.panel.inventory_first[5].y
   },
   {
     "game.panel.inventory_first_6.tile_size",
-    &game.panel.inventory_first_6.size
+    &game.panel.inventory_first[5].size
   },
   {
     "game.panel.inventory_first_7.x",
-    &game.panel.inventory_first_7.x
+    &game.panel.inventory_first[6].x
   },
   {
     "game.panel.inventory_first_7.y",
-    &game.panel.inventory_first_7.y
+    &game.panel.inventory_first[6].y
   },
   {
     "game.panel.inventory_first_7.tile_size",
-    &game.panel.inventory_first_7.size
+    &game.panel.inventory_first[6].size
   },
   {
     "game.panel.inventory_first_8.x",
-    &game.panel.inventory_first_8.x
+    &game.panel.inventory_first[7].x
   },
   {
     "game.panel.inventory_first_8.y",
-    &game.panel.inventory_first_8.y
+    &game.panel.inventory_first[7].y
   },
   {
     "game.panel.inventory_first_8.tile_size",
-    &game.panel.inventory_first_8.size
+    &game.panel.inventory_first[7].size
   },
   {
     "game.panel.inventory_last_1.x",
-    &game.panel.inventory_last_1.x
+    &game.panel.inventory_last[0].x
   },
   {
     "game.panel.inventory_last_1.y",
-    &game.panel.inventory_last_1.y
+    &game.panel.inventory_last[0].y
   },
   {
     "game.panel.inventory_last_1.tile_size",
-    &game.panel.inventory_last_1.size
+    &game.panel.inventory_last[0].size
   },
   {
     "game.panel.inventory_last_2.x",
-    &game.panel.inventory_last_2.x
+    &game.panel.inventory_last[1].x
   },
   {
     "game.panel.inventory_last_2.y",
-    &game.panel.inventory_last_2.y
+    &game.panel.inventory_last[1].y
   },
   {
     "game.panel.inventory_last_2.tile_size",
-    &game.panel.inventory_last_2.size
+    &game.panel.inventory_last[1].size
   },
   {
     "game.panel.inventory_last_3.x",
-    &game.panel.inventory_last_3.x
+    &game.panel.inventory_last[2].x
   },
   {
     "game.panel.inventory_last_3.y",
-    &game.panel.inventory_last_3.y
+    &game.panel.inventory_last[2].y
   },
   {
     "game.panel.inventory_last_3.tile_size",
-    &game.panel.inventory_last_3.size
+    &game.panel.inventory_last[2].size
   },
   {
     "game.panel.inventory_last_4.x",
-    &game.panel.inventory_last_4.x
+    &game.panel.inventory_last[3].x
   },
   {
     "game.panel.inventory_last_4.y",
-    &game.panel.inventory_last_4.y
+    &game.panel.inventory_last[3].y
   },
   {
     "game.panel.inventory_last_4.tile_size",
-    &game.panel.inventory_last_4.size
+    &game.panel.inventory_last[3].size
   },
   {
     "game.panel.inventory_last_5.x",
-    &game.panel.inventory_last_5.x
+    &game.panel.inventory_last[4].x
   },
   {
     "game.panel.inventory_last_5.y",
-    &game.panel.inventory_last_5.y
+    &game.panel.inventory_last[4].y
   },
   {
     "game.panel.inventory_last_5.tile_size",
-    &game.panel.inventory_last_5.size
+    &game.panel.inventory_last[4].size
   },
   {
     "game.panel.inventory_last_6.x",
-    &game.panel.inventory_last_6.x
+    &game.panel.inventory_last[5].x
   },
   {
     "game.panel.inventory_last_6.y",
-    &game.panel.inventory_last_6.y
+    &game.panel.inventory_last[5].y
   },
   {
     "game.panel.inventory_last_6.tile_size",
-    &game.panel.inventory_last_6.size
+    &game.panel.inventory_last[5].size
   },
   {
     "game.panel.inventory_last_7.x",
-    &game.panel.inventory_last_7.x
+    &game.panel.inventory_last[6].x
   },
   {
     "game.panel.inventory_last_7.y",
-    &game.panel.inventory_last_7.y
+    &game.panel.inventory_last[6].y
   },
   {
     "game.panel.inventory_last_7.tile_size",
-    &game.panel.inventory_last_7.size
+    &game.panel.inventory_last[6].size
   },
   {
     "game.panel.inventory_last_8.x",
-    &game.panel.inventory_last_8.x
+    &game.panel.inventory_last[7].x
   },
   {
     "game.panel.inventory_last_8.y",
-    &game.panel.inventory_last_8.y
+    &game.panel.inventory_last[7].y
   },
   {
     "game.panel.inventory_last_8.tile_size",
-    &game.panel.inventory_last_8.size
+    &game.panel.inventory_last[7].size
   },
   {
     "game.panel.key_1.x",
@@ -2914,99 +2914,99 @@ struct TokenIntPtrInfo image_config_vars[] =
   },
   {
     "game.panel.conveyor_belt_1.x",
-    &game.panel.conveyor_belt_1.x
+    &game.panel.conveyor_belt[0].x
   },
   {
     "game.panel.conveyor_belt_1.y",
-    &game.panel.conveyor_belt_1.y
+    &game.panel.conveyor_belt[0].y
   },
   {
     "game.panel.conveyor_belt_1.tile_size",
-    &game.panel.conveyor_belt_1.size
+    &game.panel.conveyor_belt[0].size
   },
   {
     "game.panel.conveyor_belt_1_switch.x",
-    &game.panel.conveyor_belt_1_switch.x
+    &game.panel.conveyor_belt_switch[0].x
   },
   {
     "game.panel.conveyor_belt_1_switch.y",
-    &game.panel.conveyor_belt_1_switch.y
+    &game.panel.conveyor_belt_switch[0].y
   },
   {
     "game.panel.conveyor_belt_1_switch.tile_size",
-    &game.panel.conveyor_belt_1_switch.size
+    &game.panel.conveyor_belt_switch[0].size
   },
   {
     "game.panel.conveyor_belt_2.x",
-    &game.panel.conveyor_belt_2.x
+    &game.panel.conveyor_belt[1].x
   },
   {
     "game.panel.conveyor_belt_2.y",
-    &game.panel.conveyor_belt_2.y
+    &game.panel.conveyor_belt[1].y
   },
   {
     "game.panel.conveyor_belt_2.tile_size",
-    &game.panel.conveyor_belt_2.size
+    &game.panel.conveyor_belt[1].size
   },
   {
     "game.panel.conveyor_belt_2_switch.x",
-    &game.panel.conveyor_belt_2_switch.x
+    &game.panel.conveyor_belt_switch[1].x
   },
   {
     "game.panel.conveyor_belt_2_switch.y",
-    &game.panel.conveyor_belt_2_switch.y
+    &game.panel.conveyor_belt_switch[1].y
   },
   {
     "game.panel.conveyor_belt_2_switch.tile_size",
-    &game.panel.conveyor_belt_2_switch.size
+    &game.panel.conveyor_belt_switch[1].size
   },
   {
     "game.panel.conveyor_belt_3.x",
-    &game.panel.conveyor_belt_3.x
+    &game.panel.conveyor_belt[2].x
   },
   {
     "game.panel.conveyor_belt_3.y",
-    &game.panel.conveyor_belt_3.y
+    &game.panel.conveyor_belt[2].y
   },
   {
     "game.panel.conveyor_belt_3.tile_size",
-    &game.panel.conveyor_belt_3.size
+    &game.panel.conveyor_belt[2].size
   },
   {
     "game.panel.conveyor_belt_3_switch.x",
-    &game.panel.conveyor_belt_3_switch.x
+    &game.panel.conveyor_belt_switch[2].x
   },
   {
     "game.panel.conveyor_belt_3_switch.y",
-    &game.panel.conveyor_belt_3_switch.y
+    &game.panel.conveyor_belt_switch[2].y
   },
   {
     "game.panel.conveyor_belt_3_switch.tile_size",
-    &game.panel.conveyor_belt_3_switch.size
+    &game.panel.conveyor_belt_switch[2].size
   },
   {
     "game.panel.conveyor_belt_4.x",
-    &game.panel.conveyor_belt_4.x
+    &game.panel.conveyor_belt[3].x
   },
   {
     "game.panel.conveyor_belt_4.y",
-    &game.panel.conveyor_belt_4.y
+    &game.panel.conveyor_belt[3].y
   },
   {
     "game.panel.conveyor_belt_4.tile_size",
-    &game.panel.conveyor_belt_4.size
+    &game.panel.conveyor_belt[3].size
   },
   {
     "game.panel.conveyor_belt_4_switch.x",
-    &game.panel.conveyor_belt_4_switch.x
+    &game.panel.conveyor_belt_switch[3].x
   },
   {
     "game.panel.conveyor_belt_4_switch.y",
-    &game.panel.conveyor_belt_4_switch.y
+    &game.panel.conveyor_belt_switch[3].y
   },
   {
     "game.panel.conveyor_belt_4_switch.tile_size",
-    &game.panel.conveyor_belt_4_switch.size
+    &game.panel.conveyor_belt_switch[3].size
   },
   {
     "game.panel.magic_wall.x",
@@ -3072,6 +3072,358 @@ struct TokenIntPtrInfo image_config_vars[] =
     "game.panel.gravity_state.font_active",
     &game.panel.gravity_state.font_alt
   },
+  {
+    "game.panel.ce_score_1.x",
+    &game.panel.ce_score[0].x
+  },
+  {
+    "game.panel.ce_score_1.y",
+    &game.panel.ce_score[0].y
+  },
+  {
+    "game.panel.ce_score_1.align",
+    &game.panel.ce_score[0].align
+  },
+  {
+    "game.panel.ce_score_1.valign",
+    &game.panel.ce_score[0].valign
+  },
+  {
+    "game.panel.ce_score_1.digits",
+    &game.panel.ce_score[0].size
+  },
+  {
+    "game.panel.ce_score_1.font",
+    &game.panel.ce_score[0].font
+  },
+  {
+    "game.panel.ce_score_1.element",
+    &game.panel.ce_score[0].id
+  },
+  {
+    "game.panel.ce_score_1_element.x",
+    &game.panel.ce_score_element[0].x
+  },
+  {
+    "game.panel.ce_score_1_element.y",
+    &game.panel.ce_score_element[0].y
+  },
+  {
+    "game.panel.ce_score_1_element.tile_size",
+    &game.panel.ce_score_element[0].size
+  },
+  {
+    "game.panel.ce_score_1_element.element",
+    &game.panel.ce_score_element[0].id
+  },
+  {
+    "game.panel.ce_score_2.x",
+    &game.panel.ce_score[1].x
+  },
+  {
+    "game.panel.ce_score_2.y",
+    &game.panel.ce_score[1].y
+  },
+  {
+    "game.panel.ce_score_2.align",
+    &game.panel.ce_score[1].align
+  },
+  {
+    "game.panel.ce_score_2.valign",
+    &game.panel.ce_score[1].valign
+  },
+  {
+    "game.panel.ce_score_2.digits",
+    &game.panel.ce_score[1].size
+  },
+  {
+    "game.panel.ce_score_2.font",
+    &game.panel.ce_score[1].font
+  },
+  {
+    "game.panel.ce_score_2.element",
+    &game.panel.ce_score[1].id
+  },
+  {
+    "game.panel.ce_score_2_element.x",
+    &game.panel.ce_score_element[1].x
+  },
+  {
+    "game.panel.ce_score_2_element.y",
+    &game.panel.ce_score_element[1].y
+  },
+  {
+    "game.panel.ce_score_2_element.tile_size",
+    &game.panel.ce_score_element[1].size
+  },
+  {
+    "game.panel.ce_score_2_element.element",
+    &game.panel.ce_score_element[1].id
+  },
+  {
+    "game.panel.ce_score_3.x",
+    &game.panel.ce_score[2].x
+  },
+  {
+    "game.panel.ce_score_3.y",
+    &game.panel.ce_score[2].y
+  },
+  {
+    "game.panel.ce_score_3.align",
+    &game.panel.ce_score[2].align
+  },
+  {
+    "game.panel.ce_score_3.valign",
+    &game.panel.ce_score[2].valign
+  },
+  {
+    "game.panel.ce_score_3.digits",
+    &game.panel.ce_score[2].size
+  },
+  {
+    "game.panel.ce_score_3.font",
+    &game.panel.ce_score[2].font
+  },
+  {
+    "game.panel.ce_score_3.element",
+    &game.panel.ce_score[2].id
+  },
+  {
+    "game.panel.ce_score_3_element.x",
+    &game.panel.ce_score_element[2].x
+  },
+  {
+    "game.panel.ce_score_3_element.y",
+    &game.panel.ce_score_element[2].y
+  },
+  {
+    "game.panel.ce_score_3_element.tile_size",
+    &game.panel.ce_score_element[2].size
+  },
+  {
+    "game.panel.ce_score_3_element.element",
+    &game.panel.ce_score_element[2].id
+  },
+  {
+    "game.panel.ce_score_4.x",
+    &game.panel.ce_score[3].x
+  },
+  {
+    "game.panel.ce_score_4.y",
+    &game.panel.ce_score[3].y
+  },
+  {
+    "game.panel.ce_score_4.align",
+    &game.panel.ce_score[3].align
+  },
+  {
+    "game.panel.ce_score_4.valign",
+    &game.panel.ce_score[3].valign
+  },
+  {
+    "game.panel.ce_score_4.digits",
+    &game.panel.ce_score[3].size
+  },
+  {
+    "game.panel.ce_score_4.font",
+    &game.panel.ce_score[3].font
+  },
+  {
+    "game.panel.ce_score_4.element",
+    &game.panel.ce_score[3].id
+  },
+  {
+    "game.panel.ce_score_4_element.x",
+    &game.panel.ce_score_element[3].x
+  },
+  {
+    "game.panel.ce_score_4_element.y",
+    &game.panel.ce_score_element[3].y
+  },
+  {
+    "game.panel.ce_score_4_element.tile_size",
+    &game.panel.ce_score_element[3].size
+  },
+  {
+    "game.panel.ce_score_4_element.element",
+    &game.panel.ce_score_element[3].id
+  },
+  {
+    "game.panel.ce_score_5.x",
+    &game.panel.ce_score[4].x
+  },
+  {
+    "game.panel.ce_score_5.y",
+    &game.panel.ce_score[4].y
+  },
+  {
+    "game.panel.ce_score_5.align",
+    &game.panel.ce_score[4].align
+  },
+  {
+    "game.panel.ce_score_5.valign",
+    &game.panel.ce_score[4].valign
+  },
+  {
+    "game.panel.ce_score_5.digits",
+    &game.panel.ce_score[4].size
+  },
+  {
+    "game.panel.ce_score_5.font",
+    &game.panel.ce_score[4].font
+  },
+  {
+    "game.panel.ce_score_5.element",
+    &game.panel.ce_score[4].id
+  },
+  {
+    "game.panel.ce_score_5_element.x",
+    &game.panel.ce_score_element[4].x
+  },
+  {
+    "game.panel.ce_score_5_element.y",
+    &game.panel.ce_score_element[4].y
+  },
+  {
+    "game.panel.ce_score_5_element.tile_size",
+    &game.panel.ce_score_element[4].size
+  },
+  {
+    "game.panel.ce_score_5_element.element",
+    &game.panel.ce_score_element[4].id
+  },
+  {
+    "game.panel.ce_score_6.x",
+    &game.panel.ce_score[5].x
+  },
+  {
+    "game.panel.ce_score_6.y",
+    &game.panel.ce_score[5].y
+  },
+  {
+    "game.panel.ce_score_6.align",
+    &game.panel.ce_score[5].align
+  },
+  {
+    "game.panel.ce_score_6.valign",
+    &game.panel.ce_score[5].valign
+  },
+  {
+    "game.panel.ce_score_6.digits",
+    &game.panel.ce_score[5].size
+  },
+  {
+    "game.panel.ce_score_6.font",
+    &game.panel.ce_score[5].font
+  },
+  {
+    "game.panel.ce_score_6.element",
+    &game.panel.ce_score[5].id
+  },
+  {
+    "game.panel.ce_score_6_element.x",
+    &game.panel.ce_score_element[5].x
+  },
+  {
+    "game.panel.ce_score_6_element.y",
+    &game.panel.ce_score_element[5].y
+  },
+  {
+    "game.panel.ce_score_6_element.tile_size",
+    &game.panel.ce_score_element[5].size
+  },
+  {
+    "game.panel.ce_score_6_element.element",
+    &game.panel.ce_score_element[5].id
+  },
+  {
+    "game.panel.ce_score_7.x",
+    &game.panel.ce_score[6].x
+  },
+  {
+    "game.panel.ce_score_7.y",
+    &game.panel.ce_score[6].y
+  },
+  {
+    "game.panel.ce_score_7.align",
+    &game.panel.ce_score[6].align
+  },
+  {
+    "game.panel.ce_score_7.valign",
+    &game.panel.ce_score[6].valign
+  },
+  {
+    "game.panel.ce_score_7.digits",
+    &game.panel.ce_score[6].size
+  },
+  {
+    "game.panel.ce_score_7.font",
+    &game.panel.ce_score[6].font
+  },
+  {
+    "game.panel.ce_score_7.element",
+    &game.panel.ce_score[6].id
+  },
+  {
+    "game.panel.ce_score_7_element.x",
+    &game.panel.ce_score_element[6].x
+  },
+  {
+    "game.panel.ce_score_7_element.y",
+    &game.panel.ce_score_element[6].y
+  },
+  {
+    "game.panel.ce_score_7_element.tile_size",
+    &game.panel.ce_score_element[6].size
+  },
+  {
+    "game.panel.ce_score_7_element.element",
+    &game.panel.ce_score_element[6].id
+  },
+  {
+    "game.panel.ce_score_8.x",
+    &game.panel.ce_score[7].x
+  },
+  {
+    "game.panel.ce_score_8.y",
+    &game.panel.ce_score[7].y
+  },
+  {
+    "game.panel.ce_score_8.align",
+    &game.panel.ce_score[7].align
+  },
+  {
+    "game.panel.ce_score_8.valign",
+    &game.panel.ce_score[7].valign
+  },
+  {
+    "game.panel.ce_score_8.digits",
+    &game.panel.ce_score[7].size
+  },
+  {
+    "game.panel.ce_score_8.font",
+    &game.panel.ce_score[7].font
+  },
+  {
+    "game.panel.ce_score_8.element",
+    &game.panel.ce_score[7].id
+  },
+  {
+    "game.panel.ce_score_8_element.x",
+    &game.panel.ce_score_element[7].x
+  },
+  {
+    "game.panel.ce_score_8_element.y",
+    &game.panel.ce_score_element[7].y
+  },
+  {
+    "game.panel.ce_score_8_element.tile_size",
+    &game.panel.ce_score_element[7].size
+  },
+  {
+    "game.panel.ce_score_8_element.element",
+    &game.panel.ce_score_element[7].id
+  },
   {
     "game.panel.player_name.x",
     &game.panel.player_name.x
index 685202d136af4c4f6c8379b2494a44d9ae1fdca9..44d63deed1a5f8af0c3460ff3d4f85a13787a231 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2007-04-07 03:38"
+#define COMPILE_DATE_STRING "2007-04-07 17:24"
index cb57311a3e10dcd2bccbe551fcd9d90c2b675181..7d32cda82ebe2ee5137a39c078fa91f7a13f26dc 100644 (file)
@@ -8344,6 +8344,54 @@ void LoadCustomElementDescriptions()
   freeSetupFileHash(setup_file_hash);
 }
 
+static int getElementFromToken(char *token)
+{
+  int i;
+
+  /* !!! OPTIMIZE THIS BY USING HASH !!! */
+  for (i = 0; i < MAX_NUM_ELEMENTS; i++)
+    if (strEqual(token, element_info[i].token_name))
+      return i;
+
+  Error(ERR_WARN, "unknown element token '%s'", token);
+
+  return EL_UNDEFINED;
+}
+
+static int get_token_parameter_value(char *token, char *value_raw)
+{
+  char *suffix;
+
+  if (token == NULL || value_raw == NULL)
+    return ARG_UNDEFINED_VALUE;
+
+  suffix = strrchr(token, '.');
+  if (suffix == NULL)
+    suffix = token;
+
+#if 1
+  if (strEqual(suffix, ".element"))
+    return getElementFromToken(value_raw);
+#endif
+
+#if 0
+  if (strncmp(suffix, ".font", 5) == 0)
+  {
+    int i;
+
+    /* !!! OPTIMIZE THIS BY USING HASH !!! */
+    for (i = 0; i < NUM_FONTS; i++)
+      if (strEqual(value_raw, font_info[i].token_name))
+       return i;
+
+    /* if font not found, use reliable default value */
+    return FONT_INITIAL_1;
+  }
+#endif
+
+  return get_parameter_value(value_raw, suffix, TYPE_INTEGER);
+}
+
 static void LoadSpecialMenuDesignSettingsFromFilename(char *filename)
 {
   static struct TitleMessageInfo tmi;
index 2a9eabb016a0ca6c1ac2e69424e736a30cdb9044..f7cb0fe154c970a3e8484c50516e9c303abfc869 100644 (file)
 #if 1
 /* game panel display and control definitions */
 
-#define GAME_PANEL_LEVEL_NUMBER                0
-#define GAME_PANEL_GEMS                        1
+#define GAME_PANEL_LEVEL_NUMBER                        0
+#define GAME_PANEL_GEMS                                1
 #define GAME_PANEL_INVENTORY_COUNT             2
 #define GAME_PANEL_INVENTORY_FIRST_1           3
 #define GAME_PANEL_INVENTORY_FIRST_2           4
 #define GAME_PANEL_KEY_WHITE                   27
 #define GAME_PANEL_KEY_WHITE_COUNT             28
 #define GAME_PANEL_SCORE                       29
-#define GAME_PANEL_TIME                        30
+#define GAME_PANEL_TIME                                30
 #define GAME_PANEL_TIME_HH                     31
 #define GAME_PANEL_TIME_MM                     32
 #define GAME_PANEL_TIME_SS                     33
 #define GAME_PANEL_SHIELD_NORMAL_TIME          35
 #define GAME_PANEL_SHIELD_DEADLY               36
 #define GAME_PANEL_SHIELD_DEADLY_TIME          37
-#define GAME_PANEL_EXIT                        38
+#define GAME_PANEL_EXIT                                38
 #define GAME_PANEL_EMC_MAGIC_BALL              39
 #define GAME_PANEL_EMC_MAGIC_BALL_SWITCH       40
-#define GAME_PANEL_LIGHT_SWITCH                41
+#define GAME_PANEL_LIGHT_SWITCH                        41
 #define GAME_PANEL_LIGHT_SWITCH_TIME           42
 #define GAME_PANEL_TIMEGATE_SWITCH             43
-#define GAME_PANEL_TIMEGATE_SWITCH_TIME        44
+#define GAME_PANEL_TIMEGATE_SWITCH_TIME                44
 #define GAME_PANEL_SWITCHGATE_SWITCH           45
 #define GAME_PANEL_EMC_LENSES                  46
 #define GAME_PANEL_EMC_LENSES_TIME             47
 #define GAME_PANEL_PENGUINS                    54
 #define GAME_PANEL_SOKOBAN_OBJECTS             55
 #define GAME_PANEL_SOKOBAN_FIELDS              56
-#define GAME_PANEL_ROBOT_WHEEL         57
+#define GAME_PANEL_ROBOT_WHEEL                 57
 #define GAME_PANEL_CONVEYOR_BELT_1             58
-#define GAME_PANEL_CONVEYOR_BELT_1_SWITCH      59
-#define GAME_PANEL_CONVEYOR_BELT_2             60
-#define GAME_PANEL_CONVEYOR_BELT_2_SWITCH      61
-#define GAME_PANEL_CONVEYOR_BELT_3             62
-#define GAME_PANEL_CONVEYOR_BELT_3_SWITCH      63
-#define GAME_PANEL_CONVEYOR_BELT_4             64
+#define GAME_PANEL_CONVEYOR_BELT_2             59
+#define GAME_PANEL_CONVEYOR_BELT_3             60
+#define GAME_PANEL_CONVEYOR_BELT_4             61
+#define GAME_PANEL_CONVEYOR_BELT_1_SWITCH      62
+#define GAME_PANEL_CONVEYOR_BELT_2_SWITCH      63
+#define GAME_PANEL_CONVEYOR_BELT_3_SWITCH      64
 #define GAME_PANEL_CONVEYOR_BELT_4_SWITCH      65
 #define GAME_PANEL_MAGIC_WALL                  66
 #define GAME_PANEL_MAGIC_WALL_TIME             67
 #define GAME_PANEL_GRAVITY_STATE               68
-#define GAME_PANEL_PLAYER_NAME         69
-#define GAME_PANEL_LEVEL_NAME                  70
-#define GAME_PANEL_LEVEL_AUTHOR                71
-
-#define NUM_GAME_PANEL_CONTROLS                        72
+#define GAME_PANEL_CE_SCORE_1                  69
+#define GAME_PANEL_CE_SCORE_2                  70
+#define GAME_PANEL_CE_SCORE_3                  71
+#define GAME_PANEL_CE_SCORE_4                  72
+#define GAME_PANEL_CE_SCORE_5                  73
+#define GAME_PANEL_CE_SCORE_6                  74
+#define GAME_PANEL_CE_SCORE_7                  75
+#define GAME_PANEL_CE_SCORE_8                  76
+#define GAME_PANEL_CE_SCORE_1_ELEMENT          77
+#define GAME_PANEL_CE_SCORE_2_ELEMENT          78
+#define GAME_PANEL_CE_SCORE_3_ELEMENT          79
+#define GAME_PANEL_CE_SCORE_4_ELEMENT          80
+#define GAME_PANEL_CE_SCORE_5_ELEMENT          81
+#define GAME_PANEL_CE_SCORE_6_ELEMENT          82
+#define GAME_PANEL_CE_SCORE_7_ELEMENT          83
+#define GAME_PANEL_CE_SCORE_8_ELEMENT          84
+#define GAME_PANEL_PLAYER_NAME                 85
+#define GAME_PANEL_LEVEL_NAME                  86
+#define GAME_PANEL_LEVEL_AUTHOR                        87
+
+#define NUM_GAME_PANEL_CONTROLS                        88
 
 struct GamePanelControlInfo
 {
@@ -237,82 +253,82 @@ static struct GamePanelControlInfo game_panel_controls[] =
   },
   {
     GAME_PANEL_INVENTORY_FIRST_1,
-    &game.panel.inventory_first_1,
+    &game.panel.inventory_first[0],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_INVENTORY_FIRST_2,
-    &game.panel.inventory_first_2,
+    &game.panel.inventory_first[1],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_INVENTORY_FIRST_3,
-    &game.panel.inventory_first_3,
+    &game.panel.inventory_first[2],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_INVENTORY_FIRST_4,
-    &game.panel.inventory_first_4,
+    &game.panel.inventory_first[3],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_INVENTORY_FIRST_5,
-    &game.panel.inventory_first_5,
+    &game.panel.inventory_first[4],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_INVENTORY_FIRST_6,
-    &game.panel.inventory_first_6,
+    &game.panel.inventory_first[5],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_INVENTORY_FIRST_7,
-    &game.panel.inventory_first_7,
+    &game.panel.inventory_first[6],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_INVENTORY_FIRST_8,
-    &game.panel.inventory_first_8,
+    &game.panel.inventory_first[7],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_INVENTORY_LAST_1,
-    &game.panel.inventory_last_1,
+    &game.panel.inventory_last[0],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_INVENTORY_LAST_2,
-    &game.panel.inventory_last_2,
+    &game.panel.inventory_last[1],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_INVENTORY_LAST_3,
-    &game.panel.inventory_last_3,
+    &game.panel.inventory_last[2],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_INVENTORY_LAST_4,
-    &game.panel.inventory_last_4,
+    &game.panel.inventory_last[3],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_INVENTORY_LAST_5,
-    &game.panel.inventory_last_5,
+    &game.panel.inventory_last[4],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_INVENTORY_LAST_6,
-    &game.panel.inventory_last_6,
+    &game.panel.inventory_last[5],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_INVENTORY_LAST_7,
-    &game.panel.inventory_last_7,
+    &game.panel.inventory_last[6],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_INVENTORY_LAST_8,
-    &game.panel.inventory_last_8,
+    &game.panel.inventory_last[7],
     TYPE_ELEMENT,
   },
   {
@@ -512,42 +528,42 @@ static struct GamePanelControlInfo game_panel_controls[] =
   },
   {
     GAME_PANEL_CONVEYOR_BELT_1,
-    &game.panel.conveyor_belt_1,
+    &game.panel.conveyor_belt[0],
     TYPE_ELEMENT,
   },
   {
-    GAME_PANEL_CONVEYOR_BELT_1_SWITCH,
-    &game.panel.conveyor_belt_1_switch,
+    GAME_PANEL_CONVEYOR_BELT_2,
+    &game.panel.conveyor_belt[1],
     TYPE_ELEMENT,
   },
   {
-    GAME_PANEL_CONVEYOR_BELT_2,
-    &game.panel.conveyor_belt_2,
+    GAME_PANEL_CONVEYOR_BELT_3,
+    &game.panel.conveyor_belt[2],
     TYPE_ELEMENT,
   },
   {
-    GAME_PANEL_CONVEYOR_BELT_2_SWITCH,
-    &game.panel.conveyor_belt_2_switch,
+    GAME_PANEL_CONVEYOR_BELT_4,
+    &game.panel.conveyor_belt[3],
     TYPE_ELEMENT,
   },
   {
-    GAME_PANEL_CONVEYOR_BELT_3,
-    &game.panel.conveyor_belt_3,
+    GAME_PANEL_CONVEYOR_BELT_1_SWITCH,
+    &game.panel.conveyor_belt_switch[0],
     TYPE_ELEMENT,
   },
   {
-    GAME_PANEL_CONVEYOR_BELT_3_SWITCH,
-    &game.panel.conveyor_belt_3_switch,
+    GAME_PANEL_CONVEYOR_BELT_2_SWITCH,
+    &game.panel.conveyor_belt_switch[1],
     TYPE_ELEMENT,
   },
   {
-    GAME_PANEL_CONVEYOR_BELT_4,
-    &game.panel.conveyor_belt_4,
+    GAME_PANEL_CONVEYOR_BELT_3_SWITCH,
+    &game.panel.conveyor_belt_switch[2],
     TYPE_ELEMENT,
   },
   {
     GAME_PANEL_CONVEYOR_BELT_4_SWITCH,
-    &game.panel.conveyor_belt_4_switch,
+    &game.panel.conveyor_belt_switch[3],
     TYPE_ELEMENT,
   },
   {
@@ -565,6 +581,86 @@ static struct GamePanelControlInfo game_panel_controls[] =
     &game.panel.gravity_state,
     TYPE_STRING,
   },
+  {
+    GAME_PANEL_CE_SCORE_1,
+    &game.panel.ce_score[0],
+    TYPE_INTEGER,
+  },
+  {
+    GAME_PANEL_CE_SCORE_2,
+    &game.panel.ce_score[1],
+    TYPE_INTEGER,
+  },
+  {
+    GAME_PANEL_CE_SCORE_3,
+    &game.panel.ce_score[2],
+    TYPE_INTEGER,
+  },
+  {
+    GAME_PANEL_CE_SCORE_4,
+    &game.panel.ce_score[3],
+    TYPE_INTEGER,
+  },
+  {
+    GAME_PANEL_CE_SCORE_5,
+    &game.panel.ce_score[4],
+    TYPE_INTEGER,
+  },
+  {
+    GAME_PANEL_CE_SCORE_6,
+    &game.panel.ce_score[5],
+    TYPE_INTEGER,
+  },
+  {
+    GAME_PANEL_CE_SCORE_7,
+    &game.panel.ce_score[6],
+    TYPE_INTEGER,
+  },
+  {
+    GAME_PANEL_CE_SCORE_8,
+    &game.panel.ce_score[7],
+    TYPE_INTEGER,
+  },
+  {
+    GAME_PANEL_CE_SCORE_1_ELEMENT,
+    &game.panel.ce_score_element[0],
+    TYPE_ELEMENT,
+  },
+  {
+    GAME_PANEL_CE_SCORE_2_ELEMENT,
+    &game.panel.ce_score_element[1],
+    TYPE_ELEMENT,
+  },
+  {
+    GAME_PANEL_CE_SCORE_3_ELEMENT,
+    &game.panel.ce_score_element[2],
+    TYPE_ELEMENT,
+  },
+  {
+    GAME_PANEL_CE_SCORE_4_ELEMENT,
+    &game.panel.ce_score_element[3],
+    TYPE_ELEMENT,
+  },
+  {
+    GAME_PANEL_CE_SCORE_5_ELEMENT,
+    &game.panel.ce_score_element[4],
+    TYPE_ELEMENT,
+  },
+  {
+    GAME_PANEL_CE_SCORE_6_ELEMENT,
+    &game.panel.ce_score_element[5],
+    TYPE_ELEMENT,
+  },
+  {
+    GAME_PANEL_CE_SCORE_7_ELEMENT,
+    &game.panel.ce_score_element[6],
+    TYPE_ELEMENT,
+  },
+  {
+    GAME_PANEL_CE_SCORE_8_ELEMENT,
+    &game.panel.ce_score_element[7],
+    TYPE_ELEMENT,
+  },
   {
     GAME_PANEL_PLAYER_NAME,
     &game.panel.player_name,
@@ -1891,7 +1987,7 @@ void UpdateGameControlValues()
       stored_player[player_nr].num_white_keys;
   }
 
-  for (i = 0; i < 8; i++)
+  for (i = 0; i < NUM_PANEL_INVENTORY; i++)
   {
     game_panel_controls[GAME_PANEL_INVENTORY_FIRST_1 + i].value =
       get_inventory_element_from_pos(local_player, i);
@@ -1975,26 +2071,14 @@ void UpdateGameControlValues()
   game_panel_controls[GAME_PANEL_ROBOT_WHEEL].value =
     (game.robot_wheel_active ? EL_ROBOT_WHEEL_ACTIVE : EL_ROBOT_WHEEL);
 
-  game_panel_controls[GAME_PANEL_CONVEYOR_BELT_1].value =
-    (game.belt_dir[0] != MV_NONE ? EL_CONVEYOR_BELT_1_MIDDLE_ACTIVE :
-     EL_CONVEYOR_BELT_1_MIDDLE);
-  game_panel_controls[GAME_PANEL_CONVEYOR_BELT_1_SWITCH].value =
-    getBeltSwitchElementFromBeltNrAndBeltDir(0, game.belt_dir[0]);
-  game_panel_controls[GAME_PANEL_CONVEYOR_BELT_2].value =
-    (game.belt_dir[1] != MV_NONE ? EL_CONVEYOR_BELT_2_MIDDLE_ACTIVE :
-     EL_CONVEYOR_BELT_2_MIDDLE);
-  game_panel_controls[GAME_PANEL_CONVEYOR_BELT_2_SWITCH].value =
-    getBeltSwitchElementFromBeltNrAndBeltDir(1, game.belt_dir[1]);
-  game_panel_controls[GAME_PANEL_CONVEYOR_BELT_3].value =
-    (game.belt_dir[2] != MV_NONE ? EL_CONVEYOR_BELT_3_MIDDLE_ACTIVE :
-     EL_CONVEYOR_BELT_3_MIDDLE);
-  game_panel_controls[GAME_PANEL_CONVEYOR_BELT_3_SWITCH].value =
-    getBeltSwitchElementFromBeltNrAndBeltDir(2, game.belt_dir[2]);
-  game_panel_controls[GAME_PANEL_CONVEYOR_BELT_4].value =
-    (game.belt_dir[3] != MV_NONE ? EL_CONVEYOR_BELT_4_MIDDLE_ACTIVE :
-     EL_CONVEYOR_BELT_4_MIDDLE);
-  game_panel_controls[GAME_PANEL_CONVEYOR_BELT_4_SWITCH].value =
-    getBeltSwitchElementFromBeltNrAndBeltDir(3, game.belt_dir[3]);
+  for (i = 0; i < NUM_BELTS; i++)
+  {
+    game_panel_controls[GAME_PANEL_CONVEYOR_BELT_1 + i].value =
+      (game.belt_dir[i] != MV_NONE ? EL_CONVEYOR_BELT_1_MIDDLE_ACTIVE :
+       EL_CONVEYOR_BELT_1_MIDDLE) + i;
+    game_panel_controls[GAME_PANEL_CONVEYOR_BELT_1_SWITCH + i].value =
+      getBeltSwitchElementFromBeltNrAndBeltDir(i, game.belt_dir[i]);
+  }
 
   game_panel_controls[GAME_PANEL_MAGIC_WALL].value =
     (game.magic_wall_active ? EL_MAGIC_WALL_ACTIVE : EL_MAGIC_WALL);
@@ -2008,6 +2092,22 @@ void UpdateGameControlValues()
   game_panel_controls[GAME_PANEL_GRAVITY_STATE].value = game.gravity;
 #endif
 
+  for (i = 0; i < NUM_PANEL_CE_SCORE; i++)
+  {
+    if (game.panel.ce_score[i].id != EL_UNDEFINED)
+    {
+      int ce_score = element_info[game.panel.ce_score[i].id].collect_score;
+
+      game_panel_controls[GAME_PANEL_CE_SCORE_1 + i].value = ce_score;
+      game_panel_controls[GAME_PANEL_CE_SCORE_1_ELEMENT + i].value = ce_score;
+    }
+    else
+    {
+      game_panel_controls[GAME_PANEL_CE_SCORE_1 + i].value = 0;
+      game_panel_controls[GAME_PANEL_CE_SCORE_1_ELEMENT + i].value = 0;
+    }
+  }
+
   game_panel_controls[GAME_PANEL_PLAYER_NAME].value = 0;
   game_panel_controls[GAME_PANEL_LEVEL_NAME].value = 0;
   game_panel_controls[GAME_PANEL_LEVEL_AUTHOR].value = 0;
@@ -2093,31 +2193,49 @@ void DisplayGameControlValues()
                                       max_width, max_height);
          }
        }
-
-       pos->width = size * getFontWidth(font);
       }
 
+#if 1
+      /* correct text size if "digits" is zero or less */
+      if (size <= 0)
+       size = strlen(int2str(value, size));
+
+      /* dynamically correct text alignment */
+      pos->width = size * getFontWidth(font);
+#endif
+
       DrawText(PANEL_XPOS(pos), PANEL_YPOS(pos), int2str(value, size), font);
     }
     else if (type == TYPE_ELEMENT)
     {
+      int element, graphic;
+      Bitmap *src_bitmap;
+      int src_x, src_y;
+      int width, height;
       int dst_x = PANEL_XPOS(pos);
       int dst_y = PANEL_YPOS(pos);
 
       if (value == EL_UNDEFINED || value == EL_EMPTY)
       {
-       int src_x = DOOR_GFX_PAGEX5 + ALIGNED_TEXT_XPOS(pos);
-       int src_y = DOOR_GFX_PAGEY1 + ALIGNED_TEXT_YPOS(pos);
+       element = (last_value == EL_UNDEFINED ? EL_EMPTY : last_value);
+       graphic = el2panelimg(element);
 
-       BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto, src_x, src_y,
-                  size, size, dst_x, dst_y);
+       src_bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap;
+       src_x = DOOR_GFX_PAGEX5 + ALIGNED_TEXT_XPOS(pos);
+       src_y = DOOR_GFX_PAGEY1 + ALIGNED_TEXT_YPOS(pos);
       }
       else
       {
-       int graphic = el2panelimg(value);
+       element = value;
+       graphic = el2panelimg(value);
 
-       DrawSizedGraphicExt(drawto, dst_x, dst_y, graphic, frame, size);
+       getSizedGraphicSource(graphic, frame, size, &src_bitmap, &src_x,&src_y);
       }
+
+      width  = graphic_info[graphic].width  * size / TILESIZE;
+      height = graphic_info[graphic].height * size / TILESIZE;
+
+      BlitBitmap(src_bitmap, drawto, src_x, src_y, width, height, dst_x, dst_y);
     }
     else if (type == TYPE_STRING)
     {
@@ -2150,21 +2268,22 @@ void DisplayGameControlValues()
        font = (active ? font2 : font1);
       }
 
-#if 1
-      /* as with numbers, don't truncate output if "chars" is zero or less */
-      size = (size > 0 ? size : strlen(s));
-#endif
-
       if (s != NULL)
       {
-       char *s_cut = getStringCopyN(s, size);
+       char *s_cut;
 
-#if 0
-       /* (not needed anymore with above correction of "size" value) */
-       size = strlen(s_cut);   /* string size may be smaller than "chars" */
+#if 1
+       if (size <= 0)
+       {
+         /* don't truncate output if "chars" is zero or less */
+         size = strlen(s);
+
+         /* dynamically correct text alignment */
+         pos->width = size * getFontWidth(font);
+       }
 #endif
 
-       pos->width = size * getFontWidth(font);
+       s_cut = getStringCopyN(s, size);
 
        DrawText(PANEL_XPOS(pos), PANEL_YPOS(pos), s_cut, font);
 
index 55a0b5e80484304d4998d116241bd80dacd5d9cc..ace61a5b14884658f9253b36bca9b5b43510c819 100644 (file)
 /* #include "main.h" */
 
 #define MAX_INVENTORY_SIZE     1000
+
 #define STD_NUM_KEYS           4
 #define MAX_NUM_KEYS           8
 
+#define NUM_BELTS              4
+#define NUM_BELT_PARTS         3
+
+#define NUM_PANEL_INVENTORY    8
+#define NUM_PANEL_CE_SCORE     8
 
 #if 1
 struct GamePanelInfo
@@ -28,22 +34,8 @@ struct GamePanelInfo
   struct TextPosInfo level_number;
   struct TextPosInfo gems;
   struct TextPosInfo inventory_count;
-  struct TextPosInfo inventory_first_1;
-  struct TextPosInfo inventory_first_2;
-  struct TextPosInfo inventory_first_3;
-  struct TextPosInfo inventory_first_4;
-  struct TextPosInfo inventory_first_5;
-  struct TextPosInfo inventory_first_6;
-  struct TextPosInfo inventory_first_7;
-  struct TextPosInfo inventory_first_8;
-  struct TextPosInfo inventory_last_1;
-  struct TextPosInfo inventory_last_2;
-  struct TextPosInfo inventory_last_3;
-  struct TextPosInfo inventory_last_4;
-  struct TextPosInfo inventory_last_5;
-  struct TextPosInfo inventory_last_6;
-  struct TextPosInfo inventory_last_7;
-  struct TextPosInfo inventory_last_8;
+  struct TextPosInfo inventory_first[NUM_PANEL_INVENTORY];
+  struct TextPosInfo inventory_last[NUM_PANEL_INVENTORY];
   struct TextPosInfo key[MAX_NUM_KEYS];
   struct TextPosInfo key_white;
   struct TextPosInfo key_white_count;
@@ -76,17 +68,13 @@ struct GamePanelInfo
   struct TextPosInfo sokoban_objects;
   struct TextPosInfo sokoban_fields;
   struct TextPosInfo robot_wheel;
-  struct TextPosInfo conveyor_belt_1;
-  struct TextPosInfo conveyor_belt_1_switch;
-  struct TextPosInfo conveyor_belt_2;
-  struct TextPosInfo conveyor_belt_2_switch;
-  struct TextPosInfo conveyor_belt_3;
-  struct TextPosInfo conveyor_belt_3_switch;
-  struct TextPosInfo conveyor_belt_4;
-  struct TextPosInfo conveyor_belt_4_switch;
+  struct TextPosInfo conveyor_belt[NUM_BELTS];
+  struct TextPosInfo conveyor_belt_switch[NUM_BELTS];
   struct TextPosInfo magic_wall;
   struct TextPosInfo magic_wall_time;
   struct TextPosInfo gravity_state;
+  struct TextPosInfo ce_score[NUM_PANEL_CE_SCORE];
+  struct TextPosInfo ce_score_element[NUM_PANEL_CE_SCORE];
   struct TextPosInfo player_name;
   struct TextPosInfo level_name;
   struct TextPosInfo level_author;
index e300b9bb50821b6c4115fb0e2a8181af2ea57de5..b93c9bdeea4ee03056530b61aeced0a1c8d0d978 100644 (file)
@@ -607,6 +607,23 @@ boolean strEqualN(char *s1, char *s2, int n)
          strncmp(s1, s2, n) == 0);
 }
 
+boolean strEqualPrefix(char *s, char *prefix)
+{
+  return (s == NULL && prefix == NULL ? TRUE  :
+         s == NULL && prefix != NULL ? FALSE :
+         s != NULL && prefix == NULL ? FALSE :
+         strncmp(s, prefix, strlen(prefix)) == 0);
+}
+
+boolean strEqualSuffix(char *s, char *suffix)
+{
+  return (s == NULL && suffix == NULL ? TRUE  :
+         s == NULL && suffix != NULL ? FALSE :
+         s != NULL && suffix == NULL ? FALSE :
+         strlen(s) < strlen(suffix)  ? FALSE :
+         strncmp(&s[strlen(s) - strlen(suffix)], suffix, strlen(suffix)) == 0);
+}
+
 
 /* ------------------------------------------------------------------------- */
 /* command line option handling functions                                    */
@@ -1853,7 +1870,11 @@ int get_parameter_value(char *value_raw, char *suffix, int type)
              string_has_parameter(value, "melt")       ? FADE_MODE_MELT :
              FADE_MODE_DEFAULT);
   }
+#if 1
+  else if (strEqualPrefix(suffix, ".font"))    /* (may also be ".font_xyz") */
+#else
   else if (strEqualN(suffix, ".font", 5))      /* (may also be ".font_xyz") */
+#endif
   {
     result = gfx.get_font_from_token_function(value);
   }
@@ -1870,35 +1891,6 @@ int get_parameter_value(char *value_raw, char *suffix, int type)
   return result;
 }
 
-int get_token_parameter_value(char *token, char *value_raw)
-{
-  char *suffix;
-
-  if (token == NULL || value_raw == NULL)
-    return ARG_UNDEFINED_VALUE;
-
-  suffix = strrchr(token, '.');
-  if (suffix == NULL)
-    suffix = token;
-
-#if 0
-  if (strncmp(suffix, ".font", 5) == 0)
-  {
-    int i;
-
-    /* !!! OPTIMIZE THIS BY USING HASH !!! */
-    for (i = 0; i < NUM_FONTS; i++)
-      if (strEqual(value_raw, font_info[i].token_name))
-       return i;
-
-    /* if font not found, use reliable default value */
-    return FONT_INITIAL_1;
-  }
-#endif
-
-  return get_parameter_value(value_raw, suffix, TYPE_INTEGER);
-}
-
 struct ScreenModeInfo *get_screen_mode_from_string(char *screen_mode_string)
 {
   static struct ScreenModeInfo screen_mode;
index cd4b2dd06675d3d5727267ba84a11c65dc452950..3d011184260d5e65b87b9cc1371154246c92028a 100644 (file)
@@ -108,6 +108,8 @@ char *getStringToLower(char *);
 void setString(char **, char *);
 boolean strEqual(char *, char *);
 boolean strEqualN(char *, char *, int);
+boolean strEqualPrefix(char *, char *);
+boolean strEqualSuffix(char *, char *);
 
 void GetOptions(char **, void (*print_usage_function)(void));
 
@@ -182,7 +184,6 @@ boolean FileIsArtworkType(char *, int);
 char *get_mapped_token(char *);
 
 int get_parameter_value(char *, char *, int);
-int get_token_parameter_value(char *, char *);
 
 struct ScreenModeInfo *get_screen_mode_from_string(char *);
 void get_aspect_ratio_from_screen_mode(struct ScreenModeInfo *, int *x, int *y);
index c0e5d776a10fdfec799160a73a29ae0735107276..0a306068fd4428651977f151339dc924212cf2bd 100644 (file)
@@ -1052,6 +1052,7 @@ struct TextPosInfo
   int align, valign;
   int size;
   int font, font_alt;
+  int id;
 };
 
 
index eb6b438688736b525534e15efd4dd11a5eecbcc4..1e62cc61186a8ab658c32be77c43875a7ff6d2ab 100644 (file)
 
 #define MAX_NUM_AMOEBA         100
 
-#define NUM_BELTS              4
-#define NUM_BELT_PARTS         3
 #define NUM_ENVELOPES          4
 #define MIN_ENVELOPE_XSIZE     1
 #define MIN_ENVELOPE_YSIZE     1