X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=014ae9ce04297cce285466cf91b71c21c77ad9b4;hb=6d06ba238902736bb99714dc8122bb32a286577a;hp=2ae872b475000ea3d2f0bddca41248f332f09f1c;hpb=b33f14a8bdad5e3c9547c37b3854025daba761c7;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 2ae872b4..014ae9ce 100644 --- a/src/tools.c +++ b/src/tools.c @@ -585,7 +585,10 @@ void FadeExt(int fade_mask, int fade_mode) fade_delay = fading.fade_delay; post_delay = (fade_mode == FADE_MODE_FADE_OUT ? fading.post_delay : 0); - draw_border_function = DrawMaskedBorder_FIELD; + if (border.draw_masked_when_fading) + draw_border_function = DrawMaskedBorder_FIELD; /* update when fading */ + else + DrawMaskedBorder_FIELD(); /* draw once */ } else /* REDRAW_ALL */ { @@ -620,7 +623,9 @@ void FadeExt(int fade_mask, int fade_mode) void FadeIn(int fade_mask) { +#if 0 global.border_status = game_status; +#endif #if 0 global.fading_status = game_status; @@ -700,6 +705,10 @@ void FadeOut(int fade_mask) FadeExt(fade_mask, FADE_MODE_FADE_OUT); #endif #endif + +#if 1 + global.border_status = game_status; +#endif } void FadeCross(int fade_mask) @@ -6067,6 +6076,69 @@ void ResetGfxAnimation_EM(int x, int y, int tile) GfxFrame[x][y] = 0; } +void SetGfxAnimation_EM(int tile, int frame_em, int x, int y) +{ +#if 0 + int element = object_mapping[tile].element_rnd; +#endif + int action = object_mapping[tile].action; + int direction = object_mapping[tile].direction; + boolean is_backside = object_mapping[tile].is_backside; + boolean action_removing = (action == ACTION_DIGGING || + action == ACTION_SNAPPING || + action == ACTION_COLLECTING); + +#if 0 + printf("::: SET: %d, %d: '%s'\n", x, y, EL_NAME(element)); +#endif + +#if 1 + if (action_removing) + { +#if 0 + printf("::: %d, %d: action_removing [%s]\n", x, y, EL_NAME(element)); +#endif + + GfxFrame[x][y] = 7 - frame_em; + } + else if (action == ACTION_FALLING || + action == ACTION_MOVING || + action == ACTION_PUSHING || + action == ACTION_EATING || + action == ACTION_FILLING || + action == ACTION_EMPTYING) + { + int move_dir = + (action == ACTION_FALLING || + action == ACTION_FILLING || + action == ACTION_EMPTYING ? MV_DOWN : direction); + + if (is_backside) + { + GfxFrame[x][y]++; + + if (move_dir == MV_LEFT) + GfxFrame[x - 1][y] = GfxFrame[x][y]; + else if (move_dir == MV_RIGHT) + GfxFrame[x + 1][y] = GfxFrame[x][y]; + else if (move_dir == MV_UP) + GfxFrame[x][y - 1] = GfxFrame[x][y]; + else if (move_dir == MV_DOWN) + GfxFrame[x][y + 1] = GfxFrame[x][y]; + } + +#if 0 + printf("::: %d, %d: %s, %d, %d [%d]\n", x, y, EL_NAME(element), is_backside, + move_dir, GfxFrame[x][y]); +#endif + } + else + GfxFrame[x][y]++; +#else + GfxFrame[x][y] = 7 - frame_em; +#endif +} + void getGraphicSourceObjectExt_EM(int tile, int frame_em, Bitmap **src_bitmap, int *src_x, int *src_y, int x, int y) @@ -6088,10 +6160,28 @@ void getGraphicSourceObjectExt_EM(int tile, int frame_em, struct GraphicInfo *g = &graphic_info[graphic]; int sync_frame; +#if 0 + printf("::: GET: %d, %d: '%s'\n", x, y, EL_NAME(element)); +#endif + +#if 0 + if (GfxFrame[x][y] < 8) + printf("::: %d, %d: %d [%s]\n", x, y, GfxFrame[x][y], EL_NAME(element)); +#endif + +#if 1 + if (graphic_info[graphic].anim_global_sync) + sync_frame = FrameCounter; + else if (IN_FIELD(x, y, MAX_LEV_FIELDX, MAX_LEV_FIELDY)) + sync_frame = GfxFrame[x][y]; + else + sync_frame = 0; /* steel border */ +#else if (graphic_info[graphic].anim_global_sync) sync_frame = FrameCounter; else sync_frame = 7 - frame_em; +#endif SetRandomAnimationValue(x, y);