rnd-20030426-1-src
authorHolger Schemel <info@artsoft.org>
Sat, 26 Apr 2003 17:05:59 +0000 (19:05 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:41:32 +0000 (10:41 +0200)
src/conf_fnt.c
src/conf_gfx.c
src/conf_gfx.h
src/conftime.h
src/editor.c
src/libgame/hash.c
src/libgame/setup.c
src/libgame/setup.h
src/main.c
src/main.h
src/screens.c

index 09e6dd854b5e3a993f07e7e98cc31fe31a0ad2f2..0a191dda15f257a76f19a1f25fb52e882c988d34 100644 (file)
@@ -71,13 +71,17 @@ font_to_graphic[] =
     FONT_TEXT_1,                               GFX_SPECIAL_ARG_LEVELS,
     IMG_FONT_TEXT_1_LEVELS
   },
+  {
+    FONT_TEXT_1,                               GFX_SPECIAL_ARG_PREVIEW,
+    IMG_FONT_TEXT_1_PREVIEW
+  },
   {
     FONT_TEXT_1,                               GFX_SPECIAL_ARG_SCORES,
     IMG_FONT_TEXT_1_SCORES
   },
   {
-    FONT_TEXT_1,                               GFX_SPECIAL_ARG_PREVIEW,
-    IMG_FONT_TEXT_1_PREVIEW
+    FONT_TEXT_1_ACTIVE,                                GFX_SPECIAL_ARG_SCORES,
+    IMG_FONT_TEXT_1_ACTIVE_SCORES
   },
   {
     FONT_TEXT_2,                               -1,
@@ -87,13 +91,17 @@ font_to_graphic[] =
     FONT_TEXT_2,                               GFX_SPECIAL_ARG_LEVELS,
     IMG_FONT_TEXT_2_LEVELS
   },
+  {
+    FONT_TEXT_2,                               GFX_SPECIAL_ARG_PREVIEW,
+    IMG_FONT_TEXT_2_PREVIEW
+  },
   {
     FONT_TEXT_2,                               GFX_SPECIAL_ARG_SCORES,
     IMG_FONT_TEXT_2_SCORES
   },
   {
-    FONT_TEXT_2,                               GFX_SPECIAL_ARG_PREVIEW,
-    IMG_FONT_TEXT_2_PREVIEW
+    FONT_TEXT_2_ACTIVE,                                GFX_SPECIAL_ARG_SCORES,
+    IMG_FONT_TEXT_2_ACTIVE_SCORES
   },
   {
     FONT_TEXT_3,                               -1,
@@ -103,13 +111,17 @@ font_to_graphic[] =
     FONT_TEXT_3,                               GFX_SPECIAL_ARG_LEVELS,
     IMG_FONT_TEXT_3_LEVELS
   },
+  {
+    FONT_TEXT_3,                               GFX_SPECIAL_ARG_PREVIEW,
+    IMG_FONT_TEXT_3_PREVIEW
+  },
   {
     FONT_TEXT_3,                               GFX_SPECIAL_ARG_SCORES,
     IMG_FONT_TEXT_3_SCORES
   },
   {
-    FONT_TEXT_3,                               GFX_SPECIAL_ARG_PREVIEW,
-    IMG_FONT_TEXT_3_PREVIEW
+    FONT_TEXT_3_ACTIVE,                                GFX_SPECIAL_ARG_SCORES,
+    IMG_FONT_TEXT_3_ACTIVE_SCORES
   },
   {
     FONT_TEXT_4,                               -1,
@@ -123,6 +135,10 @@ font_to_graphic[] =
     FONT_TEXT_4,                               GFX_SPECIAL_ARG_SCORES,
     IMG_FONT_TEXT_4_SCORES
   },
