diff --git a/src/ecopy.c b/src/ecopy.c index e5f6557..316e598 100644 --- a/src/ecopy.c +++ b/src/ecopy.c @@ -246,22 +246,6 @@ static int eCopyArea9(int sx, int sy, int w, int h, int dx, int dy, int opt) { return key; } -static void eCopyArea10(int step) { - if (step == 0) { - return; - } - if (step == 64) { - sdl_copyArea(ecp.sx, ecp.sy, ecp.w, ecp.h, ecp.dx, ecp.dy); - ags_updateArea(ecp.dx, ecp.dy, ecp.w, ecp.h); - return; - } - ags_scaledCopyArea(ecp.sx, ecp.sy, ecp.w, ecp.h, - ecp.dx + ecp.w * (64 - step) / 128, ecp.dy + ecp.h * (64 - step) / 128, - ecp.w * step / 64, ecp.h * step / 64, 0); - ags_updateArea(ecp.dx + ecp.w * (64 - step) / 128, ecp.dy + ecp.h * (64 - step) / 128, - ecp.w * step / 64, ecp.h * step / 64); -} - static int eCopyArea12(int dx, int dy, int w, int h, int opt) { int x, key = 0, cnt; int waitcnt = opt == 0 ? 20 : opt; @@ -818,6 +802,8 @@ static int eCopyArea5sp(int sx, int sy, int w, int h, int dx, int dy, int opt) { static int duration(enum nact_effect effect, int opt, SDL_Rect *rect) { switch (effect) { + case NACT_EFFECT_ZOOM_IN: + return opt ? opt * 64 : 500; case NACT_EFFECT_BLIND_DOWN: case NACT_EFFECT_BLIND_UP: return (opt ? opt : 40) * (rect->h / 16 + 16); @@ -968,13 +954,6 @@ void ags_eCopyArea(int sx, int sy, int w, int h, int dx, int dy, int sw, int opt case 9: ret = eCopyArea9(sx, sy, w, h, dx, dy, opt); break; - case 10: - i.step_max = 64; - i.effect_time = opt == 0 ? 500 : opt * 64; - i.cancel = cancel; - i.callback = eCopyArea10; - ags_fader(&i); - return; case 12: ret = eCopyArea12(dx, dy, w, h, opt); break; diff --git a/src/effect.h b/src/effect.h index 729669e..672f4c9 100644 --- a/src/effect.h +++ b/src/effect.h @@ -22,6 +22,7 @@ // Effect types of the CE command. enum nact_effect { + NACT_EFFECT_ZOOM_IN = 10, NACT_EFFECT_BLIND_DOWN = 11, NACT_EFFECT_MOSAIC = 24, NACT_EFFECT_FADEIN = 27, @@ -104,6 +105,7 @@ enum sdl_effect_type { EFFECT_WINDMILL, EFFECT_WINDMILL_180, EFFECT_WINDMILL_360, + EFFECT_ZOOM_IN, EFFECT_ROTATE_OUT, EFFECT_ROTATE_IN, EFFECT_ROTATE_OUT_CW, diff --git a/src/sdl_effect.c b/src/sdl_effect.c index 59d0eff..2847682 100644 --- a/src/sdl_effect.c +++ b/src/sdl_effect.c @@ -31,6 +31,7 @@ enum sdl_effect_type from_nact_effect(enum nact_effect effect) { switch (effect) { + case NACT_EFFECT_ZOOM_IN: return EFFECT_ZOOM_IN; case NACT_EFFECT_BLIND_DOWN: return EFFECT_BLIND_DOWN; case NACT_EFFECT_MOSAIC: return EFFECT_MOSAIC; case NACT_EFFECT_FADEIN: return EFFECT_FADEIN; @@ -980,6 +981,11 @@ static void rotate_step(struct sdl_effect *eff, double progress) { bg_texture = eff->tx_old; fg_texture = eff->tx_new; break; + case EFFECT_ZOOM_IN: + bg_texture = eff->tx_old; + fg_texture = eff->tx_new; + angle = 0; + break; default: assert(!"Cannot happen"); } @@ -1058,6 +1064,7 @@ struct sdl_effect *sdl_effect_init(SDL_Rect *rect, agsurface_t *old, int ox, int case EFFECT_ROTATE_IN: case EFFECT_ROTATE_OUT_CW: case EFFECT_ROTATE_IN_CW: + case EFFECT_ZOOM_IN: return rotate_new(rect, sf_old, sf_new, type); default: WARNING("Unknown effect %d\n", type);