Mercurial > otakunoraifu
comparison scn2k/scn2k_grpimpl.cc @ 71:1fd20d231376
Fix objScale with 2D zoom; implement objWidth and objHeight.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 01 Apr 2011 23:49:12 +0200 |
parents | bdd8a5ff8f46 |
children | f8751d74918b |
comparison
equal
deleted
inserted
replaced
70:281dcd7217df | 71:1fd20d231376 |
---|---|
627 | 627 |
628 void Grp::impl_objScale(Cmd& cmd) { | 628 void Grp::impl_objScale(Cmd& cmd) { |
629 int base_arg = 0; | 629 int base_arg = 0; |
630 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51)); | 630 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51)); |
631 | 631 |
632 int zoom = (cmd.args[base_arg + 1].value + cmd.args[base_arg + 2].value)/2; //FIXME: eurk | 632 int zoomx = cmd.args[base_arg + 1].value; |
633 zoomx = zoomx*256/100; | |
634 | |
635 int zoomy = cmd.args[base_arg + 2].value; | |
636 zoomy = zoomy*256/100; | |
637 | |
638 g->SetZoomRotate(zoomx, zoomy, -1); | |
639 cmd.clear(); | |
640 } | |
641 | |
642 void Grp::impl_objWidth(Cmd& cmd) { | |
643 int base_arg = 0; | |
644 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51)); | |
645 | |
646 int zoom = cmd.args[base_arg + 1].value; | |
633 zoom = zoom*256/100; | 647 zoom = zoom*256/100; |
634 g->SetZoomRotate(zoom, -1); | 648 |
649 g->SetZoomRotate(zoom, -1, -1); | |
650 cmd.clear(); | |
651 } | |
652 | |
653 void Grp::impl_objHeight(Cmd& cmd) { | |
654 int base_arg = 0; | |
655 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51)); | |
656 | |
657 int zoom = cmd.args[base_arg + 1].value; | |
658 zoom = zoom*256/100; | |
659 | |
660 g->SetZoomRotate(-1, zoom, -1); | |
635 cmd.clear(); | 661 cmd.clear(); |
636 } | 662 } |
637 | 663 |
638 void Grp::impl_objRotate(Cmd& cmd) { | 664 void Grp::impl_objRotate(Cmd& cmd) { |
639 int base_arg = 0; | 665 int base_arg = 0; |
644 if (angle < 0) { | 670 if (angle < 0) { |
645 angle %= 360; | 671 angle %= 360; |
646 angle += 360; | 672 angle += 360; |
647 } | 673 } |
648 angle %= 360; | 674 angle %= 360; |
649 g->SetZoomRotate(-1, angle); | 675 g->SetZoomRotate(-1, -1, angle); |
650 cmd.clear(); | 676 cmd.clear(); |
651 } | 677 } |
652 | 678 |
653 void Grp::impl_objPosDims(Cmd& cmd) { | 679 void Grp::impl_objPosDims(Cmd& cmd) { |
654 int base_arg = 0; | 680 int base_arg = 0; |