+  {
+    FONT_TEXT_4_ACTIVE,                                GFX_SPECIAL_ARG_SCORES,
+    IMG_FONT_TEXT_4_ACTIVE_SCORES
+  },
   {
     FONT_INPUT_1,                              -1,
     IMG_FONT_INPUT_1
index 2b58e36c0c730f43300b1d6f60813fc38ed619df..ef05d3bf2f0dacc0794b071f05b63b563189f855 100644 (file)
@@ -3160,16 +3160,21 @@ struct ConfigInfo image_config[] =
   { "font.text_1.LEVELS.y",                    "0"                     },
   { "font.text_1.LEVELS.width",                        "16"                    },
   { "font.text_1.LEVELS.height",               "32"                    },
-  { "font.text_1.SCORES",                      "RocksFontBig.pcx"      },
-  { "font.text_1.SCORES.x",                    "0"                     },
-  { "font.text_1.SCORES.y",                    "320"                   },
-  { "font.text_1.SCORES.width",                        "32"                    },
-  { "font.text_1.SCORES.height",               "32"                    },
   { "font.text_1.PREVIEW",                     "RocksFontEM.pcx"       },
   { "font.text_1.PREVIEW.x",                   "0"                     },
   { "font.text_1.PREVIEW.y",                   "160"                   },
   { "font.text_1.PREVIEW.width",               "16"                    },
   { "font.text_1.PREVIEW.height",              "16"                    },
+  { "font.text_1.SCORES",                      "RocksFontMedium.pcx"   },
+  { "font.text_1.SCORES.x",                    "0"                     },
+  { "font.text_1.SCORES.y",                    "480"                   },
+  { "font.text_1.SCORES.width",                        "16"                    },
+  { "font.text_1.SCORES.height",               "32"                    },
+  { "font.text_1.active.SCORES",               "RocksFontMedium.pcx"   },
+  { "font.text_1.active.SCORES.x",             "0"                     },
+  { "font.text_1.active.SCORES.y",             "0"                     },
+  { "font.text_1.active.SCORES.width",         "16"                    },
+  { "font.text_1.active.SCORES.height",                "32"                    },
   { "font.text_2",                             "RocksFontSmall.pcx"    },
   { "font.text_2.x",                           "0"                     },
   { "font.text_2.y",                           "210"                   },
@@ -3180,16 +3185,21 @@ struct ConfigInfo image_config[] =
   { "font.text_2.LEVELS.y",                    "160"                   },
   { "font.text_2.LEVELS.width",                        "16"                    },
   { "font.text_2.LEVELS.height",               "32"                    },
-  { "font.text_2.SCORES",                      "RocksFontMedium.pcx"   },
-  { "font.text_2.SCORES.x",                    "0"                     },
-  { "font.text_2.SCORES.y",                    "480"                   },
-  { "font.text_2.SCORES.width",                        "16"                    },
-  { "font.text_2.SCORES.height",               "32"                    },
   { "font.text_2.PREVIEW",                     "RocksFontEM.pcx"       },
   { "font.text_2.PREVIEW.x",                   "0"                     },
   { "font.text_2.PREVIEW.y",                   "160"                   },
   { "font.text_2.PREVIEW.width",               "16"                    },
   { "font.text_2.PREVIEW.height",              "16"                    },
+  { "font.text_2.SCORES",                      "RocksFontBig.pcx"      },
+  { "font.text_2.SCORES.x",                    "0"                     },
+  { "font.text_2.SCORES.y",                    "320"                   },
+  { "font.text_2.SCORES.width",                        "32"                    },
+  { "font.text_2.SCORES.height",               "32"                    },
+  { "font.text_2.active.SCORES",               "RocksFontBig.pcx"      },
+  { "font.text_2.active.SCORES.x",             "0"                     },
+  { "font.text_2.active.SCORES.y",             "0"                     },
+  { "font.text_2.active.SCORES.width",         "32"                    },
+  { "font.text_2.active.SCORES.height",                "32"                    },
   { "font.text_3",                             "RocksFontSmall.pcx"    },
   { "font.text_3.x",                           "0"                     },
   { "font.text_3.y",                           "0"                     },
@@ -3200,16 +3210,21 @@ struct ConfigInfo image_config[] =
   { "font.text_3.LEVELS.y",                    "320"                   },
   { "font.text_3.LEVELS.width",                        "16"                    },
   { "font.text_3.LEVELS.height",               "32"                    },
-  { "font.text_3.SCORES",                      "RocksFontBig.pcx"      },
-  { "font.text_3.SCORES.x",                    "0"                     },
-  { "font.text_3.SCORES.y",                    "0"                     },
-  { "font.text_3.SCORES.width",                        "32"                    },
-  { "font.text_3.SCORES.height",               "32"                    },
   { "font.text_3.PREVIEW",                     "RocksFontEM.pcx"       },
   { "font.text_3.PREVIEW.x",                   "0"                     },
   { "font.text_3.PREVIEW.y",                   "160"                   },
   { "font.text_3.PREVIEW.width",               "16"                    },
   { "font.text_3.PREVIEW.height",              "16"                    },
+  { "font.text_3.SCORES",                      "RocksFontMedium.pcx"   },
+  { "font.text_3.SCORES.x",                    "0"                     },
+  { "font.text_3.SCORES.y",                    "480"                   },
+  { "font.text_3.SCORES.width",                        "16"                    },
+  { "font.text_3.SCORES.height",               "32"                    },
+  { "font.text_3.active.SCORES",               "RocksFontMedium.pcx"   },
+  { "font.text_3.active.SCORES.x",             "0"                     },
+  { "font.text_3.active.SCORES.y",             "0"                     },
+  { "font.text_3.active.SCORES.width",         "16"                    },
+  { "font.text_3.active.SCORES.height",                "32"                    },
   { "font.text_4",                             "RocksFontSmall.pcx"    },
   { "font.text_4.x",                           "0"                     },
   { "font.text_4.y",                           "70"                    },
@@ -3222,9 +3237,14 @@ struct ConfigInfo image_config[] =
   { "font.text_4.LEVELS.height",               "32"                    },
   { "font.text_4.SCORES",                      "RocksFontMedium.pcx"   },
   { "font.text_4.SCORES.x",                    "0"                     },
-  { "font.text_4.SCORES.y",                    "0"                     },
+  { "font.text_4.SCORES.y",                    "480"                   },
   { "font.text_4.SCORES.width",                        "16"                    },
   { "font.text_4.SCORES.height",               "32"                    },
+  { "font.text_4.active.SCORES",               "RocksFontMedium.pcx"   },
+  { "font.text_4.active.SCORES.x",             "0"                     },
+  { "font.text_4.active.SCORES.y",             "0"                     },
+  { "font.text_4.active.SCORES.width",         "16"                    },
+  { "font.text_4.active.SCORES.height",                "32"                    },
 
   { "font.input_1",                            "RocksFontSmall.pcx"    },
   { "font.input_1.x",                          "0"                     },
index 76452cdc84e8ba1501e7b8ffed99bddf00d90662..43f70b6166ae878124366fc693c59086646d4c80 100644 (file)
 #define IMG_FONT_MENU_2                                        824
 #define IMG_FONT_TEXT_1                                        825
 #define IMG_FONT_TEXT_1_LEVELS                         826
-#define IMG_FONT_TEXT_1_SCORES                         827
-#define IMG_FONT_TEXT_1_PREVIEW                                828
-#define IMG_FONT_TEXT_2                                        829
-#define IMG_FONT_TEXT_2_LEVELS                         830
-#define IMG_FONT_TEXT_2_SCORES                         831
+#define IMG_FONT_TEXT_1_PREVIEW                                827
+#define IMG_FONT_TEXT_1_SCORES                         828
+#define IMG_FONT_TEXT_1_ACTIVE_SCORES                  829
+#define IMG_FONT_TEXT_2                                        830
+#define IMG_FONT_TEXT_2_LEVELS                         831
 #define IMG_FONT_TEXT_2_PREVIEW                                832
-#define IMG_FONT_TEXT_3                                        833
-#define IMG_FONT_TEXT_3_LEVELS                         834
-#define IMG_FONT_TEXT_3_SCORES                         835
-#define IMG_FONT_TEXT_3_PREVIEW                                836
-#define IMG_FONT_TEXT_4                                        837
-#define IMG_FONT_TEXT_4_LEVELS                         838
-#define IMG_FONT_TEXT_4_SCORES                         839
-#define IMG_FONT_INPUT_1                               840
-#define IMG_FONT_INPUT_1_MAIN                          841
-#define IMG_FONT_INPUT_1_ACTIVE                                842
-#define IMG_FONT_INPUT_1_ACTIVE_MAIN                   843
-#define IMG_FONT_INPUT_1_ACTIVE_SETUP                  844
-#define IMG_FONT_INPUT_2                               845
-#define IMG_FONT_INPUT_2_ACTIVE                                846
-#define IMG_FONT_OPTION_OFF                            847
-#define IMG_FONT_OPTION_ON                             848
-#define IMG_FONT_VALUE_1                               849
-#define IMG_FONT_VALUE_2                               850
-#define IMG_FONT_VALUE_OLD                             851
-#define IMG_FONT_LEVEL_NUMBER                          852
-#define IMG_FONT_TAPE_RECORDER                         853
-#define IMG_FONT_GAME_INFO                             854
-#define IMG_GLOBAL_BORDER                              855
-#define IMG_GLOBAL_DOOR                                        856
-#define IMG_EDITOR_ELEMENT_BORDER                      857
-#define IMG_BACKGROUND                                 858
-#define IMG_BACKGROUND_MAIN                            859
-#define IMG_BACKGROUND_LEVELS                          860
-#define IMG_BACKGROUND_SCORES                          861
-#define IMG_BACKGROUND_EDITOR                          862
-#define IMG_BACKGROUND_INFO                            863
-#define IMG_BACKGROUND_SETUP                           864
-#define IMG_BACKGROUND_DOOR                            865
+#define IMG_FONT_TEXT_2_SCORES                         833
+#define IMG_FONT_TEXT_2_ACTIVE_SCORES                  834
+#define IMG_FONT_TEXT_3                                        835
+#define IMG_FONT_TEXT_3_LEVELS                         836
+#define IMG_FONT_TEXT_3_PREVIEW                                837
+#define IMG_FONT_TEXT_3_SCORES                         838
+#define IMG_FONT_TEXT_3_ACTIVE_SCORES                  839
+#define IMG_FONT_TEXT_4                                        840
+#define IMG_FONT_TEXT_4_LEVELS                         841
+#define IMG_FONT_TEXT_4_SCORES                         842
+#define IMG_FONT_TEXT_4_ACTIVE_SCORES                  843
+#define IMG_FONT_INPUT_1                               844
+#define IMG_FONT_INPUT_1_MAIN                          845
+#define IMG_FONT_INPUT_1_ACTIVE                                846
+#define IMG_FONT_INPUT_1_ACTIVE_MAIN                   847
+#define IMG_FONT_INPUT_1_ACTIVE_SETUP                  848
+#define IMG_FONT_INPUT_2                               849
+#define IMG_FONT_INPUT_2_ACTIVE                                850
+#define IMG_FONT_OPTION_OFF                            851
+#define IMG_FONT_OPTION_ON                             852
+#define IMG_FONT_VALUE_1                               853
+#define IMG_FONT_VALUE_2                               854
+#define IMG_FONT_VALUE_OLD                             855
+#define IMG_FONT_LEVEL_NUMBER                          856
+#define IMG_FONT_TAPE_RECORDER                         857
+#define IMG_FONT_GAME_INFO                             858
+#define IMG_GLOBAL_BORDER                              859
+#define IMG_GLOBAL_DOOR                                        860
+#define IMG_EDITOR_ELEMENT_BORDER                      861
+#define IMG_BACKGROUND                                 862
+#define IMG_BACKGROUND_MAIN                            863
+#define IMG_BACKGROUND_LEVELS                          864
+#define IMG_BACKGROUND_SCORES                          865
+#define IMG_BACKGROUND_EDITOR                          866
+#define IMG_BACKGROUND_INFO                            867
+#define IMG_BACKGROUND_SETUP                           868
+#define IMG_BACKGROUND_DOOR                            869
 
-#define NUM_IMAGE_FILES                                        866
+#define NUM_IMAGE_FILES                                        870
 
 #endif /* CONF_GFX_H */
index a14a5fb542284507683c6bb005329c7adeda3967..f4dfe72679c85a5a172e23b6bb4c57acd5c1ccc4 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-04-25 01:16]"
+#define COMPILE_DATE_STRING "[2003-04-26 19:05]"
index 86311c57cc985846a50c28ce36b66a0b710a9dc6..b028364fdeb4131f8755da432c750dca8b8f3439 100644 (file)
@@ -3641,7 +3641,7 @@ static void DrawPropertiesTabulatorGadgets()
   struct GadgetDesign *gd = &gd_gi->alt_design[GD_BUTTON_UNPRESSED];
   int gd_x = gd->x + gd_gi->border.width / 2;
   int gd_y = gd->y + gd_gi->height - 1;
