X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fanim.c;h=2ebf520f79d793a365b5acdedfbdc77a5ea263e5;hb=f50b39e5a25f45c554d42130174da25d90131e57;hp=9d1f0b5c734dc75200cc077ff88d826051ceb443;hpb=6357574062edeea7adf7b5522687309001100e82;p=rocksndiamonds.git diff --git a/src/anim.c b/src/anim.c index 9d1f0b5c..2ebf520f 100644 --- a/src/anim.c +++ b/src/anim.c @@ -828,7 +828,8 @@ static boolean SetGlobalAnimPart_Viewport(struct GlobalAnimPartControlInfo *part int viewport_height; boolean changed = FALSE; - if (part->last_anim_status == global.anim_status) + if (part->last_anim_status == global.anim_status && + part->control_info.class != get_hash_from_key("pointer")) return FALSE; part->last_anim_status = global.anim_status; @@ -845,6 +846,15 @@ 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")) + { + viewport_x = gfx.mouse_x + part->control_info.x; + viewport_y = gfx.mouse_y + part->control_info.y; + viewport_width = part->graphic_info.width; + viewport_height = part->graphic_info.height; + + part->drawing_stage = DRAW_GLOBAL_ANIM_STAGE_2; + } else if (part->control_info.class == get_hash_from_key("door_1")) { viewport_x = DX; @@ -1256,10 +1266,13 @@ static int HandleGlobalAnim_Part(struct GlobalAnimPartControlInfo *part, part->step_yoffset = 0; } - if (c->x != ARG_UNDEFINED_VALUE) - part->x = c->x; - if (c->y != ARG_UNDEFINED_VALUE) - part->y = c->y; + if (part->control_info.class != get_hash_from_key("pointer")) + { + if (c->x != ARG_UNDEFINED_VALUE) + part->x = c->x; + if (c->y != ARG_UNDEFINED_VALUE) + part->y = c->y; + } if (c->position == POS_LAST && anim->last_x > -g->width && anim->last_x < part->viewport_width &&