From d9479668b752772803e523561bc544a6c7efe725 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 26 Nov 2021 13:27:51 +0100 Subject: [PATCH] added additional empty space elements to level editor --- src/editor.c | 41 +++++++++++++++++++++++++++++++++++++++++ src/files.c | 5 +++++ src/init.c | 2 ++ src/libgame/system.h | 1 + src/main.c | 10 ++++++++++ src/main.h | 18 ++++++++++-------- 6 files changed, 69 insertions(+), 8 deletions(-) diff --git a/src/editor.c b/src/editor.c index 7f63d89e..b32cbd82 100644 --- a/src/editor.c +++ b/src/editor.c @@ -5272,6 +5272,41 @@ static int *editor_el_group_ptr = editor_el_group; static int num_editor_hl_group = ARRAY_SIZE(editor_hl_group); static int num_editor_el_group = ARRAY_SIZE(editor_el_group); +static int editor_hl_empty_space[] = +{ + EL_INTERNAL_CASCADE_ES_ACTIVE, + EL_CHAR('E'), + EL_CHAR('S'), + EL_EMPTY, +}; + +static int editor_el_empty_space[] = +{ + EL_EMPTY_SPACE_1, + EL_EMPTY_SPACE_2, + EL_EMPTY_SPACE_3, + EL_EMPTY_SPACE_4, + + EL_EMPTY_SPACE_5, + EL_EMPTY_SPACE_6, + EL_EMPTY_SPACE_7, + EL_EMPTY_SPACE_8, + + EL_EMPTY_SPACE_9, + EL_EMPTY_SPACE_10, + EL_EMPTY_SPACE_11, + EL_EMPTY_SPACE_12, + + EL_EMPTY_SPACE_13, + EL_EMPTY_SPACE_14, + EL_EMPTY_SPACE_15, + EL_EMPTY_SPACE_16 +}; +static int *editor_hl_empty_space_ptr = editor_hl_empty_space; +static int *editor_el_empty_space_ptr = editor_el_empty_space; +static int num_editor_hl_empty_space = ARRAY_SIZE(editor_hl_empty_space); +static int num_editor_el_empty_space = ARRAY_SIZE(editor_el_empty_space); + static int editor_hl_reference[] = { EL_INTERNAL_CASCADE_REF_ACTIVE, @@ -5484,6 +5519,12 @@ editor_elements_info[] = &editor_hl_group_ptr, &num_editor_hl_group, &editor_el_group_ptr, &num_editor_el_group }, + { + &setup_editor_el_custom, + &setup.editor_cascade.el_es, + &editor_hl_empty_space_ptr, &num_editor_hl_empty_space, + &editor_el_empty_space_ptr, &num_editor_el_empty_space + }, { &setup_editor_el_custom, &setup.editor_cascade.el_ref, diff --git a/src/files.c b/src/files.c index d78432d1..bffb1605 100644 --- a/src/files.c +++ b/src/files.c @@ -10214,6 +10214,10 @@ static struct TokenInfo editor_cascade_setup_tokens[] = TYPE_SWITCH, &setup.editor_cascade.el_ge, "editor.cascade.el_ge" }, + { + TYPE_SWITCH, + &setup.editor_cascade.el_es, "editor.cascade.el_es" + }, { TYPE_SWITCH, &setup.editor_cascade.el_ref, "editor.cascade.el_ref" @@ -10948,6 +10952,7 @@ static void setSetupInfoToDefaults_EditorCascade(struct SetupInfo *si) si->editor_cascade.el_steel_chars = FALSE; si->editor_cascade.el_ce = FALSE; si->editor_cascade.el_ge = FALSE; + si->editor_cascade.el_es = FALSE; si->editor_cascade.el_ref = FALSE; si->editor_cascade.el_user = FALSE; si->editor_cascade.el_dynamic = FALSE; diff --git a/src/init.c b/src/init.c index 114b177f..c98670a4 100644 --- a/src/init.c +++ b/src/init.c @@ -4348,6 +4348,7 @@ void InitElementPropertiesStatic(void) EL_INTERNAL_CASCADE_STEEL_CHARS_ACTIVE, EL_INTERNAL_CASCADE_CE_ACTIVE, EL_INTERNAL_CASCADE_GE_ACTIVE, + EL_INTERNAL_CASCADE_ES_ACTIVE, EL_INTERNAL_CASCADE_REF_ACTIVE, EL_INTERNAL_CASCADE_USER_ACTIVE, EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE, @@ -4371,6 +4372,7 @@ void InitElementPropertiesStatic(void) EL_INTERNAL_CASCADE_STEEL_CHARS, EL_INTERNAL_CASCADE_CE, EL_INTERNAL_CASCADE_GE, + EL_INTERNAL_CASCADE_ES, EL_INTERNAL_CASCADE_REF, EL_INTERNAL_CASCADE_USER, EL_INTERNAL_CASCADE_DYNAMIC, diff --git a/src/libgame/system.h b/src/libgame/system.h index 327cba88..4acc61d8 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1355,6 +1355,7 @@ struct SetupEditorCascadeInfo boolean el_steel_chars; boolean el_ce; boolean el_ge; + boolean el_es; boolean el_ref; boolean el_user; boolean el_dynamic; diff --git a/src/main.c b/src/main.c index 496a86c9..4ef296f2 100644 --- a/src/main.c +++ b/src/main.c @@ -7294,6 +7294,16 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "internal", "hide group elements" }, + { + "internal_cascade_es", + "internal", + "show empty space elements" + }, + { + "internal_cascade_es.active", + "internal", + "hide empty space elements" + }, { "internal_cascade_ref", "internal", diff --git a/src/main.h b/src/main.h index 3f2389cc..9108054e 100644 --- a/src/main.h +++ b/src/main.h @@ -2134,19 +2134,21 @@ #define EL_INTERNAL_CASCADE_CE_ACTIVE (EL_FIRST_INTERNAL + 29) #define EL_INTERNAL_CASCADE_GE (EL_FIRST_INTERNAL + 30) #define EL_INTERNAL_CASCADE_GE_ACTIVE (EL_FIRST_INTERNAL + 31) -#define EL_INTERNAL_CASCADE_REF (EL_FIRST_INTERNAL + 32) -#define EL_INTERNAL_CASCADE_REF_ACTIVE (EL_FIRST_INTERNAL + 33) -#define EL_INTERNAL_CASCADE_USER (EL_FIRST_INTERNAL + 34) -#define EL_INTERNAL_CASCADE_USER_ACTIVE (EL_FIRST_INTERNAL + 35) -#define EL_INTERNAL_CASCADE_DYNAMIC (EL_FIRST_INTERNAL + 36) -#define EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE (EL_FIRST_INTERNAL + 37) +#define EL_INTERNAL_CASCADE_ES (EL_FIRST_INTERNAL + 32) +#define EL_INTERNAL_CASCADE_ES_ACTIVE (EL_FIRST_INTERNAL + 33) +#define EL_INTERNAL_CASCADE_REF (EL_FIRST_INTERNAL + 34) +#define EL_INTERNAL_CASCADE_REF_ACTIVE (EL_FIRST_INTERNAL + 35) +#define EL_INTERNAL_CASCADE_USER (EL_FIRST_INTERNAL + 36) +#define EL_INTERNAL_CASCADE_USER_ACTIVE (EL_FIRST_INTERNAL + 37) +#define EL_INTERNAL_CASCADE_DYNAMIC (EL_FIRST_INTERNAL + 38) +#define EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE (EL_FIRST_INTERNAL + 39) #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 + 37) +#define EL_INTERNAL_END (EL_FIRST_INTERNAL + 39) -#define MAX_NUM_ELEMENTS (EL_FIRST_INTERNAL + 38) +#define MAX_NUM_ELEMENTS (EL_FIRST_INTERNAL + 40) // values for graphics/sounds action types -- 2.34.1