-  Pixel line_color = GetPixel(gd->bitmap, gd_x, gd_y);
+  Pixel tab_color = GetPixel(gd->bitmap, gd_x, gd_y);
   int id_first = ED_TEXTBUTTON_ID_PROPERTIES_INFO;
   int id_last  = ED_TEXTBUTTON_ID_PROPERTIES_INFO;
   int i;
@@ -3659,19 +3659,23 @@ static void DrawPropertiesTabulatorGadgets()
     int gadget_id = textbutton_info[i].gadget_id;
     struct GadgetInfo *gi = level_editor_gadget[gadget_id];
     boolean active = (i != edit_mode_properties);
-    Pixel color = (active ? BLACK_PIXEL : line_color);
 
-    /* draw solid or black line below tabulator button */
-    FillRectangle(drawto, gi->x, gi->y + gi->height, gi->width, 1, color);
+    /* draw background line below tabulator button */
+    ClearRectangleOnBackground(drawto, gi->x, gi->y + gi->height, gi->width,1);
+
+    /* draw solid line below inactive tabulator buttons */
+    if (!active && tab_color != BLACK_PIXEL)   /* black => transparent */
+      FillRectangle(drawto, gi->x, gi->y + gi->height, gi->width,1, tab_color);
 
     ModifyGadget(gi, GDI_ACTIVE, active, GDI_END);
     MapTextbuttonGadget(i);
   }
 
   /* draw little border line below tabulator buttons */
