From: Holger Schemel Date: Wed, 22 Aug 2007 20:22:44 +0000 (+0200) Subject: rnd-20070822-1-src X-Git-Tag: 3.2.4^2~19 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=66a60ab1d501cd3a7a666b3012702455927b3b13;p=rocksndiamonds.git rnd-20070822-1-src * fixed problem with broken crumbled graphics after level set changes when using R'n'D custom artwork with level sets using the EMC engine --- diff --git a/ChangeLog b/ChangeLog index 9c14c0e5..5969c513 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-05-07 + * fixed problem with broken crumbled graphics after level set changes + when using R'n'D custom artwork with level sets using the EMC engine + 2007-05-07 * fixed invisible "joysticks deactivated ..." text on setup input screen diff --git a/src/conftime.h b/src/conftime.h index 965c6684..efc5d524 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2007-05-08 01:19" +#define COMPILE_DATE_STRING "2007-08-22 22:17" diff --git a/src/engines.h b/src/engines.h index d5415f82..998a22ca 100644 --- a/src/engines.h +++ b/src/engines.h @@ -34,7 +34,8 @@ extern void PlayLevelSound_EM(int, int, int, int); extern void InitGraphicInfo_EM(void); void SetGfxAnimation_EM(int, int, int, int); -void getGraphicSourceObjectExt_EM(int, int, Bitmap **, int *, int *, int, int); +void getGraphicSourceObjectExt_EM(int, int, Bitmap **, int *, int *, + Bitmap **, int *, int *, int, int); void getGraphicSourcePlayerExt_EM(int, int, int, Bitmap **, int *, int *); #endif /* ENGINES_H */ diff --git a/src/game_em/graphics.c b/src/game_em/graphics.c index f33d4db8..a908126c 100644 --- a/src/game_em/graphics.c +++ b/src/game_em/graphics.c @@ -151,6 +151,8 @@ static struct GraphicInfo_EM *getObjectGraphic(int x, int y) if (!game.use_native_emc_graphics_engine) getGraphicSourceObjectExt_EM(tile, frame, &g->bitmap, &g->src_x, &g->src_y, + &g->crumbled_bitmap, + &g->crumbled_src_x, &g->crumbled_src_y, x - 2, y - 2); return g; } @@ -220,6 +222,13 @@ static void DrawLevelFieldCrumbled_EM(int x, int y, int sx, int sy, if (crm == 0) /* no crumbled edges for this tile */ return; +#if 0 + if (x == 3 && y == 3 && frame == 0) + printf("::: %d, %d\n", + graphic_info_em_object[207][0].crumbled_src_x, + graphic_info_em_object[207][0].crumbled_src_y); +#endif + for (i = 0; i < 4; i++) { if (crm & (1 << i)) diff --git a/src/main.h b/src/main.h index 2866d903..c191f6ac 100644 --- a/src/main.h +++ b/src/main.h @@ -1962,7 +1962,7 @@ #if CREATE_SPECIAL_EDITION_RND_JUE #undef PROGRAM_TITLE_STRING -#define PROGRAM_TITLE_STRING "R'n'D - Version Jue" +#define PROGRAM_TITLE_STRING "R'n'D - jue" #undef PROGRAM_UNIX_DATADIR_STRING #define PROGRAM_UNIX_DATADIR_STRING ".rocksndiamonds-jue" #endif diff --git a/src/tools.c b/src/tools.c index 0522aae0..f593aeda 100644 --- a/src/tools.c +++ b/src/tools.c @@ -6042,6 +6042,8 @@ void SetGfxAnimation_EM(int tile, int frame_em, int x, int y) void getGraphicSourceObjectExt_EM(int tile, int frame_em, Bitmap **src_bitmap, int *src_x, int *src_y, + Bitmap **crumbled_src_bitmap, + int *crumbled_src_x, int *crumbled_src_y, int x, int y) { int element = object_mapping[tile].element_rnd; @@ -6058,6 +6060,12 @@ void getGraphicSourceObjectExt_EM(int tile, int frame_em, int graphic = (direction == MV_NONE ? el_act2img(effective_element, action) : el_act_dir2img(effective_element, action, direction)); + int crumbled = (direction == MV_NONE ? + el_act2crm(effective_element, action) : + el_act_dir2crm(effective_element, action, direction)); + int base_graphic = el_act2img(effective_element, ACTION_DEFAULT); + int base_crumbled = el_act2crm(effective_element, ACTION_DEFAULT); + boolean has_crumbled_graphics = (base_crumbled != base_graphic); struct GraphicInfo *g = &graphic_info[graphic]; int sync_frame; @@ -6093,6 +6101,28 @@ void getGraphicSourceObjectExt_EM(int tile, int frame_em, sync_frame); getGraphicSourceExt(graphic, frame, src_bitmap, src_x, src_y, FALSE); + +#if 0 + if (x == 1 && y == 1 && frame == 0) + printf("--> %d, %d, %d\n", *crumbled_src_x, *crumbled_src_y, tile); +#endif + +#if 0 + getGraphicSource(crumbled, frame, crumbled_src_bitmap, + crumbled_src_x, crumbled_src_y); +#endif + +#if 0 + *crumbled_src_bitmap = NULL; + *crumbled_src_x = 0; + *crumbled_src_y = 0; + + if (has_crumbled_graphics && crumbled != IMG_EMPTY_SPACE) + { + getGraphicSource(crumbled, frame, crumbled_src_bitmap, + crumbled_src_x, crumbled_src_y); + } +#endif } void getGraphicSourcePlayerExt_EM(int player_nr, int anim, int frame_em, @@ -6292,6 +6322,7 @@ void InitGraphicInfo_EM(void) boolean has_action_graphics = (graphic != base_graphic); boolean has_crumbled_graphics = (base_crumbled != base_graphic); struct GraphicInfo *g = &graphic_info[graphic]; + struct GraphicInfo *g_crumbled = &graphic_info[crumbled]; struct GraphicInfo_EM *g_em = &graphic_info_em_object[i][7 - j]; Bitmap *src_bitmap; int src_x, src_y; @@ -6444,17 +6475,43 @@ void InitGraphicInfo_EM(void) #endif /* if element can be crumbled, but certain action graphics are just empty - space (like snapping sand with the original R'n'D graphics), do not + space (like instantly snapping sand to empty space in 1 frame), do not treat these empty space graphics as crumbled graphics in EMC engine */ if (has_crumbled_graphics && crumbled != IMG_EMPTY_SPACE) { - getGraphicSource(crumbled, frame, &src_bitmap, &src_x, &src_y); + int frame_crumbled = getAnimationFrame(g_crumbled->anim_frames, + g_crumbled->anim_delay, + g_crumbled->anim_mode, + g_crumbled->anim_start_frame, + sync_frame); + + getGraphicSource(crumbled, frame_crumbled, &src_bitmap, &src_x, &src_y); g_em->has_crumbled_graphics = TRUE; g_em->crumbled_bitmap = src_bitmap; g_em->crumbled_src_x = src_x; g_em->crumbled_src_y = src_y; g_em->crumbled_border_size = graphic_info[crumbled].border_size; + + +#if 0 + if (g_em == &graphic_info_em_object[207][0]) + printf("... %d, %d [%d, %d, %d, %d] [%d, %d, %d, %d, %d, %d => %d]\n", + graphic_info_em_object[207][0].crumbled_src_x, + graphic_info_em_object[207][0].crumbled_src_y, + + crumbled, frame, src_x, src_y, + + g->anim_frames, + g->anim_delay, + g->anim_mode, + g->anim_start_frame, + sync_frame, + gfx.anim_random_frame, + frame); +#endif + + } #if 0