
#include "ming.h"

int main()
{
  SWFShape s;
  SWFFill f;
  SWFMovieClip p;
  SWFDisplayItem i;
  SWFMovie m;

  int n;

  Ming_init();
  Ming_setScale(1.0);

  s = newSWFShape();
  f = SWFShape_addBitmapFill(s, newSWFDBLBitmap(fopen("../common/alpha.dbl", "rb")),
							 SWFFILL_TILED_BITMAP);

  SWFFill_moveTo(f, -16, -16);
  SWFShape_setRightFill(s, f);

  SWFShape_movePenTo(s, -16, -16);
  SWFShape_drawLine(s, 32, 0);
  SWFShape_drawLine(s, 0, 32);
  SWFShape_drawLine(s, -32, 0);
  SWFShape_drawLine(s, 0, -32);

  p = newSWFMovieClip();

  i = SWFMovieClip_add(p, s);
  SWFMovieClip_nextFrame(p);

  for(n=0; n<90; ++n)
  {
    SWFDisplayItem_rotate(i, 4);
    SWFMovieClip_nextFrame(p);
  }

  m = newSWFMovie();
  SWFMovie_setDimension(m, 64, 48);

  i = SWFMovie_add(m, p);
  SWFDisplayItem_moveTo(i, 24, 24);

  i = SWFMovie_add(m, p);
  SWFDisplayItem_moveTo(i, 40, 24);

  SWFMovie_save(m, "test.swf");

  exit(0);
}
