/* ENLARGE REGULAR SIZE TO BIG SIZE */

/* Ask for verbose results. */

options results

/* Grab the arguments. */

arg frame " " total " " loopf

/* Start talking to ADPro, and bring it into view. */

address "ADPro"

ADPRO_TO_FRONT

/* Set image info for current frame. */

IMAGE_TYPE

if index(ADPRO_RESULT,"BITPLANE") = 0 then
do
   image = 0

   /* Deal with the palette. */

   if frame = 1 & loopf = 0 then PSTATUS UNLOCKED

   /* Set image parameters with default conversion options. */

   ABS_SCALE 320 400

   DITHER 6
   DITHER_AMOUNT 16

   SCREEN_TYPE 258
   RENDER_TYPE HAM8
end
else
do
   image = 1

   /* Deal with the palette. */

   PSTATUS LOCKED

   /* Use image parameters as defined by loaded image. */
   /* Except for the following... */

   DITHER 0
   DITHER_AMOUNT 16
end

/* Get the image's dimensions. */

XSIZE

ix = ADPRO_RESULT

YSIZE

iy = ADPRO_RESULT

/* Scale the image! */

dw = (ix*4)-ix
dh = (iy*4)-iy

nw = ix+(dw*((frame-1)/(total-1)))
nh = iy+(dh*((frame-1)/(total-1)))

ABS_SCALE nw nh

/* Now, crop-out only the center of the bigger image. */

XSIZE

sx = ADPRO_RESULT

YSIZE

sy = ADPRO_RESULT

ox = (sx-ix)%2
oy = (sy-iy)%2

OPERATOR "CROP_IMAGE" ix iy ox oy

/* Render the image. */

EXECUTE

/* Take care of palette locking/unlocking. */

if image = 0 then PSTATUS LOCKED

if image = 1 then PSTATUS UNLOCKED

/* Show the new image for a sec. */

ADPRO_DISPLAY

PAUSE 50

/* Throw ADPro into the background. */

ADPRO_UNDISPLAY

ADPRO_TO_BACK

/* Start talking to AWorks, bring it into view. */

address "AWorks.1"

SCREEN_TO_FRONT

exit
