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,
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,
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,
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
{ "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" },
{ "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" },
{ "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" },
{ "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" },
#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 */
-#define COMPILE_DATE_STRING "[2003-04-25 01:16]"
+#define COMPILE_DATE_STRING "[2003-04-26 19:05]"
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;
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()
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;
/* 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;
}
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);
}
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)
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)
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 =
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)
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 *);
/* 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" },
{ "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" },
#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 */
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);
}
}