From e81cc7dec1526e1e876ba9ce1e2064fe40d417e3 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 29 Nov 2004 13:14:45 +0100 Subject: [PATCH] rnd-20041129-2-src --- src/conftime.h | 2 +- src/init.c | 2 +- src/tools.c | 52 ++++++++++++++++++++++++++++++++++++-------------- 3 files changed, 40 insertions(+), 16 deletions(-) diff --git a/src/conftime.h b/src/conftime.h index c8c075e8..8415f4ba 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2004-11-29 05:04]" +#define COMPILE_DATE_STRING "[2004-11-29 13:13]" diff --git a/src/init.c b/src/init.c index 41bfb1e9..26be1fcd 100644 --- a/src/init.c +++ b/src/init.c @@ -270,7 +270,7 @@ void InitElementSmallImages() InitElementSmallImagesScaledUp(property_mapping[i].artwork_index); #endif -#if 1 +#if 0 /* !!! FIX THIS (CHANGE TO USING NORMAL ELEMENT GRAPHIC DEFINITIONS) !!! */ for (i = IMG_EMC_OBJECT; i <= IMG_EMC_SPRITE; i++) InitElementSmallImagesScaledUp(i); diff --git a/src/tools.c b/src/tools.c index c42dc99c..51ed2793 100644 --- a/src/tools.c +++ b/src/tools.c @@ -5495,6 +5495,19 @@ int get_next_element(int element) } } +#if 1 +int el_act_dir2img(int element, int action, int direction) +{ + element = GFX_ELEMENT(element); + + if (direction == MV_NO_MOVING) + return element_info[element].graphic[action]; + + direction = MV_DIR_BIT(direction); + + return element_info[element].direction_graphic[action][direction]; +} +#else int el_act_dir2img(int element, int action, int direction) { element = GFX_ELEMENT(element); @@ -5502,7 +5515,21 @@ int el_act_dir2img(int element, int action, int direction) return element_info[element].direction_graphic[action][direction]; } +#endif +#if 1 +static int el_act_dir2crm(int element, int action, int direction) +{ + element = GFX_ELEMENT(element); + + if (direction == MV_NO_MOVING) + return element_info[element].crumbled[action]; + + direction = MV_DIR_BIT(direction); + + return element_info[element].direction_crumbled[action][direction]; +} +#else static int el_act_dir2crm(int element, int action, int direction) { element = GFX_ELEMENT(element); @@ -5510,6 +5537,7 @@ static int el_act_dir2crm(int element, int action, int direction) return element_info[element].direction_crumbled[action][direction]; } +#endif int el_act2img(int element, int action) { @@ -5720,10 +5748,12 @@ void InitGraphicInfo_EM(void) action_active ? action : action_other ? action : ACTION_DEFAULT); - int graphic = (direction == MV_NO_MOVING ? - el_act2img(effective_element, effective_action) : - el_act_dir2img(effective_element, effective_action, + int graphic = (el_act_dir2img(effective_element, effective_action, direction)); + int crumbled = (el_act_dir2crm(effective_element, effective_action, + direction)); + int base_graphic = el_act2img(effective_element, ACTION_DEFAULT); + int base_crumbled = el_act2crm(effective_element, ACTION_DEFAULT); struct GraphicInfo *g = &graphic_info[graphic]; struct GraphicInfo_EM *g_em = &graphic_info_em_object[i][7 - j]; Bitmap *src_bitmap; @@ -5861,16 +5891,9 @@ void InitGraphicInfo_EM(void) g_em->crumbled_border_size = 0; #endif -#if 1 - if (element_info[effective_element].crumbled[ACTION_DEFAULT] != - element_info[effective_element].graphic[ACTION_DEFAULT]) -#else - if (element_info[effective_element].crumbled[effective_action] != - element_info[effective_element].graphic[effective_action]) -#endif + if (base_crumbled != base_graphic && crumbled != IMG_EMPTY_SPACE) { - int crumbled_graphic = el_act2crm(effective_element, effective_action); - struct GraphicInfo *g_crumbled = &graphic_info[crumbled_graphic]; + struct GraphicInfo *g_crumbled = &graphic_info[crumbled]; g_em->has_crumbled_graphics = TRUE; g_em->crumbled_bitmap = g_crumbled->bitmap; @@ -5949,8 +5972,9 @@ void InitGraphicInfo_EM(void) last_i = i; } - printf("::: EMC GFX ERROR for element %d -> %d ('%s')", - i, element, element_info[element].token_name); + printf("::: EMC GFX ERROR for element %d -> %d ('%s') [%d, %d]", + i, element, element_info[element].token_name, + effective_action, direction); if (element != effective_element) printf(" [%d ('%s')]", -- 2.34.1