差分発生行の前後
無視リスト:
コミット日時:
2010/03/21 18:04:34 (3 年前)
コミッタ:
hkrn
ログメッセージ:

use uint (primitive type) instead of using Point class

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/commands/LineCommand.as

    r3501 r3574  
    1616        public function reset():void 
    1717        { 
    18             m_compressedValue = 
    19                 s_readCoordinate.x = 
    20                 s_readCoordinate.y = 
    21                 s_writeCoordinate.x = 
    22                 s_writeCoordinate.y = 0; 
     18            m_compressedValue = 0; 
     19            s_readCoordinateX = 0; 
     20            s_readCoordinateY = 0; 
     21            s_writeCoordinateX = 0; 
     22            s_writeCoordinateY = 0; 
    2323        } 
    2424         
     
    2828        } 
    2929         
    30         protected function get readCoordinate():Point 
    31         { 
    32             return s_readCoordinate; 
    33         } 
    34          
    35         protected function get writeCoordinate():Point 
    36         { 
    37             return s_writeCoordinate; 
    38         } 
    39          
    40         private static var s_readCoordinate:Point = new Point(); 
    41         private static var s_writeCoordinate:Point = new Point(); 
     30        protected var s_readCoordinateX:int; 
     31        protected var s_readCoordinateY:int; 
     32        protected var s_writeCoordinateX:int; 
     33        protected var s_writeCoordinateY:int; 
    4234        protected var m_compressedValue:int; 
    4335    } 
  • as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/commands/LineToCommand.as

    r3524 r3574  
    3939                y = bytes.readShort(); 
    4040            } 
    41             readCoordinate.x += x; 
    42             readCoordinate.y += y; 
     41            s_readCoordinateX += x; 
     42            s_readCoordinateY += y; 
    4343        } 
    4444         
    4545        public function write(bytes:ByteArray, args:Object):void 
    4646        { 
    47             var dx:int = args.x - writeCoordinate.x
    48             var dy:int = args.y - writeCoordinate.y
     47            var dx:int = args.x - s_writeCoordinateX
     48            var dy:int = args.y - s_writeCoordinateY
    4949            if (dx >= -4 && dx <= 3 && dy >= -4 && dy <= 3) { 
    5050                // dxもdyも3bitに収まる場合 
     
    6060                bytes.writeShort(dy); 
    6161            } 
    62             writeCoordinate.x = args.x; 
    63             writeCoordinate.y = args.y; 
     62            s_writeCoordinateX = args.x; 
     63            s_writeCoordinateY = args.y; 
    6464        } 
    6565         
     
    6767        { 
    6868            painter.lineTo( 
    69                 readCoordinate.x || writeCoordinate.x
    70                 readCoordinate.y || writeCoordinate.y 
     69                s_readCoordinateX || s_writeCoordinateX
     70                s_readCoordinateY || s_writeCoordinateY 
    7171            ); 
    7272        } 
  • as3/gunyarapaint/branches/gunyarapaint/framework/src/org/libspark/gunyarapaint/framework/commands/MoveToCommand.as

    r3524 r3574  
    3333                y = bytes.readShort(); 
    3434            } 
    35             readCoordinate.x += x; 
    36             readCoordinate.y += y; 
     35            s_readCoordinateX += x; 
     36            s_readCoordinateY += y; 
    3737        } 
    3838         
    3939        public function write(bytes:ByteArray, args:Object):void 
    4040        { 
    41             var dx:int = args.x - writeCoordinate.x
    42             var dy:int = args.y - writeCoordinate.y
     41            var dx:int = args.x - s_writeCoordinateX
     42            var dy:int = args.y - s_writeCoordinateY
    4343            if (dx >= -64 && dx <= 63 && dy >= -64 && dy <= 63) { 
    4444                // dxもdyも7bitに収まる場合 
     
    5050                bytes.writeShort(dy); 
    5151            } 
    52             writeCoordinate.x = args.x; 
    53             writeCoordinate.y = args.y; 
     52            s_writeCoordinateX = args.x; 
     53            s_writeCoordinateY = args.y; 
    5454        } 
    5555         
     
    5757        { 
    5858            painter.moveTo( 
    59                 readCoordinate.x || writeCoordinate.x
    60                 readCoordinate.y || writeCoordinate.y 
     59                s_readCoordinateX || s_writeCoordinateX
     60                s_readCoordinateY || s_writeCoordinateY 
    6161            ); 
    6262            painter.startDrawingSession();