-  FillRectangle(drawto, gd_gi->x, gd_gi->y + gd_gi->height + 1,
-               3 * gd_gi->width + 2 * ED_GADGET_DISTANCE, ED_GADGET_DISTANCE,
-               line_color);
+  if (tab_color != BLACK_PIXEL)                        /* black => transparent */
+    FillRectangle(drawto, gd_gi->x, gd_gi->y + gd_gi->height + 1,
+                 3 * gd_gi->width + 2 * ED_GADGET_DISTANCE,
+                 ED_GADGET_DISTANCE, tab_color);
 }
 
 static void DrawPropertiesInfo()
index 32c7dec9852f64bbe45739ee3484f0f4ad9ca817..805190bfe81404424a3e34e40024bd683395e43a 100644 (file)
@@ -57,6 +57,7 @@ create_hashtable(unsigned int minsize, float maxloadfactor,
     if (NULL == h) return NULL; /*oom*/
     h->table = (struct entry **)malloc(sizeof(struct entry*) * size);
     if (NULL == h->table) { free(h); return NULL; } /*oom*/
+
     for (i=0;i<size;i++) { h->table[i] = NULL; }
     h->tablelength  = size;
     h->entrycount   = 0;
@@ -194,9 +195,9 @@ hashtable_change(struct hashtable *h, void *k, void *v)
         /* Check hash value to short circuit heavier comparison */
         if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
        {
-         free(e->v);
-         e->v = v;
-         return -1;
+           free(e->v);
+           e->v = v;
+           return -1;
        }
         e = e->next;
     }
