From: Holger Schemel Date: Sat, 30 Aug 2014 08:43:46 +0000 (+0200) Subject: Merge branch 'master' into releases X-Git-Tag: 3.0.4^0 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=2622581d611b8b727b1f7c4cffd3d72bcd9065bf;hp=2ee9128343a1ff13629253513033d55f22e69e8f;p=rocksndiamonds.git Merge branch 'master' into releases --- diff --git a/CHANGES b/CHANGES index 6f704695..2939326e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Release Version 3.0.4 [13 SEP 2003] +----------------------------------- + * fixed bug in multiple config pages code that caused crashes + * fixed bug in custom definition of crumbled element graphic + Release Version 3.0.3 [08 SEP 2003] ----------------------------------- - fixed bug (missing array boundary check) which could crash the game @@ -8,6 +13,7 @@ Release Version 3.0.3 [08 SEP 2003] - added envelope content which gets displayed when collecting envelope - added multiple change event pages for custom elements - added support for loading various music formats through SDL_mixer + - added music to Supaplex classic level set Release Version 3.0.2 [22 AUG 2003] ----------------------------------- diff --git a/src/conftime.h b/src/conftime.h index bd0e8187..a5d63c85 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-09-08 00:04]" +#define COMPILE_DATE_STRING "[2003-09-13 01:34]" diff --git a/src/files.c b/src/files.c index 0b85e1eb..ac3f0b4b 100644 --- a/src/files.c +++ b/src/files.c @@ -689,6 +689,8 @@ static int LoadLevel_CUS4(FILE *file, int chunk_size, struct LevelInfo *level) /* read change property values */ + setElementChangePages(ei, ei->num_change_pages); + for (i=0; i < ei->num_change_pages; i++) { struct ElementChangeInfo *change = &ei->change_page[i]; diff --git a/src/game.c b/src/game.c index 91694d2d..750c70a9 100644 --- a/src/game.c +++ b/src/game.c @@ -2285,6 +2285,22 @@ void Explode(int ex, int ey, int phase, int mode) ExplodePhase[x][y] = (phase < last_phase ? phase + 1 : 0); +#ifdef DEBUG + + /* activate this even in non-DEBUG version until cause for crash in + getGraphicAnimationFrame() (see below) is found and eliminated */ +#endif +#if 1 + + if (GfxElement[x][y] == EL_UNDEFINED) + { + printf("Explode(): x = %d, y = %d: GfxElement == EL_UNDEFINED\n", x, y); + printf("Explode(): This should never happen!\n"); + + GfxElement[x][y] = EL_EMPTY; + } +#endif + if (phase == first_phase_after_start) { int element = Store2[x][y]; @@ -5364,10 +5380,13 @@ static void ChangeElementNowExt(int x, int y, int target_element) RelocatePlayer(x, y, target_element); } -static void ChangeElementNow(int x, int y, int element, int page) +static boolean ChangeElementNow(int x, int y, int element, int page) { struct ElementChangeInfo *change = &element_info[element].change_page[page]; + if (Changed[x][y]) /* do not change already changed elements */ + return FALSE; + Changed[x][y] = TRUE; /* no more changes in this frame */ CheckTriggeredElementChange(x, y, Feld[x][y], CE_OTHER_IS_CHANGING); @@ -5375,7 +5394,8 @@ static void ChangeElementNow(int x, int y, int element, int page) if (change->explode) { Bang(x, y); - return; + + return TRUE; } if (change->use_content) @@ -5433,7 +5453,7 @@ static void ChangeElementNow(int x, int y, int element, int page) if (change->only_complete && change->use_random_change && RND(100) < change->random) - return; + return FALSE; for (yy = 0; yy < 3; yy++) for(xx = 0; xx < 3 ; xx++) { @@ -5466,6 +5486,8 @@ static void ChangeElementNow(int x, int y, int element, int page) PlaySoundLevelElementAction(x, y, element, ACTION_CHANGING); } + + return TRUE; } static void ChangeElement(int x, int y, int page) @@ -5506,10 +5528,11 @@ static void ChangeElement(int x, int y, int page) return; } - ChangeElementNow(x, y, element, page); - - if (change->post_change_function) - change->post_change_function(x, y); + if (ChangeElementNow(x, y, element, page)) + { + if (change->post_change_function) + change->post_change_function(x, y); + } } } @@ -5566,8 +5589,10 @@ static boolean CheckTriggeredElementChange(int lx, int ly, int trigger_element, if (x == lx && y == ly) /* do not change trigger element itself */ continue; +#if 0 if (Changed[x][y]) /* do not change already changed elements */ continue; +#endif if (Feld[x][y] == element) { diff --git a/src/main.h b/src/main.h index 76be4a45..69c1c26c 100644 --- a/src/main.h +++ b/src/main.h @@ -376,7 +376,7 @@ #define MAX_ENVELOPE_YSIZE 20 #define MAX_ENVELOPE_TEXT_LEN (MAX_ENVELOPE_XSIZE * MAX_ENVELOPE_YSIZE) #define MIN_CHANGE_PAGES 1 -#define MAX_CHANGE_PAGES 10 +#define MAX_CHANGE_PAGES 16 /* values for elements with content */ #define MIN_ELEMENT_CONTENTS 1 @@ -993,9 +993,9 @@ #define PROGRAM_VERSION_MAJOR 3 #define PROGRAM_VERSION_MINOR 0 -#define PROGRAM_VERSION_PATCH 3 +#define PROGRAM_VERSION_PATCH 4 #define PROGRAM_VERSION_RELEASE 0 -#define PROGRAM_VERSION_STRING "3.0.3" +#define PROGRAM_VERSION_STRING "3.0.4" #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" diff --git a/src/screens.c b/src/screens.c index 0965eb9e..c119ff7c 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1812,7 +1812,6 @@ static struct TokenInfo setup_info_editor[] = { TYPE_SWITCH, &setup.editor.el_chars, "Characters:" }, { TYPE_SWITCH, &setup.editor.el_custom, "Custom:" }, { TYPE_SWITCH, &setup.editor.el_custom_more, "More Custom:" }, - { TYPE_EMPTY, NULL, "" }, { TYPE_SWITCH, &setup.editor.el_headlines, "Headlines:" }, { TYPE_EMPTY, NULL, "" }, { TYPE_LEAVE_MENU, execSetupMain, "Back" }, diff --git a/src/tools.c b/src/tools.c index 1f0856dc..f8f37ea0 100644 --- a/src/tools.c +++ b/src/tools.c @@ -35,6 +35,7 @@ static void UnmapToolButtons(); static void HandleToolButtons(struct GadgetInfo *); static int el_act_dir2crm(int, int, int); +static int el_act2crm(int, int); static struct GadgetInfo *tool_gadget[NUM_TOOL_BUTTONS]; static int request_gadget_id = -1; @@ -1217,6 +1218,12 @@ static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame) { 0, +1 } }; +#if 0 + if (x == 0 && y == 7) + printf("::: %d, %d [%d]\n", GfxElement[x][y], Feld[x][y], + crumbled_border_size); +#endif + if (!IN_LEV_FIELD(x, y)) return; @@ -1272,7 +1279,9 @@ static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame) } else /* crumble neighbour fields */ { +#if 0 getGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y); +#endif for(i=0; i<4; i++) { @@ -1287,6 +1296,12 @@ static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame) IS_MOVING(xx, yy)) continue; +#if 1 + graphic = el_act2crm(Feld[xx][yy], ACTION_DEFAULT); + + getGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y); +#endif + if (i == 1 || i == 2) { width = crumbled_border_size; @@ -1312,7 +1327,18 @@ static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame) void DrawLevelFieldCrumbledSand(int x, int y) { +#if 1 + int graphic; + + if (!IN_LEV_FIELD(x, y)) + return; + + graphic = el_act2crm(Feld[x][y], ACTION_DEFAULT); + + DrawLevelFieldCrumbledSandExt(x, y, graphic, 0); +#else DrawLevelFieldCrumbledSandExt(x, y, IMG_SAND_CRUMBLED, 0); +#endif } void DrawLevelFieldCrumbledSandDigging(int x, int y, int direction, @@ -2780,6 +2806,13 @@ int el_act2img(int element, int action) return element_info[element].graphic[action]; } +int el_act2crm(int element, int action) +{ + element = GFX_ELEMENT(element); + + return element_info[element].crumbled[action]; +} + int el_dir2img(int element, int direction) { element = GFX_ELEMENT(element);