From: Holger Schemel Date: Wed, 11 Jan 2006 01:18:27 +0000 (+0100) Subject: rnd-20060111-1-src X-Git-Tag: 3.1.2^2~1 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=1e5cae5e3ab889c3bcba80a065c6d7ba1e6d28a2;p=rocksndiamonds.git rnd-20060111-1-src * added android (can clone elements) from EMC engine to R'n'D engine --- diff --git a/ChangeLog b/ChangeLog index 0a04d73c..c2e26a35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ +2006-01-10 + * added android (can clone elements) from EMC engine to R'n'D engine + 2006-01-09 - * added magic ball (element creator) from EMC engine to R'n'D engine + * added magic ball (creates elements) from EMC engine to R'n'D engine 2006-01-07 * uploaded fixed pre-release version 3.2.0-6 binary and source code diff --git a/src/conftime.h b/src/conftime.h index ba055a8e..a67bca14 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-01-10 18:58]" +#define COMPILE_DATE_STRING "[2006-01-11 00:42]" diff --git a/src/editor.c b/src/editor.c index 1f75066a..c2d1ba50 100644 --- a/src/editor.c +++ b/src/editor.c @@ -366,63 +366,66 @@ #define GADGET_ID_BALL_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 36) #define GADGET_ID_BALL_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 37) #define GADGET_ID_BALL_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 38) -#define GADGET_ID_ENVELOPE_XSIZE_DOWN (GADGET_ID_COUNTER_FIRST + 39) -#define GADGET_ID_ENVELOPE_XSIZE_TEXT (GADGET_ID_COUNTER_FIRST + 40) -#define GADGET_ID_ENVELOPE_XSIZE_UP (GADGET_ID_COUNTER_FIRST + 41) -#define GADGET_ID_ENVELOPE_YSIZE_DOWN (GADGET_ID_COUNTER_FIRST + 42) -#define GADGET_ID_ENVELOPE_YSIZE_TEXT (GADGET_ID_COUNTER_FIRST + 43) -#define GADGET_ID_ENVELOPE_YSIZE_UP (GADGET_ID_COUNTER_FIRST + 44) -#define GADGET_ID_CUSTOM_SCORE_DOWN (GADGET_ID_COUNTER_FIRST + 45) -#define GADGET_ID_CUSTOM_SCORE_TEXT (GADGET_ID_COUNTER_FIRST + 46) -#define GADGET_ID_CUSTOM_SCORE_UP (GADGET_ID_COUNTER_FIRST + 47) -#define GADGET_ID_CUSTOM_GEMCOUNT_DOWN (GADGET_ID_COUNTER_FIRST + 48) -#define GADGET_ID_CUSTOM_GEMCOUNT_TEXT (GADGET_ID_COUNTER_FIRST + 49) -#define GADGET_ID_CUSTOM_GEMCOUNT_UP (GADGET_ID_COUNTER_FIRST + 50) -#define GADGET_ID_CUSTOM_VALUE_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 51) -#define GADGET_ID_CUSTOM_VALUE_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 52) -#define GADGET_ID_CUSTOM_VALUE_FIX_UP (GADGET_ID_COUNTER_FIRST + 53) -#define GADGET_ID_CUSTOM_VALUE_RND_DOWN (GADGET_ID_COUNTER_FIRST + 54) -#define GADGET_ID_CUSTOM_VALUE_RND_TEXT (GADGET_ID_COUNTER_FIRST + 55) -#define GADGET_ID_CUSTOM_VALUE_RND_UP (GADGET_ID_COUNTER_FIRST + 56) -#define GADGET_ID_PUSH_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 57) -#define GADGET_ID_PUSH_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 58) -#define GADGET_ID_PUSH_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 59) -#define GADGET_ID_PUSH_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 60) -#define GADGET_ID_PUSH_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 61) -#define GADGET_ID_PUSH_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 62) -#define GADGET_ID_DROP_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 63) -#define GADGET_ID_DROP_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 64) -#define GADGET_ID_DROP_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 65) -#define GADGET_ID_DROP_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 66) -#define GADGET_ID_DROP_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 67) -#define GADGET_ID_DROP_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 68) -#define GADGET_ID_MOVE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 69) -#define GADGET_ID_MOVE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 70) -#define GADGET_ID_MOVE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 71) -#define GADGET_ID_MOVE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 72) -#define GADGET_ID_MOVE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 73) -#define GADGET_ID_MOVE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 74) -#define GADGET_ID_EXPLOSION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 75) -#define GADGET_ID_EXPLOSION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 76) -#define GADGET_ID_EXPLOSION_DELAY_UP (GADGET_ID_COUNTER_FIRST + 77) -#define GADGET_ID_IGNITION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 78) -#define GADGET_ID_IGNITION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 79) -#define GADGET_ID_IGNITION_DELAY_UP (GADGET_ID_COUNTER_FIRST + 80) -#define GADGET_ID_CHANGE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 81) -#define GADGET_ID_CHANGE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 82) -#define GADGET_ID_CHANGE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 83) -#define GADGET_ID_CHANGE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 84) -#define GADGET_ID_CHANGE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 85) -#define GADGET_ID_CHANGE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 86) -#define GADGET_ID_CHANGE_CONT_RND_DOWN (GADGET_ID_COUNTER_FIRST + 87) -#define GADGET_ID_CHANGE_CONT_RND_TEXT (GADGET_ID_COUNTER_FIRST + 88) -#define GADGET_ID_CHANGE_CONT_RND_UP (GADGET_ID_COUNTER_FIRST + 89) -#define GADGET_ID_GROUP_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 90) -#define GADGET_ID_GROUP_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 91) -#define GADGET_ID_GROUP_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 92) +#define GADGET_ID_ANDROID_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 39) +#define GADGET_ID_ANDROID_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 40) +#define GADGET_ID_ANDROID_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 41) +#define GADGET_ID_ENVELOPE_XSIZE_DOWN (GADGET_ID_COUNTER_FIRST + 42) +#define GADGET_ID_ENVELOPE_XSIZE_TEXT (GADGET_ID_COUNTER_FIRST + 43) +#define GADGET_ID_ENVELOPE_XSIZE_UP (GADGET_ID_COUNTER_FIRST + 44) +#define GADGET_ID_ENVELOPE_YSIZE_DOWN (GADGET_ID_COUNTER_FIRST + 45) +#define GADGET_ID_ENVELOPE_YSIZE_TEXT (GADGET_ID_COUNTER_FIRST + 46) +#define GADGET_ID_ENVELOPE_YSIZE_UP (GADGET_ID_COUNTER_FIRST + 47) +#define GADGET_ID_CUSTOM_SCORE_DOWN (GADGET_ID_COUNTER_FIRST + 48) +#define GADGET_ID_CUSTOM_SCORE_TEXT (GADGET_ID_COUNTER_FIRST + 49) +#define GADGET_ID_CUSTOM_SCORE_UP (GADGET_ID_COUNTER_FIRST + 50) +#define GADGET_ID_CUSTOM_GEMCOUNT_DOWN (GADGET_ID_COUNTER_FIRST + 51) +#define GADGET_ID_CUSTOM_GEMCOUNT_TEXT (GADGET_ID_COUNTER_FIRST + 52) +#define GADGET_ID_CUSTOM_GEMCOUNT_UP (GADGET_ID_COUNTER_FIRST + 53) +#define GADGET_ID_CUSTOM_VALUE_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 54) +#define GADGET_ID_CUSTOM_VALUE_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 55) +#define GADGET_ID_CUSTOM_VALUE_FIX_UP (GADGET_ID_COUNTER_FIRST + 56) +#define GADGET_ID_CUSTOM_VALUE_RND_DOWN (GADGET_ID_COUNTER_FIRST + 57) +#define GADGET_ID_CUSTOM_VALUE_RND_TEXT (GADGET_ID_COUNTER_FIRST + 58) +#define GADGET_ID_CUSTOM_VALUE_RND_UP (GADGET_ID_COUNTER_FIRST + 59) +#define GADGET_ID_PUSH_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 60) +#define GADGET_ID_PUSH_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 61) +#define GADGET_ID_PUSH_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 62) +#define GADGET_ID_PUSH_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 63) +#define GADGET_ID_PUSH_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 64) +#define GADGET_ID_PUSH_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 65) +#define GADGET_ID_DROP_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 66) +#define GADGET_ID_DROP_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 67) +#define GADGET_ID_DROP_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 68) +#define GADGET_ID_DROP_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 69) +#define GADGET_ID_DROP_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 70) +#define GADGET_ID_DROP_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 71) +#define GADGET_ID_MOVE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 72) +#define GADGET_ID_MOVE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 73) +#define GADGET_ID_MOVE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 74) +#define GADGET_ID_MOVE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 75) +#define GADGET_ID_MOVE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 76) +#define GADGET_ID_MOVE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 77) +#define GADGET_ID_EXPLOSION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 78) +#define GADGET_ID_EXPLOSION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 79) +#define GADGET_ID_EXPLOSION_DELAY_UP (GADGET_ID_COUNTER_FIRST + 80) +#define GADGET_ID_IGNITION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 81) +#define GADGET_ID_IGNITION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 82) +#define GADGET_ID_IGNITION_DELAY_UP (GADGET_ID_COUNTER_FIRST + 83) +#define GADGET_ID_CHANGE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 84) +#define GADGET_ID_CHANGE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 85) +#define GADGET_ID_CHANGE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 86) +#define GADGET_ID_CHANGE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 87) +#define GADGET_ID_CHANGE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 88) +#define GADGET_ID_CHANGE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 89) +#define GADGET_ID_CHANGE_CONT_RND_DOWN (GADGET_ID_COUNTER_FIRST + 90) +#define GADGET_ID_CHANGE_CONT_RND_TEXT (GADGET_ID_COUNTER_FIRST + 91) +#define GADGET_ID_CHANGE_CONT_RND_UP (GADGET_ID_COUNTER_FIRST + 92) +#define GADGET_ID_GROUP_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 93) +#define GADGET_ID_GROUP_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 94) +#define GADGET_ID_GROUP_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 95) /* drawing area identifiers */ -#define GADGET_ID_DRAWING_AREA_FIRST (GADGET_ID_COUNTER_FIRST + 93) +#define GADGET_ID_DRAWING_AREA_FIRST (GADGET_ID_COUNTER_FIRST + 96) #define GADGET_ID_DRAWING_LEVEL (GADGET_ID_DRAWING_AREA_FIRST + 0) #define GADGET_ID_YAMYAM_CONTENT_0 (GADGET_ID_DRAWING_AREA_FIRST + 1) @@ -441,22 +444,23 @@ #define GADGET_ID_MAGIC_BALL_CONTENT_5 (GADGET_ID_DRAWING_AREA_FIRST + 14) #define GADGET_ID_MAGIC_BALL_CONTENT_6 (GADGET_ID_DRAWING_AREA_FIRST + 15) #define GADGET_ID_MAGIC_BALL_CONTENT_7 (GADGET_ID_DRAWING_AREA_FIRST + 16) -#define GADGET_ID_AMOEBA_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 17) -#define GADGET_ID_START_ELEMENT (GADGET_ID_DRAWING_AREA_FIRST + 18) -#define GADGET_ID_ARTWORK_ELEMENT (GADGET_ID_DRAWING_AREA_FIRST + 19) -#define GADGET_ID_EXPLOSION_ELEMENT (GADGET_ID_DRAWING_AREA_FIRST + 20) -#define GADGET_ID_CUSTOM_GRAPHIC (GADGET_ID_DRAWING_AREA_FIRST + 21) -#define GADGET_ID_CUSTOM_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 22) -#define GADGET_ID_CUSTOM_MOVE_ENTER (GADGET_ID_DRAWING_AREA_FIRST + 23) -#define GADGET_ID_CUSTOM_MOVE_LEAVE (GADGET_ID_DRAWING_AREA_FIRST + 24) -#define GADGET_ID_CUSTOM_CHANGE_TARGET (GADGET_ID_DRAWING_AREA_FIRST + 25) -#define GADGET_ID_CUSTOM_CHANGE_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 26) -#define GADGET_ID_CUSTOM_CHANGE_TRIGGER (GADGET_ID_DRAWING_AREA_FIRST + 27) -#define GADGET_ID_GROUP_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 28) -#define GADGET_ID_RANDOM_BACKGROUND (GADGET_ID_DRAWING_AREA_FIRST + 29) +#define GADGET_ID_ANDROID_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 17) +#define GADGET_ID_AMOEBA_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 18) +#define GADGET_ID_START_ELEMENT (GADGET_ID_DRAWING_AREA_FIRST + 19) +#define GADGET_ID_ARTWORK_ELEMENT (GADGET_ID_DRAWING_AREA_FIRST + 20) +#define GADGET_ID_EXPLOSION_ELEMENT (GADGET_ID_DRAWING_AREA_FIRST + 21) +#define GADGET_ID_CUSTOM_GRAPHIC (GADGET_ID_DRAWING_AREA_FIRST + 22) +#define GADGET_ID_CUSTOM_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 23) +#define GADGET_ID_CUSTOM_MOVE_ENTER (GADGET_ID_DRAWING_AREA_FIRST + 24) +#define GADGET_ID_CUSTOM_MOVE_LEAVE (GADGET_ID_DRAWING_AREA_FIRST + 25) +#define GADGET_ID_CUSTOM_CHANGE_TARGET (GADGET_ID_DRAWING_AREA_FIRST + 26) +#define GADGET_ID_CUSTOM_CHANGE_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 27) +#define GADGET_ID_CUSTOM_CHANGE_TRIGGER (GADGET_ID_DRAWING_AREA_FIRST + 28) +#define GADGET_ID_GROUP_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 29) +#define GADGET_ID_RANDOM_BACKGROUND (GADGET_ID_DRAWING_AREA_FIRST + 30) /* text input identifiers */ -#define GADGET_ID_TEXT_INPUT_FIRST (GADGET_ID_DRAWING_AREA_FIRST + 30) +#define GADGET_ID_TEXT_INPUT_FIRST (GADGET_ID_DRAWING_AREA_FIRST + 31) #define GADGET_ID_LEVEL_NAME (GADGET_ID_TEXT_INPUT_FIRST + 0) #define GADGET_ID_LEVEL_AUTHOR (GADGET_ID_TEXT_INPUT_FIRST + 1) @@ -614,26 +618,27 @@ #define ED_COUNTER_ID_ELEMENT_VALUE4 10 #define ED_COUNTER_ID_YAMYAM_CONTENT 11 #define ED_COUNTER_ID_BALL_CONTENT 12 -#define ED_COUNTER_ID_ENVELOPE_XSIZE 13 -#define ED_COUNTER_ID_ENVELOPE_YSIZE 14 -#define ED_COUNTER_ID_CUSTOM_SCORE 15 -#define ED_COUNTER_ID_CUSTOM_GEMCOUNT 16 -#define ED_COUNTER_ID_CUSTOM_VALUE_FIX 17 -#define ED_COUNTER_ID_CUSTOM_VALUE_RND 18 -#define ED_COUNTER_ID_PUSH_DELAY_FIX 19 -#define ED_COUNTER_ID_PUSH_DELAY_RND 20 -#define ED_COUNTER_ID_DROP_DELAY_FIX 21 -#define ED_COUNTER_ID_DROP_DELAY_RND 22 -#define ED_COUNTER_ID_MOVE_DELAY_FIX 23 -#define ED_COUNTER_ID_MOVE_DELAY_RND 24 -#define ED_COUNTER_ID_EXPLOSION_DELAY 25 -#define ED_COUNTER_ID_IGNITION_DELAY 26 -#define ED_COUNTER_ID_GROUP_CONTENT 27 -#define ED_COUNTER_ID_CHANGE_DELAY_FIX 28 -#define ED_COUNTER_ID_CHANGE_DELAY_RND 29 -#define ED_COUNTER_ID_CHANGE_CONT_RND 30 - -#define ED_NUM_COUNTERBUTTONS 31 +#define ED_COUNTER_ID_ANDROID_CONTENT 13 +#define ED_COUNTER_ID_ENVELOPE_XSIZE 14 +#define ED_COUNTER_ID_ENVELOPE_YSIZE 15 +#define ED_COUNTER_ID_CUSTOM_SCORE 16 +#define ED_COUNTER_ID_CUSTOM_GEMCOUNT 17 +#define ED_COUNTER_ID_CUSTOM_VALUE_FIX 18 +#define ED_COUNTER_ID_CUSTOM_VALUE_RND 19 +#define ED_COUNTER_ID_PUSH_DELAY_FIX 20 +#define ED_COUNTER_ID_PUSH_DELAY_RND 21 +#define ED_COUNTER_ID_DROP_DELAY_FIX 22 +#define ED_COUNTER_ID_DROP_DELAY_RND 23 +#define ED_COUNTER_ID_MOVE_DELAY_FIX 24 +#define ED_COUNTER_ID_MOVE_DELAY_RND 25 +#define ED_COUNTER_ID_EXPLOSION_DELAY 26 +#define ED_COUNTER_ID_IGNITION_DELAY 27 +#define ED_COUNTER_ID_GROUP_CONTENT 28 +#define ED_COUNTER_ID_CHANGE_DELAY_FIX 29 +#define ED_COUNTER_ID_CHANGE_DELAY_RND 30 +#define ED_COUNTER_ID_CHANGE_CONT_RND 31 + +#define ED_NUM_COUNTERBUTTONS 32 #define ED_COUNTER_ID_LEVEL_FIRST ED_COUNTER_ID_LEVEL_XSIZE #define ED_COUNTER_ID_LEVEL_LAST ED_COUNTER_ID_LEVEL_RANDOM @@ -853,21 +858,22 @@ #define ED_DRAWING_ID_MAGIC_BALL_CONTENT_5 14 #define ED_DRAWING_ID_MAGIC_BALL_CONTENT_6 15 #define ED_DRAWING_ID_MAGIC_BALL_CONTENT_7 16 -#define ED_DRAWING_ID_AMOEBA_CONTENT 17 -#define ED_DRAWING_ID_START_ELEMENT 18 -#define ED_DRAWING_ID_ARTWORK_ELEMENT 19 -#define ED_DRAWING_ID_EXPLOSION_ELEMENT 20 -#define ED_DRAWING_ID_CUSTOM_GRAPHIC 21 -#define ED_DRAWING_ID_CUSTOM_CONTENT 22 -#define ED_DRAWING_ID_CUSTOM_MOVE_ENTER 23 -#define ED_DRAWING_ID_CUSTOM_MOVE_LEAVE 24 -#define ED_DRAWING_ID_CUSTOM_CHANGE_TARGET 25 -#define ED_DRAWING_ID_CUSTOM_CHANGE_CONTENT 26 -#define ED_DRAWING_ID_CUSTOM_CHANGE_TRIGGER 27 -#define ED_DRAWING_ID_GROUP_CONTENT 28 -#define ED_DRAWING_ID_RANDOM_BACKGROUND 29 - -#define ED_NUM_DRAWING_AREAS 30 +#define ED_DRAWING_ID_ANDROID_CONTENT 17 +#define ED_DRAWING_ID_AMOEBA_CONTENT 18 +#define ED_DRAWING_ID_START_ELEMENT 19 +#define ED_DRAWING_ID_ARTWORK_ELEMENT 20 +#define ED_DRAWING_ID_EXPLOSION_ELEMENT 21 +#define ED_DRAWING_ID_CUSTOM_GRAPHIC 22 +#define ED_DRAWING_ID_CUSTOM_CONTENT 23 +#define ED_DRAWING_ID_CUSTOM_MOVE_ENTER 24 +#define ED_DRAWING_ID_CUSTOM_MOVE_LEAVE 25 +#define ED_DRAWING_ID_CUSTOM_CHANGE_TARGET 26 +#define ED_DRAWING_ID_CUSTOM_CHANGE_CONTENT 27 +#define ED_DRAWING_ID_CUSTOM_CHANGE_TRIGGER 28 +#define ED_DRAWING_ID_GROUP_CONTENT 29 +#define ED_DRAWING_ID_RANDOM_BACKGROUND 30 + +#define ED_NUM_DRAWING_AREAS 31 /* @@ -1100,6 +1106,14 @@ static struct &level.num_ball_contents, NULL, NULL, "number of content areas" }, + { + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(4), + MIN_ANDROID_ELEMENTS, MAX_ANDROID_ELEMENTS, + GADGET_ID_ANDROID_CONTENT_DOWN, GADGET_ID_ANDROID_CONTENT_UP, + GADGET_ID_ANDROID_CONTENT_TEXT, GADGET_ID_NONE, + &level.num_android_clone_elements, + NULL, NULL, "number of clonable elements" + }, { ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(0), MIN_ENVELOPE_XSIZE, MAX_ENVELOPE_XSIZE, @@ -2820,6 +2834,15 @@ static struct NULL, NULL, "8", NULL }, + /* ---------- android content -------------------------------------------- */ + + { + ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(5), + GADGET_ID_ANDROID_CONTENT, GADGET_ID_NONE, + &level.android_clone_element[0], MAX_ANDROID_ELEMENTS, 1, + "elements:", NULL, NULL, "elements android can clone" + }, + /* ---------- amoeba content --------------------------------------------- */ { @@ -7243,6 +7266,31 @@ static void DrawMagicBallContentAreas() DrawText(x, y + 2 * MINI_TILEY, "active", FONT_TEXT_1); } +static void DrawAndroidElementArea(int element) +{ + int num_elements = level.num_android_clone_elements; + int id = ED_DRAWING_ID_ANDROID_CONTENT; + int sx = SX + drawingarea_info[id].x - MINI_TILEX / 2; + int sy = SY + drawingarea_info[id].y - MINI_TILEY / 2; + int xsize = MAX_ANDROID_ELEMENTS; + int ysize = 1; + + /* display counter to choose number of element areas */ + MapCounterButtons(ED_COUNTER_ID_ANDROID_CONTENT); + + if (drawingarea_info[id].text_left != NULL) + sx += getTextWidthForDrawingArea(drawingarea_info[id].text_left); + + UnmapDrawingArea(id); + + ModifyEditorDrawingArea(id, num_elements, 1); + + /* delete content areas in case of reducing number of them */ + DrawBackground(sx, sy, (xsize + 1) * MINI_TILEX, (ysize + 1) * MINI_TILEY); + + MapDrawingArea(id); +} + static void DrawGroupElementArea(int element) { int num_elements = group_element_info.num_elements; @@ -7440,7 +7488,9 @@ static void DrawPropertiesInfo() /* pre-defined properties */ { EP_CAN_PASS_MAGIC_WALL, "- can pass magic walls" }, { EP_SWITCHABLE, "- can be switched" }, - { EP_HAS_CONTENT, "- can contain other elements" }, +#if 0 + { EP_HAS_EDITOR_CONTENT, "- can contain other elements" }, +#endif { -1, NULL } }; @@ -7648,7 +7698,7 @@ static boolean checkPropertiesConfig(int element) IS_GROUP_ELEMENT(element) || IS_ENVELOPE(element) || ELEM_IS_PLAYER(element) || - HAS_CONTENT(element) || + HAS_EDITOR_CONTENT(element) || CAN_GROW(element) || COULD_MOVE_INTO_ACID(element) || MAYBE_DONT_COLLIDE_WITH(element)) @@ -7682,12 +7732,13 @@ static void DrawPropertiesConfig() int counter_id = ED_COUNTER_ID_ELEMENT_VALUE1 + num_element_counters; counterbutton_info[counter_id].y = - ED_ELEMENT_SETTINGS_YPOS((HAS_CONTENT(properties_element) ? 1 : 0) + - (CAN_GROW(properties_element) ? 1 : 0) + - (COULD_MOVE_INTO_ACID(properties_element) ? 1 : 0) + - (MAYBE_DONT_COLLIDE_WITH(properties_element) ? 1 : 0)+ - (properties_element == EL_EMC_MAGIC_BALL ? 2 : 0) + - num_element_counters); + ED_ELEMENT_SETTINGS_YPOS( + (HAS_EDITOR_CONTENT(properties_element) ? 1 : 0) + + (CAN_GROW(properties_element) ? 1 : 0) + + (COULD_MOVE_INTO_ACID(properties_element) ? 1 : 0) + + (MAYBE_DONT_COLLIDE_WITH(properties_element) ? 1 : 0) + + (properties_element == EL_EMC_MAGIC_BALL ? 2 : 0) + + num_element_counters); counterbutton_info[counter_id].value = elements_with_counter[i].value; counterbutton_info[counter_id].text_right= elements_with_counter[i].text; @@ -7713,7 +7764,7 @@ static void DrawPropertiesConfig() } } - if (HAS_CONTENT(properties_element)) + if (HAS_EDITOR_CONTENT(properties_element)) { /* draw stickybutton gadget */ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_STICK_ELEMENT); @@ -7729,6 +7780,8 @@ static void DrawPropertiesConfig() MapCheckbuttonGadget(ED_CHECKBUTTON_ID_RANDOM_BALL_CONTENT); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_INITIAL_BALL_STATE); } + else if (properties_element == EL_EMC_ANDROID) + DrawAndroidElementArea(properties_element); } if (ELEM_IS_PLAYER(properties_element)) @@ -7781,7 +7834,7 @@ static void DrawPropertiesConfig() ED_ELEMENT_SETTINGS_XPOS(IS_CUSTOM_ELEMENT(properties_element) ? 1 : 0); checkbutton_info[ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID].y = ED_ELEMENT_SETTINGS_YPOS(IS_CUSTOM_ELEMENT(properties_element) ? 6 : - HAS_CONTENT(properties_element) ? 1 : 0); + HAS_EDITOR_CONTENT(properties_element) ? 1 : 0); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID); } @@ -7803,7 +7856,7 @@ static void DrawPropertiesConfig() if (CAN_GROW(properties_element)) { checkbutton_info[ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE].y = - ED_ELEMENT_SETTINGS_YPOS(HAS_CONTENT(properties_element) ? 1 : 0); + ED_ELEMENT_SETTINGS_YPOS(HAS_EDITOR_CONTENT(properties_element) ? 1 : 0); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE); } @@ -9069,6 +9122,10 @@ static void HandleCounterButtons(struct GadgetInfo *gi) DrawMagicBallContentAreas(); break; + case ED_COUNTER_ID_ANDROID_CONTENT: + DrawAndroidElementArea(properties_element); + break; + case ED_COUNTER_ID_GROUP_CONTENT: DrawGroupElementArea(properties_element); CopyGroupElementPropertiesToGame(properties_element); @@ -10081,6 +10138,8 @@ static void HandleDrawingAreaInfo(struct GadgetInfo *gi) id <= GADGET_ID_MAGIC_BALL_CONTENT_7) sprintf(infotext, "content area %d position: %d, %d", id - GADGET_ID_MAGIC_BALL_CONTENT_0 + 1, sx, sy); + else if (id == GADGET_ID_ANDROID_CONTENT) + sprintf(infotext, "android element position: %d", sx + 1); else if (drawingarea_info[type_id].infotext != NULL) strcpy(infotext, drawingarea_info[type_id].infotext); } diff --git a/src/events.c b/src/events.c index d7d023e7..410c34c2 100644 --- a/src/events.c +++ b/src/events.c @@ -435,6 +435,7 @@ void HandleButton(int mx, int my, int button) break; case GAME_MODE_EDITOR: + HandleLevelEditorIdle(); break; case GAME_MODE_INFO: diff --git a/src/files.c b/src/files.c index 6db3036e..b11e7a9c 100644 --- a/src/files.c +++ b/src/files.c @@ -86,8 +86,8 @@ #define CONF_VALUE_ELEMENT_7 (CONF_MASK_2_BYTE | 7) #define CONF_VALUE_ELEMENT_8 (CONF_MASK_2_BYTE | 8) -#define CONF_VALUE_CONTENT_1 (CONF_MASK_MULTI_BYTES | 1) -#define CONF_VALUE_CONTENT_8 (CONF_MASK_MULTI_BYTES | 2) +#define CONF_VALUE_ELEMENTS (CONF_MASK_MULTI_BYTES | 1) +#define CONF_VALUE_CONTENTS (CONF_MASK_MULTI_BYTES | 2) #define CONF_VALUE_INTEGER(x) ((x) >= CONF_VALUE_INTEGER_1 && \ (x) <= CONF_VALUE_INTEGER_8) @@ -101,24 +101,43 @@ #define CONF_CONTENT_NUM_ELEMENTS (3 * 3) #define CONF_CONTENT_NUM_BYTES (CONF_CONTENT_NUM_ELEMENTS * 2) +#define CONF_ELEMENT_NUM_BYTES (2) + +#define CONF_ENTITY_NUM_BYTES(t) ((t) == CONF_VALUE_ELEMENTS ? \ + CONF_ELEMENT_NUM_BYTES : \ + (t) == CONF_VALUE_CONTENTS ? \ + CONF_CONTENT_NUM_BYTES : 1) + +#define CONF_ELEMENT_BYTE_POS(i) ((i) * CONF_ELEMENT_NUM_BYTES) +#define CONF_ELEMENTS_ELEMENT(b,i) ((b[CONF_ELEMENT_BYTE_POS(i)] << 8) | \ + (b[CONF_ELEMENT_BYTE_POS(i) + 1])) #define CONF_CONTENT_ELEMENT_POS(c,x,y) ((c) * CONF_CONTENT_NUM_ELEMENTS + \ (y) * 3 + (x)) -#define CONF_CONTENT_BYTE_POS(c,x,y) (CONF_CONTENT_ELEMENT_POS(c,x,y) * 2) -#define CONF_CONTENT_ELEMENT(b,c,x,y) ((b[CONF_CONTENT_BYTE_POS(c,x,y)] << 8)|\ - (b[CONF_CONTENT_BYTE_POS(c,x,y) + 1])) +#define CONF_CONTENT_BYTE_POS(c,x,y) (CONF_CONTENT_ELEMENT_POS(c,x,y) * \ + CONF_ELEMENT_NUM_BYTES) +#define CONF_CONTENTS_ELEMENT(b,c,x,y) ((b[CONF_CONTENT_BYTE_POS(c,x,y)]<< 8)|\ + (b[CONF_CONTENT_BYTE_POS(c,x,y) + 1])) static struct LevelInfo li; static struct { - int element; - int type; - void *value; - int default_value; + int element; /* element for which data is to be stored */ + int type; /* type of data to be stored */ + + /* (mandatory) */ + void *value; /* variable that holds the data to be stored */ + int default_value; /* initial default value for this variable */ + + /* (optional) */ + void *num_entities; /* number of entities for multi-byte data */ + int default_num_entities; /* default number of entities for this data */ + int max_num_entities; /* maximal number of entities for this data */ } element_conf[] = { /* ---------- 1-byte values ---------------------------------------------- */ + { EL_EMC_ANDROID, CONF_VALUE_INTEGER_1, &li.android_move_time, 10 @@ -271,10 +290,6 @@ static struct EL_EMC_MAGIC_BALL, CONF_VALUE_INTEGER_1, &li.ball_time, 10 }, - { - EL_EMC_MAGIC_BALL, CONF_VALUE_INTEGER_2, - &li.num_ball_contents, 8 - }, { EL_EMC_MAGIC_BALL, CONF_VALUE_BOOLEAN_1, &li.ball_random, FALSE @@ -285,6 +300,7 @@ static struct }, /* ---------- 2-byte values ---------------------------------------------- */ + { EL_PLAYER_1, CONF_VALUE_ELEMENT_1, &li.start_element[0], EL_PLAYER_1 @@ -335,14 +351,21 @@ static struct }, /* ---------- multi-byte values ------------------------------------------ */ + + { + EL_EMC_MAGIC_BALL, CONF_VALUE_CONTENTS, + &li.ball_content, EL_EMPTY, + &li.num_ball_contents, 4, MAX_ELEMENT_CONTENTS + }, { - EL_EMC_MAGIC_BALL, CONF_VALUE_CONTENT_8, - &li.ball_content, EL_EMPTY + EL_EMC_ANDROID, CONF_VALUE_ELEMENTS, + &li.android_clone_element[0], EL_EMPTY, + &li.num_android_clone_elements, 1, MAX_ANDROID_ELEMENTS }, { -1, -1, - NULL, -1 + NULL, -1, }, }; @@ -380,23 +403,39 @@ static void setLevelInfoToDefaultsFromConfigList(struct LevelInfo *level) int type = element_conf[i].type; int bytes = type & CONF_MASK_BYTES; - if (bytes != CONF_MASK_MULTI_BYTES) + if (bytes == CONF_MASK_MULTI_BYTES) + { + int default_num_entities = element_conf[i].default_num_entities; + int max_num_entities = element_conf[i].max_num_entities; + + *(int *)(element_conf[i].num_entities) = default_num_entities; + + if (type == CONF_VALUE_ELEMENTS) + { + int *element_array = (int *)(element_conf[i].value); + int j; + + for (j = 0; j < max_num_entities; j++) + element_array[j] = default_value; + } + else if (type == CONF_VALUE_CONTENTS) + { + struct Content *content = (struct Content *)(element_conf[i].value); + int c, x, y; + + for (c = 0; c < max_num_entities; c++) + for (y = 0; y < 3; y++) + for (x = 0; x < 3; x++) + content[c].e[x][y] = default_value; + } + } + else /* constant size configuration data (1, 2 or 4 bytes) */ { if (CONF_VALUE_BOOLEAN(type)) *(boolean *)(element_conf[i].value) = default_value; else *(int *) (element_conf[i].value) = default_value; } - else if (type == CONF_VALUE_CONTENT_8) - { - struct Content *content = (struct Content *)(element_conf[i].value); - int c, x, y; - - for (c = 0; c < MAX_ELEMENT_CONTENTS; c++) - for (y = 0; y < 3; y++) - for (x = 0; x < 3; x++) - content[c].e[x][y] = default_value; - } } *level = li; /* copy temporary buffer back to level information */ @@ -554,8 +593,10 @@ static void setLevelInfoToDefaults(struct LevelInfo *level) for (y = 0; y < 3; y++) level->ball_content[i].e[x][y] = EL_EMPTY; #endif +#if 0 for (i = 0; i < 16; i++) level->android_array[i] = FALSE; +#endif level->use_custom_template = FALSE; @@ -1676,19 +1717,41 @@ static int LoadLevel_CONF(FILE *file, int chunk_size, struct LevelInfo *level) if (element_conf[i].element == element && element_conf[i].type == type) { + int num_entities = num_bytes / CONF_ENTITY_NUM_BYTES(type); + int max_num_entities = element_conf[i].max_num_entities; + + if (num_entities > max_num_entities) + { + Error(ERR_WARN, + "truncating number of entities for element %d from %d to %d", + element, num_entities, max_num_entities); + + num_entities = max_num_entities; + } + + *(int *)(element_conf[i].num_entities) = num_entities; + element_found = TRUE; - if (type == CONF_VALUE_CONTENT_8) + if (type == CONF_VALUE_ELEMENTS) + { + int *element_array = (int *)(element_conf[i].value); + int j; + + for (j = 0; j < num_entities; j++) + element_array[j] = + getMappedElement(CONF_ELEMENTS_ELEMENT(buffer, j)); + } + else if (type == CONF_VALUE_CONTENTS) { struct Content *content= (struct Content *)(element_conf[i].value); - int num_contents = num_bytes / CONF_CONTENT_NUM_BYTES; int c, x, y; - for (c = 0; c < num_contents; c++) + for (c = 0; c < num_entities; c++) for (y = 0; y < 3; y++) for (x = 0; x < 3; x++) content[c].e[x][y] = - getMappedElement(CONF_CONTENT_ELEMENT(buffer, c, x, y)); + getMappedElement(CONF_CONTENTS_ELEMENT(buffer, c, x, y)); } else element_found = FALSE; @@ -1701,7 +1764,7 @@ static int LoadLevel_CONF(FILE *file, int chunk_size, struct LevelInfo *level) real_chunk_size += 2 + num_bytes; } - else + else /* constant size configuration data (1, 2 or 4 bytes) */ { int value = (bytes == CONF_MASK_1_BYTE ? getFile8Bit (file) : bytes == CONF_MASK_2_BYTE ? getFile16BitBE(file) : @@ -2373,8 +2436,12 @@ void CopyNativeLevel_RND_to_EM(struct LevelInfo *level) map_element_RND_to_EM(level-> ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]); + map_android_clone_elements_RND_to_EM(level); + +#if 0 for (i = 0; i < 16; i++) lev->android_array[i] = FALSE; /* !!! YET TO COME !!! */ +#endif /* first fill the complete playfield with the default border element */ for (y = 0; y < EM_MAX_CAVE_HEIGHT; y++) @@ -2499,8 +2566,12 @@ void CopyNativeLevel_EM_to_RND(struct LevelInfo *level) level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]] = map_element_EM_to_RND(lev->ball_array[i][j]); + map_android_clone_elements_EM_to_RND(level); + +#if 0 for (i = 0; i < 16; i++) level->android_array[i] = FALSE; /* !!! YET TO COME !!! */ +#endif /* convert the playfield (some elements need special treatment) */ for (y = 0; y < level->fieldy; y++) for (x = 0; x < level->fieldx; x++) @@ -3720,9 +3791,39 @@ static int SaveLevel_CONF_Value(FILE *file, int pos) return num_bytes; } -static int SaveLevel_CONF_Content(FILE *file, int pos, int num_contents) +static int SaveLevel_CONF_Elements(FILE *file, int pos) +{ + int *element_array = (int *)(element_conf[pos].value); + int num_elements = *(int *)element_conf[pos].num_entities; + int default_value = element_conf[pos].default_value; + int element = element_conf[pos].element; + int type = element_conf[pos].type; + int num_bytes = 0; + boolean modified = FALSE; + int i; + + /* check if any settings have been modified before saving them */ + for (i = 0; i < num_elements; i++) + if (element_array[i] != default_value) + modified = TRUE; + + if (!modified) /* do not save unmodified default settings */ + return 0; + + num_bytes += putFile16BitBE(file, element); + num_bytes += putFile8Bit(file, type); + num_bytes += putFile16BitBE(file, num_elements * CONF_ELEMENT_NUM_BYTES); + + for (i = 0; i < num_elements; i++) + num_bytes += putFile16BitBE(file, element_array[i]); + + return num_bytes; +} + +static int SaveLevel_CONF_Contents(FILE *file, int pos) { struct Content *content = (struct Content *)(element_conf[pos].value); + int num_contents = *(int *)element_conf[pos].num_entities; int default_value = element_conf[pos].default_value; int element = element_conf[pos].element; int type = element_conf[pos].type; @@ -3766,8 +3867,10 @@ static int SaveLevel_CONF(FILE *file, struct LevelInfo *level) if (bytes != CONF_MASK_MULTI_BYTES) chunk_size += SaveLevel_CONF_Value(file, i); - else if (type == CONF_VALUE_CONTENT_8) - chunk_size += SaveLevel_CONF_Content(file, i, MAX_ELEMENT_CONTENTS); + else if (type == CONF_VALUE_ELEMENTS) + chunk_size += SaveLevel_CONF_Elements(file, i); + else if (type == CONF_VALUE_CONTENTS) + chunk_size += SaveLevel_CONF_Contents(file, i); } return chunk_size; diff --git a/src/game.c b/src/game.c index dc1ab4c4..05223934 100644 --- a/src/game.c +++ b/src/game.c @@ -6608,10 +6608,11 @@ static void RunTimegateWheel(int x, int y) static void InitMagicBallDelay(int x, int y) { - ChangeDelay[x][y] = level.ball_time * FRAMES_PER_SECOND; - - if (ChangeDelay[x][y] == 0) - ChangeDelay[x][y] = 1; +#if 1 + ChangeDelay[x][y] = (level.ball_time + 1) * 8 + 1; +#else + ChangeDelay[x][y] = level.ball_time * FRAMES_PER_SECOND + 1; +#endif } static void ActivateMagicBall(int bx, int by) diff --git a/src/init.c b/src/init.c index eac7d298..708ab4a6 100644 --- a/src/init.c +++ b/src/init.c @@ -1681,7 +1681,7 @@ static int get_special_property_bit(int element, int property_bit_nr) { EL_SP_MURPHY, 0 }, { EL_SOKOBAN_FIELD_PLAYER, 0 }, - /* all element that can move may be able to also move into acid */ + /* all elements that can move may be able to also move into acid */ { EL_BUG, 1 }, { EL_BUG_LEFT, 1 }, { EL_BUG_RIGHT, 1 }, @@ -1723,6 +1723,7 @@ static int get_special_property_bit(int element, int property_bit_nr) { EL_SP_ELECTRON, 15 }, { EL_BALLOON, 16 }, { EL_SPRING, 17 }, + { EL_EMC_ANDROID, 18 }, { -1, -1 }, }; @@ -3181,7 +3182,7 @@ void InitElementPropertiesStatic() -1 }; - static int ep_has_content[] = + static int ep_has_editor_content[] = { EL_PLAYER_1, EL_PLAYER_2, @@ -3194,6 +3195,7 @@ void InitElementPropertiesStatic() EL_AMOEBA_FULL, EL_BD_AMOEBA, EL_EMC_MAGIC_BALL, + EL_EMC_ANDROID, -1 }; @@ -3526,7 +3528,7 @@ void InitElementPropertiesStatic() { ep_keygate, EP_KEYGATE }, { ep_amoeboid, EP_AMOEBOID }, { ep_amoebalive, EP_AMOEBALIVE }, - { ep_has_content, EP_HAS_CONTENT }, + { ep_has_editor_content, EP_HAS_EDITOR_CONTENT }, { ep_can_turn_each_move, EP_CAN_TURN_EACH_MOVE }, { ep_can_grow, EP_CAN_GROW }, { ep_active_bomb, EP_ACTIVE_BOMB }, diff --git a/src/main.h b/src/main.h index c723314d..58483c61 100644 --- a/src/main.h +++ b/src/main.h @@ -115,7 +115,7 @@ #define EP_KEYGATE 49 #define EP_AMOEBOID 50 #define EP_AMOEBALIVE 51 -#define EP_HAS_CONTENT 52 +#define EP_HAS_EDITOR_CONTENT 52 #define EP_CAN_TURN_EACH_MOVE 53 #define EP_CAN_GROW 54 #define EP_ACTIVE_BOMB 55 @@ -521,7 +521,7 @@ #define IS_KEYGATE(e) HAS_PROPERTY(e, EP_KEYGATE) #define IS_AMOEBOID(e) HAS_PROPERTY(e, EP_AMOEBOID) #define IS_AMOEBALIVE(e) HAS_PROPERTY(e, EP_AMOEBALIVE) -#define HAS_CONTENT(e) HAS_PROPERTY(e, EP_HAS_CONTENT) +#define HAS_EDITOR_CONTENT(e) HAS_PROPERTY(e, EP_HAS_EDITOR_CONTENT) #define CAN_TURN_EACH_MOVE(e) HAS_PROPERTY(e, EP_CAN_TURN_EACH_MOVE) #define CAN_GROW(e) HAS_PROPERTY(e, EP_CAN_GROW) #define IS_ACTIVE_BOMB(e) HAS_PROPERTY(e, EP_ACTIVE_BOMB) @@ -746,6 +746,8 @@ #define MAX_CHANGE_PAGES 32 #define MIN_ELEMENTS_IN_GROUP 1 #define MAX_ELEMENTS_IN_GROUP 16 +#define MIN_ANDROID_ELEMENTS 1 +#define MAX_ANDROID_ELEMENTS 16 /* values for elements with content */ #define MIN_ELEMENT_CONTENTS 1 @@ -1910,8 +1912,12 @@ struct LevelInfo struct Content ball_content[MAX_ELEMENT_CONTENTS]; int num_ball_contents; +#if 0 boolean android_array[16]; #endif + int num_android_clone_elements; + int android_clone_element[MAX_ANDROID_ELEMENTS]; +#endif int can_move_into_acid_bits; /* bitfield to store property for elements */ int dont_collide_with_bits; /* bitfield to store property for elements */ diff --git a/src/tools.c b/src/tools.c index 64cbcc25..27c2a9f8 100644 --- a/src/tools.c +++ b/src/tools.c @@ -4758,6 +4758,63 @@ int map_element_EM_to_RND(int element_em) return EL_UNKNOWN; } +void map_android_clone_elements_RND_to_EM(struct LevelInfo *level) +{ + struct LevelInfo_EM *level_em = level->native_em_level; + struct LEVEL *lev = level_em->lev; + int i, j; + + for (i = 0; i < level->num_android_clone_elements; i++) + { + int element_rnd = level->android_clone_element[i]; + int element_em = map_element_RND_to_EM(element_rnd); + + for (j = 0; em_object_mapping_list[j].element_em != -1; j++) + if (em_object_mapping_list[j].element_rnd == element_rnd) + lev->android_array[em_object_mapping_list[j].element_em] = element_em; + } +} + +void map_android_clone_elements_EM_to_RND(struct LevelInfo *level) +{ + struct LevelInfo_EM *level_em = level->native_em_level; + struct LEVEL *lev = level_em->lev; + int i, j; + + level->num_android_clone_elements = 0; + + for (i = 0; i < TILE_MAX; i++) + { + int element_em = lev->android_array[i]; + int element_rnd; + boolean element_found = FALSE; + + if (element_em == Xblank) + continue; + + element_rnd = map_element_EM_to_RND(element_em); + + for (j = 0; j < level->num_android_clone_elements; j++) + if (level->android_clone_element[j] == element_rnd) + element_found = TRUE; + + if (!element_found) + { + level->android_clone_element[level->num_android_clone_elements++] = + element_rnd; + + if (level->num_android_clone_elements == MAX_ANDROID_ELEMENTS) + break; + } + } + + if (level->num_android_clone_elements == 0) + { + level->num_android_clone_elements = 1; + level->android_clone_element[0] = EL_EMPTY; + } +} + #if 0 int map_element_RND_to_EM(int element_rnd) diff --git a/src/tools.h b/src/tools.h index a59f2bac..0168369e 100644 --- a/src/tools.h +++ b/src/tools.h @@ -142,6 +142,9 @@ int map_element_EM_to_RND(int); int map_direction_RND_to_EM(int); int map_direction_EM_to_RND(int); +void map_android_clone_elements_RND_to_EM(struct LevelInfo *); +void map_android_clone_elements_EM_to_RND(struct LevelInfo *); + int get_next_element(int); int el_act_dir2img(int, int, int); int el_act2img(int, int);