@@ -260,24 +261,23 @@ hashtable_destroy(struct hashtable *h, int free_values)
     unsigned int i;
     struct entry *e, *f;
     struct entry **table = h->table;
-    if (free_values)
-    {
-        for (i = 0; i < h->tablelength; i++)
-        {
-            e = table[i];
-            while (NULL != e)
-            { f = e; e = e->next; free(f->k); free(f->v); free(f); }
-        }
-    }
-    else
+
+    for (i = 0; i < h->tablelength; i++)
     {
-        for (i = 0; i < h->tablelength; i++)
-        {
-            e = table[i];
-            while (NULL != e)
-            { f = e; e = e->next; free(f->k); free(f); }
-        }
+        e = table[i];
+        while (NULL != e)
+       {
+           f = e;
+           e = e->next;
+           free(f->k);
+           if (free_values)
+               free(f->v);
+           free(f);
+       }
     }
+
+    free(h->table);
+    free(h);
 }
 
 
index 1e9a56e2e1917f2f2779fc8c2256a065d42be6bc..8be4c7a8a80e59312ae41a010d37117da914331c 100644 (file)
@@ -1040,6 +1040,18 @@ char *getFormattedSetupEntry(char *token, char *value)
   return entry;
 }
 
+SetupFileList *newSetupFileList(char *token, char *value)
+{
+  SetupFileList *new = checked_malloc(sizeof(SetupFileList));
+
+  new->token = getStringCopy(token);
+  new->value = getStringCopy(value);
+
+  new->next = NULL;
+
+  return new;
+}
+
 void freeSetupFileList(SetupFileList *list)
 {
   if (list == NULL)
@@ -1054,18 +1066,6 @@ void freeSetupFileList(SetupFileList *list)
   free(list);
 }
 
