- m.sx = 20 * 0x10000;
- m.sy = 20 * 0x10000;
- m.tx = -10;
- m.ty = -10;
- fs = swf_ShapeAddBitmapFillStyle(s, &m, id, 0);
- swf_SetU16(t, id + 1); // id
- r.xmin = r.ymin = 0;
- r.xmax = width * 20;
- r.ymax = height * 20;
+ if (global.fit_to_movie) {
+ m.sx = 0x10000 * movie_width / width;
+ m.sy = 0x10000 * movie_height / height;
+ width = movie_width / 20;
+ height = movie_height / 20;
+ } else {
+ m.sx = 20 * 0x10000;
+ m.sy = 20 * 0x10000;
+ }
+ m.tx = global.xoffset * 20;
+ m.ty = global.yoffset * 20;
+ fs = swf_ShapeAddBitmapFillStyle(s, &m, global.next_id, 1);
+ global.next_id++;
+ swf_SetU16(t, global.next_id); // id
+ r.xmin = global.xoffset * 20;
+ r.ymin = global.yoffset * 20;
+ r.xmax = r.xmin + width * 20;
+ r.ymax = r.ymin + height * 20;