From: Holger Schemel Date: Wed, 15 Feb 2017 19:40:13 +0000 (+0100) Subject: added level editor support for Mirror Magic (and Deflektor) game elements X-Git-Tag: 4.1.0.0~228 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=8d7a5267680e5bb2dbe9925e3d20ef32fda0c734;p=rocksndiamonds.git added level editor support for Mirror Magic (and Deflektor) game elements --- diff --git a/src/editor.c b/src/editor.c index 3d6b0980..63387347 100644 --- a/src/editor.c +++ b/src/editor.c @@ -4215,6 +4215,116 @@ static int *editor_el_dx_boulderdash_ptr = editor_el_dx_boulderdash; static int num_editor_hl_dx_boulderdash = SIZEOF_ARRAY_INT(editor_hl_dx_boulderdash); static int num_editor_el_dx_boulderdash = SIZEOF_ARRAY_INT(editor_el_dx_boulderdash); +static int editor_hl_mirror_magic[] = +{ + EL_INTERNAL_CASCADE_MM_ACTIVE, + EL_CHAR('M'), + EL_CHAR('M'), + EL_EMPTY, +}; + +static int editor_el_mirror_magic[] = +{ + EL_MM_MCDUFFIN_RIGHT, + EL_MM_MCDUFFIN_UP, + EL_MM_MCDUFFIN_LEFT, + EL_MM_MCDUFFIN_DOWN, + + EL_MM_MIRROR_START, + EL_MM_MIRROR_FIXED_START, + EL_MM_POLARISATOR_START, + EL_MM_POLARISATOR_CROSS_START, + + EL_MM_BEAMER_RED_START, + EL_MM_BEAMER_YELLOW_START, + EL_MM_BEAMER_GREEN_START, + EL_MM_BEAMER_BLUE_START, + + EL_MM_PRISM, + EL_MM_FUSE_ACTIVE, + EL_MM_PACMAN_RIGHT, + EL_MM_EXIT_CLOSED, + + EL_MM_KETTLE, + EL_MM_BOMB, + EL_MM_KEY, + EL_MM_FUEL_FULL, + + EL_MM_LIGHTBULB, + EL_MM_LIGHTBULB_ACTIVE, + EL_MM_GRAY_BALL, + EL_MM_LIGHTBALL, + + EL_MM_STEEL_WALL, + EL_MM_WOODEN_WALL, + EL_MM_ICE_WALL, + EL_MM_AMOEBA_WALL, + + EL_MM_STEEL_LOCK, + EL_MM_WOODEN_LOCK, + EL_MM_STEEL_BLOCK, + EL_MM_WOODEN_BLOCK, + + EL_MM_STEEL_GRID_FIXED_1, + EL_MM_STEEL_GRID_FIXED_2, + EL_MM_STEEL_GRID_FIXED_3, + EL_MM_STEEL_GRID_FIXED_4, + + EL_MM_WOODEN_GRID_FIXED_1, + EL_MM_WOODEN_GRID_FIXED_2, + EL_MM_WOODEN_GRID_FIXED_3, + EL_MM_WOODEN_GRID_FIXED_4 +}; +static int *editor_hl_mirror_magic_ptr = editor_hl_mirror_magic; +static int *editor_el_mirror_magic_ptr = editor_el_mirror_magic; +static int num_editor_hl_mirror_magic = SIZEOF_ARRAY_INT(editor_hl_mirror_magic); +static int num_editor_el_mirror_magic = SIZEOF_ARRAY_INT(editor_el_mirror_magic); + +static int editor_hl_deflektor[] = +{ + EL_INTERNAL_CASCADE_DF_ACTIVE, + EL_CHAR('D'), + EL_CHAR('F'), + EL_EMPTY, +}; + +static int editor_el_deflektor[] = +{ + EL_DF_LASER_RIGHT, + EL_DF_LASER_UP, + EL_DF_LASER_LEFT, + EL_DF_LASER_DOWN, + + EL_DF_RECEIVER_RIGHT, + EL_DF_RECEIVER_UP, + EL_DF_RECEIVER_LEFT, + EL_DF_RECEIVER_DOWN, + + EL_DF_MIRROR_START, + EL_DF_MIRROR_ROTATING_START, + EL_DF_CELL, + EL_DF_MINE, + + EL_DF_FIBRE_OPTIC_RED_1, + EL_DF_FIBRE_OPTIC_YELLOW_1, + EL_DF_FIBRE_OPTIC_GREEN_1, + EL_DF_FIBRE_OPTIC_BLUE_1, + + EL_DF_STEEL_GRID_FIXED_START, + EL_DF_STEEL_GRID_ROTATING_START, + EL_DF_WOODEN_GRID_FIXED_START, + EL_DF_WOODEN_GRID_ROTATING_START, + + EL_DF_STEEL_WALL, + EL_DF_WOODEN_WALL, + EL_DF_REFRACTOR, + EL_EMPTY +}; +static int *editor_hl_deflektor_ptr = editor_hl_deflektor; +static int *editor_el_deflektor_ptr = editor_el_deflektor; +static int num_editor_hl_deflektor = SIZEOF_ARRAY_INT(editor_hl_deflektor); +static int num_editor_el_deflektor = SIZEOF_ARRAY_INT(editor_el_deflektor); + static int editor_hl_chars[] = { EL_INTERNAL_CASCADE_CHARS_ACTIVE, @@ -4984,6 +5094,18 @@ editor_elements_info[] = &editor_hl_dx_boulderdash_ptr, &num_editor_hl_dx_boulderdash, &editor_el_dx_boulderdash_ptr, &num_editor_el_dx_boulderdash }, + { + &setup.editor.el_classic, + &setup.editor_cascade.el_mm, + &editor_hl_mirror_magic_ptr, &num_editor_hl_mirror_magic, + &editor_el_mirror_magic_ptr, &num_editor_el_mirror_magic + }, + { + &setup.editor.el_classic, + &setup.editor_cascade.el_df, + &editor_hl_deflektor_ptr, &num_editor_hl_deflektor, + &editor_el_deflektor_ptr, &num_editor_el_deflektor + }, { &setup.editor.el_classic, &setup.editor_cascade.el_chars, @@ -5236,7 +5358,7 @@ static void ReinitializeElementList() Error(ERR_WARN, "editor element %d is runtime element", element); if (strEqual(getElementInfoText(element), INFOTEXT_UNKNOWN_ELEMENT)) - Error(ERR_WARN, "no element description for element %d", element); + Error(ERR_WARN, "no element description text for element %d", element); } } @@ -7802,7 +7924,8 @@ void CheckElementDescriptions() for (i = 0; i < NUM_FILE_ELEMENTS; i++) if (getElementDescriptionFilename(i) == NULL && !IS_OBSOLETE(i)) - Error(ERR_WARN, "no element description for element '%s'", EL_NAME(i)); + Error(ERR_WARN, "no element description file for element '%s'", + EL_NAME(i)); } static int getMaxEdFieldX(boolean has_scrollbar) diff --git a/src/files.c b/src/files.c index e387efc7..ebb61203 100644 --- a/src/files.c +++ b/src/files.c @@ -8331,6 +8331,8 @@ static struct TokenInfo editor_cascade_setup_tokens[] = { TYPE_SWITCH, &seci.el_sp, "editor.cascade.el_sp" }, { TYPE_SWITCH, &seci.el_dc, "editor.cascade.el_dc" }, { TYPE_SWITCH, &seci.el_dx, "editor.cascade.el_dx" }, + { TYPE_SWITCH, &seci.el_mm, "editor.cascade.el_mm" }, + { TYPE_SWITCH, &seci.el_df, "editor.cascade.el_df" }, { TYPE_SWITCH, &seci.el_chars, "editor.cascade.el_chars" }, { TYPE_SWITCH, &seci.el_steel_chars, "editor.cascade.el_steel_chars" }, { TYPE_SWITCH, &seci.el_ce, "editor.cascade.el_ce" }, @@ -8524,6 +8526,10 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->editor.el_supaplex = TRUE; si->editor.el_diamond_caves = TRUE; si->editor.el_dx_boulderdash = TRUE; + + si->editor.el_mirror_magic = TRUE; + si->editor.el_deflektor = TRUE; + si->editor.el_chars = TRUE; si->editor.el_steel_chars = TRUE; @@ -8659,6 +8665,9 @@ static void setSetupInfoToDefaults_EditorCascade(struct SetupInfo *si) si->editor_cascade.el_dc = TRUE; si->editor_cascade.el_dx = TRUE; + si->editor_cascade.el_mm = TRUE; + si->editor_cascade.el_df = TRUE; + si->editor_cascade.el_chars = FALSE; si->editor_cascade.el_steel_chars = FALSE; si->editor_cascade.el_ce = FALSE; diff --git a/src/init.c b/src/init.c index 6980eb9a..48cb8973 100644 --- a/src/init.c +++ b/src/init.c @@ -4261,6 +4261,8 @@ void InitElementPropertiesStatic() EL_INTERNAL_CASCADE_SP_ACTIVE, EL_INTERNAL_CASCADE_DC_ACTIVE, EL_INTERNAL_CASCADE_DX_ACTIVE, + EL_INTERNAL_CASCADE_MM_ACTIVE, + EL_INTERNAL_CASCADE_DF_ACTIVE, EL_INTERNAL_CASCADE_CHARS_ACTIVE, EL_INTERNAL_CASCADE_STEEL_CHARS_ACTIVE, EL_INTERNAL_CASCADE_CE_ACTIVE, @@ -4282,6 +4284,8 @@ void InitElementPropertiesStatic() EL_INTERNAL_CASCADE_SP, EL_INTERNAL_CASCADE_DC, EL_INTERNAL_CASCADE_DX, + EL_INTERNAL_CASCADE_MM, + EL_INTERNAL_CASCADE_DF, EL_INTERNAL_CASCADE_CHARS, EL_INTERNAL_CASCADE_STEEL_CHARS, EL_INTERNAL_CASCADE_CE, diff --git a/src/libgame/system.h b/src/libgame/system.h index efc4490d..730c8a7f 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -994,6 +994,10 @@ struct SetupEditorInfo boolean el_supaplex; boolean el_diamond_caves; boolean el_dx_boulderdash; + + boolean el_mirror_magic; + boolean el_deflektor; + boolean el_chars; boolean el_steel_chars; @@ -1022,6 +1026,8 @@ struct SetupEditorCascadeInfo boolean el_sp; boolean el_dc; boolean el_dx; + boolean el_mm; + boolean el_df; boolean el_chars; boolean el_steel_chars; boolean el_ce;