-SetupFileList *newSetupFileList(char *token, char *value)
-{
-  SetupFileList *new = checked_malloc(sizeof(SetupFileList));
-
-  new->token = getStringCopy(token);
-  new->value = getStringCopy(value);
-
-  new->next = NULL;
-
-  return new;
-}
-
 char *getListEntry(SetupFileList *list, char *token)
 {
   if (list == NULL)
@@ -1147,15 +1147,6 @@ static int keys_are_equal(void *key1, void *key2)
   return (strcmp((char *)key1, (char *)key2) == 0);
 }
 
-void freeSetupFileHash(SetupFileHash *hash)
-{
-  if (hash == NULL)
-    return;
-
-  hashtable_destroy(hash, 1);  /* 1 == also free values */
-  free(hash);
-}
-
 SetupFileHash *newSetupFileHash()
 {
   SetupFileHash *new_hash =
@@ -1164,6 +1155,14 @@ SetupFileHash *newSetupFileHash()
   return new_hash;
 }
 
+void freeSetupFileHash(SetupFileHash *hash)
+{
+  if (hash == NULL)
+    return;
+
+  hashtable_destroy(hash, 1);  /* 1 == also free values stored in hash */
+}
+
 char *getHashEntry(SetupFileHash *hash, char *token)
 {
   if (hash == NULL)
index 9b4440334f8933226ab01e8618b23b1c66bdb20b..479f88c4c482030741b7589aedeebe78696b1967 100644 (file)
@@ -227,14 +227,14 @@ boolean checkCookieString(const char *, const char *);
 
 char *getFormattedSetupEntry(char *, char *);
 
-void freeSetupFileList(struct SetupFileList *);
 struct SetupFileList *newSetupFileList(char *, char *);
+void freeSetupFileList(struct SetupFileList *);
 char *getListEntry(struct SetupFileList *, char *);
 void setListEntry(struct SetupFileList *, char *, char *);
 SetupFileList *loadSetupFileList(char *);
 
-void freeSetupFileHash(SetupFileHash *);
 SetupFileHash *newSetupFileHash();
+void freeSetupFileHash(SetupFileHash *);
 char *getHashEntry(SetupFileHash *, char *);
 void setHashEntry(SetupFileHash *, char *, char *);
 SetupFileHash *loadSetupFileHash(char *);
index 1289c0b6faca1dd467202d00267ee509aa96824c..7fd87aee20f7584fc075a25ed81f6b7cf7471b8a 100644 (file)
@@ -3004,6 +3004,9 @@ struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1] =
 /* 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"           },
@@ -3014,13 +3017,17 @@ 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_1.active"      },
-  { "font.input_1"             },
   { "font.input_2.active"      },
+  { "font.input_1"             },
   { "font.input_2"             },
   { "font.option_off"          },
   { "font.option_on"           },
index c5a79500ed547e960ab515958be62c0ebd18070a..212327620687aa67be87f174fe7b1bed66d5f324 100644 (file)
 #define FONT_TITLE_2                           5
 #define FONT_MENU_1                            6
 #define FONT_MENU_2                            7
-#define FONT_TEXT_1                            8
-#define FONT_TEXT_2                            9
-#define FONT_TEXT_3                            10
-#define FONT_TEXT_4                            11
-#define FONT_INPUT_1_ACTIVE                    12
-#define FONT_INPUT_1                           13
-#define FONT_INPUT_2_ACTIVE                    14
-#define FONT_INPUT_2                           15
-#define FONT_OPTION_OFF                                16
-#define FONT_OPTION_ON                         17
-#define FONT_VALUE_1                           18
-#define FONT_VALUE_2                           19
-#define FONT_VALUE_OLD                         20
-#define FONT_LEVEL_NUMBER                      21
-#define FONT_TAPE_RECORDER                     22
-#define FONT_GAME_INFO                         23
-
-#define NUM_FONTS                              24
+#define FONT_TEXT_1_ACTIVE                     8
+#define FONT_TEXT_2_ACTIVE                     9
+#define FONT_TEXT_3_ACTIVE                     10
+#define FONT_TEXT_4_ACTIVE                     11
+#define FONT_TEXT_1                            12
+#define FONT_TEXT_2                            13
+#define FONT_TEXT_3                            14
+#define FONT_TEXT_4                            15
+#define FONT_INPUT_1_ACTIVE                    16
+#define FONT_INPUT_2_ACTIVE                    17
+#define FONT_INPUT_1                           18
+#define FONT_INPUT_2                           19
+#define FONT_OPTION_OFF                                20
+#define FONT_OPTION_ON                         21
+#define FONT_VALUE_1                           22
+#define FONT_VALUE_2                           23
+#define FONT_VALUE_OLD                         24
+#define FONT_LEVEL_NUMBER                      25
+#define FONT_TAPE_RECORDER                     26
+#define FONT_GAME_INFO                         27
+
+#define NUM_FONTS                              28
 #define NUM_INITIAL_FONTS                      4
 
 /* values for game_status */
