From: Holger Schemel Date: Fri, 26 Nov 2021 12:06:07 +0000 (+0100) Subject: added additional empty space elements (not used yet) X-Git-Tag: 4.3.1.0~19 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=3f1999929dd6662da92c8f1b20c2fcbbce0c0ed7;p=rocksndiamonds.git added additional empty space elements (not used yet) --- diff --git a/build-scripts/create_element_defs.pl b/build-scripts/create_element_defs.pl index 0966816a..3f5693fe 100755 --- a/build-scripts/create_element_defs.pl +++ b/build-scripts/create_element_defs.pl @@ -42,6 +42,8 @@ my $filename_conf_cus_c = 'conf_cus.c'; my $filename_conf_cus_h = 'conf_cus.h'; my $filename_conf_grp_c = 'conf_grp.c'; my $filename_conf_grp_h = 'conf_grp.h'; +my $filename_conf_emp_c = 'conf_emp.c'; +my $filename_conf_emp_h = 'conf_emp.h'; my $filename_conf_e2g_c = 'conf_e2g.c'; my $filename_conf_esg_c = 'conf_esg.c'; my $filename_conf_e2s_c = 'conf_e2s.c'; @@ -61,6 +63,8 @@ my $text_cus_c = 'values for graphics configuration (custom elements)'; my $text_cus_h = 'values for elements configuration (custom elements)'; my $text_grp_c = 'values for graphics configuration (group elements)'; my $text_grp_h = 'values for elements configuration (group elements)'; +my $text_emp_c = 'values for graphics configuration (empty elements)'; +my $text_emp_h = 'values for elements configuration (empty elements)'; my $text_e2g_c = 'values for element/graphics mapping configuration (normal)'; my $text_esg_c = 'values for element/graphics mapping configuration (special)'; my $text_e2s_c = 'values for element/sounds mapping configuration'; @@ -72,6 +76,7 @@ my $text_act_c = 'values for active states of elements and fonts'; my $num_custom_elements = 256; my $num_group_elements = 32; +my $num_empty_elements = 16; my $char_skip = '---[SKIP]---'; @@ -393,6 +398,28 @@ sub print_graphics_list } } + if (/^\#include "conf_emp.c"/) # dump list of empty elements + { + for (my $nr = 0; $nr < $num_empty_elements; $nr++) + { + my $line = sprintf("#define IMG_EMPTY_SPACE_%d", $nr + 1); + + my $tabs = get_tabs($line, $max_num_tabs); + + print "$line$tabs$i\n"; + + $i++; + + $line = sprintf("#define IMG_EMPTY_SPACE_%d_EDITOR", $nr + 1); + + $tabs = get_tabs($line, $max_num_tabs); + + print "$line$tabs$i\n"; + + $i++; + } + } + if (!contains_image_file($_)) # skip all lines without image file { next; @@ -727,6 +754,24 @@ sub print_group_elements_list print_file_footer($filename_conf_grp_c); } +sub print_empty_elements_list +{ + print_file_header($filename_conf_emp_h, $text_emp_h); + + for (my $i = 0; $i < $num_empty_elements; $i++) + { + my $left = sprintf("#define EL_EMPTY_SPACE_%d", $i + 1); + + my $tabs_left = get_tabs($left, 5); + + my $right = "(EL_EMPTY_SPACE_START + $i)"; + + print "$left$tabs_left$right\n"; + } + + print_file_footer($filename_conf_emp_c); +} + sub print_custom_graphics_list { my @extensions1 = @@ -889,6 +934,89 @@ sub print_group_graphics_list print_file_footer($filename_conf_grp_c); } +sub print_empty_graphics_list +{ + my @extensions1 = + ( + '', + '.xpos', + '.ypos', + '.frames', + ); + my @extensions2 = + ( + '', + '.xpos', + '.ypos', + ); + + my $num_non_empty_elements = $num_custom_elements + $num_group_elements; + + print_file_header($filename_conf_emp_c, $text_emp_c); + + for (my $i = 0; $i < $num_empty_elements; $i++) + { + foreach my $ext (@extensions1) + { + my $left = sprintf(" \{ \"empty_space_%d$ext\",", $i + 1); + + my $tabs_left = get_tabs($left, 6); + + # my $right = ($ext eq '' ? 'RocksDC.png' : + my $right = ($ext eq '' ? 'RocksCE.png' : + $ext eq '.frames' ? '1' : '0'); + + if ($ext eq '.xpos') + { + # $right = 4; + $right = int($i % 16); + } + elsif ($ext eq '.ypos') + { + # $right = 15; + $right = int($i / 16) + int($num_non_empty_elements / 16); + } + + $right = "\"$right\""; + + my $tabs_right = get_tabs($right, 3); + + print "$left$tabs_left$right$tabs_right},\n"; + } + + foreach my $ext (@extensions2) + { + my $left = sprintf(" \{ \"empty_space_%d.EDITOR$ext\",", $i + 1); + + my $tabs_left = get_tabs($left, 6); + + # my $right = ($ext eq '' ? 'RocksDC.png' : '0'); + my $right = ($ext eq '' ? 'RocksCE.png' : '0'); + + if ($ext eq '.xpos') + { + # $right = 14; + $right = int($i % 16) + 16; + } + elsif ($ext eq '.ypos') + { + # $right = 15; + $right = int($i / 16) + int($num_non_empty_elements / 16); + } + + $right = "\"$right\""; + + my $tabs_right = get_tabs($right, 3); + + print "$left$tabs_left$right$tabs_right},\n"; + } + + print "\n"; + } + + print_file_footer($filename_conf_emp_c); +} + sub get_known_element_definitions_ALTERNATIVE { my %known_element = (); @@ -1644,6 +1772,15 @@ sub print_element_to_graphic_list print_element_to_graphic_entry($element, '-1', '-1', '-1', $graphic); } + # dump list of empty elements + for (my $i = 0; $i < $num_empty_elements; $i++) + { + my $element = sprintf("EL_EMPTY_SPACE_%d", $i + 1); + my $graphic = sprintf("IMG_EMPTY_SPACE_%d", $i + 1); + + print_element_to_graphic_entry($element, '-1', '-1', '-1', $graphic); + } + print_element_to_graphic_entry('-1', '-1', '-1', '-1', '-1'); print "};\n"; @@ -1815,6 +1952,17 @@ sub print_element_to_special_graphic_list $graphic); } + # dump list of empty element editor graphics + for (my $i = 0; $i < $num_empty_elements; $i++) + { + my $element = sprintf("EL_EMPTY_SPACE_%d", $i + 1); + my $graphic = sprintf("IMG_EMPTY_SPACE_%d_EDITOR", $i + 1); + + print_element_to_special_graphic_entry($element, + 'GFX_SPECIAL_ARG_EDITOR', + $graphic); + } + # dump other special editor graphics foreach my $token (@elements_with_editor_graphic) { @@ -2557,6 +2705,8 @@ sub main print "- '$filename_conf_cus_h'\n"; print "- '$filename_conf_grp_c'\n"; print "- '$filename_conf_grp_h'\n"; + print "- '$filename_conf_emp_c'\n"; + print "- '$filename_conf_emp_h'\n"; print "- '$filename_conf_e2g_c'\n"; print "- '$filename_conf_esg_c'\n"; print "- '$filename_conf_fnt_c'\n"; @@ -2604,6 +2754,14 @@ sub main { print_group_elements_list(); } + elsif ($ARGV[0] eq $filename_conf_emp_c) + { + print_empty_graphics_list(); + } + elsif ($ARGV[0] eq $filename_conf_emp_h) + { + print_empty_elements_list(); + } elsif ($ARGV[0] eq $filename_conf_e2g_c) { print_element_to_graphic_list(); diff --git a/graphics/gfx_classic/RocksCE.png b/graphics/gfx_classic/RocksCE.png index 72bbb0a4..5a5f1812 100644 Binary files a/graphics/gfx_classic/RocksCE.png and b/graphics/gfx_classic/RocksCE.png differ diff --git a/src/Makefile b/src/Makefile index 0456b906..f9fb4581 100644 --- a/src/Makefile +++ b/src/Makefile @@ -192,6 +192,8 @@ CNFS = conf_gfx.h \ conf_cus.h \ conf_grp.c \ conf_grp.h \ + conf_emp.c \ + conf_emp.h \ conf_e2g.c \ conf_esg.c \ conf_e2s.c \ diff --git a/src/conf_gfx.c b/src/conf_gfx.c index a5b8aa86..62326d7a 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -5788,6 +5788,7 @@ struct ConfigInfo image_config[] = #include "conf_chr.c" // include auto-generated data structure definitions #include "conf_cus.c" // include auto-generated data structure definitions #include "conf_grp.c" // include auto-generated data structure definitions +#include "conf_emp.c" // include auto-generated data structure definitions // ========================================================================== diff --git a/src/main.c b/src/main.c index 27d40168..496a86c9 100644 --- a/src/main.c +++ b/src/main.c @@ -6278,6 +6278,86 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "spring", "spring (starts moving right)" }, + { + "empty_space_1", + "empty_space", + "empty space 1" + }, + { + "empty_space_2", + "empty_space", + "empty space 2" + }, + { + "empty_space_3", + "empty_space", + "empty space 3" + }, + { + "empty_space_4", + "empty_space", + "empty space 4" + }, + { + "empty_space_5", + "empty_space", + "empty space 5" + }, + { + "empty_space_6", + "empty_space", + "empty space 6" + }, + { + "empty_space_7", + "empty_space", + "empty space 7" + }, + { + "empty_space_8", + "empty_space", + "empty space 8" + }, + { + "empty_space_9", + "empty_space", + "empty space 9" + }, + { + "empty_space_10", + "empty_space", + "empty space 10" + }, + { + "empty_space_11", + "empty_space", + "empty space 11" + }, + { + "empty_space_12", + "empty_space", + "empty space 12" + }, + { + "empty_space_13", + "empty_space", + "empty space 13" + }, + { + "empty_space_14", + "empty_space", + "empty space 14" + }, + { + "empty_space_15", + "empty_space", + "empty space 15" + }, + { + "empty_space_16", + "empty_space", + "empty space 16" + }, // -------------------------------------------------------------------------- // "real" (and therefore drawable) runtime elements diff --git a/src/main.h b/src/main.h index 14c2e885..3f2389cc 100644 --- a/src/main.h +++ b/src/main.h @@ -1912,7 +1912,16 @@ #define EL_SPRING_LEFT 1215 #define EL_SPRING_RIGHT 1216 -#define NUM_FILE_ELEMENTS 1217 +// ---------- begin of empty space elements section --------------------------- +#define EL_EMPTY_SPACE_START 1217 + +#include "conf_emp.h" // include auto-generated data structure definitions + +#define NUM_EMPTY_SPACE_ELEMENTS 16 +#define EL_EMPTY_SPACE_END 1232 +// ---------- end of empty space elements section ----------------------------- + +#define NUM_FILE_ELEMENTS 1233 // "real" (and therefore drawable) runtime elements