
#include <mingpp.h>

int main()
{
  Ming_init();
  Ming_setScale(1.0);

  SWFBitmap *b = new SWFBitmap("../common/backyard.jpg");
  SWFShape *s = new SWFShape();

  s->setRightFill(s->addBitmapFill(b));
  s->drawLine(b->getWidth(), 0);
  s->drawLine(0, b->getHeight());
  s->drawLine(-b->getWidth(), 0);
  s->drawLine(0, -b->getHeight());

  SWFMovie *m = new SWFMovie();
  m->setDimension(b->getWidth(), b->getHeight());

  SWFDisplayItem *i = m->add(s);

  for(int n=0; n<20; ++n)
  {
    i->multColor(1.0-n/10.0, 1.0, 1.0);
    i->addColor(0xff*n/20.0, 0, 0);
    m->nextFrame();
  }
  for(int n=20; n>0; --n)
  {
    i->multColor(1.0-n/10.0, 1.0, 1.0);
    i->addColor(0xff*n/20.0, 0, 0);
    m->nextFrame();
  }

  m->save("test.swf");

  exit(0);
}
