X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fanim.c;h=53435a97a71f660a6c5c62c904220ed3890f0fa3;hb=edaa850fd2d2cae7ec31961fae3d56487e710c71;hp=e836ff6a3aaf8ff85dabe6b0679111df38133f88;hpb=70df2b1709f05156b8bf6b142cc2a2e23205130b;p=rocksndiamonds.git diff --git a/src/anim.c b/src/anim.c index e836ff6a..53435a97 100644 --- a/src/anim.c +++ b/src/anim.c @@ -531,10 +531,6 @@ static void InitGlobalAnimControls(void) anim->state = ANIM_STATE_INACTIVE; - // if draw order is undefined, set to default value "0" - if (anim->control_info.draw_order == ARG_UNDEFINED_VALUE) - anim->control_info.draw_order = 0; - part_nr = 0; for (p = 0; p < NUM_GLOBAL_ANIM_PARTS_ALL; p++) @@ -602,14 +598,15 @@ static void InitGlobalAnimControls(void) anim->has_base = TRUE; } - // force pointer-style animations to pass-through clicks - if (part->control_info.class == get_hash_from_key("pointer") && - part->control_info.style == STYLE_DEFAULT) - part->control_info.style |= STYLE_PASSTHROUGH; + // apply special settings to pointer-style animations + if (part->control_info.class == get_hash_from_string("pointer")) + { + // force pointer-style animations to be checked for clicks first + part->control_info.draw_order = 1000000; - // if draw order is undefined, inherit it from main animation - if (part->control_info.draw_order == ARG_UNDEFINED_VALUE) - part->control_info.draw_order = anim->control_info.draw_order; + // force pointer-style animations to pass-through clicks + part->control_info.style |= STYLE_PASSTHROUGH; + } } if (anim->num_parts > 0 || anim->has_base) @@ -788,7 +785,7 @@ static void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage) int mode_nr; int i; - if (!setup.toons) + if (!setup.global_animations) return; if (drawing_stage == DRAW_GLOBAL_ANIM_STAGE_1 && @@ -898,6 +895,11 @@ static void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage) int frame; int last_anim_random_frame = gfx.anim_random_frame; + if (!setup.toons && + part->graphic >= IMG_TOON_1 && + part->graphic <= IMG_TOON_20) + continue; + // when preparing source fading buffer, only draw animations to be stopped if (drawing_target == DRAW_TO_FADE_SOURCE && game_mode_anim_action[part->mode_nr] != ANIM_STOP) @@ -985,7 +987,7 @@ static boolean SetGlobalAnimPart_Viewport(struct GlobalAnimPartControlInfo *part boolean changed = FALSE; if (part->last_anim_status == global.anim_status && - part->control_info.class != get_hash_from_key("pointer")) + part->control_info.class != get_hash_from_string("pointer")) return FALSE; part->last_anim_status = global.anim_status; @@ -994,8 +996,8 @@ static boolean SetGlobalAnimPart_Viewport(struct GlobalAnimPartControlInfo *part part->class_playfield_or_door = FALSE; - if (part->control_info.class == get_hash_from_key("window") || - part->control_info.class == get_hash_from_key("border")) + if (part->control_info.class == get_hash_from_string("window") || + part->control_info.class == get_hash_from_string("border")) { viewport_x = 0; viewport_y = 0; @@ -1004,7 +1006,7 @@ static boolean SetGlobalAnimPart_Viewport(struct GlobalAnimPartControlInfo *part part->drawing_stage = DRAW_GLOBAL_ANIM_STAGE_2; } - else if (part->control_info.class == get_hash_from_key("pointer")) + else if (part->control_info.class == get_hash_from_string("pointer")) { int mx = MIN(MAX(0, gfx.mouse_x), WIN_XSIZE - 1); int my = MIN(MAX(0, gfx.mouse_y), WIN_YSIZE - 1); @@ -1025,7 +1027,7 @@ static boolean SetGlobalAnimPart_Viewport(struct GlobalAnimPartControlInfo *part if (global.anim_status != GAME_MODE_LOADING) gfx.cursor_mode_override = CURSOR_NONE; } - else if (part->control_info.class == get_hash_from_key("door_1")) + else if (part->control_info.class == get_hash_from_string("door_1")) { viewport_x = DX; viewport_y = DY; @@ -1034,7 +1036,7 @@ static boolean SetGlobalAnimPart_Viewport(struct GlobalAnimPartControlInfo *part part->class_playfield_or_door = TRUE; } - else if (part->control_info.class == get_hash_from_key("door_2")) + else if (part->control_info.class == get_hash_from_string("door_2")) { if (part->mode_nr == GAME_MODE_EDITOR) { @@ -1073,7 +1075,7 @@ static boolean SetGlobalAnimPart_Viewport(struct GlobalAnimPartControlInfo *part part->viewport_width = viewport_width; part->viewport_height = viewport_height; - if (part->control_info.class != get_hash_from_key("pointer")) + if (part->control_info.class != get_hash_from_string("pointer")) changed = TRUE; } @@ -1611,7 +1613,7 @@ static int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, part->step_yoffset = 0; } - if (part->control_info.class != get_hash_from_key("pointer")) + if (part->control_info.class != get_hash_from_string("pointer")) { if (c->x != ARG_UNDEFINED_VALUE) part->x = c->x; @@ -2074,7 +2076,7 @@ static boolean InitGlobalAnim_Clicked(int mx, int my, int clicked_event) // if request dialog is active, only handle pointer-style animations if (game.request_active && - part->control_info.class != get_hash_from_key("pointer")) + part->control_info.class != get_hash_from_string("pointer")) continue; if (clicked_event == ANIM_CLICKED_RESET)