From 652f2eebd3bac1458da0010bef1b1208c19649c7 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 30 Dec 2005 17:06:34 +0100 Subject: [PATCH] rnd-20051230-1-src --- ChangeLog | 2 +- src/conf_fnt.c | 4 - src/conf_gfx.c | 14 +- src/conf_gfx.h | 129 +++++++-------- src/conftime.h | 2 +- src/editor.c | 373 +++++++++++++++++++++++++++++++++++-------- src/files.c | 33 +++- src/init.c | 180 ++++++++++++++------- src/libgame/system.h | 2 +- src/main.c | 140 ++++++++++++++++ src/main.h | 54 ++++++- src/screens.c | 222 ++++++++++++++++++------- 12 files changed, 879 insertions(+), 276 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8d6353c7..fb8552cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,7 +26,7 @@ make it possible to show a snapping animation like in Emerald Mine 2005-12-16 - * added dynamic checkboxes to custom element action settings in editor + * added dynamic selectboxes to custom element action settings in editor * added "CE value" counter for custom elements (instead of "CE count") * added option to use the last "CE value" after custom element change * added option to use the "CE value" of other elements in CE actions diff --git a/src/conf_fnt.c b/src/conf_fnt.c index b00d432f..404adc6f 100644 --- a/src/conf_fnt.c +++ b/src/conf_fnt.c @@ -47,10 +47,6 @@ font_to_graphic[] = FONT_TITLE_1, -1, IMG_FONT_TITLE_1 }, - { - FONT_TITLE_1, GFX_SPECIAL_ARG_LEVELS, - IMG_FONT_TITLE_1_LEVELS - }, { FONT_TITLE_2, -1, IMG_FONT_TITLE_2 diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 09fff402..33df1992 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -3956,11 +3956,6 @@ struct ConfigInfo image_config[] = { "font.title_1.y", "480" }, { "font.title_1.width", "32" }, { "font.title_1.height", "32" }, - { "font.title_1.LEVELS", "RocksFontBig.pcx" }, - { "font.title_1.LEVELS.x", "0" }, - { "font.title_1.LEVELS.y", "320" }, - { "font.title_1.LEVELS.width", "32" }, - { "font.title_1.LEVELS.height", "32" }, { "font.title_2", "RocksFontSmall.pcx" }, { "font.title_2.x", "0" }, { "font.title_2.y", "0" }, @@ -4186,6 +4181,15 @@ struct ConfigInfo image_config[] = { "editor.element_border_input.xpos", "0" }, { "editor.element_border_input.ypos", "0" }, + { "editor.cascade_list", "RocksFontEM.pcx" }, + { "editor.cascade_list.xpos", "11" }, + { "editor.cascade_list.ypos", "0" }, + { "editor.cascade_list.frames", "1" }, + { "editor.cascade_list.active", "RocksFontEM.pcx" }, + { "editor.cascade_list.active.xpos", "13" }, + { "editor.cascade_list.active.ypos", "0" }, + { "editor.cascade_list.active.frames", "1" }, + { "background.envelope_1", "RocksScreen.pcx" }, { "background.envelope_1.x", "0" }, { "background.envelope_1.y", "0" }, diff --git a/src/conf_gfx.h b/src/conf_gfx.h index 0dc6f9ae..02a7bb63 100644 --- a/src/conf_gfx.h +++ b/src/conf_gfx.h @@ -1455,70 +1455,71 @@ #define IMG_FONT_INITIAL_3 1434 #define IMG_FONT_INITIAL_4 1435 #define IMG_FONT_TITLE_1 1436 -#define IMG_FONT_TITLE_1_LEVELS 1437 -#define IMG_FONT_TITLE_2 1438 -#define IMG_FONT_MENU_1 1439 -#define IMG_FONT_MENU_2 1440 -#define IMG_FONT_TEXT_1 1441 -#define IMG_FONT_TEXT_1_LEVELS 1442 -#define IMG_FONT_TEXT_1_PREVIEW 1443 -#define IMG_FONT_TEXT_1_SCORES 1444 -#define IMG_FONT_TEXT_1_ACTIVE_SCORES 1445 -#define IMG_FONT_TEXT_2 1446 -#define IMG_FONT_TEXT_2_LEVELS 1447 -#define IMG_FONT_TEXT_2_PREVIEW 1448 -#define IMG_FONT_TEXT_2_SCORES 1449 -#define IMG_FONT_TEXT_2_ACTIVE_SCORES 1450 -#define IMG_FONT_TEXT_3 1451 -#define IMG_FONT_TEXT_3_LEVELS 1452 -#define IMG_FONT_TEXT_3_PREVIEW 1453 -#define IMG_FONT_TEXT_3_SCORES 1454 -#define IMG_FONT_TEXT_3_ACTIVE_SCORES 1455 -#define IMG_FONT_TEXT_4 1456 -#define IMG_FONT_TEXT_4_LEVELS 1457 -#define IMG_FONT_TEXT_4_SCORES 1458 -#define IMG_FONT_TEXT_4_ACTIVE_SCORES 1459 -#define IMG_FONT_ENVELOPE_1 1460 -#define IMG_FONT_ENVELOPE_2 1461 -#define IMG_FONT_ENVELOPE_3 1462 -#define IMG_FONT_ENVELOPE_4 1463 -#define IMG_FONT_INPUT_1 1464 -#define IMG_FONT_INPUT_1_MAIN 1465 -#define IMG_FONT_INPUT_1_ACTIVE 1466 -#define IMG_FONT_INPUT_1_ACTIVE_MAIN 1467 -#define IMG_FONT_INPUT_1_ACTIVE_SETUP 1468 -#define IMG_FONT_INPUT_2 1469 -#define IMG_FONT_INPUT_2_ACTIVE 1470 -#define IMG_FONT_OPTION_OFF 1471 -#define IMG_FONT_OPTION_ON 1472 -#define IMG_FONT_VALUE_1 1473 -#define IMG_FONT_VALUE_2 1474 -#define IMG_FONT_VALUE_OLD 1475 -#define IMG_FONT_LEVEL_NUMBER 1476 -#define IMG_FONT_TAPE_RECORDER 1477 -#define IMG_FONT_GAME_INFO 1478 -#define IMG_GLOBAL_BORDER 1479 -#define IMG_GLOBAL_DOOR 1480 -#define IMG_EDITOR_ELEMENT_BORDER 1481 -#define IMG_EDITOR_ELEMENT_BORDER_INPUT 1482 -#define IMG_BACKGROUND_ENVELOPE_1 1483 -#define IMG_BACKGROUND_ENVELOPE_2 1484 -#define IMG_BACKGROUND_ENVELOPE_3 1485 -#define IMG_BACKGROUND_ENVELOPE_4 1486 -#define IMG_BACKGROUND 1487 -#define IMG_BACKGROUND_MAIN 1488 -#define IMG_BACKGROUND_LEVELS 1489 -#define IMG_BACKGROUND_SCORES 1490 -#define IMG_BACKGROUND_EDITOR 1491 -#define IMG_BACKGROUND_INFO 1492 -#define IMG_BACKGROUND_INFO_ELEMENTS 1493 -#define IMG_BACKGROUND_INFO_MUSIC 1494 -#define IMG_BACKGROUND_INFO_CREDITS 1495 -#define IMG_BACKGROUND_INFO_PROGRAM 1496 -#define IMG_BACKGROUND_INFO_LEVELSET 1497 -#define IMG_BACKGROUND_SETUP 1498 -#define IMG_BACKGROUND_DOOR 1499 +#define IMG_FONT_TITLE_2 1437 +#define IMG_FONT_MENU_1 1438 +#define IMG_FONT_MENU_2 1439 +#define IMG_FONT_TEXT_1 1440 +#define IMG_FONT_TEXT_1_LEVELS 1441 +#define IMG_FONT_TEXT_1_PREVIEW 1442 +#define IMG_FONT_TEXT_1_SCORES 1443 +#define IMG_FONT_TEXT_1_ACTIVE_SCORES 1444 +#define IMG_FONT_TEXT_2 1445 +#define IMG_FONT_TEXT_2_LEVELS 1446 +#define IMG_FONT_TEXT_2_PREVIEW 1447 +#define IMG_FONT_TEXT_2_SCORES 1448 +#define IMG_FONT_TEXT_2_ACTIVE_SCORES 1449 +#define IMG_FONT_TEXT_3 1450 +#define IMG_FONT_TEXT_3_LEVELS 1451 +#define IMG_FONT_TEXT_3_PREVIEW 1452 +#define IMG_FONT_TEXT_3_SCORES 1453 +#define IMG_FONT_TEXT_3_ACTIVE_SCORES 1454 +#define IMG_FONT_TEXT_4 1455 +#define IMG_FONT_TEXT_4_LEVELS 1456 +#define IMG_FONT_TEXT_4_SCORES 1457 +#define IMG_FONT_TEXT_4_ACTIVE_SCORES 1458 +#define IMG_FONT_ENVELOPE_1 1459 +#define IMG_FONT_ENVELOPE_2 1460 +#define IMG_FONT_ENVELOPE_3 1461 +#define IMG_FONT_ENVELOPE_4 1462 +#define IMG_FONT_INPUT_1 1463 +#define IMG_FONT_INPUT_1_MAIN 1464 +#define IMG_FONT_INPUT_1_ACTIVE 1465 +#define IMG_FONT_INPUT_1_ACTIVE_MAIN 1466 +#define IMG_FONT_INPUT_1_ACTIVE_SETUP 1467 +#define IMG_FONT_INPUT_2 1468 +#define IMG_FONT_INPUT_2_ACTIVE 1469 +#define IMG_FONT_OPTION_OFF 1470 +#define IMG_FONT_OPTION_ON 1471 +#define IMG_FONT_VALUE_1 1472 +#define IMG_FONT_VALUE_2 1473 +#define IMG_FONT_VALUE_OLD 1474 +#define IMG_FONT_LEVEL_NUMBER 1475 +#define IMG_FONT_TAPE_RECORDER 1476 +#define IMG_FONT_GAME_INFO 1477 +#define IMG_GLOBAL_BORDER 1478 +#define IMG_GLOBAL_DOOR 1479 +#define IMG_EDITOR_ELEMENT_BORDER 1480 +#define IMG_EDITOR_ELEMENT_BORDER_INPUT 1481 +#define IMG_EDITOR_CASCADE_LIST 1482 +#define IMG_EDITOR_CASCADE_LIST_ACTIVE 1483 +#define IMG_BACKGROUND_ENVELOPE_1 1484 +#define IMG_BACKGROUND_ENVELOPE_2 1485 +#define IMG_BACKGROUND_ENVELOPE_3 1486 +#define IMG_BACKGROUND_ENVELOPE_4 1487 +#define IMG_BACKGROUND 1488 +#define IMG_BACKGROUND_MAIN 1489 +#define IMG_BACKGROUND_LEVELS 1490 +#define IMG_BACKGROUND_SCORES 1491 +#define IMG_BACKGROUND_EDITOR 1492 +#define IMG_BACKGROUND_INFO 1493 +#define IMG_BACKGROUND_INFO_ELEMENTS 1494 +#define IMG_BACKGROUND_INFO_MUSIC 1495 +#define IMG_BACKGROUND_INFO_CREDITS 1496 +#define IMG_BACKGROUND_INFO_PROGRAM 1497 +#define IMG_BACKGROUND_INFO_LEVELSET 1498 +#define IMG_BACKGROUND_SETUP 1499 +#define IMG_BACKGROUND_DOOR 1500 -#define NUM_IMAGE_FILES 1500 +#define NUM_IMAGE_FILES 1501 #endif /* CONF_GFX_H */ diff --git a/src/conftime.h b/src/conftime.h index 9bcd0843..d3562706 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2005-12-29 01:23]" +#define COMPILE_DATE_STRING "[2005-12-30 17:05]" diff --git a/src/editor.c b/src/editor.c index 4852f3e3..e25ece36 100644 --- a/src/editor.c +++ b/src/editor.c @@ -277,7 +277,7 @@ #define ED_TEXTBUTTON_XSIZE ED_WIN_COUNT_XSIZE #define ED_TEXTBUTTON_YSIZE ED_WIN_COUNT_YSIZE -/* values for ClearEditorGadgetInfoText() and HandleGadgetInfoText() */ +/* values for ClearEditorGadgetInfoText() and HandleEditorGadgetInfoText() */ #define INFOTEXT_XPOS SX #define INFOTEXT_YPOS (SY + SYSIZE - MINI_TILEX + 2) #define INFOTEXT_XSIZE SXSIZE @@ -2937,6 +2937,7 @@ static void HandleRadiobuttons(struct GadgetInfo *); static void HandleCheckbuttons(struct GadgetInfo *); static void HandleControlButtons(struct GadgetInfo *); static void HandleDrawingAreaInfo(struct GadgetInfo *); +static void PrintEditorGadgetInfoText(struct GadgetInfo *); static struct GadgetInfo *level_editor_gadget[NUM_EDITOR_GADGETS]; static int right_gadget_border[NUM_EDITOR_GADGETS]; @@ -2958,6 +2959,12 @@ static int element_shift = 0; static int editor_hl_boulderdash[] = { + EL_INTERNAL_CASCADE_BD_ACTIVE, + EL_CHAR('B'), + EL_CHAR('D'), + EL_EMPTY, + +#if 0 EL_CHAR('B'), EL_CHAR('O'), EL_CHAR('U'), @@ -2972,6 +2979,7 @@ static int editor_hl_boulderdash[] = EL_CHAR('A'), EL_CHAR('S'), EL_CHAR('H'), +#endif }; static int editor_el_boulderdash[] = @@ -3008,6 +3016,12 @@ static int num_editor_el_boulderdash = SIZEOF_ARRAY_INT(editor_el_boulderdash); static int editor_hl_emerald_mine[] = { + EL_INTERNAL_CASCADE_EM_ACTIVE, + EL_CHAR('E'), + EL_CHAR('M'), + EL_EMPTY, + +#if 0 EL_CHAR('E'), EL_CHAR('M'), EL_CHAR('E'), @@ -3022,6 +3036,7 @@ static int editor_hl_emerald_mine[] = EL_CHAR('I'), EL_CHAR('N'), EL_CHAR('E'), +#endif }; static int editor_el_emerald_mine[] = @@ -3108,6 +3123,12 @@ static int num_editor_el_emerald_mine=SIZEOF_ARRAY_INT(editor_el_emerald_mine); static int editor_hl_emerald_mine_club[] = { + EL_INTERNAL_CASCADE_EMC_ACTIVE, + EL_CHAR('E'), + EL_CHAR('M'), + EL_CHAR('C'), + +#if 0 EL_CHAR('E'), EL_CHAR('M'), EL_CHAR('E'), @@ -3127,6 +3148,7 @@ static int editor_hl_emerald_mine_club[] = EL_CHAR('L'), EL_CHAR('U'), EL_CHAR('B'), +#endif }; static int editor_el_emerald_mine_club[] = @@ -3240,10 +3262,17 @@ static int num_editor_el_emerald_mine_club=SIZEOF_ARRAY_INT(editor_el_emerald_mi static int editor_hl_more[] = { + EL_INTERNAL_CASCADE_RND_ACTIVE, + EL_CHAR('R'), + EL_CHAR('N'), + EL_CHAR('D'), + +#if 0 EL_CHAR('M'), EL_CHAR('O'), EL_CHAR('R'), EL_CHAR('E'), +#endif }; static int editor_el_more[] = @@ -3335,6 +3364,12 @@ static int num_editor_el_more = SIZEOF_ARRAY_INT(editor_el_more); static int editor_hl_sokoban[] = { + EL_INTERNAL_CASCADE_SB_ACTIVE, + EL_CHAR('S'), + EL_CHAR('B'), + EL_EMPTY, + +#if 0 EL_CHAR('S'), EL_CHAR('O'), EL_CHAR('K'), @@ -3344,6 +3379,7 @@ static int editor_hl_sokoban[] = EL_CHAR('B'), EL_CHAR('A'), EL_CHAR('N'), +#endif }; static int editor_el_sokoban[] = @@ -3360,6 +3396,12 @@ static int num_editor_el_sokoban = SIZEOF_ARRAY_INT(editor_el_sokoban); static int editor_hl_supaplex[] = { + EL_INTERNAL_CASCADE_SP_ACTIVE, + EL_CHAR('S'), + EL_CHAR('P'), + EL_EMPTY, + +#if 0 EL_CHAR('S'), EL_CHAR('U'), EL_CHAR('P'), @@ -3369,6 +3411,7 @@ static int editor_hl_supaplex[] = EL_CHAR('L'), EL_CHAR('E'), EL_CHAR('X'), +#endif }; static int editor_el_supaplex[] = @@ -3434,6 +3477,12 @@ static int num_editor_el_supaplex = SIZEOF_ARRAY_INT(editor_el_supaplex); static int editor_hl_diamond_caves[] = { + EL_INTERNAL_CASCADE_DC_ACTIVE, + EL_CHAR('D'), + EL_CHAR('C'), + EL_CHAR('2'), + +#if 0 EL_CHAR('D'), EL_CHAR('I'), EL_CHAR('A'), @@ -3453,6 +3502,7 @@ static int editor_hl_diamond_caves[] = EL_CHAR(' '), EL_CHAR('I'), EL_CHAR('I'), +#endif }; static int editor_el_diamond_caves[] = @@ -3529,6 +3579,12 @@ static int num_editor_el_diamond_caves = SIZEOF_ARRAY_INT(editor_el_diamond_cave static int editor_hl_dx_boulderdash[] = { + EL_INTERNAL_CASCADE_DX_ACTIVE, + EL_CHAR('D'), + EL_CHAR('X'), + EL_EMPTY, + +#if 0 EL_CHAR('D'), EL_CHAR('X'), EL_CHAR('-'), @@ -3548,6 +3604,7 @@ static int editor_hl_dx_boulderdash[] = EL_CHAR('A'), EL_CHAR('S'), EL_CHAR('H'), +#endif }; static int editor_el_dx_boulderdash[] = @@ -3579,10 +3636,17 @@ static int num_editor_el_dx_boulderdash = SIZEOF_ARRAY_INT(editor_el_dx_boulderd static int editor_hl_chars[] = { + EL_INTERNAL_CASCADE_TEXT_ACTIVE, + EL_CHAR('T'), + EL_CHAR('X'), + EL_CHAR('T'), + +#if 0 EL_CHAR('T'), EL_CHAR('E'), EL_CHAR('X'), EL_CHAR('T'), +#endif }; static int editor_el_chars[] = @@ -3684,6 +3748,12 @@ static int num_editor_el_chars = SIZEOF_ARRAY_INT(editor_el_chars); static int editor_hl_custom[] = { + EL_INTERNAL_CASCADE_CE_ACTIVE, + EL_CHAR('C'), + EL_CHAR('E'), + EL_EMPTY, + +#if 0 EL_CHAR('C'), EL_CHAR('U'), EL_CHAR('S'), @@ -3703,6 +3773,7 @@ static int editor_hl_custom[] = EL_CHAR('N'), EL_CHAR('T'), EL_CHAR('S'), +#endif }; static int editor_el_custom[] = @@ -3865,19 +3936,8 @@ static int editor_el_custom[] = EL_CUSTOM_START + 124, EL_CUSTOM_START + 125, EL_CUSTOM_START + 126, - EL_CUSTOM_START + 127 -}; -static int *editor_hl_custom_ptr = editor_hl_custom; -static int *editor_el_custom_ptr = editor_el_custom; -static int num_editor_hl_custom = SIZEOF_ARRAY_INT(editor_hl_custom); -static int num_editor_el_custom = SIZEOF_ARRAY_INT(editor_el_custom); - -static int editor_hl_custom_more[] = -{ -}; + EL_CUSTOM_START + 127, -static int editor_el_custom_more[] = -{ EL_CUSTOM_START + 128, EL_CUSTOM_START + 129, EL_CUSTOM_START + 130, @@ -4036,31 +4096,26 @@ static int editor_el_custom_more[] = EL_CUSTOM_START + 252, EL_CUSTOM_START + 253, EL_CUSTOM_START + 254, - EL_CUSTOM_START + 255 -}; -static int *editor_hl_custom_more_ptr = editor_hl_custom_more; -static int *editor_el_custom_more_ptr = editor_el_custom_more; -static int num_editor_hl_custom_more = SIZEOF_ARRAY_INT(editor_hl_custom_more); -static int num_editor_el_custom_more = SIZEOF_ARRAY_INT(editor_el_custom_more); + EL_CUSTOM_START + 255, -static int editor_hl_custom_special[] = -{ -}; - -static int editor_el_custom_special[] = -{ EL_TRIGGER_ELEMENT, EL_TRIGGER_PLAYER, EL_EMPTY, EL_EMPTY }; -static int *editor_hl_custom_special_ptr = editor_hl_custom_special; -static int *editor_el_custom_special_ptr = editor_el_custom_special; -static int num_editor_hl_custom_special = SIZEOF_ARRAY_INT(editor_hl_custom_special); -static int num_editor_el_custom_special = SIZEOF_ARRAY_INT(editor_el_custom_special); +static int *editor_hl_custom_ptr = editor_hl_custom; +static int *editor_el_custom_ptr = editor_el_custom; +static int num_editor_hl_custom = SIZEOF_ARRAY_INT(editor_hl_custom); +static int num_editor_el_custom = SIZEOF_ARRAY_INT(editor_el_custom); static int editor_hl_group[] = { + EL_INTERNAL_CASCADE_GE_ACTIVE, + EL_CHAR('G'), + EL_CHAR('E'), + EL_EMPTY, + +#if 0 EL_CHAR('G'), EL_CHAR('R'), EL_CHAR('O'), @@ -4080,6 +4135,7 @@ static int editor_hl_group[] = EL_CHAR('N'), EL_CHAR('T'), EL_CHAR('S'), +#endif }; static int editor_el_group[] = @@ -4102,19 +4158,8 @@ static int editor_el_group[] = EL_GROUP_START + 12, EL_GROUP_START + 13, EL_GROUP_START + 14, - EL_GROUP_START + 15 -}; -static int *editor_hl_group_ptr = editor_hl_group; -static int *editor_el_group_ptr = editor_el_group; -static int num_editor_hl_group = SIZEOF_ARRAY_INT(editor_hl_group); -static int num_editor_el_group = SIZEOF_ARRAY_INT(editor_el_group); - -static int editor_hl_group_more[] = -{ -}; + EL_GROUP_START + 15, -static int editor_el_group_more[] = -{ EL_GROUP_START + 16, EL_GROUP_START + 17, EL_GROUP_START + 18, @@ -4135,13 +4180,19 @@ static int editor_el_group_more[] = EL_GROUP_START + 30, EL_GROUP_START + 31 }; -static int *editor_hl_group_more_ptr = editor_hl_group_more; -static int *editor_el_group_more_ptr = editor_el_group_more; -static int num_editor_hl_group_more = SIZEOF_ARRAY_INT(editor_hl_group_more); -static int num_editor_el_group_more = SIZEOF_ARRAY_INT(editor_el_group_more); +static int *editor_hl_group_ptr = editor_hl_group; +static int *editor_el_group_ptr = editor_el_group; +static int num_editor_hl_group = SIZEOF_ARRAY_INT(editor_hl_group); +static int num_editor_el_group = SIZEOF_ARRAY_INT(editor_el_group); static int editor_hl_user_defined[] = { + EL_INTERNAL_CASCADE_USER_ACTIVE, + EL_CHAR('M'), + EL_CHAR('Y'), + EL_EMPTY, + +#if 0 EL_CHAR('U'), EL_CHAR('S'), EL_CHAR('E'), @@ -4156,6 +4207,7 @@ static int editor_hl_user_defined[] = EL_CHAR('N'), EL_CHAR('E'), EL_CHAR('D'), +#endif }; static int *editor_hl_user_defined_ptr = editor_hl_user_defined; @@ -4163,6 +4215,19 @@ static int *editor_el_user_defined_ptr = NULL; static int num_editor_hl_user_defined=SIZEOF_ARRAY_INT(editor_hl_user_defined); static int num_editor_el_user_defined = 0; +static int editor_hl_dynamic[] = +{ + EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE, + EL_CHAR('D'), + EL_CHAR('Y'), + EL_CHAR('N'), +}; + +static int *editor_hl_dynamic_ptr = editor_hl_dynamic; +static int *editor_el_dynamic_ptr = NULL; +static int num_editor_hl_dynamic = SIZEOF_ARRAY_INT(editor_hl_dynamic); +static int num_editor_el_dynamic = 0; + static int editor_hl_empty[] = { }; static int editor_el_empty[ED_NUM_ELEMENTLIST_BUTTONS]; @@ -4240,31 +4305,21 @@ editor_elements_info[] = &editor_hl_custom_ptr, &num_editor_hl_custom, &editor_el_custom_ptr, &num_editor_el_custom }, - { - &setup.editor.el_custom_more, - &editor_hl_custom_more_ptr, &num_editor_hl_custom_more, - &editor_el_custom_more_ptr, &num_editor_el_custom_more - }, - { - &setup.editor.el_custom, - &editor_hl_custom_special_ptr, &num_editor_hl_custom_special, - &editor_el_custom_special_ptr, &num_editor_el_custom_special - }, { &setup.editor.el_custom, &editor_hl_group_ptr, &num_editor_hl_group, &editor_el_group_ptr, &num_editor_el_group }, - { - &setup.editor.el_custom_more, - &editor_hl_group_more_ptr, &num_editor_hl_group_more, - &editor_el_group_more_ptr, &num_editor_el_group_more - }, { &setup.editor.el_user_defined, &editor_hl_user_defined_ptr, &num_editor_hl_user_defined, &editor_el_user_defined_ptr, &num_editor_el_user_defined }, + { + &setup.editor.el_dynamic, + &editor_hl_dynamic_ptr, &num_editor_hl_dynamic, + &editor_el_dynamic_ptr, &num_editor_el_dynamic, + }, { &use_el_empty, &editor_hl_empty_ptr, &num_editor_hl_empty, @@ -4314,7 +4369,11 @@ static char *getElementInfoText(int element) { char *info_text = NULL; +#if 1 + if (element < MAX_NUM_ELEMENTS) +#else if (element < NUM_FILE_ELEMENTS) +#endif { if (strlen(element_info[element].description) > 0) info_text = element_info[element].description; @@ -4330,6 +4389,53 @@ static char *getElementInfoText(int element) return info_text; } +static void InitDynamicEditorElementList(int **elements, int *num_elements) +{ + boolean element_found[NUM_FILE_ELEMENTS]; + int i, x, y; + + /* initialize list of used elements to "not used" */ + for (i = 0; i < NUM_FILE_ELEMENTS; i++) + element_found[i] = FALSE; + + /* find all elements used in current level */ + for (y = 0; y < lev_fieldy; y++) + for (x = 0; x < lev_fieldx; x++) + if (Feld[x][y] < NUM_FILE_ELEMENTS) /* should always be true */ + element_found[Feld[x][y]] = TRUE; + + *num_elements = 0; + + /* count number of elements used in current level */ + for (i = 0; i < NUM_FILE_ELEMENTS; i++) + if (element_found[i]) + (*num_elements)++; + + /* add space for up to 3 more elements for padding that may be needed */ + *num_elements += 3; + + /* free memory for old list of elements, if needed */ + checked_free(*elements); + + /* allocate memory for new list of elements */ + *elements = checked_malloc(*num_elements * sizeof(int)); + + *num_elements = 0; + + /* add all elements used in current level (non-custom/group elements) */ + for (i = 0; i < NUM_FILE_ELEMENTS; i++) + if (element_found[i] && !(IS_CUSTOM_ELEMENT(i) || IS_GROUP_ELEMENT(i))) + (*elements)[(*num_elements)++] = i; + + /* add all elements used in current level (custom/group elements) */ + for (i = 0; i < NUM_FILE_ELEMENTS; i++) + if (element_found[i] && (IS_CUSTOM_ELEMENT(i) || IS_GROUP_ELEMENT(i))) + (*elements)[(*num_elements)++] = i; + + while (*num_elements % 4) /* pad with empty elements, if needed */ + (*elements)[(*num_elements)++] = EL_EMPTY; +} + static void ReinitializeElementList() { int pos = 0; @@ -4341,6 +4447,10 @@ static void ReinitializeElementList() LoadUserDefinedEditorElementList(&editor_el_user_defined_ptr, &num_editor_el_user_defined); + /* initialize dynamic level element list for each invocation of editor */ + InitDynamicEditorElementList(&editor_el_dynamic_ptr, + &num_editor_el_dynamic); + /* initialize list of empty elements (used for padding, if needed) */ for (i = 0; i < ED_NUM_ELEMENTLIST_BUTTONS; i++) editor_el_empty[i] = EL_EMPTY; @@ -4366,11 +4476,26 @@ static void ReinitializeElementList() /* determine size of element list */ for (i = 0; editor_elements_info[i].setup_value != NULL; i++) { + boolean found_inactive_cascade = FALSE; + if (*editor_elements_info[i].setup_value) { if (setup.editor.el_headlines) + { num_editor_elements += *editor_elements_info[i].headline_list_size; + for (j = 0; j < *editor_elements_info[i].headline_list_size; j++) + { + int element = (*editor_elements_info[i].headline_list)[j]; + + if (IS_EDITOR_CASCADE_INACTIVE(element)) + found_inactive_cascade = TRUE; + } + } + + if (found_inactive_cascade) + continue; + num_editor_elements += *editor_elements_info[i].element_list_size; } } @@ -4389,11 +4514,25 @@ static void ReinitializeElementList() /* fill element list */ for (i = 0; editor_elements_info[i].setup_value != NULL; i++) { + boolean found_inactive_cascade = FALSE; + if (*editor_elements_info[i].setup_value) { if (setup.editor.el_headlines) + { for (j = 0; j < *editor_elements_info[i].headline_list_size; j++) - editor_elements[pos++] = (*editor_elements_info[i].headline_list)[j]; + { + int element = (*editor_elements_info[i].headline_list)[j]; + + editor_elements[pos++] = element; + + if (IS_EDITOR_CASCADE_INACTIVE(element)) + found_inactive_cascade = TRUE; + } + } + + if (found_inactive_cascade) + continue; for (j = 0; j < *editor_elements_info[i].element_list_size; j++) editor_elements[pos++] = (*editor_elements_info[i].element_list)[j]; @@ -5961,11 +6100,12 @@ static boolean LevelContainsPlayer() return TRUE; /* !!! CURRENTLY DEACTIVATED !!! */ - for (y = 0; y < lev_fieldy; y++) - for (x = 0; x < lev_fieldx; x++) - if (Feld[x][y] == EL_PLAYER_1 || - Feld[x][y] == EL_SP_MURPHY) - player_found = TRUE; + for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) + { + if (Feld[x][y] == EL_PLAYER_1 || + Feld[x][y] == EL_SP_MURPHY) + player_found = TRUE; + } return player_found; } @@ -6557,6 +6697,7 @@ void DrawLevelEd() redraw_mask |= REDRAW_ALL; + ReinitializeElementList(); /* update dynamic level element list */ ReinitializeElementListButtons(); /* custom element may look different */ UnmapTapeButtons(); @@ -6675,6 +6816,25 @@ static void AdjustEditorScrollbar(int id) GDI_SCROLLBAR_ITEM_POSITION, item_position, GDI_END); } +static void AdjustElementListScrollbar() +{ + struct GadgetInfo *gi = level_editor_gadget[GADGET_ID_SCROLL_LIST_VERTICAL]; + int items_max, items_visible, item_position; + + if (element_shift < 0) + element_shift = 0; + if (element_shift > num_editor_elements - ED_NUM_ELEMENTLIST_BUTTONS) + element_shift = num_editor_elements - ED_NUM_ELEMENTLIST_BUTTONS; + + items_max = num_editor_elements / ED_ELEMENTLIST_BUTTONS_HORIZ; + items_visible = ED_ELEMENTLIST_BUTTONS_VERT; + item_position = element_shift / ED_ELEMENTLIST_BUTTONS_HORIZ; + + ModifyGadget(gi, GDI_SCROLLBAR_ITEMS_MAX, items_max, + GDI_SCROLLBAR_ITEMS_VISIBLE, items_visible, + GDI_SCROLLBAR_ITEM_POSITION, item_position, GDI_END); +} + static void ModifyEditorCounterValue(int counter_id, int new_value) { int *counter_value = counterbutton_info[counter_id].value; @@ -6824,10 +6984,15 @@ static void DrawLevelInfoWindow() ClearWindow(); UnmapLevelEditorWindowGadgets(); +#if 0 + DrawTextSCentered(ED_SETTINGS1_YPOS, FONT_TITLE_1, "Level Settings"); + DrawTextSCentered(ED_SETTINGS2_YPOS, FONT_TITLE_1, "Editor Settings"); +#else DrawText(SX + ED_SETTINGS2_XPOS, SY + ED_SETTINGS1_YPOS, "Level Settings", FONT_TITLE_1); DrawText(SX + ED_SETTINGS2_XPOS, SY + ED_SETTINGS2_YPOS, "Editor Settings", FONT_TITLE_1); +#endif /* draw counter gadgets */ for (i = ED_COUNTER_ID_LEVEL_FIRST; i <= ED_COUNTER_ID_LEVEL_LAST; i++) @@ -7734,8 +7899,12 @@ static void DrawPropertiesWindow() SetMainBackgroundImage(IMG_BACKGROUND_EDITOR); ClearWindow(); +#if 0 + DrawTextSCentered(ED_SETTINGS1_YPOS, FONT_TITLE_1, "Element Settings"); +#else DrawText(SX + ED_SETTINGS2_XPOS, SY + ED_SETTINGS1_YPOS, "Element Settings", FONT_TITLE_1); +#endif DrawElementBorder(SX + xstart * MINI_TILEX, SY + ystart * MINI_TILEY + MINI_TILEY / 2, @@ -9329,6 +9498,34 @@ static void HandleControlButtons(struct GadgetInfo *gi) int element_position = id - GADGET_ID_ELEMENTLIST_FIRST; int new_element = editor_elements[element_position + element_shift]; + if (IS_EDITOR_CASCADE(new_element)) + { + int i; + + for (i = 0; editor_elements_info[i].setup_value != NULL; i++) + { + int *cascade_element = *editor_elements_info[i].headline_list; + + if (*cascade_element == new_element) + { + *cascade_element = EL_CASCADE_TOGGLE(*cascade_element); + + ReinitializeElementList(); +#if 0 + ReinitializeElementListButtons(); +#endif + ModifyEditorElementList(); + AdjustElementListScrollbar(); + + PrintEditorGadgetInfoText(level_editor_gadget[id]); + + break; + } + } + + break; + } + if (last_custom_copy_mode != -1) { if (CopyCustomElement(properties_element, new_element, @@ -9482,25 +9679,66 @@ void ClearEditorGadgetInfoText() DrawBackground(INFOTEXT_XPOS, INFOTEXT_YPOS, INFOTEXT_XSIZE, INFOTEXT_YSIZE); } +void PrintEditorGadgetInfoText(struct GadgetInfo *gi) +{ + char infotext[MAX_OUTPUT_LINESIZE + 1]; + char shortcut[MAX_OUTPUT_LINESIZE + 1]; + int max_infotext_len = getMaxInfoTextLength(); + + if (gi == NULL || gi->info_text == NULL) + return; + + strncpy(infotext, gi->info_text, max_infotext_len); + infotext[max_infotext_len] = '\0'; + + if (gi->custom_id < ED_NUM_CTRL_BUTTONS) + { + int key = control_info[gi->custom_id].shortcut; + + if (key) + { + if (gi->custom_id == GADGET_ID_SINGLE_ITEMS) /* special case 1 */ + sprintf(shortcut, " ('.' or '%c')", key); + else if (gi->custom_id == GADGET_ID_PICK_ELEMENT) /* special case 2 */ + sprintf(shortcut, " ('%c' or 'Ctrl')", key); + else if (gi->custom_id == GADGET_ID_TEST) /* special case 3 */ + sprintf(shortcut, " ('Enter' or 'Shift-%c')", key); + else /* normal case */ + sprintf(shortcut, " ('%s%c')", + (key >= 'A' && key <= 'Z' ? "Shift-" : ""), key); + + if (strlen(infotext) + strlen(shortcut) <= max_infotext_len) + strcat(infotext, shortcut); + } + } + + DrawText(INFOTEXT_XPOS, INFOTEXT_YPOS, infotext, FONT_TEXT_2); +} + void HandleEditorGadgetInfoText(void *ptr) { struct GadgetInfo *gi = (struct GadgetInfo *)ptr; +#if 0 char infotext[MAX_OUTPUT_LINESIZE + 1]; char shortcut[MAX_OUTPUT_LINESIZE + 1]; int max_infotext_len = getMaxInfoTextLength(); +#endif if (game_status != GAME_MODE_EDITOR) return; ClearEditorGadgetInfoText(); - if (gi->event.type == GD_EVENT_INFO_LEAVING) + if (gi == NULL || gi->event.type == GD_EVENT_INFO_LEAVING) return; /* misuse this function to delete brush cursor, if needed */ if (edit_mode == ED_MODE_DRAWING && draw_with_brush) DeleteBrushFromCursor(); +#if 1 + PrintEditorGadgetInfoText(gi); +#else if (gi == NULL || gi->info_text == NULL) return; @@ -9529,6 +9767,7 @@ void HandleEditorGadgetInfoText(void *ptr) } DrawText(INFOTEXT_XPOS, INFOTEXT_YPOS, infotext, FONT_TEXT_2); +#endif } static void HandleDrawingAreaInfo(struct GadgetInfo *gi) diff --git a/src/files.c b/src/files.c index 74362467..1d299303 100644 --- a/src/files.c +++ b/src/files.c @@ -391,6 +391,10 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) static boolean clipboard_elements_initialized = FALSE; int i, j, x, y; +#if 1 + InitElementPropertiesStatic(); +#endif + setLevelInfoToDefaultsFromConfigList(level); setLevelInfoToDefaults_EM(); @@ -587,9 +591,13 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) ei->current_change_page = 0; +#if 0 + /* !!! now done in InitElementPropertiesStatic() (see above) !!! */ + /* !!! (else properties set there will be overwritten here) !!! */ /* start with no properties at all */ for (j = 0; j < NUM_EP_BITFIELDS; j++) Properties[element][j] = EP_BITMASK_DEFAULT; +#endif /* now set default properties */ SET_PROPERTY(element, EP_CAN_MOVE_INTO_ACID, TRUE); @@ -2317,6 +2325,16 @@ void CopyNativeLevel_RND_to_EM(struct LevelInfo *level) /* initialize player positions and delete players from the playfield */ for (y = 0; y < lev->height; y++) for (x = 0; x < lev->width; x++) { +#if 1 + /* !!! CURRENTLY ONLY SUPPORT FOR ONE PLAYER !!! */ + if (ELEM_IS_PLAYER(level->field[x][y])) + { + ply1->x_initial = x + 1; + ply1->y_initial = y + 1; + level_em->cave[x + 1][y + 1] = map_element_RND_to_EM(EL_EMPTY); + } +#else + /* !!! ADD SUPPORT FOR MORE THAN ONE PLAYER !!! */ if (level->field[x][y] == EL_PLAYER_1) { ply1->x_initial = x + 1; @@ -2329,6 +2347,7 @@ void CopyNativeLevel_RND_to_EM(struct LevelInfo *level) ply2->y_initial = y + 1; level_em->cave[x + 1][y + 1] = map_element_RND_to_EM(EL_EMPTY); } +#endif } } @@ -4479,9 +4498,9 @@ void SaveScore(int nr) #define SETUP_TOKEN_EDITOR_EL_DX_BOULDERDASH 7 #define SETUP_TOKEN_EDITOR_EL_CHARS 8 #define SETUP_TOKEN_EDITOR_EL_CUSTOM 9 -#define SETUP_TOKEN_EDITOR_EL_CUSTOM_MORE 10 -#define SETUP_TOKEN_EDITOR_EL_HEADLINES 11 -#define SETUP_TOKEN_EDITOR_EL_USER_DEFINED 12 +#define SETUP_TOKEN_EDITOR_EL_HEADLINES 10 +#define SETUP_TOKEN_EDITOR_EL_USER_DEFINED 11 +#define SETUP_TOKEN_EDITOR_EL_DYNAMIC 12 #define NUM_EDITOR_SETUP_TOKENS 13 @@ -4570,9 +4589,9 @@ static struct TokenInfo editor_setup_tokens[] = { TYPE_SWITCH, &sei.el_dx_boulderdash,"editor.el_dx_boulderdash" }, { TYPE_SWITCH, &sei.el_chars, "editor.el_chars" }, { TYPE_SWITCH, &sei.el_custom, "editor.el_custom" }, - { TYPE_SWITCH, &sei.el_custom_more, "editor.el_custom_more" }, { TYPE_SWITCH, &sei.el_headlines, "editor.el_headlines" }, { TYPE_SWITCH, &sei.el_user_defined, "editor.el_user_defined" }, + { TYPE_SWITCH, &sei.el_dynamic, "editor.el_dynamic" }, }; static struct TokenInfo shortcut_setup_tokens[] = @@ -4670,10 +4689,10 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->editor.el_dx_boulderdash = TRUE; si->editor.el_chars = TRUE; si->editor.el_custom = TRUE; - si->editor.el_custom_more = FALSE; si->editor.el_headlines = TRUE; si->editor.el_user_defined = FALSE; + si->editor.el_dynamic = TRUE; si->shortcut.save_game = DEFAULT_KEY_SAVE_GAME; si->shortcut.load_game = DEFAULT_KEY_LOAD_GAME; @@ -4970,6 +4989,10 @@ void LoadUserDefinedEditorElementList(int **elements, int *num_elements) /* add space for up to 3 more elements for padding that may be needed */ *num_elements += 3; + /* free memory for old list of elements, if needed */ + checked_free(*elements); + + /* allocate memory for new list of elements */ *elements = checked_malloc(*num_elements * sizeof(int)); *num_elements = 0; diff --git a/src/init.c b/src/init.c index 78ec6bac..b89412c4 100644 --- a/src/init.c +++ b/src/init.c @@ -451,6 +451,17 @@ void InitElementGraphicInfo() element_info[EL_AMOEBA_TO_DIAMOND].graphic[ACTION_DEFAULT] = IMG_AMOEBA_DEAD; #endif +#if 1 + /* set hardcoded definitions for some internal elements without graphic */ + for (i = 0; i < MAX_NUM_ELEMENTS; i++) + { + if (IS_EDITOR_CASCADE_INACTIVE(i)) + element_info[i].graphic[ACTION_DEFAULT] = IMG_EDITOR_CASCADE_LIST; + else if (IS_EDITOR_CASCADE_ACTIVE(i)) + element_info[i].graphic[ACTION_DEFAULT] = IMG_EDITOR_CASCADE_LIST_ACTIVE; + } +#endif + /* now set all undefined/invalid graphics to -1 to set to default after it */ for (i = 0; i < MAX_NUM_ELEMENTS; i++) { @@ -3350,74 +3361,115 @@ void InitElementPropertiesStatic() -1 }; + static int ep_editor_cascade_active[] = + { + EL_INTERNAL_CASCADE_BD_ACTIVE, + EL_INTERNAL_CASCADE_EM_ACTIVE, + EL_INTERNAL_CASCADE_EMC_ACTIVE, + EL_INTERNAL_CASCADE_RND_ACTIVE, + EL_INTERNAL_CASCADE_SB_ACTIVE, + EL_INTERNAL_CASCADE_SP_ACTIVE, + EL_INTERNAL_CASCADE_DC_ACTIVE, + EL_INTERNAL_CASCADE_DX_ACTIVE, + EL_INTERNAL_CASCADE_TEXT_ACTIVE, + EL_INTERNAL_CASCADE_CE_ACTIVE, + EL_INTERNAL_CASCADE_GE_ACTIVE, + EL_INTERNAL_CASCADE_USER_ACTIVE, + EL_INTERNAL_CASCADE_GENERIC_ACTIVE, + EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE, + -1 + }; + + static int ep_editor_cascade_inactive[] = + { + EL_INTERNAL_CASCADE_BD, + EL_INTERNAL_CASCADE_EM, + EL_INTERNAL_CASCADE_EMC, + EL_INTERNAL_CASCADE_RND, + EL_INTERNAL_CASCADE_SB, + EL_INTERNAL_CASCADE_SP, + EL_INTERNAL_CASCADE_DC, + EL_INTERNAL_CASCADE_DX, + EL_INTERNAL_CASCADE_TEXT, + EL_INTERNAL_CASCADE_CE, + EL_INTERNAL_CASCADE_GE, + EL_INTERNAL_CASCADE_USER, + EL_INTERNAL_CASCADE_GENERIC, + EL_INTERNAL_CASCADE_DYNAMIC, + -1 + }; + static struct { int *elements; int property; } element_properties[] = { - { ep_diggable, EP_DIGGABLE }, - { ep_collectible_only, EP_COLLECTIBLE_ONLY }, - { ep_dont_run_into, EP_DONT_RUN_INTO }, - { ep_dont_collide_with, EP_DONT_COLLIDE_WITH }, - { ep_dont_touch, EP_DONT_TOUCH }, - { ep_indestructible, EP_INDESTRUCTIBLE }, - { ep_slippery, EP_SLIPPERY }, - { ep_can_change, EP_CAN_CHANGE }, - { ep_can_move, EP_CAN_MOVE }, - { ep_can_fall, EP_CAN_FALL }, - { ep_can_smash_player, EP_CAN_SMASH_PLAYER }, - { ep_can_smash_enemies, EP_CAN_SMASH_ENEMIES }, - { ep_can_smash_everything, EP_CAN_SMASH_EVERYTHING }, - { ep_explodes_by_fire, EP_EXPLODES_BY_FIRE }, - { ep_explodes_smashed, EP_EXPLODES_SMASHED }, - { ep_explodes_impact, EP_EXPLODES_IMPACT }, - { ep_walkable_over, EP_WALKABLE_OVER }, - { ep_walkable_inside, EP_WALKABLE_INSIDE }, - { ep_walkable_under, EP_WALKABLE_UNDER }, - { ep_passable_over, EP_PASSABLE_OVER }, - { ep_passable_inside, EP_PASSABLE_INSIDE }, - { ep_passable_under, EP_PASSABLE_UNDER }, - { ep_droppable, EP_DROPPABLE }, - { ep_explodes_1x1_old, EP_EXPLODES_1X1_OLD }, - { ep_pushable, EP_PUSHABLE }, - { ep_explodes_cross_old, EP_EXPLODES_CROSS_OLD }, - { ep_protected, EP_PROTECTED }, - { ep_throwable, EP_THROWABLE }, - { ep_can_explode, EP_CAN_EXPLODE }, - { ep_gravity_reachable, EP_GRAVITY_REACHABLE }, - - { ep_player, EP_PLAYER }, - { ep_can_pass_magic_wall, EP_CAN_PASS_MAGIC_WALL }, - { ep_switchable, EP_SWITCHABLE }, - { ep_bd_element, EP_BD_ELEMENT }, - { ep_sp_element, EP_SP_ELEMENT }, - { ep_sb_element, EP_SB_ELEMENT }, - { ep_gem, EP_GEM }, - { ep_food_dark_yamyam, EP_FOOD_DARK_YAMYAM }, - { ep_food_penguin, EP_FOOD_PENGUIN }, - { ep_food_pig, EP_FOOD_PIG }, - { ep_historic_wall, EP_HISTORIC_WALL }, - { ep_historic_solid, EP_HISTORIC_SOLID }, - { ep_classic_enemy, EP_CLASSIC_ENEMY }, - { ep_belt, EP_BELT }, - { ep_belt_active, EP_BELT_ACTIVE }, - { ep_belt_switch, EP_BELT_SWITCH }, - { ep_tube, EP_TUBE }, - { ep_keygate, EP_KEYGATE }, - { ep_amoeboid, EP_AMOEBOID }, - { ep_amoebalive, EP_AMOEBALIVE }, - { ep_has_content, EP_HAS_CONTENT }, - { ep_can_turn_each_move, EP_CAN_TURN_EACH_MOVE }, - { ep_can_grow, EP_CAN_GROW }, - { ep_active_bomb, EP_ACTIVE_BOMB }, - { ep_inactive, EP_INACTIVE }, - - { ep_em_slippery_wall, EP_EM_SLIPPERY_WALL }, - - { ep_gfx_crumbled, EP_GFX_CRUMBLED }, - - { NULL, -1 } + { ep_diggable, EP_DIGGABLE }, + { ep_collectible_only, EP_COLLECTIBLE_ONLY }, + { ep_dont_run_into, EP_DONT_RUN_INTO }, + { ep_dont_collide_with, EP_DONT_COLLIDE_WITH }, + { ep_dont_touch, EP_DONT_TOUCH }, + { ep_indestructible, EP_INDESTRUCTIBLE }, + { ep_slippery, EP_SLIPPERY }, + { ep_can_change, EP_CAN_CHANGE }, + { ep_can_move, EP_CAN_MOVE }, + { ep_can_fall, EP_CAN_FALL }, + { ep_can_smash_player, EP_CAN_SMASH_PLAYER }, + { ep_can_smash_enemies, EP_CAN_SMASH_ENEMIES }, + { ep_can_smash_everything, EP_CAN_SMASH_EVERYTHING }, + { ep_explodes_by_fire, EP_EXPLODES_BY_FIRE }, + { ep_explodes_smashed, EP_EXPLODES_SMASHED }, + { ep_explodes_impact, EP_EXPLODES_IMPACT }, + { ep_walkable_over, EP_WALKABLE_OVER }, + { ep_walkable_inside, EP_WALKABLE_INSIDE }, + { ep_walkable_under, EP_WALKABLE_UNDER }, + { ep_passable_over, EP_PASSABLE_OVER }, + { ep_passable_inside, EP_PASSABLE_INSIDE }, + { ep_passable_under, EP_PASSABLE_UNDER }, + { ep_droppable, EP_DROPPABLE }, + { ep_explodes_1x1_old, EP_EXPLODES_1X1_OLD }, + { ep_pushable, EP_PUSHABLE }, + { ep_explodes_cross_old, EP_EXPLODES_CROSS_OLD }, + { ep_protected, EP_PROTECTED }, + { ep_throwable, EP_THROWABLE }, + { ep_can_explode, EP_CAN_EXPLODE }, + { ep_gravity_reachable, EP_GRAVITY_REACHABLE }, + + { ep_player, EP_PLAYER }, + { ep_can_pass_magic_wall, EP_CAN_PASS_MAGIC_WALL }, + { ep_switchable, EP_SWITCHABLE }, + { ep_bd_element, EP_BD_ELEMENT }, + { ep_sp_element, EP_SP_ELEMENT }, + { ep_sb_element, EP_SB_ELEMENT }, + { ep_gem, EP_GEM }, + { ep_food_dark_yamyam, EP_FOOD_DARK_YAMYAM }, + { ep_food_penguin, EP_FOOD_PENGUIN }, + { ep_food_pig, EP_FOOD_PIG }, + { ep_historic_wall, EP_HISTORIC_WALL }, + { ep_historic_solid, EP_HISTORIC_SOLID }, + { ep_classic_enemy, EP_CLASSIC_ENEMY }, + { ep_belt, EP_BELT }, + { ep_belt_active, EP_BELT_ACTIVE }, + { ep_belt_switch, EP_BELT_SWITCH }, + { ep_tube, EP_TUBE }, + { ep_keygate, EP_KEYGATE }, + { ep_amoeboid, EP_AMOEBOID }, + { ep_amoebalive, EP_AMOEBALIVE }, + { ep_has_content, EP_HAS_CONTENT }, + { ep_can_turn_each_move, EP_CAN_TURN_EACH_MOVE }, + { ep_can_grow, EP_CAN_GROW }, + { ep_active_bomb, EP_ACTIVE_BOMB }, + { ep_inactive, EP_INACTIVE }, + + { ep_em_slippery_wall, EP_EM_SLIPPERY_WALL }, + + { ep_gfx_crumbled, EP_GFX_CRUMBLED }, + + { ep_editor_cascade_active, EP_EDITOR_CASCADE_ACTIVE }, + { ep_editor_cascade_inactive, EP_EDITOR_CASCADE_INACTIVE }, + + { NULL, -1 } }; int i, j, k; @@ -3645,6 +3697,10 @@ void InitElementPropertiesEngine(int engine_version) SET_PROPERTY(i, EP_GFX_CRUMBLED, element_info[i].crumbled[ACTION_DEFAULT] != IMG_EMPTY); #endif + + /* ---------- EDITOR_CASCADE ------------------------------------------- */ + SET_PROPERTY(i, EP_EDITOR_CASCADE, (IS_EDITOR_CASCADE_ACTIVE(i) || + IS_EDITOR_CASCADE_INACTIVE(i))); } /* dynamically adjust element properties according to game engine version */ diff --git a/src/libgame/system.h b/src/libgame/system.h index 0ccf0a29..c8b7d4d3 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -586,8 +586,8 @@ struct SetupEditorInfo boolean el_dx_boulderdash; boolean el_chars; boolean el_custom; - boolean el_custom_more; boolean el_user_defined; + boolean el_dynamic; boolean el_headlines; }; diff --git a/src/main.c b/src/main.c index d335c571..50f262eb 100644 --- a/src/main.c +++ b/src/main.c @@ -4194,6 +4194,146 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "internal", "-" }, + { + "internal_cascade_bd", + "internal", + "show Boulder Dash elements" + }, + { + "internal_cascade_bd.active", + "internal", + "hide Boulder Dash elements" + }, + { + "internal_cascade_em", + "internal", + "show Emerald Mine elements" + }, + { + "internal_cascade_em.active", + "internal", + "hide Emerald Mine elements" + }, + { + "internal_cascade_emc", + "internal", + "show Emerald Mine Club elements" + }, + { + "internal_cascade_emc.active", + "internal", + "hide Emerald Mine Club elements" + }, + { + "internal_cascade_rnd", + "internal", + "show Rocks'n'Diamonds elements" + }, + { + "internal_cascade_rnd.active", + "internal", + "hide Rocks'n'Diamonds elements" + }, + { + "internal_cascade_sb", + "internal", + "show Sokoban elements" + }, + { + "internal_cascade_sb.active", + "internal", + "hide Sokoban elements" + }, + { + "internal_cascade_sp", + "internal", + "show Supaplex elements" + }, + { + "internal_cascade_sp.active", + "internal", + "hide Supaplex elements" + }, + { + "internal_cascade_dc", + "internal", + "show Diamond Caves II elements" + }, + { + "internal_cascade_dc.active", + "internal", + "hide Diamond Caves II elements" + }, + { + "internal_cascade_dx", + "internal", + "show DX Boulderdash elements" + }, + { + "internal_cascade_dx.active", + "internal", + "hide DX Boulderdash elements" + }, + { + "internal_cascade_text", + "internal", + "show text elements" + }, + { + "internal_cascade_text.active", + "internal", + "hide text elements" + }, + { + "internal_cascade_ce", + "internal", + "show custom elements" + }, + { + "internal_cascade_ce.active", + "internal", + "hide custom elements" + }, + { + "internal_cascade_ge", + "internal", + "show group elements" + }, + { + "internal_cascade_ge.active", + "internal", + "hide group elements" + }, + { + "internal_cascade_user", + "internal", + "show user defined elements" + }, + { + "internal_cascade_user.active", + "internal", + "hide user defined elements" + }, + { + "internal_cascade_generic", + "internal", + "show elements" + }, + { + "internal_cascade_generic.active", + "internal", + "hide elements" + }, + { + "internal_cascade_dynamic", + "internal", + "show elements from this level" + }, + { + "internal_cascade_dynamic.active", + "internal", + "hide elements from this level" + }, /* keyword to stop parser: "ELEMENT_INFO_END" <-- do not change! */ diff --git a/src/main.h b/src/main.h index 49c07a6c..5331d94a 100644 --- a/src/main.h +++ b/src/main.h @@ -154,12 +154,15 @@ /* values for internal purpose only (level editor) */ #define EP_WALK_TO_OBJECT 81 #define EP_DEADLY 82 +#define EP_EDITOR_CASCADE 83 +#define EP_EDITOR_CASCADE_ACTIVE 84 +#define EP_EDITOR_CASCADE_INACTIVE 85 /* values for internal purpose only (game engine) */ -#define EP_HAS_ACTION 83 -#define EP_CAN_CHANGE_OR_HAS_ACTION 84 +#define EP_HAS_ACTION 86 +#define EP_CAN_CHANGE_OR_HAS_ACTION 87 -#define NUM_ELEMENT_PROPERTIES 85 +#define NUM_ELEMENT_PROPERTIES 88 #define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32) #define EP_BITFIELD_BASE 0 @@ -537,6 +540,13 @@ HAS_PROPERTY(e, EP_CAN_EXPLODE_BY_EXPLOSION) #define COULD_MOVE_INTO_ACID(e) HAS_PROPERTY(e, EP_COULD_MOVE_INTO_ACID) #define MAYBE_DONT_COLLIDE_WITH(e) HAS_PROPERTY(e, EP_MAYBE_DONT_COLLIDE_WITH) + +#define IS_EDITOR_CASCADE(e) HAS_PROPERTY(e, EP_EDITOR_CASCADE) +#define IS_EDITOR_CASCADE_ACTIVE(e) \ + HAS_PROPERTY(e, EP_EDITOR_CASCADE_ACTIVE) +#define IS_EDITOR_CASCADE_INACTIVE(e) \ + HAS_PROPERTY(e, EP_EDITOR_CASCADE_INACTIVE) + #define HAS_ACTION(e) HAS_PROPERTY(e, EP_HAS_ACTION) #define CAN_CHANGE_OR_HAS_ACTION(e) \ HAS_PROPERTY(e, EP_CAN_CHANGE_OR_HAS_ACTION) @@ -687,6 +697,11 @@ #define IS_LOOP_SOUND(s) (sound_info[s].loop) +#define EL_CASCADE_ACTIVE(e) (IS_EDITOR_CASCADE_INACTIVE(e) ? (e) + 1 : (e)) +#define EL_CASCADE_INACTIVE(e) (IS_EDITOR_CASCADE_ACTIVE(e) ? (e) - 1 : (e)) +#define EL_CASCADE_TOGGLE(e) (IS_EDITOR_CASCADE_INACTIVE(e) ? (e) + 1 : \ + IS_EDITOR_CASCADE_ACTIVE(e) ? (e) - 1 : (e)) + /* fundamental game speed values */ #define ONE_SECOND_DELAY 1000 /* delay value for one second */ @@ -1315,12 +1330,41 @@ #define EL_INTERNAL_CLIPBOARD_GROUP (EL_FIRST_INTERNAL + 2) #define EL_INTERNAL_DUMMY (EL_FIRST_INTERNAL + 3) +#define EL_INTERNAL_CASCADE_BD (EL_FIRST_INTERNAL + 4) +#define EL_INTERNAL_CASCADE_BD_ACTIVE (EL_FIRST_INTERNAL + 5) +#define EL_INTERNAL_CASCADE_EM (EL_FIRST_INTERNAL + 6) +#define EL_INTERNAL_CASCADE_EM_ACTIVE (EL_FIRST_INTERNAL + 7) +#define EL_INTERNAL_CASCADE_EMC (EL_FIRST_INTERNAL + 8) +#define EL_INTERNAL_CASCADE_EMC_ACTIVE (EL_FIRST_INTERNAL + 9) +#define EL_INTERNAL_CASCADE_RND (EL_FIRST_INTERNAL + 10) +#define EL_INTERNAL_CASCADE_RND_ACTIVE (EL_FIRST_INTERNAL + 11) +#define EL_INTERNAL_CASCADE_SB (EL_FIRST_INTERNAL + 12) +#define EL_INTERNAL_CASCADE_SB_ACTIVE (EL_FIRST_INTERNAL + 13) +#define EL_INTERNAL_CASCADE_SP (EL_FIRST_INTERNAL + 14) +#define EL_INTERNAL_CASCADE_SP_ACTIVE (EL_FIRST_INTERNAL + 15) +#define EL_INTERNAL_CASCADE_DC (EL_FIRST_INTERNAL + 16) +#define EL_INTERNAL_CASCADE_DC_ACTIVE (EL_FIRST_INTERNAL + 17) +#define EL_INTERNAL_CASCADE_DX (EL_FIRST_INTERNAL + 18) +#define EL_INTERNAL_CASCADE_DX_ACTIVE (EL_FIRST_INTERNAL + 19) +#define EL_INTERNAL_CASCADE_TEXT (EL_FIRST_INTERNAL + 20) +#define EL_INTERNAL_CASCADE_TEXT_ACTIVE (EL_FIRST_INTERNAL + 21) +#define EL_INTERNAL_CASCADE_CE (EL_FIRST_INTERNAL + 22) +#define EL_INTERNAL_CASCADE_CE_ACTIVE (EL_FIRST_INTERNAL + 23) +#define EL_INTERNAL_CASCADE_GE (EL_FIRST_INTERNAL + 24) +#define EL_INTERNAL_CASCADE_GE_ACTIVE (EL_FIRST_INTERNAL + 25) +#define EL_INTERNAL_CASCADE_USER (EL_FIRST_INTERNAL + 26) +#define EL_INTERNAL_CASCADE_USER_ACTIVE (EL_FIRST_INTERNAL + 27) +#define EL_INTERNAL_CASCADE_GENERIC (EL_FIRST_INTERNAL + 28) +#define EL_INTERNAL_CASCADE_GENERIC_ACTIVE (EL_FIRST_INTERNAL + 29) +#define EL_INTERNAL_CASCADE_DYNAMIC (EL_FIRST_INTERNAL + 30) +#define EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE (EL_FIRST_INTERNAL + 31) + #define EL_INTERNAL_CLIPBOARD_START (EL_FIRST_INTERNAL + 0) #define EL_INTERNAL_CLIPBOARD_END (EL_FIRST_INTERNAL + 2) #define EL_INTERNAL_START (EL_FIRST_INTERNAL + 0) -#define EL_INTERNAL_END (EL_FIRST_INTERNAL + 3) +#define EL_INTERNAL_END (EL_FIRST_INTERNAL + 31) -#define MAX_NUM_ELEMENTS (EL_FIRST_INTERNAL + 4) +#define MAX_NUM_ELEMENTS (EL_FIRST_INTERNAL + 32) /* values for graphics/sounds action types */ diff --git a/src/screens.c b/src/screens.c index 43d02fb4..b3732972 100644 --- a/src/screens.c +++ b/src/screens.c @@ -60,6 +60,8 @@ #define MAX_MENU_ENTRIES_ON_SCREEN (SCR_FIELDY - 2) #define MENU_SCREEN_START_YPOS 2 #define MENU_SCREEN_VALUE_XPOS 14 +#define MENU_TITLE1_YPOS 8 +#define MENU_TITLE2_YPOS 46 /* buttons and scrollbars identifiers */ #define SCREEN_CTRL_ID_SCROLL_UP 0 @@ -203,8 +205,8 @@ static void PlayMenuMusic() void DrawHeadline() { - DrawTextSCentered(8, FONT_TITLE_1, PROGRAM_TITLE_STRING); - DrawTextSCentered(46, FONT_TITLE_2, PROGRAM_COPYRIGHT_STRING); + DrawTextSCentered(MENU_TITLE1_YPOS, FONT_TITLE_1, PROGRAM_TITLE_STRING); + DrawTextSCentered(MENU_TITLE2_YPOS, FONT_TITLE_2, PROGRAM_COPYRIGHT_STRING); } static void ToggleFullscreenIfNeeded() @@ -235,6 +237,11 @@ void DrawMainMenu() { static LevelDirTree *leveldir_last_valid = NULL; char *name_text = (!options.network && setup.team_mode ? "Team:" : "Name:"); +#if 1 + char *level_text = "Levelset"; +#else + char *level_text = "Level:"; +#endif int name_width, level_width; int i; @@ -293,28 +300,59 @@ void DrawMainMenu() DrawHeadline(); - DrawText(mSX + 32, mSY + 2*32, name_text, FONT_MENU_1); - DrawText(mSX + 32, mSY + 3*32, "Level:", FONT_MENU_1); - DrawText(mSX + 32, mSY + 4*32, "Hall Of Fame", FONT_MENU_1); - DrawText(mSX + 32, mSY + 5*32, "Level Creator", FONT_MENU_1); - DrawText(mSX + 32, mSY + 6*32, "Info Screen", FONT_MENU_1); - DrawText(mSX + 32, mSY + 7*32, "Start Game", FONT_MENU_1); - DrawText(mSX + 32, mSY + 8*32, "Setup", FONT_MENU_1); - DrawText(mSX + 32, mSY + 9*32, "Quit", FONT_MENU_1); + DrawText(mSX + 32, mSY + 2 * 32, name_text, FONT_MENU_1); + DrawText(mSX + 32, mSY + 3 * 32, level_text, FONT_MENU_1); + DrawText(mSX + 32, mSY + 4 * 32, "Hall Of Fame", FONT_MENU_1); + DrawText(mSX + 32, mSY + 5 * 32, "Level Creator", FONT_MENU_1); + DrawText(mSX + 32, mSY + 6 * 32, "Info Screen", FONT_MENU_1); + DrawText(mSX + 32, mSY + 7 * 32, "Start Game", FONT_MENU_1); + DrawText(mSX + 32, mSY + 8 * 32, "Setup", FONT_MENU_1); + DrawText(mSX + 32, mSY + 9 * 32, "Quit", FONT_MENU_1); /* calculated after (possible) reload of custom artwork */ - name_width = getTextWidth(name_text, FONT_MENU_1); - level_width = getTextWidth("Level:", FONT_MENU_1); + name_width = getTextWidth(name_text, FONT_MENU_1); +#if 1 + level_width = 9 * getFontWidth(FONT_MENU_1); +#else + level_width = getTextWidth(level_text, FONT_MENU_1); +#endif - DrawText(mSX + 32 + name_width, mSY + 2*32, setup.player_name, FONT_INPUT_1); - DrawText(mSX + level_width + 5 * 32, mSY + 3*32, int2str(level_nr,3), + DrawText(mSX + 32 + name_width, mSY + 2 * 32, setup.player_name, + FONT_INPUT_1); +#if 1 + DrawText(mSX + level_width + 2 * 32, mSY + 3 * 32, int2str(level_nr, 3), + FONT_VALUE_1); +#else + DrawText(mSX + level_width + 5 * 32, mSY + 3 * 32, int2str(level_nr, 3), FONT_VALUE_1); +#endif DrawMicroLevel(MICROLEVEL_XPOS, MICROLEVEL_YPOS, TRUE); - DrawTextF(mSX + 32 + level_width - 2, mSY + 3*32 + 1, FONT_TEXT_3, "%d-%d", +#if 1 + +#if 1 + { + int text_height = getFontHeight(FONT_TEXT_3); + int ypos2 = -SY + 3 * 32 + 16; + int ypos1 = ypos2 - text_height; + + DrawTextF(mSX + level_width + 6 * 32, mSY + ypos1, FONT_TEXT_3, + "%03d", leveldir_current->first_level); + DrawTextF(mSX + level_width + 6 * 32, mSY + ypos2, FONT_TEXT_3, + "%03d", leveldir_current->last_level); + } +#else + DrawTextF(mSX + level_width + 6 * 32, mSY + 3 * 32 + 1, FONT_TEXT_3, + "%d", leveldir_current->levels); +#endif + +#else + DrawTextF(mSX + 32 + level_width - 2, mSY + 3 * 32 + 1, FONT_TEXT_3, "%d-%d", leveldir_current->first_level, leveldir_current->last_level); +#endif +#if 0 if (leveldir_current->readonly) { DrawTextS(mSX + level_width + 9 * 32 - 2, @@ -322,13 +360,19 @@ void DrawMainMenu() DrawTextS(mSX + level_width + 9 * 32 - 2, mSY + 3 * 32 + 1 + 7, FONT_TEXT_3, "ONLY"); } +#endif for (i = 0; i < 8; i++) initCursor(i, (i == 1 || i == 4 || i == 6 ? IMG_MENU_BUTTON_ENTER_MENU : IMG_MENU_BUTTON)); +#if 1 + drawCursorXY(level_width / 32 + 1, 1, IMG_MENU_BUTTON_LEFT); + drawCursorXY(level_width / 32 + 5, 1, IMG_MENU_BUTTON_RIGHT); +#else drawCursorXY(level_width / 32 + 4, 1, IMG_MENU_BUTTON_LEFT); drawCursorXY(level_width / 32 + 8, 1, IMG_MENU_BUTTON_RIGHT); +#endif DrawTextSCentered(326, FONT_TITLE_2, "A Game by Artsoft Entertainment"); @@ -600,7 +644,11 @@ static void DrawInfoScreen_Main() ClearWindow(); +#if 1 + DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, "Info Screen"); +#else DrawText(mSX + 16, mSY + 16, "Info Screen", FONT_TITLE_1); +#endif info_info = info_info_main; num_info_info = 0; @@ -1399,19 +1447,38 @@ static void drawChooseTreeList(int first_entry, int num_page_entries, char buffer[SCR_FIELDX * 2]; int max_buffer_len = (SCR_FIELDX - 2) * 2; char *title_string = NULL; +#if 0 + int xoffset_sets = 16; +#endif + int yoffset_sets = MENU_TITLE1_YPOS; +#if 0 int xoffset_setup = 16; +#endif int yoffset_setup = 16; +#if 1 +#if 0 + int xoffset = (ti->type == TREE_TYPE_LEVEL_DIR ? xoffset_sets : + xoffset_setup); +#endif + int yoffset = (ti->type == TREE_TYPE_LEVEL_DIR ? yoffset_sets : + yoffset_setup); +#else int xoffset = (ti->type == TREE_TYPE_LEVEL_DIR ? 0 : xoffset_setup); int yoffset = (ti->type == TREE_TYPE_LEVEL_DIR ? 0 : yoffset_setup); +#endif int last_game_status = game_status; /* save current game status */ title_string = - (ti->type == TREE_TYPE_LEVEL_DIR ? "Level Directories" : + (ti->type == TREE_TYPE_LEVEL_DIR ? "Level Sets" : ti->type == TREE_TYPE_GRAPHICS_DIR ? "Custom Graphics" : ti->type == TREE_TYPE_SOUNDS_DIR ? "Custom Sounds" : ti->type == TREE_TYPE_MUSIC_DIR ? "Custom Music" : ""); +#if 1 + DrawTextSCentered(mSY - SY + yoffset, FONT_TITLE_1, title_string); +#else DrawText(SX + xoffset, SY + yoffset, title_string, FONT_TITLE_1); +#endif /* force LEVELS font on artwork setup screen */ game_status = GAME_MODE_LEVELS; @@ -1430,7 +1497,7 @@ static void drawChooseTreeList(int first_entry, int num_page_entries, node_first = getTreeInfoFirstGroupEntry(ti); node = getTreeInfoFromPos(node_first, entry_pos); - strncpy(buffer, node->name , max_buffer_len); + strncpy(buffer, node->name, max_buffer_len); buffer[max_buffer_len] = '\0'; DrawText(mSX + 32, mSY + ypos * 32, buffer, FONT_TEXT_1 + node->color); @@ -1452,6 +1519,11 @@ static void drawChooseTreeInfo(int entry_pos, TreeInfo *ti) { TreeInfo *node, *node_first; int x, last_redraw_mask = redraw_mask; +#if 1 + int ypos = MENU_TITLE2_YPOS; +#else + int ypos = 40; +#endif if (ti->type != TREE_TYPE_LEVEL_DIR) return; @@ -1459,16 +1531,16 @@ static void drawChooseTreeInfo(int entry_pos, TreeInfo *ti) node_first = getTreeInfoFirstGroupEntry(ti); node = getTreeInfoFromPos(node_first, entry_pos); - DrawBackground(SX + 32, SY + 32, SXSIZE - 64, 32); + DrawBackground(SX, SY + ypos, SXSIZE, getFontHeight(FONT_TITLE_2)); if (node->parent_link) - DrawTextFCentered(40, FONT_TITLE_2, "leave group \"%s\"", + DrawTextFCentered(ypos, FONT_TITLE_2, "leave group \"%s\"", node->class_desc); else if (node->level_group) - DrawTextFCentered(40, FONT_TITLE_2, "enter group \"%s\"", + DrawTextFCentered(ypos, FONT_TITLE_2, "enter group \"%s\"", node->class_desc); else if (ti->type == TREE_TYPE_LEVEL_DIR) - DrawTextFCentered(40, FONT_TITLE_2, "%3d levels (%s)", + DrawTextFCentered(ypos, FONT_TITLE_2, "%3d levels (%s)", node->levels, node->class_desc); /* let BackToFront() redraw only what is needed */ @@ -1747,8 +1819,15 @@ static void drawHallOfFameList(int first_entry, int highlight_position) SetMainBackgroundImage(IMG_BACKGROUND_SCORES); ClearWindow(); - DrawText(mSX + 80, mSY + 8, "Hall Of Fame", FONT_TITLE_1); - DrawTextFCentered(46, FONT_TITLE_2, "HighScores of Level %d", level_nr); +#if 1 + DrawTextSCentered(MENU_TITLE1_YPOS, FONT_TITLE_1, "Hall Of Fame"); + DrawTextFCentered(MENU_TITLE2_YPOS, FONT_TITLE_2, + "HighScores of Level %d", level_nr); +#else + DrawText(mSX + 80, mSY + MENU_TITLE1_YPOS, "Hall Of Fame", FONT_TITLE_1); + DrawTextFCentered(MENU_TITLE2_YPOS, FONT_TITLE_2, + "HighScores of Level %d", level_nr); +#endif for (i = 0; i < NUM_MENU_ENTRIES_ON_SCREEN; i++) { @@ -1974,9 +2053,9 @@ static struct TokenInfo setup_info_editor[] = { TYPE_SWITCH, &setup.editor.el_dx_boulderdash,"DX Boulderd.:" }, { TYPE_SWITCH, &setup.editor.el_chars, "Characters:" }, { TYPE_SWITCH, &setup.editor.el_custom, "Custom:" }, - { TYPE_SWITCH, &setup.editor.el_custom_more, "More Custom:" }, { TYPE_SWITCH, &setup.editor.el_headlines, "Headlines:" }, { TYPE_SWITCH, &setup.editor.el_user_defined, "User defined:" }, + { TYPE_SWITCH, &setup.editor.el_dynamic, "Dynamic:" }, { TYPE_EMPTY, NULL, "" }, { TYPE_LEAVE_MENU, execSetupMain, "Back" }, @@ -2204,7 +2283,11 @@ static void DrawSetupScreen_Generic() title_string = "Setup Shortcuts"; } +#if 1 + DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, title_string); +#else DrawText(mSX + 16, mSY + 16, title_string, FONT_TITLE_1); +#endif num_setup_info = 0; for (i = 0; setup_info[i].type != 0 && i < NUM_MENU_ENTRIES_ON_SCREEN; i++) @@ -2238,6 +2321,11 @@ static void DrawSetupScreen_Generic() num_setup_info++; } +#if 0 + DrawTextSCentered(SYSIZE - 20, FONT_TEXT_4, + "Joysticks deactivated in setup menu"); +#endif + FadeToFront(); InitAnimation(); HandleSetupScreen_Generic(0, 0, 0, 0, MB_MENU_INITIALIZE); @@ -2338,7 +2426,11 @@ void DrawSetupScreen_Input() { ClearWindow(); - DrawText(mSX+16, mSY+16, "Setup Input", FONT_TITLE_1); +#if 1 + DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, "Setup Input"); +#else + DrawText(mSX + 16, mSY + 16, "Setup Input", FONT_TITLE_1); +#endif initCursor(0, IMG_MENU_BUTTON); initCursor(1, IMG_MENU_BUTTON); @@ -2348,12 +2440,14 @@ void DrawSetupScreen_Input() drawCursorXY(10, 0, IMG_MENU_BUTTON_LEFT); drawCursorXY(12, 0, IMG_MENU_BUTTON_RIGHT); - DrawText(mSX+32, mSY+2*32, "Player:", FONT_MENU_1); - DrawText(mSX+32, mSY+3*32, "Device:", FONT_MENU_1); - DrawText(mSX+32, mSY+15*32, "Back", FONT_MENU_1); + DrawText(mSX + 32, mSY + 2 * 32, "Player:", FONT_MENU_1); + DrawText(mSX + 32, mSY + 3 * 32, "Device:", FONT_MENU_1); + DrawText(mSX + 32, mSY + 15 * 32, "Back", FONT_MENU_1); #if 0 DeactivateJoystickForCalibration(); +#endif +#if 1 DrawTextSCentered(SYSIZE - 20, FONT_TEXT_4, "Joysticks deactivated on this screen"); #endif @@ -2411,7 +2505,8 @@ static void drawPlayerSetupInputInfo(int player_nr) custom_key = setup.input[player_nr].key; - DrawText(mSX+11*32, mSY+2*32, int2str(player_nr +1, 1), FONT_INPUT_1_ACTIVE); + DrawText(mSX + 11 * 32, mSY + 2 * 32, int2str(player_nr + 1, 1), + FONT_INPUT_1_ACTIVE); ClearRectangleOnBackground(drawto, mSX + 8 * TILEX, mSY + 2 * TILEY, TILEX, TILEY); @@ -2422,36 +2517,36 @@ static void drawPlayerSetupInputInfo(int player_nr) { char *device_name = setup.input[player_nr].joy.device_name; - DrawText(mSX+8*32, mSY+3*32, + DrawText(mSX + 8 * 32, mSY + 3 * 32, joystick_name[getJoystickNrFromDeviceName(device_name)], FONT_VALUE_1); - DrawText(mSX+32, mSY+4*32, "Calibrate", FONT_MENU_1); + DrawText(mSX + 32, mSY + 4 * 32, "Calibrate", FONT_MENU_1); } else { - DrawText(mSX+8*32, mSY+3*32, "Keyboard ", FONT_VALUE_1); - DrawText(mSX+32, mSY+4*32, "Customize", FONT_MENU_1); + DrawText(mSX + 8 * 32, mSY + 3 * 32, "Keyboard ", FONT_VALUE_1); + DrawText(mSX + 1 * 32, mSY + 4 * 32, "Customize", FONT_MENU_1); } - DrawText(mSX+32, mSY+5*32, "Actual Settings:", FONT_MENU_1); + DrawText(mSX + 32, mSY + 5 * 32, "Actual Settings:", FONT_MENU_1); drawCursorXY(1, 4, IMG_MENU_BUTTON_LEFT); drawCursorXY(1, 5, IMG_MENU_BUTTON_RIGHT); drawCursorXY(1, 6, IMG_MENU_BUTTON_UP); drawCursorXY(1, 7, IMG_MENU_BUTTON_DOWN); - DrawText(mSX+2*32, mSY+6*32, ":", FONT_VALUE_OLD); - DrawText(mSX+2*32, mSY+7*32, ":", FONT_VALUE_OLD); - DrawText(mSX+2*32, mSY+8*32, ":", FONT_VALUE_OLD); - DrawText(mSX+2*32, mSY+9*32, ":", FONT_VALUE_OLD); - DrawText(mSX+32, mSY+10*32, "Snap Field:", FONT_VALUE_OLD); - DrawText(mSX+32, mSY+12*32, "Drop Element:", FONT_VALUE_OLD); + DrawText(mSX + 2 * 32, mSY + 6 * 32, ":", FONT_VALUE_OLD); + DrawText(mSX + 2 * 32, mSY + 7 * 32, ":", FONT_VALUE_OLD); + DrawText(mSX + 2 * 32, mSY + 8 * 32, ":", FONT_VALUE_OLD); + DrawText(mSX + 2 * 32, mSY + 9 * 32, ":", FONT_VALUE_OLD); + DrawText(mSX + 1 * 32, mSY + 10 * 32, "Snap Field:", FONT_VALUE_OLD); + DrawText(mSX + 1 * 32, mSY + 12 * 32, "Drop Element:", FONT_VALUE_OLD); for (i = 0; i < 6; i++) { int ypos = 6 + i + (i > 3 ? i-3 : 0); - DrawText(mSX + 3*32, mSY + ypos*32, + DrawText(mSX + 3 * 32, mSY + ypos * 32, " ", FONT_VALUE_1); - DrawText(mSX + 3*32, mSY + ypos*32, + DrawText(mSX + 3 * 32, mSY + ypos * 32, (setup.input[player_nr].use_joystick ? custom[i].text : getKeyNameFromKey(*custom[i].key)), FONT_VALUE_1); @@ -2601,17 +2696,22 @@ void CustomizeKeyboard(int player_nr) custom_key = setup.input[player_nr].key; ClearWindow(); + +#if 1 + DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, "Keyboard Input"); +#else DrawText(mSX + 16, mSY + 16, "Keyboard Input", FONT_TITLE_1); +#endif BackToFront(); InitAnimation(); step_nr = 0; - DrawText(mSX, mSY + (2+2*step_nr)*32, + DrawText(mSX, mSY + (2 + 2 * step_nr) * 32, customize_step[step_nr].text, FONT_INPUT_1_ACTIVE); - DrawText(mSX, mSY + (2+2*step_nr+1)*32, + DrawText(mSX, mSY + (2 + 2 * step_nr + 1) * 32, "Key:", FONT_INPUT_1_ACTIVE); - DrawText(mSX + 4*32, mSY + (2+2*step_nr+1)*32, + DrawText(mSX + 4 * 32, mSY + (2 + 2 * step_nr + 1) * 32, getKeyNameFromKey(*customize_step[step_nr].key), FONT_VALUE_OLD); while (!finished) @@ -2651,32 +2751,32 @@ void CustomizeKeyboard(int player_nr) /* got new key binding */ *customize_step[step_nr].key = key; - DrawText(mSX + 4*32, mSY + (2+2*step_nr+1)*32, + DrawText(mSX + 4 * 32, mSY + (2 + 2 * step_nr + 1) * 32, " ", FONT_VALUE_1); - DrawText(mSX + 4*32, mSY + (2+2*step_nr+1)*32, + DrawText(mSX + 4 * 32, mSY + (2 + 2 * step_nr + 1) * 32, getKeyNameFromKey(key), FONT_VALUE_1); step_nr++; /* un-highlight last query */ - DrawText(mSX, mSY+(2+2*(step_nr-1))*32, - customize_step[step_nr-1].text, FONT_MENU_1); - DrawText(mSX, mSY+(2+2*(step_nr-1)+1)*32, + DrawText(mSX, mSY + (2 + 2 * (step_nr - 1)) * 32, + customize_step[step_nr - 1].text, FONT_MENU_1); + DrawText(mSX, mSY + (2 + 2 * (step_nr - 1) + 1) * 32, "Key:", FONT_MENU_1); /* press 'Enter' to leave */ if (step_nr == 6) { - DrawText(mSX + 16, mSY + 15*32+16, + DrawText(mSX + 16, mSY + 15 * 32 + 16, "Press Enter", FONT_TITLE_1); break; } /* query next key binding */ - DrawText(mSX, mSY+(2+2*step_nr)*32, + DrawText(mSX, mSY + (2 + 2 * step_nr) * 32, customize_step[step_nr].text, FONT_INPUT_1_ACTIVE); - DrawText(mSX, mSY+(2+2*step_nr+1)*32, + DrawText(mSX, mSY + (2 + 2 * step_nr + 1) * 32, "Key:", FONT_INPUT_1_ACTIVE); - DrawText(mSX + 4*32, mSY+(2+2*step_nr+1)*32, + DrawText(mSX + 4 * 32, mSY + (2 + 2 * step_nr + 1) * 32, getKeyNameFromKey(*customize_step[step_nr].key), FONT_VALUE_OLD); } @@ -2739,13 +2839,13 @@ static boolean CalibrateJoystickMain(int player_nr) } } - DrawText(mSX, mSY + 6 * 32, " ROTATE JOYSTICK ", FONT_TITLE_1); - DrawText(mSX, mSY + 7 * 32, "IN ALL DIRECTIONS", FONT_TITLE_1); - DrawText(mSX + 16, mSY + 9 * 32, " IF ALL BALLS ", FONT_TITLE_1); - DrawText(mSX, mSY + 10 * 32, " ARE YELLOW, ", FONT_TITLE_1); - DrawText(mSX, mSY + 11 * 32, " CENTER JOYSTICK ", FONT_TITLE_1); - DrawText(mSX, mSY + 12 * 32, " AND ", FONT_TITLE_1); - DrawText(mSX, mSY + 13 * 32, "PRESS ANY BUTTON!", FONT_TITLE_1); + DrawTextSCentered(mSY - SY + 6 * 32, FONT_TITLE_1, "Rotate joystick"); + DrawTextSCentered(mSY - SY + 7 * 32, FONT_TITLE_1, "in all directions"); + DrawTextSCentered(mSY - SY + 9 * 32, FONT_TITLE_1, "if all balls"); + DrawTextSCentered(mSY - SY + 10 * 32, FONT_TITLE_1, "are marked,"); + DrawTextSCentered(mSY - SY + 11 * 32, FONT_TITLE_1, "center joystick"); + DrawTextSCentered(mSY - SY + 12 * 32, FONT_TITLE_1, "and"); + DrawTextSCentered(mSY - SY + 13 * 32, FONT_TITLE_1, "press any button!"); joy_value = Joystick(player_nr); last_x = (joy_value & JOY_LEFT ? -1 : joy_value & JOY_RIGHT ? +1 : 0); -- 2.34.1