index eab0b75eee96855176fe7cffc5940338c5d23c7d..437ab3cb63c09c90c1bde3507d888bf036d8280e 100644 (file)
@@ -1554,16 +1554,22 @@ static void drawHallOfFameList(int first_entry, int highlight_position)
   for(i=0; i<MAX_MENU_ENTRIES_ON_SCREEN; i++)
   {
     int entry = first_entry + i;
-
-    DrawText(mSX, mSY + 64 + i * 32, "..................................",
-            (entry == highlight_position ? FONT_TEXT_4 : FONT_TEXT_2));
-    DrawText(mSX, mSY + 64 + i * 32, int2str(entry + 1, 3),
-            (entry == highlight_position ? FONT_TEXT_4 : FONT_TEXT_2));
-    DrawText(mSX + 64, mSY + 64 + i * 32, highscore[entry].Name,
-            (entry == highlight_position ? FONT_TEXT_3 : FONT_TEXT_1));
-    DrawText(mSX + 14 * 32 + 16, mSY + 64 + i * 32,
-            int2str(highscore[entry].Score, 5),
-            (entry == highlight_position ? FONT_TEXT_4 : FONT_TEXT_2));
+    boolean active = (entry == highlight_position);
+    int font_nr1 = (active ? FONT_TEXT_1_ACTIVE : FONT_TEXT_1);
+    int font_nr2 = (active ? FONT_TEXT_2_ACTIVE : FONT_TEXT_2);
+    int font_nr3 = (active ? FONT_TEXT_3_ACTIVE : FONT_TEXT_3);
+    int font_nr4 = (active ? FONT_TEXT_4_ACTIVE : FONT_TEXT_4);
+    int dx1 = 3 * getFontWidth(font_nr1);
+    int dx2 = dx1 + getFontWidth(font_nr1);
+    int dx3 = dx2 + 25 * getFontWidth(font_nr3);
+    int sy = mSY + 64 + i * 32;
+
+    DrawText(mSX, sy, int2str(entry + 1, 3), font_nr1);
+    DrawText(mSX + dx1, sy, ".", font_nr1);
+    DrawText(mSX + dx2, sy, ".........................", font_nr3);
+    if (strcmp(highscore[entry].Name, EMPTY_PLAYER_NAME) != 0)
+      DrawText(mSX + dx2, sy, highscore[entry].Name, font_nr2);
+    DrawText(mSX + dx3, sy, int2str(highscore[entry].Score, 5), font_nr4);
   }
 }