
#include "ming.h"

int main()
{
  SWFMorph p;
  SWFShape s;
  SWFMovie m;
  SWFDisplayItem i;

  int r;

  Ming_init();
  Ming_setScale(1.0);

  p = newSWFMorphShape();

  s = SWFMorph_getShape1(p);
  SWFShape_setLine(s, 0, 0, 0, 0, 0xff);
  SWFShape_setLeftFill(s, SWFShape_addSolidFill(s, 0xff, 0, 0, 0xff));
  SWFShape_movePenTo(s, -1000,-1000);
  SWFShape_drawLine(s, 2000,0);
  SWFShape_drawLine(s, 0,2000);
  SWFShape_drawLine(s, -2000,0);
  SWFShape_drawLine(s, 0,-2000);

  s = SWFMorph_getShape2(p);
  SWFShape_setLine(s, 60, 0, 0, 0, 0xff);
  SWFShape_setLeftFill(s, SWFShape_addSolidFill(s, 0, 0, 0xff, 0xff));
  SWFShape_movePenTo(s, 0,-1000);
  SWFShape_drawLine(s, 1000,1000);
  SWFShape_drawLine(s, -1000,1000);
  SWFShape_drawLine(s, -1000,-1000);
  SWFShape_drawLine(s, 1000,-1000);

  m = newSWFMovie();
  SWFMovie_setDimension(m, 3000,2000);
  SWFMovie_setBackground(m, 0xff, 0xff, 0xff);

  i = SWFMovie_add(m, p);
  SWFDisplayItem_moveTo(i, 1500, 1000);

  for(r=0; r<=10; ++r)
  {
    SWFDisplayItem_setRatio(i, r/10.0);
    SWFMovie_nextFrame(m);
  }

  SWFMovie_save(m, "test.swf");

  exit(0);
}
